Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MEMO.txt 10.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. Roving RN-42
  2. ============
  3. TODO
  4. ----
  5. - Lipo charger configuration: fast charge time
  6. - Low voltage alarm: LED indcates voltage of Lipo
  7. - CTS/RTS lines are needed? just connect in loop back if no flow control is needed.
  8. - CTS is needed for waking up from deep sleep?
  9. - Serial API callback when data are available/received(and when send buffer is available)
  10. - Serial API instance several serial ports can be used
  11. DONE:
  12. - USB connection check - 07.01
  13. - BT on/off check: whether RX line is pulled up? - checking RTS 07.01
  14. - USB/BT switching BT is on -> BT, BT is off -> USB - 07.01
  15. - Under voltage lock out UVLO for protection of Lipo - Lipo has discharge protection at 3.100V 07.01
  16. - Power saving: HHKB scan, BT radio control - 9h with 850mAh, this is enough 07.01
  17. Configuration
  18. -------------
  19. Ver 6.15 04/26/2013
  20. (c) Roving Networks
  21. ***Settings***
  22. BTA=0006664B3AE3
  23. BTName=tmkBT-3AE3
  24. Baudrt(SW4)=115K
  25. Mode =Pair
  26. Authen=2
  27. Bonded=1
  28. Rem=001BDC06415B
  29. ***ADVANCED Settings***
  30. SrvName= keyboard/mouse
  31. SrvClass=0000
  32. DevClass=05C0
  33. InqWindw=0100
  34. PagWindw=0100
  35. CfgTimer=255
  36. StatuStr=NULL
  37. HidFlags=3f
  38. DTRtimer=8
  39. KeySwapr=0
  40. ***OTHER Settings***
  41. Profile= HID
  42. CfgChar= $
  43. SniffEna=0
  44. LowPower=0
  45. TX Power=4
  46. IOPorts= 0
  47. IOValues=0
  48. Sleeptmr=0
  49. DebugMod=0
  50. RoleSwch=0
  51. Ver 6.15 04/26/2013
  52. (c) Roving Networks
  53. ***Settings***
  54. BTA=0006664B3AE3
  55. BTName=tmkBT-3AE3
  56. Baudrt(SW4)=115K
  57. Mode =DTR
  58. Authen=2
  59. Bonded=0
  60. Rem=BCF5AC9BCB7E
  61. ***ADVANCED Settings***
  62. SrvName= keyboard/mouse
  63. SrvClass=0000
  64. DevClass=0000
  65. InqWindw=0100
  66. PagWindw=0100
  67. CfgTimer=255
  68. StatuStr=NULL
  69. HidFlags=3f
  70. DTRtimer=8
  71. KeySwapr=0
  72. ***OTHER Settings***
  73. Profile= HID
  74. CfgChar= $
  75. SniffEna=0
  76. LowPower=0
  77. TX Power=ffe8
  78. IOPorts= 0
  79. IOValues=0
  80. Sleeptmr=0
  81. DebugMod=0
  82. RoleSwch=0
  83. command mode
  84. ------------
  85. To enter command mode disconnect the module from host and type '$$$'.(you will see 'CMD')
  86. To exit type '---'.(you will see 'END')
  87. Serial line: 115200bps, 8bit, 1-stopbit, non-parity, no flow control
  88. SSP: 115200bps, 8bit, 1-stopbit, non-parity, no flow control(via Bluetooth)
  89. S-,tmkBT // Device name
  90. SH,0038 // HID register
  91. SC,0000 // COD: 000005C0 (see HID spec/Bluegiga doc)
  92. SD,05C0 // bit 12-8 7 6 5-0
  93. // 00101 1 1 0
  94. // peripheral pointing keybaord joystick, gamepad, ...
  95. S~,6 // HID profile
  96. SS,keyboard/mouse // service name
  97. SM,6 // Pairing mode: auto connect
  98. SM,4 // Master mode: Connection can be controled with GPIO6
  99. SY,FEE8 // lower power -20dbM
  100. HID profile
  101. -----------
  102. S~,6 HID profile
  103. S~,0 SPP profile
  104. R,1 reboot
  105. Apple iOS
  106. ---------
  107. Cannot supported without apple iAP authentication chip.
  108. HID flag register
  109. -----------------
  110. SH,0200
  111. GH
  112. 10 0000 0000(0200) default
  113. 00 0011 1000(0038) Combo
  114. || | | |\_\____ number of paired devices to which the module can reconnect
  115. || | | \_______ send out reports over UART (0xFF <len> <data>)
  116. || \__\_________ descriptor type
  117. |\______________ toggle virtual keyboard on iOS when first connected
  118. \_______________ Force HID mode if GPIO11 is high on power-up
  119. Descriptor type:
  120. 0000: keybaord
  121. 0001: Game Pad
  122. 0010: Mouse
  123. 0011: Combo
  124. 0100: Joystick
  125. 1xxx: reserved
  126. Out report - Indicator
  127. ----------------------
  128. 0xFE 0x02 0x01 <LED_state>
  129. LED Status
  130. ----------
  131. Configuring 10 times per sec
  132. Startup/configuration timer 2 times per sec
  133. Discoverable/Inquiring/Idle once per sec
  134. Connected solid on
  135. Pairing
  136. -------
  137. First, host initiates pairing process and once it is done, auto connect will work thereafter.
  138. SM,3 Master mode
  139. SM,4 Auto Connect DTR Mode uses GPIO6 to make and break connection(Mode =DTR)
  140. confirm: auto connect works and control connection with GPIO6
  141. SM,5 Auto Connect ANY Mode (Mode =ANY)
  142. each time GPIO is set, make inquiry and connect to the first found device
  143. SM,6 automatically reconnect(Mode =Pair)
  144. confirm: auto connect works well but difficult to enter command mode.
  145. Fast data mode
  146. --------------
  147. The module enters fast data mode after 'remote configuration timer' window is passed from power on.
  148. In this mode the module does not accept '$$$' to enter command mode.
  149. Power Management
  150. ----------------
  151. Inquiry and Page window Idle or Active (3.1.1)
  152. Downside: delay in discovery or connection time
  153. SI, // set inquiry scan window(discovery) on/off duty?
  154. SJ, // set page scan window(connection)
  155. This reduces averaege power >20mA to 5mA(3mA in Sniff mode)
  156. Sniff mode Transmit
  157. Sniff mode is disabled by default and radio is active continuously when connected.(25-30mA)
  158. In Sniff mode the radio wakes up intermittently and sleeps in very low power mode.(2mA)
  159. SW,<val> // set interval timer(*0.625ms) 0000-7FFF
  160. Deep sleep Idle (3.1.2)
  161. In this mode the module shuts down completly and only draws about 300uA. To enable this set the most signifant bit(0x8000) of Sniff interaval timer.
  162. SW,8320 // deep sleep enable(interval=0x320*0.625ms)
  163. In normal sleep the firmware is still running in idle mode, and wakes up about 20 times per second to check ports, update LEDs, etc. During deep sleep, the firmware actually stops runnig some tasks and the LEDs only update about once per second.
  164. To wake from deep sleep there are three ways: (in worst case wake up takes 5ms)
  165. *send a charactor to the UART(first charactor will be lost)
  166. *toggle CTS low to high and wait 5ms
  167. *wake automatically every slot time(<val>*0.625ms)
  168. Once the radio is awake it stay active for exactly 1 second of inactivity and then sleeps again.
  169. Downside: latency and data loss
  170. Disable Output driver Idle or Active (3.1.3)
  171. S%,1000 // set all GPIO pins(0-11) to inputs.
  172. Lower Transmit Power Idle or Active (3.1.4)
  173. SY,<hex> // transmit power setting(takes effect after a power cycle and reboot)
  174. Downside: reducing effective range
  175. Optimizig for Latency
  176. ---------------------
  177. By default the firmware is optimized for throughput.
  178. SQ,16 // set latency bit
  179. SQ,0 // unset latency bit
  180. Configuration timer settings
  181. ----------------------------
  182. Remote configuration is used for the module to be configured with various commands over Bluetooth(SPP profile only?).
  183. The module has remote configuration timer to allow remote configuration over Bluetooth after power up in Slave mode. In Master modes the remote configuration timer is set to 0(no remote configuration). (In Trigger Master mode the timer is used as an idle timer to break the connection after time expires with no charactors receive.)
  184. ST,0 // no remote, no local when connected
  185. ST,<1-252> // local and remote with timeout in seconds from power up
  186. ST,253 // local only without timeout
  187. ST,254 // remote only without timeout
  188. ST,255 // local and remote without timeout
  189. Android
  190. -------
  191. 3.7.1.5 Note: To connect with Android phone the modules must wake up 11ms every 2.5seconds.
  192. Commands
  193. --------
  194. SC,
  195. SM,<val>
  196. SD,
  197. SP,<string> Pin code(alpahnumeric)
  198. SQ,<mask> Special configuration(GPIO, discovery mode, low latency, reboot, UART)
  199. SR,<hex> Store remote address
  200. SR,Z Erase all address
  201. SS,<string> Set service name(1-20)**
  202. ST,<val> Remote configuration timer(Master:0, Slave:0-255, Triger:as idle timer)
  203. SU,<val> UART baud rate
  204. SW,<val> low-power sniff mode** deep sleep and wake up every 625us * <val>
  205. SX,<0|1> bonding enable only acceps device that matches the stored address
  206. SY,<hex> power setting**
  207. SZ,<val> non-standard raw baud rate <val>=baud*0.004096
  208. S~,<val> Profile 0:SPP, 5:APL, 6:HID
  209. S-,<string> Device name -15 alphanumeric charactors
  210. S?,<0|1> role switch enable
  211. S$,<char> command mode char
  212. $|,<hex> low-power connect mode deep sleep/active(discoverable and connectable) cycle
  213. D display basic setting
  214. E display extended setting
  215. GB display the device's Bluetooth address
  216. GF display Bluetooth address of connected device
  217. GK show connection status
  218. GR show remote address for reconnecting
  219. G& show GPIO pin
  220. G<char> show stored setting
  221. + toggle local echo on/off
  222. & show GPIO 3,4,6,7(DIP switch)
  223. C connect to stored remote address
  224. C,<address> connect last address
  225. CFI connect and go into fast data mode
  226. CFR connect and go into fast data mode
  227. CT,<address>,<val> connect to the address and disconnect after val?
  228. F,1 fast data mod:
  229. H display help
  230. I,<time>,<cod> inquiry scan with <cod>
  231. IN
  232. IQ scan
  233. IS inquiry scan with 001F00
  234. J hide pin code
  235. K, kill disconnects current connection
  236. L link quality
  237. M show modem signlal status
  238. O display other settings
  239. P,<car> pass through?
  240. Q quiet mode make the module not discoverable
  241. Q,0 discoverable and connectable
  242. Q,1 not discoverable and not connectable
  243. Q,2 not discoverable and connectable
  244. Q,? display current quiet mode
  245. R,1 reboot
  246. T,<0|1> pass received data while in command mode
  247. U,<baud>,<parity> change UART setting tentatively
  248. V display firmware version
  249. W wake from quiet mode enable discovery and connection
  250. Z deep sleep mode(<2mA)