aboutsummaryrefslogtreecommitdiff
path: root/protocol
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-04-19 23:43:52 +0900
committertmk <nobody@nowhere>2013-04-20 00:45:56 +0900
commit663027751831eb0e80d64c90aaf82d2921533aed (patch)
treec0e5e9034e3db11c01d0828feb92046d1729f1ce /protocol
parent90da1c59bd4e2d501bb0ccb670a90677f2f9c4e7 (diff)
downloadqmk_firmware-663027751831eb0e80d64c90aaf82d2921533aed.tar.gz
qmk_firmware-663027751831eb0e80d64c90aaf82d2921533aed.zip
Add support of mouse horizontal wheel to iWRAP
Diffstat (limited to 'protocol')
-rw-r--r--protocol/iwrap/iWRAP5.txt131
-rw-r--r--protocol/iwrap/iwrap.c21
-rw-r--r--protocol/iwrap/mouse.desc41
3 files changed, 117 insertions, 76 deletions
diff --git a/protocol/iwrap/iWRAP5.txt b/protocol/iwrap/iWRAP5.txt
index e5ecc5c8e..65bbe0421 100644
--- a/protocol/iwrap/iWRAP5.txt
+++ b/protocol/iwrap/iWRAP5.txt
@@ -204,64 +204,73 @@ CALL 78:dd:08:b7:e4:a2 11 HID
204 204
205Setting 205Setting
206======== 206========
207Following settings need to be done before wiring into keyboard.
208- UART speed: 38400bps(115200bps didn't work with software serial)
209- No SSP procedure(without MITM protection)
210- No Power Saving
211
212# clear pairing record and set default
207SET BT PAIR * 213SET BT PAIR *
208SET RESET 214SET RESET
209 215
216SET CONTROL INIT SET CONTROL MUX 0
217SET CONTROL BAUD 38400,8n1
218SET BT NAME TMK Blootooth WT12
210SET BT CLASS 0005c0 219SET BT CLASS 0005c0
211SET BT AUTH * 0000 220SET BT AUTH * 0000
212SET BT SSP 2 0 221SET BT SSP 3 0
213SET CONTROL CONFIG 800 222SET CONTROL CONFIG 4800
214SET PROFILE HID 0f c0 0100 00 en 0409 Bluetooth keyboard 223SET PROFILE HID 0f c0 0100 00 en 0409 TMK Bluetooth keyboard(WT12)
215SET PROFILE SPP 224SET PROFILE SPP
216 225
217SET CONTROL INIT SET CONTROL MUX 0 226# power saving?
218SET BT NAME TMK Blootooth WT12
219SET PROFILE HID 0f c0 0100 00 en 0409 TMK Bluetooth keyboard(WT12)
220SDP ADD 1124 HID
221SET BT PAIRCOUNT 4
222SET BT POWER 3 3 3
223SET BT SNIFF 100 20 1 8 227SET BT SNIFF 100 20 1 8
224RESET
225 228
226SET CONTROL BAUD 38400,8n1
227 229
228# combo keyboard + mouse 230# Report Descriptor
229HID SET 7f 05010906a1010507850119e029e715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100c005010902a1010901a1008502050919012903150025019503750181020501093815f1250f9501750581060501093009311581257f750895028106c0c0 231# combo keyboard + mouse + consumer
232HID SET d2 05010906a1010507850119e029e715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100c005010902a1010901a1008502050919012908150025017501950881020501093009311581257f750895028106093895018106050c0a380295018106c0c0050c0901a1018503050c1500250109e909ea09e209cd19b529b87501950881020a8a010a21020a2a021a23022a27027501950881020a83010a96010a92010a9e010a94010a060209b209b4750195088102c0
230 233
231HID SET d1 05010906a1010507850119e029e715002501750195088102950175088101950575010508850119012905910295017503910395067508150025650507190029658100c005010902a1010901a1008502050919012903150025019503750181020501093815f1250f9501750581060501093009311581257f750895028106c0c0050c0901a1018503050c1500250109e909ea09e209cd19b529b87501950881020a8a010a21020a2a021a23022a27027501950881020a83010a96010a92010a9e010a94010a060209b209b4750195088102c0
232 234
233 235
234--------------------- 236
237
238
239----------
240after setting
241----------
242set
235SET BT BDADDR 00:07:80:47:22:14 243SET BT BDADDR 00:07:80:47:22:14
236SET BT NAME TMK BT WT12 244SET BT NAME TMK Blootooth WT12
237SET BT CLASS 0005c0 245SET BT CLASS 0005c0
238SET BT AUTH * 0000 246SET BT AUTH * 0000
239SET BT IDENT BT:47 f000 5.0.1 Bluegiga iWRAP 247SET BT IDENT BT:47 f000 5.0.1 Bluegiga iWRAP
240SET BT LAP 9e8b33 248SET BT LAP 9e8b33
241SET BT PAGEMODE 4 2000 1 249SET BT PAGEMODE 4 2000 1
242SET BT PAIRCOUNT 4 250SET BT PAIR 78:dd:08:b7:e4:a2 9e3d85c91bcae73fef8cc10bec18b42f
243SET BT PAIR 78:dd:08:b7:e4:a2 fe2fd79e86c6bbfa9351a032bceb2648
244SET BT POWER 3 3 3 251SET BT POWER 3 3 3
245SET BT ROLE 1 f 12c0 252SET BT ROLE 0 f 7d00
246SET BT SNIFF 100 20 1 8 253SET BT SNIFF 0 20 1 8
247SET BT SSP 3 0 254SET BT SSP 3 0
248SET BT MTU 672 255SET BT MTU 667
249SET CONTROL BAUD 38400,8n1 256SET CONTROL BAUD 38400,8n1
250SET CONTROL CD 00 0 257SET CONTROL CD 00 0
251SET CONTROL ECHO 7 258SET CONTROL ECHO 7
252SET CONTROL ESCAPE - 20 1 259SET CONTROL ESCAPE 43 00 1
253SET CONTROL GAIN 0 5 260SET CONTROL GAIN 0 5
254SET CONTROL INIT SET CONTROL MUX 0 261SET CONTROL INIT SET CONTROL MUX 0
255SET CONTROL MSC DTE 00 00 00 00 00 00 262SET CONTROL MSC DTE 00 00 00 00 00 00
263SET CONTROL MUX 1
256SET CONTROL PIO 00 00 264SET CONTROL PIO 00 00
257SET CONTROL READY 00 265SET CONTROL READY 00
258SET PROFILE HID 0f c0 0100 00 en 0409 TMK Bluetooth keyboard 266SET PROFILE HID 0f c0 0100 00 en 0409 TMK Bluetooth keyboard(WT12)
259SET 267SET
260SET control config list
261SET CONTROL CONFIG 0000 0000 0000 410e CLOCK_CACHE INTERLACED_INQ INTERLACED_PAGE KLUDGE UART_LATENCY
262 268
269set control config list
270SET CONTROL CONFIG 0000 0000 0000 4900 KLUDGE INTERACTIVE_PIN UART_LATENCY
263 271
264 272
273info config
265WRAP THOR AI (5.0.1 build 620) 274WRAP THOR AI (5.0.1 build 620)
266Copyright (c) 2003-2012 Bluegiga Technologies Inc. 275Copyright (c) 2003-2012 Bluegiga Technologies Inc.
267Compiled on Oct 1 2012 10:56:21, running on WT12-A module, psr v31 276Compiled on Oct 1 2012 10:56:21, running on WT12-A module, psr v31
@@ -269,42 +278,59 @@ Compiled on Oct 1 2012 10:56:21, running on WT12-A module, psr v31
269 - BOCK4 version 620 (Oct 1 2012 10:56:03) (max acl/sco 7/1) 278 - BOCK4 version 620 (Oct 1 2012 10:56:03) (max acl/sco 7/1)
270 - Bluetooth version 3.0, Power class 2 279 - Bluetooth version 3.0, Power class 2
271 - Loader 8615, firmware 8825 (56-bit encryption), native execution mode 280 - Loader 8615, firmware 8825 (56-bit encryption), native execution mode
272 - up 0 days, 00:13, 0 connections (pool 1) 281 - up 0 days, 01:50, 2 connections (pool 2)
273 - User configuration: 282 - User configuration:
274&028b = 0000 1388 283&028d = 0001
275&028c = 0001 0020 0100 0001 0008 0000
276&028d = 0000
277&0295 = 0000 0005 000b 0000 0003 0000 0000 0000 0000 0000 0000 284&0295 = 0000 0005 000b 0000 0003 0000 0000 0000 0000 0000 0000
278&0298 = c006 285&0298 = c053
279&0299 = 0000 0000 286&0299 = 0000 0000
280&02a3 = 0030 0030 0030 0030 287&02a3 = 0030 0030 0030 0030
281&02a4 = 009d 0000 288&02a4 = 009d 0000
282&02a5 = 0053 0045 0054 0020 0043 004f 004e 0054 0052 004f 004c 0020 004d 0055 0058 0020 0030 289&02a5 = 0053 0045 0054 0020 0043 004f 004e 0054 0052 004f 004c 0020 004d 0055 0058 0020 0030
283&02a7 = 0000 05c0 290&02a7 = 0000 05c0
284&02a8 = 400e 0000 0000 291&02a8 = 0800 0000 0000 0000
285&02aa = 0004 2000 0001 0033 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 292&02aa = 0004 2000 0001 0033 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
286&02ab = 0001 000f 12c0 293&02ac = 0000 0000 002b 0000 0000 0000 0000 0000 0000 0000 0002 0000 0000 0000 0010 0000 0000 0000 0000 029b 0000 0000 0000 0000
287&02ac = 0000 0020 002b 0000 0000 0000 0000 0000 0000 0000 000a 0000 0000 0000 0004 0000 0000 0000 0000 02a0 0000 0000 0000 0000 294&02ad = 4d54 204b 6c42 6f6f 6f74 746f 2068 5457 3231
288&02ad = 4d54 204b 5442 5720 3154 0032
289&02b0 = fa65 b0aa 934a 077b a600 d1cc fe58 8dd5 295&02b0 = fa65 b0aa 934a 077b a600 d1cc fe58 8dd5
290&02b3 = 0004 0004 0004 0000 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 000d 0007 0005 8afb 0005 0000 1c13 0000 0c3d 0005 b435 0006 b450 0006 0000 1416 000d 296&02b3 = 0004 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0003 0005 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0005
291&02b7 = 000f 00c0 0100 0000 0065 006e 0409 4d54 204b 6c42 6575 6f74 746f 2068 656b 6279 616f 6472 0000 297&02b7 = 000f 00c0 0100 0000 0065 006e 0409 4d54 204b 6c42 6575 6f74 746f &02bb = 8000
292--------------------- 298READY.
299----------
293 300
294 301
295---------- 302
296after SET RESET 303-----
297---------- 304After 5.0.1 Firmware update
305Firmware: ai-5.0.1-620-25b.bc4.dfu
306PSR: wt12-a.ai-5.0.1-620-25b.psrf
307-----
308info config
298WRAP THOR AI (5.0.1 build 620) 309WRAP THOR AI (5.0.1 build 620)
299Copyright (c) 2003-2012 Bluegiga Technologies Inc. 310Copyright (c) 2003-2012 Bluegiga Technologies Inc.
311Compiled on Oct 1 2012 10:56:21, running on WT12-A module, psr v31
312 BGIO FTP HFP HFP_AG HID HID_CONSUMER_PAGE HSP MAP MDP OTA PBAP PIO=0x00fc SSP SUBRATE TEST VOLUME
313 - BOCK4 version 620 (Oct 1 2012 10:56:03) (max acl/sco 7/1)
314 - Bluetooth version 3.0, Power class 2
315 - Loader 8615, firmware 8825 (56-bit encryption), native execution mode
316 - up 0 days, 00:03, 0 connections (pool 1)
317 - User configuration:
318&0295 = 0000 0005 000b 0000 0003 0000 0000 0000 0000 0000 0000
319&0299 = 0000 0000
320&02aa = 0004 2000 0001 0033 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
321&02ac = 0000 0000 002b 0000 0000 0000 0000 0000 0000 0000 0002 0000 0000 0000 0010 0000 0000 0000 0000 029b 0000 0000 0000 0000
322&02ad = 5457 3231 412d
323&02b0 = fa65 b0aa 934a 077b a600 d1cc fe58 8dd5
300READY. 324READY.
325
301set 326set
302SET BT BDADDR 00:07:80:47:22:14 327SET BT BDADDR 00:07:80:47:22:14
303SET BT NAME WT12 328SET BT NAME WT12-A
304SET BT CLASS 001f00 329SET BT CLASS 001f00
305SET BT IDENT BT:47 f000 5.0.1 Bluegiga iWRAP 330SET BT IDENT BT:47 f000 5.0.1 Bluegiga iWRAP
306SET BT LAP 9e8b33 331SET BT LAP 9e8b33
307SET BT PAGEMODE 4 2000 1 332SET BT PAGEMODE 4 2000 1
333SET BT PAIR 78:dd:08:b7:e4:a2 af18f81faa107e6dd068762ef921f48b
308SET BT POWER 3 3 3 334SET BT POWER 3 3 3
309SET BT ROLE 0 f 7d00 335SET BT ROLE 0 f 7d00
310SET BT SNIFF 0 20 1 8 336SET BT SNIFF 0 20 1 8
@@ -321,25 +347,6 @@ SET CONTROL READY 00
321SET PROFILE SPP Bluetooth Serial Port 347SET PROFILE SPP Bluetooth Serial Port
322SET 348SET
323 349
324 350set control config list
325SET CONTROL CONFIG 0000 0000 0000 0100 KLUDGE 351SET CONTROL CONFIG 0000 0000 0000 0100 KLUDGE
326 352---------
327
328info config
329WRAP THOR AI (5.0.1 build 620)
330Copyright (c) 2003-2012 Bluegiga Technologies Inc.
331Compiled on Oct 1 2012 10:56:21, running on WT12-A module, psr v31
332 BGIO FTP HFP HFP_AG HID HID_CONSUMER_PAGE HSP MAP MDP OTA PBAP PIO=0x00fc SSP SUBRATE TEST VOLUME
333 - BOCK4 version 620 (Oct 1 2012 10:56:03) (max acl/sco 7/1)
334 - Bluetooth version 3.0, Power class 2
335 - Loader 8615, firmware 8825 (56-bit encryption), native execution mode
336 - up 0 days, 00:00, 0 connections (pool 1)
337 - User configuration:
338&0295 = 0000 0005 000b 0000 0003 0000 0000 0000 0000 0000 0000
339&0299 = 0000 0000
340&02aa = 0004 2000 0001 0033 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
341&02ac = 0000 0000 002b 0000 0000 0000 0000 0000 0000 0000 0002 0000 0000 0000 0010 0000 0000 0000 0000 029b 0000 0000 0000 0000
342&02ad = 5457 3231
343&02b0 = fa65 b0aa 934a 077b a600 d1cc fe58 8dd5
344READY.
345----------
diff --git a/protocol/iwrap/iwrap.c b/protocol/iwrap/iwrap.c
index d65d9e38e..6a404116a 100644
--- a/protocol/iwrap/iwrap.c
+++ b/protocol/iwrap/iwrap.c
@@ -335,7 +335,7 @@ static void send_keyboard(report_keyboard_t *report)
335 xmit(0x9f); 335 xmit(0x9f);
336 xmit(0x0a); // Length 336 xmit(0x0a); // Length
337 xmit(0xa1); // DATA(Input) 337 xmit(0xa1); // DATA(Input)
338 xmit(0x01); 338 xmit(0x01); // Report ID
339 xmit(report->mods); 339 xmit(report->mods);
340 xmit(0x00); // reserved byte(always 0) 340 xmit(0x00); // reserved byte(always 0)
341 xmit(report->keys[0]); 341 xmit(report->keys[0]);
@@ -351,22 +351,17 @@ static void send_mouse(report_mouse_t *report)
351{ 351{
352#if defined(MOUSEKEY_ENABLE) || defined(PS2_MOUSE_ENABLE) 352#if defined(MOUSEKEY_ENABLE) || defined(PS2_MOUSE_ENABLE)
353 if (!iwrap_connected() && !iwrap_check_connection()) return; 353 if (!iwrap_connected() && !iwrap_check_connection()) return;
354 MUX_HEADER(0x01, 0x07); 354 MUX_HEADER(0x01, 0x09);
355 // HID raw mode header 355 // HID raw mode header
356 xmit(0x9f); 356 xmit(0x9f);
357 xmit(0x05); // Length 357 xmit(0x07); // Length
358 xmit(0xa1); // DATA(Input) 358 xmit(0xa1); // DATA(Input)
359 xmit(0x02); 359 xmit(0x02); // Report ID
360 /* vertical wheel support */ 360 xmit(report->buttons);
361 int8_t wheel = report->v;
362 if (wheel < -15) {
363 wheel = -15;
364 } else if (wheel > 15) {
365 wheel = 15;
366 }
367 xmit(((wheel&0x1f)<<3) | (report->buttons&0x07));
368 xmit(report->x); 361 xmit(report->x);
369 xmit(report->y); 362 xmit(report->y);
363 xmit(report->v);
364 xmit(report->h);
370 MUX_FOOTER(0x01); 365 MUX_FOOTER(0x01);
371#endif 366#endif
372} 367}
@@ -465,7 +460,7 @@ static void send_consumer(uint16_t data)
465 xmit(0x9f); 460 xmit(0x9f);
466 xmit(0x05); // Length 461 xmit(0x05); // Length
467 xmit(0xa1); // DATA(Input) 462 xmit(0xa1); // DATA(Input)
468 xmit(0x03); 463 xmit(0x03); // Report ID
469 xmit(bits1); 464 xmit(bits1);
470 xmit(bits2); 465 xmit(bits2);
471 xmit(bits3); 466 xmit(bits3);
diff --git a/protocol/iwrap/mouse.desc b/protocol/iwrap/mouse.desc
index f2c432500..11898f2b1 100644
--- a/protocol/iwrap/mouse.desc
+++ b/protocol/iwrap/mouse.desc
@@ -1 +1,40 @@
105010902a1010901a1008502050919012903150025019503750181020501093815f1250f9501750581060501093009311581257f750895028106c0c0 105010902a1010901a1008502050919012908150025017501950881020501093009311581257f750895028106093895018106050c0a380295018106c0c0
2
3Length: 67(0x43)
4virtical/horizontal wheel support
5
6 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
7 0x09, 0x02, // USAGE (Mouse)
8 0xa1, 0x01, // COLLECTION (Application)
9 0x09, 0x01, // USAGE (Pointer)
10 0xa1, 0x00, // COLLECTION (Physical)
11 0x85, 0x02, // REPORT_ID (2)
12 // ---------------------------- Buttons
13 0x05, 0x09, // USAGE_PAGE (Button)
14 0x19, 0x01, // USAGE_MINIMUM (Button 1)
15 0x29, 0x08, // USAGE_MAXIMUM (Button 8)
16 0x15, 0x00, // LOGICAL_MINIMUM (0)
17 0x25, 0x01, // LOGICAL_MAXIMUM (1)
18 0x75, 0x01, // REPORT_SIZE (1)
19 0x95, 0x08, // REPORT_COUNT (8)
20 0x81, 0x02, // INPUT (Data,Var,Abs)
21 // ---------------------------- X,Y position
22 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
23 0x09, 0x30, // USAGE (X)
24 0x09, 0x31, // USAGE (Y)
25 0x15, 0x81, // LOGICAL_MINIMUM (-127)
26 0x25, 0x7f, // LOGICAL_MAXIMUM (127)
27 0x75, 0x08, // REPORT_SIZE (8)
28 0x95, 0x02, // REPORT_COUNT (2)
29 0x81, 0x06, // INPUT (Data,Var,Rel)
30 // ---------------------------- Vertical wheel
31 0x09, 0x38, // USAGE (Wheel)
32 0x95, 0x01, // REPORT_COUNT (1)
33 0x81, 0x06, // INPUT (Data,Var,Rel)
34 // ---------------------------- Horizontal wheel
35 0x05, 0x0c, // USAGE_PAGE (Consumer Devices)
36 0x0a, 0x38, 0x02, // USAGE (AC Pan)
37 0x95, 0x01, // REPORT_COUNT (1)
38 0x81, 0x06, // INPUT (Data,Var,Rel)
39 0xc0, // END_COLLECTION
40 0xc0, // END_COLLECTION