Keyboard firmwares for Atmel AVR and Cortex-M
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

MEMO.txt 9.9KB

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