annotate Output/pjrcUSB/arm/usb_desc.c @ 430:d3cef419c849

Adding relative movement mouse key support - Still very basic (lots of room for improvement) - Capability format will likely change at some point - 16 bit movement control, however repeat rate limits usability (will need KLL 0.4 to make better)
author Jacob Alexander <haata@kiibohd.com>
date Mon, 21 Mar 2016 22:23:57 -0700
parents 970dab727f47
children 45feb80a2ad1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
117
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
1 /* Teensyduino Core Library
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
2 * http://www.pjrc.com/teensy/
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
3 * Copyright (c) 2013 PJRC.COM, LLC.
420
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 392
diff changeset
4 * Modified by Jacob Alexander (2013-2016)
117
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
5 *
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
6 * Permission is hereby granted, free of charge, to any person obtaining
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
7 * a copy of this software and associated documentation files (the
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
8 * "Software"), to deal in the Software without restriction, including
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
9 * without limitation the rights to use, copy, modify, merge, publish,
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
10 * distribute, sublicense, and/or sell copies of the Software, and to
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
11 * permit persons to whom the Software is furnished to do so, subject to
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
12 * the following conditions:
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
13 *
123
0c5d1fe99302 Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents: 119
diff changeset
14 * 1. The above copyright notice and this permission notice shall be
117
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
15 * included in all copies or substantial portions of the Software.
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
16 *
123
0c5d1fe99302 Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents: 119
diff changeset
17 * 2. If the Software is incorporated into a build system that allows
117
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
18 * selection among a list of target devices, then similar target
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
19 * devices manufactured by PJRC.COM must be included in the list of
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
20 * target devices and selectable in the same manner.
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
21 *
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
25 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
26 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
27 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
28 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
29 * SOFTWARE.
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
30 */
5ffefdf89b37 Adding in USB module updates from Teensyduino 1.18rc2.
Jacob Alexander <haata@kiibohd.com>
parents: 104
diff changeset
31
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
32 // ----- Includes -----
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
33
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
34 // Local Includes
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
35 #include "usb_desc.h"
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
36
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
37 // Generated Includes
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
38 #include <kll_defs.h>
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
39
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
40
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
41
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
42 // ----- Macros -----
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
43
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
44 #define LSB(n) ((n) & 255)
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
45 #define MSB(n) (((n) >> 8) & 255)
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
46
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
47
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
48
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
49 // ----- USB Device Descriptor -----
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
50
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
51 // USB Device Descriptor. The USB host reads this first, to learn
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
52 // what type of device is connected.
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
53 static uint8_t device_descriptor[] = {
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
54 18, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
55 1, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
56 0x00, 0x02, // bcdUSB
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
57 DEVICE_CLASS, // bDeviceClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
58 DEVICE_SUBCLASS, // bDeviceSubClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
59 DEVICE_PROTOCOL, // bDeviceProtocol
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
60 EP0_SIZE, // bMaxPacketSize0
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
61 LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
62 LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
63 0x00, 0x01, // bcdDevice
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
64 1, // iManufacturer
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
65 2, // iProduct
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
66 3, // iSerialNumber
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
67 1 // bNumConfigurations
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
68 };
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
69
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
70 // USB Device Qualifier Descriptor
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
71 static uint8_t device_qualifier_descriptor[] = {
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
72 0 // Indicate only single speed
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
73 /* Device qualifier example (used for specifying multiple USB speeds)
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
74 10, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
75 6, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
76 0x00, 0x02, // bcdUSB
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
77 DEVICE_CLASS, // bDeviceClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
78 DEVICE_SUBCLASS, // bDeviceSubClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
79 DEVICE_PROTOCOL, // bDeviceProtocol
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
80 EP0_SIZE, // bMaxPacketSize0
233
757e06368d0f Fixing NKRO for Windows.
Jacob Alexander <haata@kiibohd.com>
parents: 231
diff changeset
81 0, // bNumOtherSpeedConfigurations
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
82 0 // bReserved
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
83 */
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
84 };
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
85
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
86 // USB Debug Descriptor
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
87 // XXX Not sure of exact use, lsusb requests it
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
88 static uint8_t usb_debug_descriptor[] = {
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
89 0
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
90 };
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
91
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
92 // XXX
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
93 // These descriptors must NOT be "const", because the USB DMA
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
94 // has trouble accessing flash memory with enough bandwidth
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
95 // while the processor is executing from flash.
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
96 // XXX
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
97
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
98
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
99
389
fc2c2a1e9615 Adding basic remote capabilities + UART Rx DMA buffers
Jacob Alexander <haata@kiibohd.com>
parents: 376
diff changeset
100 // ----- USB HID Report Descriptors -----
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
101
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
102 // Each HID interface needs a special report descriptor that tells
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
103 // the meaning and format of the data.
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
105 // Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
106 static uint8_t keyboard_report_desc[] = {
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
107 // Keyboard Collection
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
108 0x05, 0x01, // Usage Page (Generic Desktop),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
109 0x09, 0x06, // Usage (Keyboard),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
110 0xA1, 0x01, // Collection (Application) - Keyboard,
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
111
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
112 // Modifier Byte
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
113 0x75, 0x01, // Report Size (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
114 0x95, 0x08, // Report Count (8),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
115 0x05, 0x07, // Usage Page (Key Codes),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
116 0x19, 0xE0, // Usage Minimum (224),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
117 0x29, 0xE7, // Usage Maximum (231),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
118 0x15, 0x00, // Logical Minimum (0),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
119 0x25, 0x01, // Logical Maximum (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
120 0x81, 0x02, // Input (Data, Variable, Absolute),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
121
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
122 // Reserved Byte
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
123 0x75, 0x08, // Report Size (8),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
124 0x95, 0x01, // Report Count (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
125 0x81, 0x03, // Output (Constant),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
126
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
127 // LED Report
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
128 0x75, 0x01, // Report Size (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
129 0x95, 0x05, // Report Count (5),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
130 0x05, 0x08, // Usage Page (LEDs),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
131 0x19, 0x01, // Usage Minimum (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
132 0x29, 0x05, // Usage Maximum (5),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
133 0x91, 0x02, // Output (Data, Variable, Absolute),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
134
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
135 // LED Report Padding
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
136 0x75, 0x03, // Report Size (3),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
137 0x95, 0x01, // Report Count (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
138 0x91, 0x03, // Output (Constant),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
139
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
140 // Normal Keys
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
141 0x75, 0x08, // Report Size (8),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
142 0x95, 0x06, // Report Count (6),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
143 0x15, 0x00, // Logical Minimum (0),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
144 0x25, 0x7F, // Logical Maximum(104),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
145 0x05, 0x07, // Usage Page (Key Codes),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
146 0x19, 0x00, // Usage Minimum (0),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
147 0x29, 0x7F, // Usage Maximum (104),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
148 0x81, 0x00, // Input (Data, Array),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
149 0xc0, // End Collection - Keyboard
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
150 };
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
151
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
152 // Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
153 static uint8_t nkro_keyboard_report_desc[] = {
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
154 // Keyboard Collection
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
155 0x05, 0x01, // Usage Page (Generic Desktop),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
156 0x09, 0x06, // Usage (Keyboard),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
157 0xA1, 0x01, // Collection (Application) - Keyboard,
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
158
251
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
159 // LED Report
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
160 0x85, 0x01, // Report ID (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
161 0x75, 0x01, // Report Size (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
162 0x95, 0x05, // Report Count (5),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
163 0x05, 0x08, // Usage Page (LEDs),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
164 0x19, 0x01, // Usage Minimum (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
165 0x29, 0x05, // Usage Maximum (5),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
166 0x91, 0x02, // Output (Data, Variable, Absolute),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
167
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
168 // LED Report Padding
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
169 0x75, 0x03, // Report Size (3),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
170 0x95, 0x01, // Report Count (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
171 0x91, 0x03, // Output (Constant),
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
172
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
173 // Normal Keys - Using an NKRO Bitmap
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
174 //
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
175 // NOTES:
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
176 // Supports all keys defined by the spec, except 1-3 which define error events
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
177 // and 0 which is "no keys pressed"
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
178 // See http://www.usb.org/developers/hidpage/Hut1_12v2.pdf Chapter 10
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
179 // Or Macros/PartialMap/usb_hid.h
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
180 //
248
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 246
diff changeset
181 // 50 (ISO \ due to \ bug) and 156 (Clear due to Delete bug) must be excluded
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 246
diff changeset
182 // due to a Linux bug with bitmaps (not useful anyways)
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
183 // 165-175 are reserved/unused as well as 222-223 and 232-65535
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
184 //
246
f23f6cff7ef8 Fixing Mac OSX USB NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 245
diff changeset
185 // Compatibility Notes:
f23f6cff7ef8 Fixing Mac OSX USB NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 245
diff changeset
186 // - Using a second endpoint for a boot mode device helps with compatibility
f23f6cff7ef8 Fixing Mac OSX USB NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 245
diff changeset
187 // - DO NOT use Padding in the descriptor for bitfields
f23f6cff7ef8 Fixing Mac OSX USB NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 245
diff changeset
188 // (Mac OSX silently fails... Windows/Linux work correctly)
251
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
189 // - DO NOT use Report IDs, Windows 8.1 will not update keyboard correctly (modifiers disappear)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
190 // (all other OSs, including OSX work fine...)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
191 // (you can use them *iff* you only have 1 per collection)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
192 // - Mac OSX and Windows 8.1 are extremely picky about padding
246
f23f6cff7ef8 Fixing Mac OSX USB NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 245
diff changeset
193 //
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
194 // Packing of bitmaps are as follows:
251
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
195 // 4-49 : 6 bytes (0x04-0x31) ( 46 bits + 2 padding bits for 6 bytes total)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
196 // 51-155 : 14 bytes (0x33-0x9B) (105 bits + 6 padding bits for 15 bytes total)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
197 // 157-164 : 1 byte (0x9D-0xA4) ( 8 bits)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
198 // 176-221 : 6 bytes (0xB0-0xDD) ( 46 bits + 2 padding bits for 6 bytes total)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
199 // 224-231 : 1 byte (0xE0-0xE7) ( 8 bits)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
200
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
201 // Modifier Byte
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
202 0x75, 0x01, // Report Size (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
203 0x95, 0x08, // Report Count (8),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
204 0x15, 0x00, // Logical Minimum (0),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
205 0x25, 0x01, // Logical Maximum (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
206 0x05, 0x07, // Usage Page (Key Codes),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
207 0x19, 0xE0, // Usage Minimum (224),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
208 0x29, 0xE7, // Usage Maximum (231),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
209 0x81, 0x02, // Input (Data, Variable, Absolute),
251
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
210
248
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 246
diff changeset
211 // 4-49 (6 bytes/46 bits) - MainKeys
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
212 0x75, 0x01, // Report Size (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
213 0x95, 0x2E, // Report Count (46),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
214 0x15, 0x00, // Logical Minimum (0),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
215 0x25, 0x01, // Logical Maximum (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
216 0x05, 0x07, // Usage Page (Key Codes),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
217 0x19, 0x04, // Usage Minimum (4),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
218 0x29, 0x31, // Usage Maximum (49),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
219 0x81, 0x02, // Input (Data, Variable, Absolute, Bitfield),
236
d494b74d5242 Fixed Linux NKRO bitmap bug.
Jacob Alexander <haata@kiibohd.com>
parents: 233
diff changeset
220
251
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
221 // Padding (2 bits)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
222 0x75, 0x02, // Report Size (2),
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
223 0x95, 0x01, // Report Count (1),
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
224 0x81, 0x03, // Input (Constant),
236
d494b74d5242 Fixed Linux NKRO bitmap bug.
Jacob Alexander <haata@kiibohd.com>
parents: 233
diff changeset
225
248
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 246
diff changeset
226 // 51-155 (14 bytes/105 bits) - SecondaryKeys
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
227 0x75, 0x01, // Report Size (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
228 0x95, 0x69, // Report Count (105),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
229 0x15, 0x00, // Logical Minimum (0),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
230 0x25, 0x01, // Logical Maximum (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
231 0x05, 0x07, // Usage Page (Key Codes),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
232 0x19, 0x33, // Usage Minimum (51),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
233 0x29, 0x9B, // Usage Maximum (155),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
234 0x81, 0x02, // Input (Data, Variable, Absolute, Bitfield),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
235
251
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
236 // Padding (7 bits)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
237 0x75, 0x07, // Report Size (7),
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
238 0x95, 0x01, // Report Count (1),
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
239 0x81, 0x03, // Input (Constant),
236
d494b74d5242 Fixed Linux NKRO bitmap bug.
Jacob Alexander <haata@kiibohd.com>
parents: 233
diff changeset
240
248
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 246
diff changeset
241 // 157-164 (1 byte/8 bits) - TertiaryKeys
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
242 0x75, 0x01, // Report Size (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
243 0x95, 0x08, // Report Count (8),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
244 0x15, 0x00, // Logical Minimum (0),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
245 0x25, 0x01, // Logical Maximum (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
246 0x05, 0x07, // Usage Page (Key Codes),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
247 0x19, 0x9D, // Usage Minimum (157),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
248 0x29, 0xA4, // Usage Maximum (164),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
249 0x81, 0x02, // Input (Data, Variable, Absolute, Bitfield),
248
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 246
diff changeset
250
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 246
diff changeset
251 // 176-221 (6 bytes/46 bits) - QuartiaryKeys
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
252 0x75, 0x01, // Report Size (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
253 0x95, 0x2E, // Report Count (46),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
254 0x15, 0x00, // Logical Minimum (0),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
255 0x25, 0x01, // Logical Maximum (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
256 0x05, 0x07, // Usage Page (Key Codes),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
257 0x19, 0xB0, // Usage Minimum (176),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
258 0x29, 0xDD, // Usage Maximum (221),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
259 0x81, 0x02, // Input (Data, Variable, Absolute, Bitfield),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
260
251
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
261 // Padding (2 bits)
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
262 0x75, 0x02, // Report Size (2),
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
263 0x95, 0x01, // Report Count (1),
d3ac199593d6 Fixing NKRO on Windows 8.1
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
264 0x81, 0x03, // Input (Constant),
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
265 0xc0, // End Collection - Keyboard
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
266 };
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
267
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
268 // System Control and Consumer Control
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
269 static uint8_t sys_ctrl_report_desc[] = {
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
270 // System Control Collection (8 bits)
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
271 //
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
272 // NOTES:
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
273 // Not bothering with NKRO for this table. If there's need, I can implement it. -HaaTa
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
274 // Using a 1KRO scheme
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
275 0x05, 0x01, // Usage Page (Generic Desktop),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
276 0x09, 0x80, // Usage (System Control),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
277 0xA1, 0x01, // Collection (Application),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
278 0x85, 0x02, // Report ID (2),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
279 0x75, 0x08, // Report Size (8),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
280 0x95, 0x01, // Report Count (1),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
281 0x16, 0x81, 0x00, // Logical Minimum (129),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
282 0x26, 0xB7, 0x00, // Logical Maximum (183),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
283 0x19, 0x81, // Usage Minimum (129),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
284 0x29, 0xB7, // Usage Maximum (183),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
285 0x81, 0x00, // Input (Data, Array),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
286 0xc0, // End Collection - System Control
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
287
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
288 // Consumer Control Collection - Media Keys (16 bits)
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
289 //
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
290 // NOTES:
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
291 // Not bothering with NKRO for this table. If there's a need, I can implement it. -HaaTa
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
292 // Using a 1KRO scheme
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
293 0x05, 0x0c, // Usage Page (Consumer),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
294 0x09, 0x01, // Usage (Consumer Control),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
295 0xA1, 0x01, // Collection (Application),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
296 0x85, 0x03, // Report ID (3),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
297 0x75, 0x10, // Report Size (16),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
298 0x95, 0x01, // Report Count (1),
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
299 0x16, 0x01, 0x00, // Logical Minimum (1),
392
36b047a5afb0 Typo from the last commit.
Jacob Alexander <haata@kiibohd.com>
parents: 391
diff changeset
300 0x26, 0x9D, 0x02, // Logical Maximum (669),
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
301 0x05, 0x0C, // Usage Page (Consumer),
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
302 0x19, 0x01, // Usage Minimum (1),
391
e85438377fe6 Adding support for kll 0.3d
Jacob Alexander <haata@kiibohd.com>
parents: 389
diff changeset
303 0x2A, 0x9D, 0x02, // Usage Maximum (669),
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
304 0x81, 0x00, // Input (Data, Array),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
305 0xc0, // End Collection - Consumer Control
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
306 };
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
307
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
308 // Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
309 static uint8_t mouse_report_desc[] = {
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
310 0x05, 0x01, // Usage Page (Generic Desktop)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
311 0x09, 0x02, // Usage (Mouse)
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
312 0xA1, 0x01, // Collection (Application)
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
313 0x09, 0x02, // Usage (Mouse)
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
314 0xA1, 0x02, // Collection (Logical)
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
315 0x09, 0x01, // Usage (Pointer)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
316
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
317 // Buttons (16 bits)
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
318 0xA1, 0x00, // Collection (Physical) - Buttons
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
319 0x05, 0x09, // Usage Page (Button)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
320 0x19, 0x01, // Usage Minimum (Button 1)
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
321 0x29, 0x10, // Usage Maximum (Button 16)
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
322 0x15, 0x00, // Logical Minimum (0)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
323 0x25, 0x01, // Logical Maximum (1)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
324 0x75, 0x01, // Report Size (1)
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
325 0x95, 0x10, // Report Count (16)
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
326 0x81, 0x02, // Input (Data,Var,Abs)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
327
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
328 // Pointer (32 bits)
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
329 0x05, 0x01, // Usage PAGE (Generic Desktop)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
330 0x09, 0x30, // Usage (X)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
331 0x09, 0x31, // Usage (Y)
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
332 0x16, 0x01, 0x80, // Logical Minimum (-32 767)
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
333 0x26, 0xFF, 0x7F, // Logical Maximum (32 767)
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
334 0x75, 0x10, // Report Size (16)
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
335 0x95, 0x02, // Report Count (2)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
336 0x81, 0x06, // Input (Data,Var,Rel)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
337
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
338 /*
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
339 // Vertical Wheel
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
340 // - Multiplier (2 bits)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
341 0xa1, 0x02, // Collection (Logical)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
342 0x09, 0x48, // Usage (Resolution Multiplier)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
343 0x15, 0x00, // Logical Minimum (0)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
344 0x25, 0x01, // Logical Maximum (1)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
345 0x35, 0x01, // Physical Minimum (1)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
346 0x45, 0x04, // Physical Maximum (4)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
347 0x75, 0x02, // Report Size (2)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
348 0x95, 0x01, // Report Count (1)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
349 0xa4, // Push
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
350 0xb1, 0x02, // Feature (Data,Var,Abs)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
351 // - Device (8 bits)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
352 0x09, 0x38, // Usage (Wheel)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
353 0x15, 0x81, // Logical Minimum (-127)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
354 0x25, 0x7f, // Logical Maximum (127)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
355 0x35, 0x00, // Physical Minimum (0) - reset physical
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
356 0x45, 0x00, // Physical Maximum (0)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
357 0x75, 0x08, // Report Size (8)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
358 0x81, 0x06, // Input (Data,Var,Rel)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
359 0xc0, // End Collection - Vertical Wheel
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
360
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
361 // Horizontal Wheel
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
362 // - Multiplier (2 bits)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
363 0xa1, 0x02, // Collection (Logical)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
364 0x09, 0x48, // Usage (Resolution Multiplier)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
365 0xb4, // Pop
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
366 0xb1, 0x02, // Feature (Data,Var,Abs)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
367 // - Padding (4 bits)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
368 0x35, 0x00, // Physical Minimum (0) - reset physical
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
369 0x45, 0x00, // Physical Maximum (0)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
370 0x75, 0x04, // Report Size (4)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
371 0xb1, 0x03, // Feature (Cnst,Var,Abs)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
372 // - Device (8 bits)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
373 0x05, 0x0c, // Usage Page (Consumer Devices)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
374 0x0a, 0x38, 0x02, // Usage (AC Pan)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
375 0x15, 0x81, // Logical Minimum (-127)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
376 0x25, 0x7f, // Logical Maximum (127)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
377 0x75, 0x08, // Report Size (8)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
378 0x81, 0x06, // Input (Data,Var,Rel)
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
379 0xc0, // End Collection - Horizontal Wheel
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
380
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
381 */
376
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
382 0xc0, // End Collection - Buttons
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
383 0xc0, // End Collection - Mouse Logical
47f89f1bfdb7 Prep for mouse support
Jacob Alexander <haata@kiibohd.com>
parents: 368
diff changeset
384 0xc0 // End Collection - Mouse Application
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
385 };
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
386
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
387 // Joystick Protocol, HID 1.11 spec, Apendix D, page 64-65
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
388 static uint8_t joystick_report_desc[] = {
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
389 0x05, 0x01, // Usage Page (Generic Desktop)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
390 0x09, 0x04, // Usage (Joystick)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
391 0xA1, 0x01, // Collection (Application)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
392 0x15, 0x00, // Logical Minimum (0)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
393 0x25, 0x01, // Logical Maximum (1)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
394 0x75, 0x01, // Report Size (1)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
395 0x95, 0x20, // Report Count (32)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
396 0x05, 0x09, // Usage Page (Button)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
397 0x19, 0x01, // Usage Minimum (Button #1)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
398 0x29, 0x20, // Usage Maximum (Button #32)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
399 0x81, 0x02, // Input (variable,absolute)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
400 0x15, 0x00, // Logical Minimum (0)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
401 0x25, 0x07, // Logical Maximum (7)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
402 0x35, 0x00, // Physical Minimum (0)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
403 0x46, 0x3B, 0x01, // Physical Maximum (315)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
404 0x75, 0x04, // Report Size (4)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
405 0x95, 0x01, // Report Count (1)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
406 0x65, 0x14, // Unit (20)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
407 0x05, 0x01, // Usage Page (Generic Desktop)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
408 0x09, 0x39, // Usage (Hat switch)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
409 0x81, 0x42, // Input (variable,absolute,null_state)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
410 0x05, 0x01, // Usage Page (Generic Desktop)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
411 0x09, 0x01, // Usage (Pointer)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
412 0xA1, 0x00, // Collection ()
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
413 0x15, 0x00, // Logical Minimum (0)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
414 0x26, 0xFF, 0x03, // Logical Maximum (1023)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
415 0x75, 0x0A, // Report Size (10)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
416 0x95, 0x04, // Report Count (4)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
417 0x09, 0x30, // Usage (X)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
418 0x09, 0x31, // Usage (Y)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
419 0x09, 0x32, // Usage (Z)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
420 0x09, 0x35, // Usage (Rz)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
421 0x81, 0x02, // Input (variable,absolute)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
422 0xC0, // End Collection
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
423 0x15, 0x00, // Logical Minimum (0)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
424 0x26, 0xFF, 0x03, // Logical Maximum (1023)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
425 0x75, 0x0A, // Report Size (10)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
426 0x95, 0x02, // Report Count (2)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
427 0x09, 0x36, // Usage (Slider)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
428 0x09, 0x36, // Usage (Slider)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
429 0x81, 0x02, // Input (variable,absolute)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
430 0xC0 // End Collection
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
431 };
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
432
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
433
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
434
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
435 // ----- USB Configuration -----
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
436
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
437 // USB Configuration Descriptor. This huge descriptor tells all
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
438 // of the devices capbilities.
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
439 static uint8_t config_descriptor[CONFIG_DESC_SIZE] = {
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
440 // --- Configuration ---
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
441 // - 9 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
442 // configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
443 9, // bLength;
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
444 2, // bDescriptorType;
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
445 LSB(CONFIG_DESC_SIZE), // wTotalLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
446 MSB(CONFIG_DESC_SIZE),
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
447 NUM_INTERFACE, // bNumInterfaces
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
448 1, // bConfigurationValue
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
449 0, // iConfiguration
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
450 0xA0, // bmAttributes
420
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 392
diff changeset
451 250, // bMaxPower - Entry Index 8
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
452
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
453 // --- Keyboard HID --- Boot Mode Keyboard Interface
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
454 // - 9 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
455 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
456 9, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
457 4, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
458 KEYBOARD_INTERFACE, // bInterfaceNumber
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
459 0, // bAlternateSetting
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
460 1, // bNumEndpoints
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
461 0x03, // bInterfaceClass (0x03 = HID)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
462 0x01, // bInterfaceSubClass (0x00 = Non-Boot, 0x01 = Boot)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
463 0x01, // bInterfaceProtocol (0x01 = Keyboard)
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
464 KEYBOARD_INTERFACE + 4, // iInterface
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
465 // - 9 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
466 // HID interface descriptor, HID 1.11 spec, section 6.2.1
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
467 9, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
468 0x21, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
469 0x11, 0x01, // bcdHID
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
470 KeyboardLocale_define, // bCountryCode
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
471 1, // bNumDescriptors
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
472 0x22, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
473 LSB(sizeof(keyboard_report_desc)), // wDescriptorLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
474 MSB(sizeof(keyboard_report_desc)),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
475 // - 7 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
476 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
477 7, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
478 5, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
479 KEYBOARD_ENDPOINT | 0x80, // bEndpointAddress
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
480 0x03, // bmAttributes (0x03=intr)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
481 KEYBOARD_SIZE, 0, // wMaxPacketSize
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
482 KEYBOARD_INTERVAL, // bInterval
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
483
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
484 // --- NKRO Keyboard HID --- OS Mode Keyboard Interface
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
485 // - 9 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
486 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
487 9, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
488 4, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
489 NKRO_KEYBOARD_INTERFACE, // bInterfaceNumber
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
490 0, // bAlternateSetting
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
491 1, // bNumEndpoints
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
492 0x03, // bInterfaceClass (0x03 = HID)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
493 0x00, // bInterfaceSubClass (0x00 = Non-Boot, 0x01 = Boot)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
494 0x01, // bInterfaceProtocol (0x01 = Keyboard)
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
495 NKRO_KEYBOARD_INTERFACE + 4, // iInterface
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
496 // - 9 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
497 // HID interface descriptor, HID 1.11 spec, section 6.2.1
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
498 9, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
499 0x21, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
500 0x11, 0x01, // bcdHID
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
501 KeyboardLocale_define, // bCountryCode
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
502 1, // bNumDescriptors
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
503 0x22, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
504 LSB(sizeof(nkro_keyboard_report_desc)), // wDescriptorLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
505 MSB(sizeof(nkro_keyboard_report_desc)),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
506 // - 7 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
507 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
508 7, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
509 5, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
510 NKRO_KEYBOARD_ENDPOINT | 0x80, // bEndpointAddress
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
511 0x03, // bmAttributes (0x03=intr)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
512 NKRO_KEYBOARD_SIZE, 0, // wMaxPacketSize
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
513 NKRO_KEYBOARD_INTERVAL, // bInterval
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
514
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
515 // --- Serial CDC --- CDC IAD Descriptor
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
516 // - 8 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
517 // interface association descriptor, USB ECN, Table 9-Z
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
518 8, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
519 11, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
520 CDC_STATUS_INTERFACE, // bFirstInterface
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
521 2, // bInterfaceCount
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
522 0x02, // bFunctionClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
523 0x02, // bFunctionSubClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
524 0x01, // bFunctionProtocol
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
525 CDC_STATUS_INTERFACE + 4, // iFunction
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
526
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
527 // --- Serial CDC --- CDC Data Interface
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
528 // - 9 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
529 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
530 9, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
531 4, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
532 CDC_STATUS_INTERFACE, // bInterfaceNumber
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
533 0, // bAlternateSetting
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
534 1, // bNumEndpoints
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
535 0x02, // bInterfaceClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
536 0x02, // bInterfaceSubClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
537 0x01, // bInterfaceProtocol
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
538 CDC_STATUS_INTERFACE + 4, // iInterface
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
539 // - 5 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
540 // CDC Header Functional Descriptor, CDC Spec 5.2.3.1, Table 26
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
541 5, // bFunctionLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
542 0x24, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
543 0x00, // bDescriptorSubtype
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
544 0x10, 0x01, // bcdCDC
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
545 // - 5 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
546 // Call Management Functional Descriptor, CDC Spec 5.2.3.2, Table 27
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
547 5, // bFunctionLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
548 0x24, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
549 0x01, // bDescriptorSubtype
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
550 0x01, // bmCapabilities
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
551 CDC_DATA_INTERFACE, // bDataInterface
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
552 // - 4 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
553 // Abstract Control Management Functional Descriptor, CDC Spec 5.2.3.3, Table 28
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
554 4, // bFunctionLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
555 0x24, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
556 0x02, // bDescriptorSubtype
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
557 0x06, // bmCapabilities
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
558 // - 5 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
559 // Union Functional Descriptor, CDC Spec 5.2.3.8, Table 33
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
560 5, // bFunctionLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
561 0x24, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
562 0x06, // bDescriptorSubtype
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
563 CDC_STATUS_INTERFACE, // bMasterInterface
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
564 CDC_DATA_INTERFACE, // bSlaveInterface0
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
565 // - 7 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
566 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
567 7, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
568 5, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
569 CDC_ACM_ENDPOINT | 0x80, // bEndpointAddress
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
570 0x03, // bmAttributes (0x03=intr)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
571 CDC_ACM_SIZE, 0, // wMaxPacketSize
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
572 64, // bInterval
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
573 // - 9 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
574 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
575 9, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
576 4, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
577 CDC_DATA_INTERFACE, // bInterfaceNumber
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
578 0, // bAlternateSetting
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
579 2, // bNumEndpoints
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
580 0x0A, // bInterfaceClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
581 0x00, // bInterfaceSubClass
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
582 0x00, // bInterfaceProtocol
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
583 CDC_DATA_INTERFACE + 4, // iInterface
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
584 // - 7 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
585 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
586 7, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
587 5, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
588 CDC_RX_ENDPOINT, // bEndpointAddress
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
589 0x02, // bmAttributes (0x02=bulk)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
590 CDC_RX_SIZE, 0, // wMaxPacketSize
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
591 0, // bInterval
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
592 // - 7 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
593 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
594 7, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
595 5, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
596 CDC_TX_ENDPOINT | 0x80, // bEndpointAddress
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
597 0x02, // bmAttributes (0x02=bulk)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
598 CDC_TX_SIZE, 0, // wMaxPacketSize
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
599 0, // bInterval
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
600
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
601 // --- Mouse Interface ---
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
602 // - 9 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
603 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
604 9, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
605 4, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
606 MOUSE_INTERFACE, // bInterfaceNumber
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
607 0, // bAlternateSetting
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
608 1, // bNumEndpoints
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
609 0x03, // bInterfaceClass (0x03 = HID)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
610 0x00, // bInterfaceSubClass (0x01 = Boot)
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
611 0x02, // bInterfaceProtocol (0x02 = Mouse)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
612 MOUSE_INTERFACE + 4, // iInterface
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
613 // - 9 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
614 // HID interface descriptor, HID 1.11 spec, section 6.2.1
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
615 9, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
616 0x21, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
617 0x11, 0x01, // bcdHID
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
618 0, // bCountryCode
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
619 1, // bNumDescriptors
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
620 0x22, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
621 LSB(sizeof(mouse_report_desc)), // wDescriptorLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
622 MSB(sizeof(mouse_report_desc)),
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
623 // - 7 bytes -
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
624 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
625 7, // bLength
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
626 5, // bDescriptorType
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
627 MOUSE_ENDPOINT | 0x80, // bEndpointAddress
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
628 0x03, // bmAttributes (0x03=intr)
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
629 MOUSE_SIZE, 0, // wMaxPacketSize
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
630 MOUSE_INTERVAL, // bInterval
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
631
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
632 // --- Joystick Interface ---
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
633 // - 9 bytes -
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
634 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
635 9, // bLength
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
636 4, // bDescriptorType
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
637 JOYSTICK_INTERFACE, // bInterfaceNumber
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
638 0, // bAlternateSetting
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
639 1, // bNumEndpoints
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
640 0x03, // bInterfaceClass (0x03 = HID)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
641 0x00, // bInterfaceSubClass
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
642 0x00, // bInterfaceProtocol
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
643 JOYSTICK_INTERFACE + 4, // iInterface
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
644 // - 9 bytes -
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
645 // HID interface descriptor, HID 1.11 spec, section 6.2.1
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
646 9, // bLength
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
647 0x21, // bDescriptorType
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
648 0x11, 0x01, // bcdHID
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
649 0, // bCountryCode
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
650 1, // bNumDescriptors
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
651 0x22, // bDescriptorType
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
652 LSB(sizeof(joystick_report_desc)), // wDescriptorLength
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
653 MSB(sizeof(joystick_report_desc)),
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
654 // - 7 bytes -
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
655 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
656 7, // bLength
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
657 5, // bDescriptorType
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
658 JOYSTICK_ENDPOINT | 0x80, // bEndpointAddress
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
659 0x03, // bmAttributes (0x03=intr)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
660 JOYSTICK_SIZE, 0, // wMaxPacketSize
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
661 JOYSTICK_INTERVAL, // bInterval
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
662
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
663 // --- System/Consumer Control ---
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
664 // - 9 bytes -
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
665 // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
666 9, // bLength
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
667 4, // bDescriptorType
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
668 SYS_CTRL_INTERFACE, // bInterfaceNumber
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
669 0, // bAlternateSetting
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
670 1, // bNumEndpoints
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
671 0x03, // bInterfaceClass (0x03 = HID)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
672 0x01, // bInterfaceSubClass (0x00 = Non-Boot, 0x01 = Boot)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
673 0x00, // bInterfaceProtocol (0x00 = None)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
674 SYS_CTRL_INTERFACE + 4, // iInterface
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
675 // - 9 bytes -
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
676 // HID interface descriptor, HID 1.11 spec, section 6.2.1
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
677 9, // bLength
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
678 0x21, // bDescriptorType
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
679 0x11, 0x01, // bcdHID
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
680 KeyboardLocale_define, // bCountryCode
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
681 1, // bNumDescriptors
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
682 0x22, // bDescriptorType
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
683 LSB(sizeof(sys_ctrl_report_desc)), // wDescriptorLength
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
684 MSB(sizeof(sys_ctrl_report_desc)),
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
685 // - 7 bytes -
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
686 // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
687 7, // bLength
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
688 5, // bDescriptorType
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
689 SYS_CTRL_ENDPOINT | 0x80, // bEndpointAddress
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
690 0x03, // bmAttributes (0x03=intr)
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
691 SYS_CTRL_SIZE, 0, // wMaxPacketSize
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
692 SYS_CTRL_INTERVAL, // bInterval
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
693 };
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
694
420
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 392
diff changeset
695 uint8_t *usb_bMaxPower = &config_descriptor[8];
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 392
diff changeset
696
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
697
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
698
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
699 // ----- String Descriptors -----
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
700
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
701 // The descriptors above can provide human readable strings,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
702 // referenced by index numbers. These descriptors are the
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
703 // actual string data
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
704
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
705 struct usb_string_descriptor_struct {
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
706 uint8_t bLength;
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
707 uint8_t bDescriptorType;
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
708 uint16_t wString[];
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
709 };
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
710
119
814b5d3d7da6 Finished USB for Teensy 3.1 (Now 3.1 compatible!)
Jacob Alexander <haata@kiibohd.com>
parents: 117
diff changeset
711 extern struct usb_string_descriptor_struct usb_string_manufacturer_name
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
712 __attribute__ ((weak, alias("usb_string_manufacturer_name_default")));
119
814b5d3d7da6 Finished USB for Teensy 3.1 (Now 3.1 compatible!)
Jacob Alexander <haata@kiibohd.com>
parents: 117
diff changeset
713 extern struct usb_string_descriptor_struct usb_string_product_name
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
714 __attribute__ ((weak, alias("usb_string_product_name_default")));
119
814b5d3d7da6 Finished USB for Teensy 3.1 (Now 3.1 compatible!)
Jacob Alexander <haata@kiibohd.com>
parents: 117
diff changeset
715 extern struct usb_string_descriptor_struct usb_string_serial_number
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
716 __attribute__ ((weak, alias("usb_string_serial_number_default")));
119
814b5d3d7da6 Finished USB for Teensy 3.1 (Now 3.1 compatible!)
Jacob Alexander <haata@kiibohd.com>
parents: 117
diff changeset
717
814b5d3d7da6 Finished USB for Teensy 3.1 (Now 3.1 compatible!)
Jacob Alexander <haata@kiibohd.com>
parents: 117
diff changeset
718 struct usb_string_descriptor_struct string0 = {
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
719 4,
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
720 3,
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
721 {0x0409}
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
722 };
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
723
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
724 #define usb_string_descriptor(name, str) \
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
725 struct usb_string_descriptor_struct name = { \
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
726 sizeof(str), \
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
727 3, \
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
728 {str} \
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
729 }
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
730
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
731 usb_string_descriptor( usb_string_manufacturer_name_default, STR_MANUFACTURER );
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
732 usb_string_descriptor( usb_string_product_name_default, STR_PRODUCT );
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
733 usb_string_descriptor( usb_string_serial_number_default, STR_SERIAL );
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
734 usb_string_descriptor( usb_string_keyboard_name, KEYBOARD_NAME );
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
735 usb_string_descriptor( usb_string_nkro_keyboard_name, NKRO_KEYBOARD_NAME );
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
736 usb_string_descriptor( usb_string_cdc_status_name, CDC_STATUS_NAME );
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
737 usb_string_descriptor( usb_string_cdc_data_name, CDC_DATA_NAME );
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
738 usb_string_descriptor( usb_string_mouse_name, MOUSE_NAME );
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
739 usb_string_descriptor( usb_string_joystick_name, JOYSTICK_NAME );
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
740 usb_string_descriptor( usb_string_sys_ctrl_name, SYS_CTRL_NAME );
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
741
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
742
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
743
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
744 // ----- Descriptors List -----
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
745
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
746 // This table provides access to all the descriptor data above.
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
747
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
748 const usb_descriptor_list_t usb_descriptor_list[] = {
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
749 //wValue, wIndex, address, length
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
750 {0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)},
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
751 {0x0200, 0x0000, config_descriptor, sizeof(config_descriptor)},
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
752 {0x0600, 0x0000, device_qualifier_descriptor, sizeof(device_qualifier_descriptor)},
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
753 {0x0A00, 0x0000, usb_debug_descriptor, sizeof(usb_debug_descriptor)},
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
754
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
755 {0x2200, KEYBOARD_INTERFACE, keyboard_report_desc, sizeof(keyboard_report_desc)},
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
756 {0x2100, KEYBOARD_INTERFACE, config_descriptor + KEYBOARD_DESC_OFFSET, 9},
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
757
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
758 {0x2200, NKRO_KEYBOARD_INTERFACE, nkro_keyboard_report_desc, sizeof(nkro_keyboard_report_desc)},
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
759 {0x2100, NKRO_KEYBOARD_INTERFACE, config_descriptor + NKRO_KEYBOARD_DESC_OFFSET, 9},
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
760
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
761 {0x2200, MOUSE_INTERFACE, mouse_report_desc, sizeof(mouse_report_desc)},
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
762 {0x2100, MOUSE_INTERFACE, config_descriptor + MOUSE_DESC_OFFSET, 9},
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
763
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
764 {0x2200, JOYSTICK_INTERFACE, joystick_report_desc, sizeof(joystick_report_desc)},
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
765 {0x2100, JOYSTICK_INTERFACE, config_descriptor + JOYSTICK_DESC_OFFSET, 9},
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
766
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
767 {0x2200, SYS_CTRL_INTERFACE, sys_ctrl_report_desc, sizeof(sys_ctrl_report_desc)},
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
768 {0x2100, SYS_CTRL_INTERFACE, config_descriptor + SYS_CTRL_DESC_OFFSET, 9},
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
769
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
770 #define iInterfaceString(num, var) \
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
771 {0x0300 + 4 + num, 0x409, (const uint8_t *)&var, 0 }
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
772
308
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
773 {0x0300, 0x0000, (const uint8_t *)&string0, 0},
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
774 {0x0301, 0x0409, (const uint8_t *)&usb_string_manufacturer_name, 0},
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
775 {0x0302, 0x0409, (const uint8_t *)&usb_string_product_name, 0},
ab4515606277 Fix whitespace
Rowan Decker <Smasher816@gmail.com>
parents: 265
diff changeset
776 {0x0303, 0x0409, (const uint8_t *)&usb_string_serial_number, 0},
368
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
777 iInterfaceString( KEYBOARD_INTERFACE, usb_string_keyboard_name ),
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
778 iInterfaceString( NKRO_KEYBOARD_INTERFACE, usb_string_nkro_keyboard_name ),
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
779 iInterfaceString( CDC_STATUS_INTERFACE, usb_string_cdc_status_name ),
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
780 iInterfaceString( CDC_DATA_INTERFACE, usb_string_cdc_data_name ),
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
781 iInterfaceString( MOUSE_INTERFACE, usb_string_mouse_name ),
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
782 iInterfaceString( JOYSTICK_INTERFACE, usb_string_joystick_name ),
06a54d582bf8 FIxing Media Keys and general USB compatibilty
Jacob Alexander <haata@kiibohd.com>
parents: 308
diff changeset
783 iInterfaceString( SYS_CTRL_INTERFACE, usb_string_sys_ctrl_name ),
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
784 {0, 0, NULL, 0}
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
785 };
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
786
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
787
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
788
231
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
789 // ----- Endpoint Configuration -----
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
790
4afb170978e9 More preparation for NKRO USB for arm
Jacob Alexander <haata@kiibohd.com>
parents: 170
diff changeset
791 // See usb_desc.h for Endpoint configuration
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
792 // 0x00 = not used
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
793 // 0x19 = Recieve only
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
794 // 0x15 = Transmit only
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
795 // 0x1D = Transmit & Recieve
170
85d74e5e1a95 More work on mk20dx128vlf5 port.
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
796 //
85d74e5e1a95 More work on mk20dx128vlf5 port.
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
797 const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS] =
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
798 {
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
799 #if (defined(ENDPOINT1_CONFIG) && NUM_ENDPOINTS >= 1)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
800 ENDPOINT1_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
801 #elif (NUM_ENDPOINTS >= 1)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
802 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
803 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
804 #if (defined(ENDPOINT2_CONFIG) && NUM_ENDPOINTS >= 2)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
805 ENDPOINT2_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
806 #elif (NUM_ENDPOINTS >= 2)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
807 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
808 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
809 #if (defined(ENDPOINT3_CONFIG) && NUM_ENDPOINTS >= 3)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
810 ENDPOINT3_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
811 #elif (NUM_ENDPOINTS >= 3)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
812 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
813 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
814 #if (defined(ENDPOINT4_CONFIG) && NUM_ENDPOINTS >= 4)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
815 ENDPOINT4_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
816 #elif (NUM_ENDPOINTS >= 4)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
817 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
818 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
819 #if (defined(ENDPOINT5_CONFIG) && NUM_ENDPOINTS >= 5)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
820 ENDPOINT5_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
821 #elif (NUM_ENDPOINTS >= 5)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
822 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
823 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
824 #if (defined(ENDPOINT6_CONFIG) && NUM_ENDPOINTS >= 6)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
825 ENDPOINT6_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
826 #elif (NUM_ENDPOINTS >= 6)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
827 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
828 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
829 #if (defined(ENDPOINT7_CONFIG) && NUM_ENDPOINTS >= 7)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
830 ENDPOINT7_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
831 #elif (NUM_ENDPOINTS >= 7)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
832 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
833 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
834 #if (defined(ENDPOINT8_CONFIG) && NUM_ENDPOINTS >= 8)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
835 ENDPOINT8_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
836 #elif (NUM_ENDPOINTS >= 8)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
837 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
838 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
839 #if (defined(ENDPOINT9_CONFIG) && NUM_ENDPOINTS >= 9)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
840 ENDPOINT9_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
841 #elif (NUM_ENDPOINTS >= 9)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
842 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
843 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
844 #if (defined(ENDPOINT10_CONFIG) && NUM_ENDPOINTS >= 10)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
845 ENDPOINT10_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
846 #elif (NUM_ENDPOINTS >= 10)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
847 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
848 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
849 #if (defined(ENDPOINT11_CONFIG) && NUM_ENDPOINTS >= 11)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
850 ENDPOINT11_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
851 #elif (NUM_ENDPOINTS >= 11)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
852 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
853 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
854 #if (defined(ENDPOINT12_CONFIG) && NUM_ENDPOINTS >= 12)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
855 ENDPOINT12_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
856 #elif (NUM_ENDPOINTS >= 12)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
857 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
858 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
859 #if (defined(ENDPOINT13_CONFIG) && NUM_ENDPOINTS >= 13)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
860 ENDPOINT13_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
861 #elif (NUM_ENDPOINTS >= 13)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
862 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
863 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
864 #if (defined(ENDPOINT14_CONFIG) && NUM_ENDPOINTS >= 14)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
865 ENDPOINT14_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
866 #elif (NUM_ENDPOINTS >= 14)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
867 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
868 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
869 #if (defined(ENDPOINT15_CONFIG) && NUM_ENDPOINTS >= 15)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
870 ENDPOINT15_CONFIG,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
871 #elif (NUM_ENDPOINTS >= 15)
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
872 ENDPOINT_UNUSED,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
873 #endif
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
874 };
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
875
246
f23f6cff7ef8 Fixing Mac OSX USB NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 245
diff changeset
876