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