Mercurial > louis > kiibohd-controller
comparison Output/pjrcUSB/arm/usb_desc.c @ 368:06a54d582bf8
FIxing Media Keys and general USB compatibilty
- Media keys tested working on Linux/Windows/Mac (use Consumer control)
- Fixed enumeration delays
- Fixed virtual serial port configuration issues
- Fixed GET_REPORT and SET_REPORT
- Added intial descriptors and endpoints for Mouse and Joystick devices
- Split out the consumer and system control endpoint
- Added more fault debugging messages
- Added interface names to endpoints (visible in Windows Device Manager)
- Added KLL define for keyboard locale
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Wed, 19 Aug 2015 00:01:15 -0700 |
parents | ab4515606277 |
children | 47f89f1bfdb7 |
comparison
equal
deleted
inserted
replaced
367:8a6c2d410ad9 | 368:06a54d582bf8 |
---|---|
1 /* Teensyduino Core Library | 1 /* Teensyduino Core Library |
2 * http://www.pjrc.com/teensy/ | 2 * http://www.pjrc.com/teensy/ |
3 * Copyright (c) 2013 PJRC.COM, LLC. | 3 * Copyright (c) 2013 PJRC.COM, LLC. |
4 * Modified by Jacob Alexander (2013-2014) | 4 * Modified by Jacob Alexander (2013-2015) |
5 * | 5 * |
6 * Permission is hereby granted, free of charge, to any person obtaining | 6 * Permission is hereby granted, free of charge, to any person obtaining |
7 * a copy of this software and associated documentation files (the | 7 * a copy of this software and associated documentation files (the |
8 * "Software"), to deal in the Software without restriction, including | 8 * "Software"), to deal in the Software without restriction, including |
9 * without limitation the rights to use, copy, modify, merge, publish, | 9 * without limitation the rights to use, copy, modify, merge, publish, |
31 | 31 |
32 // ----- Includes ----- | 32 // ----- Includes ----- |
33 | 33 |
34 // Local Includes | 34 // Local Includes |
35 #include "usb_desc.h" | 35 #include "usb_desc.h" |
36 | |
37 // Generated Includes | |
38 #include <kll_defs.h> | |
36 | 39 |
37 | 40 |
38 | 41 |
39 // ----- Macros ----- | 42 // ----- Macros ----- |
40 | 43 |
258 // Padding (2 bits) | 261 // Padding (2 bits) |
259 0x75, 0x02, // Report Size (2), | 262 0x75, 0x02, // Report Size (2), |
260 0x95, 0x01, // Report Count (1), | 263 0x95, 0x01, // Report Count (1), |
261 0x81, 0x03, // Input (Constant), | 264 0x81, 0x03, // Input (Constant), |
262 0xc0, // End Collection - Keyboard | 265 0xc0, // End Collection - Keyboard |
263 | 266 }; |
267 | |
268 // System Control and Consumer Control | |
269 static uint8_t sys_ctrl_report_desc[] = { | |
264 // System Control Collection | 270 // System Control Collection |
265 // | 271 // |
266 // NOTES: | 272 // NOTES: |
267 // Not bothering with NKRO for this table. If there's need, I can implement it. -HaaTa | 273 // Not bothering with NKRO for this table. If there's need, I can implement it. -HaaTa |
268 // Using a 1KRO scheme | 274 // Using a 1KRO scheme |
288 0x09, 0x01, // Usage (Consumer Control), | 294 0x09, 0x01, // Usage (Consumer Control), |
289 0xA1, 0x01, // Collection (Application), | 295 0xA1, 0x01, // Collection (Application), |
290 0x85, 0x03, // Report ID (3), | 296 0x85, 0x03, // Report ID (3), |
291 0x75, 0x10, // Report Size (16), | 297 0x75, 0x10, // Report Size (16), |
292 0x95, 0x01, // Report Count (1), | 298 0x95, 0x01, // Report Count (1), |
293 0x16, 0x20, 0x00, // Logical Minimum (32), | 299 0x16, 0x01, 0x00, // Logical Minimum (1), |
294 0x26, 0x9C, 0x02, // Logical Maximum (668), | 300 0x26, 0x9C, 0x02, // Logical Maximum (668), |
295 0x05, 0x0C, // Usage Page (Consumer), | 301 0x05, 0x0C, // Usage Page (Consumer), |
296 0x19, 0x20, // Usage Minimum (32), | 302 0x19, 0x01, // Usage Minimum (1), |
297 0x2A, 0x9C, 0x02, // Usage Maximum (668), | 303 0x2A, 0x9C, 0x02, // Usage Maximum (668), |
298 0x81, 0x00, // Input (Data, Array), | 304 0x81, 0x00, // Input (Data, Array), |
299 0xc0, // End Collection - Consumer Control | 305 0xc0, // End Collection - Consumer Control |
300 }; | 306 }; |
301 | 307 |
302 /* MOUSE | |
303 // Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension | 308 // Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension |
304 static uint8_t mouse_report_desc[] = { | 309 static uint8_t mouse_report_desc[] = { |
305 0x05, 0x01, // Usage Page (Generic Desktop) | 310 0x05, 0x01, // Usage Page (Generic Desktop) |
306 0x09, 0x02, // Usage (Mouse) | 311 0x09, 0x02, // Usage (Mouse) |
307 0xA1, 0x01, // Collection (Application) | 312 0xA1, 0x01, // Collection (Application) |
330 0x75, 0x08, // Report Size (8), | 335 0x75, 0x08, // Report Size (8), |
331 0x95, 0x01, // Report Count (1), | 336 0x95, 0x01, // Report Count (1), |
332 0x81, 0x06, // Input (Data, Variable, Relative) | 337 0x81, 0x06, // Input (Data, Variable, Relative) |
333 0xC0 // End Collection | 338 0xC0 // End Collection |
334 }; | 339 }; |
335 */ | 340 |
341 // Joystick Protocol, HID 1.11 spec, Apendix D, page 64-65 | |
342 static uint8_t joystick_report_desc[] = { | |
343 0x05, 0x01, // Usage Page (Generic Desktop) | |
344 0x09, 0x04, // Usage (Joystick) | |
345 0xA1, 0x01, // Collection (Application) | |
346 0x15, 0x00, // Logical Minimum (0) | |
347 0x25, 0x01, // Logical Maximum (1) | |
348 0x75, 0x01, // Report Size (1) | |
349 0x95, 0x20, // Report Count (32) | |
350 0x05, 0x09, // Usage Page (Button) | |
351 0x19, 0x01, // Usage Minimum (Button #1) | |
352 0x29, 0x20, // Usage Maximum (Button #32) | |
353 0x81, 0x02, // Input (variable,absolute) | |
354 0x15, 0x00, // Logical Minimum (0) | |
355 0x25, 0x07, // Logical Maximum (7) | |
356 0x35, 0x00, // Physical Minimum (0) | |
357 0x46, 0x3B, 0x01, // Physical Maximum (315) | |
358 0x75, 0x04, // Report Size (4) | |
359 0x95, 0x01, // Report Count (1) | |
360 0x65, 0x14, // Unit (20) | |
361 0x05, 0x01, // Usage Page (Generic Desktop) | |
362 0x09, 0x39, // Usage (Hat switch) | |
363 0x81, 0x42, // Input (variable,absolute,null_state) | |
364 0x05, 0x01, // Usage Page (Generic Desktop) | |
365 0x09, 0x01, // Usage (Pointer) | |
366 0xA1, 0x00, // Collection () | |
367 0x15, 0x00, // Logical Minimum (0) | |
368 0x26, 0xFF, 0x03, // Logical Maximum (1023) | |
369 0x75, 0x0A, // Report Size (10) | |
370 0x95, 0x04, // Report Count (4) | |
371 0x09, 0x30, // Usage (X) | |
372 0x09, 0x31, // Usage (Y) | |
373 0x09, 0x32, // Usage (Z) | |
374 0x09, 0x35, // Usage (Rz) | |
375 0x81, 0x02, // Input (variable,absolute) | |
376 0xC0, // End Collection | |
377 0x15, 0x00, // Logical Minimum (0) | |
378 0x26, 0xFF, 0x03, // Logical Maximum (1023) | |
379 0x75, 0x0A, // Report Size (10) | |
380 0x95, 0x02, // Report Count (2) | |
381 0x09, 0x36, // Usage (Slider) | |
382 0x09, 0x36, // Usage (Slider) | |
383 0x81, 0x02, // Input (variable,absolute) | |
384 0xC0 // End Collection | |
385 }; | |
336 | 386 |
337 | 387 |
338 | 388 |
339 // ----- USB Configuration ----- | 389 // ----- USB Configuration ----- |
340 | 390 |
363 0, // bAlternateSetting | 413 0, // bAlternateSetting |
364 1, // bNumEndpoints | 414 1, // bNumEndpoints |
365 0x03, // bInterfaceClass (0x03 = HID) | 415 0x03, // bInterfaceClass (0x03 = HID) |
366 0x01, // bInterfaceSubClass (0x00 = Non-Boot, 0x01 = Boot) | 416 0x01, // bInterfaceSubClass (0x00 = Non-Boot, 0x01 = Boot) |
367 0x01, // bInterfaceProtocol (0x01 = Keyboard) | 417 0x01, // bInterfaceProtocol (0x01 = Keyboard) |
368 0, // iInterface | 418 KEYBOARD_INTERFACE + 4, // iInterface |
369 // - 9 bytes - | 419 // - 9 bytes - |
370 // HID interface descriptor, HID 1.11 spec, section 6.2.1 | 420 // HID interface descriptor, HID 1.11 spec, section 6.2.1 |
371 9, // bLength | 421 9, // bLength |
372 0x21, // bDescriptorType | 422 0x21, // bDescriptorType |
373 0x11, 0x01, // bcdHID | 423 0x11, 0x01, // bcdHID |
374 0, // bCountryCode | 424 KeyboardLocale_define, // bCountryCode |
375 1, // bNumDescriptors | 425 1, // bNumDescriptors |
376 0x22, // bDescriptorType | 426 0x22, // bDescriptorType |
377 LSB(sizeof(keyboard_report_desc)), // wDescriptorLength | 427 LSB(sizeof(keyboard_report_desc)), // wDescriptorLength |
378 MSB(sizeof(keyboard_report_desc)), | 428 MSB(sizeof(keyboard_report_desc)), |
379 // - 7 bytes - | 429 // - 7 bytes - |
394 0, // bAlternateSetting | 444 0, // bAlternateSetting |
395 1, // bNumEndpoints | 445 1, // bNumEndpoints |
396 0x03, // bInterfaceClass (0x03 = HID) | 446 0x03, // bInterfaceClass (0x03 = HID) |
397 0x00, // bInterfaceSubClass (0x00 = Non-Boot, 0x01 = Boot) | 447 0x00, // bInterfaceSubClass (0x00 = Non-Boot, 0x01 = Boot) |
398 0x01, // bInterfaceProtocol (0x01 = Keyboard) | 448 0x01, // bInterfaceProtocol (0x01 = Keyboard) |
399 0, // iInterface | 449 NKRO_KEYBOARD_INTERFACE + 4, // iInterface |
400 // - 9 bytes - | 450 // - 9 bytes - |
401 // HID interface descriptor, HID 1.11 spec, section 6.2.1 | 451 // HID interface descriptor, HID 1.11 spec, section 6.2.1 |
402 9, // bLength | 452 9, // bLength |
403 0x21, // bDescriptorType | 453 0x21, // bDescriptorType |
404 0x11, 0x01, // bcdHID | 454 0x11, 0x01, // bcdHID |
405 0, // bCountryCode | 455 KeyboardLocale_define, // bCountryCode |
406 1, // bNumDescriptors | 456 1, // bNumDescriptors |
407 0x22, // bDescriptorType | 457 0x22, // bDescriptorType |
408 LSB(sizeof(nkro_keyboard_report_desc)), // wDescriptorLength | 458 LSB(sizeof(nkro_keyboard_report_desc)), // wDescriptorLength |
409 MSB(sizeof(nkro_keyboard_report_desc)), | 459 MSB(sizeof(nkro_keyboard_report_desc)), |
410 // - 7 bytes - | 460 // - 7 bytes - |
424 CDC_STATUS_INTERFACE, // bFirstInterface | 474 CDC_STATUS_INTERFACE, // bFirstInterface |
425 2, // bInterfaceCount | 475 2, // bInterfaceCount |
426 0x02, // bFunctionClass | 476 0x02, // bFunctionClass |
427 0x02, // bFunctionSubClass | 477 0x02, // bFunctionSubClass |
428 0x01, // bFunctionProtocol | 478 0x01, // bFunctionProtocol |
429 0, // iFunction | 479 CDC_STATUS_INTERFACE + 4, // iFunction |
430 | 480 |
431 // --- Serial CDC --- CDC Data Interface | 481 // --- Serial CDC --- CDC Data Interface |
432 // - 9 bytes - | 482 // - 9 bytes - |
433 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12 | 483 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12 |
434 9, // bLength | 484 9, // bLength |
437 0, // bAlternateSetting | 487 0, // bAlternateSetting |
438 1, // bNumEndpoints | 488 1, // bNumEndpoints |
439 0x02, // bInterfaceClass | 489 0x02, // bInterfaceClass |
440 0x02, // bInterfaceSubClass | 490 0x02, // bInterfaceSubClass |
441 0x01, // bInterfaceProtocol | 491 0x01, // bInterfaceProtocol |
442 0, // iInterface | 492 CDC_STATUS_INTERFACE + 4, // iInterface |
443 // - 5 bytes - | 493 // - 5 bytes - |
444 // CDC Header Functional Descriptor, CDC Spec 5.2.3.1, Table 26 | 494 // CDC Header Functional Descriptor, CDC Spec 5.2.3.1, Table 26 |
445 5, // bFunctionLength | 495 5, // bFunctionLength |
446 0x24, // bDescriptorType | 496 0x24, // bDescriptorType |
447 0x00, // bDescriptorSubtype | 497 0x00, // bDescriptorSubtype |
482 0, // bAlternateSetting | 532 0, // bAlternateSetting |
483 2, // bNumEndpoints | 533 2, // bNumEndpoints |
484 0x0A, // bInterfaceClass | 534 0x0A, // bInterfaceClass |
485 0x00, // bInterfaceSubClass | 535 0x00, // bInterfaceSubClass |
486 0x00, // bInterfaceProtocol | 536 0x00, // bInterfaceProtocol |
487 0, // iInterface | 537 CDC_DATA_INTERFACE + 4, // iInterface |
488 // - 7 bytes - | 538 // - 7 bytes - |
489 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13 | 539 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13 |
490 7, // bLength | 540 7, // bLength |
491 5, // bDescriptorType | 541 5, // bDescriptorType |
492 CDC_RX_ENDPOINT, // bEndpointAddress | 542 CDC_RX_ENDPOINT, // bEndpointAddress |
500 CDC_TX_ENDPOINT | 0x80, // bEndpointAddress | 550 CDC_TX_ENDPOINT | 0x80, // bEndpointAddress |
501 0x02, // bmAttributes (0x02=bulk) | 551 0x02, // bmAttributes (0x02=bulk) |
502 CDC_TX_SIZE, 0, // wMaxPacketSize | 552 CDC_TX_SIZE, 0, // wMaxPacketSize |
503 0, // bInterval | 553 0, // bInterval |
504 | 554 |
505 /* | 555 // --- Mouse Interface --- |
506 // Mouse Interface | |
507 // - 9 bytes - | 556 // - 9 bytes - |
508 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12 | 557 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12 |
509 9, // bLength | 558 9, // bLength |
510 4, // bDescriptorType | 559 4, // bDescriptorType |
511 MOUSE_INTERFACE, // bInterfaceNumber | 560 MOUSE_INTERFACE, // bInterfaceNumber |
512 0, // bAlternateSetting | 561 0, // bAlternateSetting |
513 1, // bNumEndpoints | 562 1, // bNumEndpoints |
514 0x03, // bInterfaceClass (0x03 = HID) | 563 0x03, // bInterfaceClass (0x03 = HID) |
515 0x00, // bInterfaceSubClass (0x01 = Boot) | 564 0x00, // bInterfaceSubClass (0x01 = Boot) |
516 0x00, // bInterfaceProtocol (0x02 = Mouse) | 565 0x02, // bInterfaceProtocol (0x02 = Mouse) |
517 0, // iInterface | 566 MOUSE_INTERFACE + 4, // iInterface |
518 // - 9 bytes - | 567 // - 9 bytes - |
519 // HID interface descriptor, HID 1.11 spec, section 6.2.1 | 568 // HID interface descriptor, HID 1.11 spec, section 6.2.1 |
520 9, // bLength | 569 9, // bLength |
521 0x21, // bDescriptorType | 570 0x21, // bDescriptorType |
522 0x11, 0x01, // bcdHID | 571 0x11, 0x01, // bcdHID |
531 5, // bDescriptorType | 580 5, // bDescriptorType |
532 MOUSE_ENDPOINT | 0x80, // bEndpointAddress | 581 MOUSE_ENDPOINT | 0x80, // bEndpointAddress |
533 0x03, // bmAttributes (0x03=intr) | 582 0x03, // bmAttributes (0x03=intr) |
534 MOUSE_SIZE, 0, // wMaxPacketSize | 583 MOUSE_SIZE, 0, // wMaxPacketSize |
535 MOUSE_INTERVAL, // bInterval | 584 MOUSE_INTERVAL, // bInterval |
536 #endif // MOUSE_INTERFACE | 585 |
537 */ | 586 // --- Joystick Interface --- |
587 // - 9 bytes - | |
588 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12 | |
589 9, // bLength | |
590 4, // bDescriptorType | |
591 JOYSTICK_INTERFACE, // bInterfaceNumber | |
592 0, // bAlternateSetting | |
593 1, // bNumEndpoints | |
594 0x03, // bInterfaceClass (0x03 = HID) | |
595 0x00, // bInterfaceSubClass | |
596 0x00, // bInterfaceProtocol | |
597 JOYSTICK_INTERFACE + 4, // iInterface | |
598 // - 9 bytes - | |
599 // HID interface descriptor, HID 1.11 spec, section 6.2.1 | |
600 9, // bLength | |
601 0x21, // bDescriptorType | |
602 0x11, 0x01, // bcdHID | |
603 0, // bCountryCode | |
604 1, // bNumDescriptors | |
605 0x22, // bDescriptorType | |
606 LSB(sizeof(joystick_report_desc)), // wDescriptorLength | |
607 MSB(sizeof(joystick_report_desc)), | |
608 // - 7 bytes - | |
609 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13 | |
610 7, // bLength | |
611 5, // bDescriptorType | |
612 JOYSTICK_ENDPOINT | 0x80, // bEndpointAddress | |
613 0x03, // bmAttributes (0x03=intr) | |
614 JOYSTICK_SIZE, 0, // wMaxPacketSize | |
615 JOYSTICK_INTERVAL, // bInterval | |
616 | |
617 // --- System/Consumer Control --- | |
618 // - 9 bytes - | |
619 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12 | |
620 9, // bLength | |
621 4, // bDescriptorType | |
622 SYS_CTRL_INTERFACE, // bInterfaceNumber | |
623 0, // bAlternateSetting | |
624 1, // bNumEndpoints | |
625 0x03, // bInterfaceClass (0x03 = HID) | |
626 0x01, // bInterfaceSubClass (0x00 = Non-Boot, 0x01 = Boot) | |
627 0x00, // bInterfaceProtocol (0x00 = None) | |
628 SYS_CTRL_INTERFACE + 4, // iInterface | |
629 // - 9 bytes - | |
630 // HID interface descriptor, HID 1.11 spec, section 6.2.1 | |
631 9, // bLength | |
632 0x21, // bDescriptorType | |
633 0x11, 0x01, // bcdHID | |
634 KeyboardLocale_define, // bCountryCode | |
635 1, // bNumDescriptors | |
636 0x22, // bDescriptorType | |
637 LSB(sizeof(sys_ctrl_report_desc)), // wDescriptorLength | |
638 MSB(sizeof(sys_ctrl_report_desc)), | |
639 // - 7 bytes - | |
640 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13 | |
641 7, // bLength | |
642 5, // bDescriptorType | |
643 SYS_CTRL_ENDPOINT | 0x80, // bEndpointAddress | |
644 0x03, // bmAttributes (0x03=intr) | |
645 SYS_CTRL_SIZE, 0, // wMaxPacketSize | |
646 SYS_CTRL_INTERVAL, // bInterval | |
538 }; | 647 }; |
539 | 648 |
540 | 649 |
541 | 650 |
542 // ----- String Descriptors ----- | 651 // ----- String Descriptors ----- |
562 4, | 671 4, |
563 3, | 672 3, |
564 {0x0409} | 673 {0x0409} |
565 }; | 674 }; |
566 | 675 |
567 struct usb_string_descriptor_struct usb_string_manufacturer_name_default = { | 676 #define usb_string_descriptor(name, str) \ |
568 sizeof(STR_MANUFACTURER), | 677 struct usb_string_descriptor_struct name = { \ |
569 3, | 678 sizeof(str), \ |
570 {STR_MANUFACTURER} | 679 3, \ |
571 }; | 680 {str} \ |
572 struct usb_string_descriptor_struct usb_string_product_name_default = { | 681 } |
573 sizeof(STR_PRODUCT), | 682 |
574 3, | 683 usb_string_descriptor( usb_string_manufacturer_name_default, STR_MANUFACTURER ); |
575 {STR_PRODUCT} | 684 usb_string_descriptor( usb_string_product_name_default, STR_PRODUCT ); |
576 }; | 685 usb_string_descriptor( usb_string_serial_number_default, STR_SERIAL ); |
577 struct usb_string_descriptor_struct usb_string_serial_number_default = { | 686 usb_string_descriptor( usb_string_keyboard_name, KEYBOARD_NAME ); |
578 sizeof(STR_SERIAL), | 687 usb_string_descriptor( usb_string_nkro_keyboard_name, NKRO_KEYBOARD_NAME ); |
579 3, | 688 usb_string_descriptor( usb_string_cdc_status_name, CDC_STATUS_NAME ); |
580 {STR_SERIAL} | 689 usb_string_descriptor( usb_string_cdc_data_name, CDC_DATA_NAME ); |
581 }; | 690 usb_string_descriptor( usb_string_mouse_name, MOUSE_NAME ); |
691 usb_string_descriptor( usb_string_joystick_name, JOYSTICK_NAME ); | |
692 usb_string_descriptor( usb_string_sys_ctrl_name, SYS_CTRL_NAME ); | |
582 | 693 |
583 | 694 |
584 | 695 |
585 // ----- Descriptors List ----- | 696 // ----- Descriptors List ----- |
586 | 697 |
590 //wValue, wIndex, address, length | 701 //wValue, wIndex, address, length |
591 {0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)}, | 702 {0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)}, |
592 {0x0200, 0x0000, config_descriptor, sizeof(config_descriptor)}, | 703 {0x0200, 0x0000, config_descriptor, sizeof(config_descriptor)}, |
593 {0x0600, 0x0000, device_qualifier_descriptor, sizeof(device_qualifier_descriptor)}, | 704 {0x0600, 0x0000, device_qualifier_descriptor, sizeof(device_qualifier_descriptor)}, |
594 {0x0A00, 0x0000, usb_debug_descriptor, sizeof(usb_debug_descriptor)}, | 705 {0x0A00, 0x0000, usb_debug_descriptor, sizeof(usb_debug_descriptor)}, |
706 | |
595 {0x2200, KEYBOARD_INTERFACE, keyboard_report_desc, sizeof(keyboard_report_desc)}, | 707 {0x2200, KEYBOARD_INTERFACE, keyboard_report_desc, sizeof(keyboard_report_desc)}, |
596 {0x2100, KEYBOARD_INTERFACE, config_descriptor + KEYBOARD_DESC_OFFSET, 9}, | 708 {0x2100, KEYBOARD_INTERFACE, config_descriptor + KEYBOARD_DESC_OFFSET, 9}, |
709 | |
597 {0x2200, NKRO_KEYBOARD_INTERFACE, nkro_keyboard_report_desc, sizeof(nkro_keyboard_report_desc)}, | 710 {0x2200, NKRO_KEYBOARD_INTERFACE, nkro_keyboard_report_desc, sizeof(nkro_keyboard_report_desc)}, |
598 {0x2100, NKRO_KEYBOARD_INTERFACE, config_descriptor + NKRO_KEYBOARD_DESC_OFFSET, 9}, | 711 {0x2100, NKRO_KEYBOARD_INTERFACE, config_descriptor + NKRO_KEYBOARD_DESC_OFFSET, 9}, |
599 /* MOUSE | 712 |
600 {0x2200, MOUSE_INTERFACE, mouse_report_desc, sizeof(mouse_report_desc)}, | 713 {0x2200, MOUSE_INTERFACE, mouse_report_desc, sizeof(mouse_report_desc)}, |
601 {0x2100, MOUSE_INTERFACE, config_descriptor+MOUSE_DESC_OFFSET, 9}, | 714 {0x2100, MOUSE_INTERFACE, config_descriptor + MOUSE_DESC_OFFSET, 9}, |
602 */ | 715 |
716 {0x2200, JOYSTICK_INTERFACE, joystick_report_desc, sizeof(joystick_report_desc)}, | |
717 {0x2100, JOYSTICK_INTERFACE, config_descriptor + JOYSTICK_DESC_OFFSET, 9}, | |
718 | |
719 {0x2200, SYS_CTRL_INTERFACE, sys_ctrl_report_desc, sizeof(sys_ctrl_report_desc)}, | |
720 {0x2100, SYS_CTRL_INTERFACE, config_descriptor + SYS_CTRL_DESC_OFFSET, 9}, | |
721 | |
722 #define iInterfaceString(num, var) \ | |
723 {0x0300 + 4 + num, 0x409, (const uint8_t *)&var, 0 } | |
724 | |
603 {0x0300, 0x0000, (const uint8_t *)&string0, 0}, | 725 {0x0300, 0x0000, (const uint8_t *)&string0, 0}, |
604 {0x0301, 0x0409, (const uint8_t *)&usb_string_manufacturer_name, 0}, | 726 {0x0301, 0x0409, (const uint8_t *)&usb_string_manufacturer_name, 0}, |
605 {0x0302, 0x0409, (const uint8_t *)&usb_string_product_name, 0}, | 727 {0x0302, 0x0409, (const uint8_t *)&usb_string_product_name, 0}, |
606 {0x0303, 0x0409, (const uint8_t *)&usb_string_serial_number, 0}, | 728 {0x0303, 0x0409, (const uint8_t *)&usb_string_serial_number, 0}, |
729 iInterfaceString( KEYBOARD_INTERFACE, usb_string_keyboard_name ), | |
730 iInterfaceString( NKRO_KEYBOARD_INTERFACE, usb_string_nkro_keyboard_name ), | |
731 iInterfaceString( CDC_STATUS_INTERFACE, usb_string_cdc_status_name ), | |
732 iInterfaceString( CDC_DATA_INTERFACE, usb_string_cdc_data_name ), | |
733 iInterfaceString( MOUSE_INTERFACE, usb_string_mouse_name ), | |
734 iInterfaceString( JOYSTICK_INTERFACE, usb_string_joystick_name ), | |
735 iInterfaceString( SYS_CTRL_INTERFACE, usb_string_sys_ctrl_name ), | |
607 {0, 0, NULL, 0} | 736 {0, 0, NULL, 0} |
608 }; | 737 }; |
609 | 738 |
610 | 739 |
611 | 740 |