]> git.donarmstrong.com Git - kiibohd-controller.git/blob - USB/pjrc/arm/usb_desc.c
CMake generated strings that configure the USB info section
[kiibohd-controller.git] / USB / pjrc / arm / usb_desc.c
1 #include "usb_desc.h"
2
3
4 // USB Descriptors are binary data which the USB host reads to
5 // automatically detect a USB device's capabilities.  The format
6 // and meaning of every field is documented in numerous USB
7 // standards.  When working with USB descriptors, despite the
8 // complexity of the standards and poor writing quality in many
9 // of those documents, remember descriptors are nothing more
10 // than constant binary data that tells the USB host what the
11 // device can do.  Computers will load drivers based on this data.
12 // Those drivers then communicate on the endpoints specified by
13 // the descriptors.
14
15 // To configure a new combination of interfaces or make minor
16 // changes to existing configuration (eg, change the name or ID
17 // numbers), usually you would edit "usb_desc.h".  This file
18 // is meant to be configured by the header, so generally it is
19 // only edited to add completely new USB interfaces or features.
20
21
22
23 // **************************************************************
24 //   USB Device
25 // **************************************************************
26
27 #define LSB(n) ((n) & 255)
28 #define MSB(n) (((n) >> 8) & 255)
29
30 // USB Device Descriptor.  The USB host reads this first, to learn
31 // what type of device is connected.
32 static uint8_t device_descriptor[] = {
33         18,                                     // bLength
34         1,                                      // bDescriptorType
35         0x00, 0x02,                             // bcdUSB
36 #ifdef DEVICE_CLASS
37         DEVICE_CLASS,                           // bDeviceClass
38 #else
39         0,
40 #endif
41 #ifdef DEVICE_SUBCLASS
42         DEVICE_SUBCLASS,                        // bDeviceSubClass
43 #else
44         0,
45 #endif
46 #ifdef DEVICE_PROTOCOL
47         DEVICE_PROTOCOL,                        // bDeviceProtocol
48 #else
49         0,
50 #endif
51         EP0_SIZE,                               // bMaxPacketSize0
52         LSB(VENDOR_ID), MSB(VENDOR_ID),         // idVendor
53         LSB(PRODUCT_ID), MSB(PRODUCT_ID),       // idProduct
54         0x00, 0x01,                             // bcdDevice
55         1,                                      // iManufacturer
56         2,                                      // iProduct
57         3,                                      // iSerialNumber
58         1                                       // bNumConfigurations
59 };
60
61 // These descriptors must NOT be "const", because the USB DMA
62 // has trouble accessing flash memory with enough bandwidth
63 // while the processor is executing from flash.
64
65
66
67 // **************************************************************
68 //   HID Report Descriptors
69 // **************************************************************
70
71 // Each HID interface needs a special report descriptor that tells
72 // the meaning and format of the data.
73
74 #ifdef KEYBOARD_INTERFACE
75 // Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
76 static uint8_t keyboard_report_desc[] = {
77         0x05, 0x01,             //  Usage Page (Generic Desktop),
78         0x09, 0x06,             //  Usage (Keyboard),
79         0xA1, 0x01,             //  Collection (Application),
80         0x75, 0x01,             //  Report Size (1),
81         0x95, 0x08,             //  Report Count (8),
82         0x05, 0x07,             //  Usage Page (Key Codes),
83         0x19, 0xE0,             //  Usage Minimum (224),
84         0x29, 0xE7,             //  Usage Maximum (231),
85         0x15, 0x00,             //  Logical Minimum (0),
86         0x25, 0x01,             //  Logical Maximum (1),
87         0x81, 0x02,             //  Input (Data, Variable, Absolute), ;Modifier byte
88         0x95, 0x08,             //  Report Count (8),
89         0x75, 0x01,             //  Report Size (1),
90         0x15, 0x00,             //  Logical Minimum (0),
91         0x25, 0x01,             //  Logical Maximum (1),
92         0x05, 0x0C,             //  Usage Page (Consumer),
93         0x09, 0xE9,             //  Usage (Volume Increment),
94         0x09, 0xEA,             //  Usage (Volume Decrement),
95         0x09, 0xE2,             //  Usage (Mute),
96         0x09, 0xCD,             //  Usage (Play/Pause),
97         0x09, 0xB5,             //  Usage (Scan Next Track),
98         0x09, 0xB6,             //  Usage (Scan Previous Track),
99         0x09, 0xB7,             //  Usage (Stop),
100         0x09, 0xB8,             //  Usage (Eject),
101         0x81, 0x02,             //  Input (Data, Variable, Absolute), ;Media keys
102         0x95, 0x05,             //  Report Count (5),
103         0x75, 0x01,             //  Report Size (1),
104         0x05, 0x08,             //  Usage Page (LEDs),
105         0x19, 0x01,             //  Usage Minimum (1),
106         0x29, 0x05,             //  Usage Maximum (5),
107         0x91, 0x02,             //  Output (Data, Variable, Absolute), ;LED report
108         0x95, 0x01,             //  Report Count (1),
109         0x75, 0x03,             //  Report Size (3),
110         0x91, 0x03,             //  Output (Constant),                 ;LED report padding
111         0x95, 0x06,             //  Report Count (6),
112         0x75, 0x08,             //  Report Size (8),
113         0x15, 0x00,             //  Logical Minimum (0),
114         0x25, 0x7F,             //  Logical Maximum(104),
115         0x05, 0x07,             //  Usage Page (Key Codes),
116         0x19, 0x00,             //  Usage Minimum (0),
117         0x29, 0x7F,             //  Usage Maximum (104),
118         0x81, 0x00,             //  Input (Data, Array),                ;Normal keys
119         0xc0                    // End Collection
120 };
121 #endif
122
123 #ifdef MOUSE_INTERFACE
124 // Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension
125 static uint8_t mouse_report_desc[] = {
126         0x05, 0x01,                     // Usage Page (Generic Desktop)
127         0x09, 0x02,                     // Usage (Mouse)
128         0xA1, 0x01,                     // Collection (Application)
129         0x05, 0x09,                     //   Usage Page (Button)
130         0x19, 0x01,                     //   Usage Minimum (Button #1)
131         0x29, 0x03,                     //   Usage Maximum (Button #3)
132         0x15, 0x00,                     //   Logical Minimum (0)
133         0x25, 0x01,                     //   Logical Maximum (1)
134         0x95, 0x03,                     //   Report Count (3)
135         0x75, 0x01,                     //   Report Size (1)
136         0x81, 0x02,                     //   Input (Data, Variable, Absolute)
137         0x95, 0x01,                     //   Report Count (1)
138         0x75, 0x05,                     //   Report Size (5)
139         0x81, 0x03,                     //   Input (Constant)
140         0x05, 0x01,                     //   Usage Page (Generic Desktop)
141         0x09, 0x30,                     //   Usage (X)
142         0x09, 0x31,                     //   Usage (Y)
143         0x15, 0x81,                     //   Logical Minimum (-127)
144         0x25, 0x7F,                     //   Logical Maximum (127)
145         0x75, 0x08,                     //   Report Size (8),
146         0x95, 0x02,                     //   Report Count (2),
147         0x81, 0x06,                     //   Input (Data, Variable, Relative)
148         0x09, 0x38,                     //   Usage (Wheel)
149         0x95, 0x01,                     //   Report Count (1),
150         0x81, 0x06,                     //   Input (Data, Variable, Relative)
151         0xC0                            // End Collection
152 };
153 #endif
154
155 #ifdef JOYSTICK_INTERFACE
156 static uint8_t joystick_report_desc[] = {
157         0x05, 0x01,                     // Usage Page (Generic Desktop)
158         0x09, 0x04,                     // Usage (Joystick)
159         0xA1, 0x01,                     // Collection (Application)
160         0x15, 0x00,                     // Logical Minimum (0)
161         0x25, 0x01,                     // Logical Maximum (1)
162         0x75, 0x01,                     // Report Size (1)
163         0x95, 0x20,                     // Report Count (32)
164         0x05, 0x09,                     // Usage Page (Button)
165         0x19, 0x01,                     // Usage Minimum (Button #1)
166         0x29, 0x20,                     // Usage Maximum (Button #32)
167         0x81, 0x02,                     // Input (variable,absolute)
168         0x15, 0x00,                     // Logical Minimum (0)
169         0x25, 0x07,                     // Logical Maximum (7)
170         0x35, 0x00,                     // Physical Minimum (0)
171         0x46, 0x3B, 0x01,               // Physical Maximum (315)
172         0x75, 0x04,                     // Report Size (4)
173         0x95, 0x01,                     // Report Count (1)
174         0x65, 0x14,                     // Unit (20)
175         0x05, 0x01,                     // Usage Page (Generic Desktop)
176         0x09, 0x39,                     // Usage (Hat switch)
177         0x81, 0x42,                     // Input (variable,absolute,null_state)
178         0x05, 0x01,                     // Usage Page (Generic Desktop)
179         0x09, 0x01,                     // Usage (Pointer)
180         0xA1, 0x00,                     // Collection ()
181         0x15, 0x00,                     //   Logical Minimum (0)
182         0x26, 0xFF, 0x03,               //   Logical Maximum (1023)
183         0x75, 0x0A,                     //   Report Size (10)
184         0x95, 0x04,                     //   Report Count (4)
185         0x09, 0x30,                     //   Usage (X)
186         0x09, 0x31,                     //   Usage (Y)
187         0x09, 0x32,                     //   Usage (Z)
188         0x09, 0x35,                     //   Usage (Rz)
189         0x81, 0x02,                     //   Input (variable,absolute)
190         0xC0,                           // End Collection
191         0x15, 0x00,                     // Logical Minimum (0)
192         0x26, 0xFF, 0x03,               // Logical Maximum (1023)
193         0x75, 0x0A,                     // Report Size (10)
194         0x95, 0x02,                     // Report Count (2)
195         0x09, 0x36,                     // Usage (Slider)
196         0x09, 0x36,                     // Usage (Slider)
197         0x81, 0x02,                     // Input (variable,absolute)
198         0xC0                            // End Collection
199 };
200 #endif
201
202
203
204 // **************************************************************
205 //   USB Configuration
206 // **************************************************************
207
208 // USB Configuration Descriptor.  This huge descriptor tells all
209 // of the devices capbilities.
210 static uint8_t config_descriptor[CONFIG_DESC_SIZE] = {
211         // configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10
212         9,                                      // bLength;
213         2,                                      // bDescriptorType;
214         LSB(CONFIG_DESC_SIZE),                 // wTotalLength
215         MSB(CONFIG_DESC_SIZE),
216         NUM_INTERFACE,                          // bNumInterfaces
217         1,                                      // bConfigurationValue
218         0,                                      // iConfiguration
219         0xC0,                                   // bmAttributes
220         50,                                     // bMaxPower
221
222 #ifdef CDC_IAD_DESCRIPTOR
223         // interface association descriptor, USB ECN, Table 9-Z
224         8,                                      // bLength
225         11,                                     // bDescriptorType
226         CDC_STATUS_INTERFACE,                   // bFirstInterface
227         2,                                      // bInterfaceCount
228         0x02,                                   // bFunctionClass
229         0x02,                                   // bFunctionSubClass
230         0x01,                                   // bFunctionProtocol
231         4,                                      // iFunction
232 #endif
233
234 #ifdef CDC_DATA_INTERFACE
235         // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
236         9,                                      // bLength
237         4,                                      // bDescriptorType
238         CDC_STATUS_INTERFACE,                   // bInterfaceNumber
239         0,                                      // bAlternateSetting
240         1,                                      // bNumEndpoints
241         0x02,                                   // bInterfaceClass
242         0x02,                                   // bInterfaceSubClass
243         0x01,                                   // bInterfaceProtocol
244         0,                                      // iInterface
245         // CDC Header Functional Descriptor, CDC Spec 5.2.3.1, Table 26
246         5,                                      // bFunctionLength
247         0x24,                                   // bDescriptorType
248         0x00,                                   // bDescriptorSubtype
249         0x10, 0x01,                             // bcdCDC
250         // Call Management Functional Descriptor, CDC Spec 5.2.3.2, Table 27
251         5,                                      // bFunctionLength
252         0x24,                                   // bDescriptorType
253         0x01,                                   // bDescriptorSubtype
254         0x01,                                   // bmCapabilities
255         1,                                      // bDataInterface
256         // Abstract Control Management Functional Descriptor, CDC Spec 5.2.3.3, Table 28
257         4,                                      // bFunctionLength
258         0x24,                                   // bDescriptorType
259         0x02,                                   // bDescriptorSubtype
260         0x06,                                   // bmCapabilities
261         // Union Functional Descriptor, CDC Spec 5.2.3.8, Table 33
262         5,                                      // bFunctionLength
263         0x24,                                   // bDescriptorType
264         0x06,                                   // bDescriptorSubtype
265         CDC_STATUS_INTERFACE,                   // bMasterInterface
266         CDC_DATA_INTERFACE,                     // bSlaveInterface0
267         // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
268         7,                                      // bLength
269         5,                                      // bDescriptorType
270         CDC_ACM_ENDPOINT | 0x80,                // bEndpointAddress
271         0x03,                                   // bmAttributes (0x03=intr)
272         CDC_ACM_SIZE, 0,                        // wMaxPacketSize
273         64,                                     // bInterval
274         // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
275         9,                                      // bLength
276         4,                                      // bDescriptorType
277         CDC_DATA_INTERFACE,                     // bInterfaceNumber
278         0,                                      // bAlternateSetting
279         2,                                      // bNumEndpoints
280         0x0A,                                   // bInterfaceClass
281         0x00,                                   // bInterfaceSubClass
282         0x00,                                   // bInterfaceProtocol
283         0,                                      // iInterface
284         // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
285         7,                                      // bLength
286         5,                                      // bDescriptorType
287         CDC_RX_ENDPOINT,                        // bEndpointAddress
288         0x02,                                   // bmAttributes (0x02=bulk)
289         CDC_RX_SIZE, 0,                         // wMaxPacketSize
290         0,                                      // bInterval
291         // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
292         7,                                      // bLength
293         5,                                      // bDescriptorType
294         CDC_TX_ENDPOINT | 0x80,                 // bEndpointAddress
295         0x02,                                   // bmAttributes (0x02=bulk)
296         CDC_TX_SIZE, 0,                         // wMaxPacketSize
297         0,                                      // bInterval
298 #endif // CDC_DATA_INTERFACE
299
300 #ifdef KEYBOARD_INTERFACE
301         // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
302         9,                                      // bLength
303         4,                                      // bDescriptorType
304         KEYBOARD_INTERFACE,                     // bInterfaceNumber
305         0,                                      // bAlternateSetting
306         1,                                      // bNumEndpoints
307         0x03,                                   // bInterfaceClass (0x03 = HID)
308         0x01,                                   // bInterfaceSubClass (0x01 = Boot)
309         0x01,                                   // bInterfaceProtocol (0x01 = Keyboard)
310         0,                                      // iInterface
311         // HID interface descriptor, HID 1.11 spec, section 6.2.1
312         9,                                      // bLength
313         0x21,                                   // bDescriptorType
314         0x11, 0x01,                             // bcdHID
315         0,                                      // bCountryCode
316         1,                                      // bNumDescriptors
317         0x22,                                   // bDescriptorType
318         LSB(sizeof(keyboard_report_desc)),      // wDescriptorLength
319         MSB(sizeof(keyboard_report_desc)),
320         // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
321         7,                                      // bLength
322         5,                                      // bDescriptorType
323         KEYBOARD_ENDPOINT | 0x80,               // bEndpointAddress
324         0x03,                                   // bmAttributes (0x03=intr)
325         KEYBOARD_SIZE, 0,                       // wMaxPacketSize
326         KEYBOARD_INTERVAL,                      // bInterval
327 #endif // KEYBOARD_INTERFACE
328
329 #ifdef MOUSE_INTERFACE
330         // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
331         9,                                      // bLength
332         4,                                      // bDescriptorType
333         MOUSE_INTERFACE,                        // bInterfaceNumber
334         0,                                      // bAlternateSetting
335         1,                                      // bNumEndpoints
336         0x03,                                   // bInterfaceClass (0x03 = HID)
337         0x01,                                   // bInterfaceSubClass (0x01 = Boot)
338         0x02,                                   // bInterfaceProtocol (0x02 = Mouse)
339         0,                                      // iInterface
340         // HID interface descriptor, HID 1.11 spec, section 6.2.1
341         9,                                      // bLength
342         0x21,                                   // bDescriptorType
343         0x11, 0x01,                             // bcdHID
344         0,                                      // bCountryCode
345         1,                                      // bNumDescriptors
346         0x22,                                   // bDescriptorType
347         LSB(sizeof(mouse_report_desc)),         // wDescriptorLength
348         MSB(sizeof(mouse_report_desc)),
349         // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
350         7,                                      // bLength
351         5,                                      // bDescriptorType
352         MOUSE_ENDPOINT | 0x80,                  // bEndpointAddress
353         0x03,                                   // bmAttributes (0x03=intr)
354         MOUSE_SIZE, 0,                          // wMaxPacketSize
355         MOUSE_INTERVAL,                         // bInterval
356 #endif // MOUSE_INTERFACE
357
358 #ifdef JOYSTICK_INTERFACE
359         // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
360         9,                                      // bLength
361         4,                                      // bDescriptorType
362         JOYSTICK_INTERFACE,                     // bInterfaceNumber
363         0,                                      // bAlternateSetting
364         1,                                      // bNumEndpoints
365         0x03,                                   // bInterfaceClass (0x03 = HID)
366         0x00,                                   // bInterfaceSubClass
367         0x00,                                   // bInterfaceProtocol
368         0,                                      // iInterface
369         // HID interface descriptor, HID 1.11 spec, section 6.2.1
370         9,                                      // bLength
371         0x21,                                   // bDescriptorType
372         0x11, 0x01,                             // bcdHID
373         0,                                      // bCountryCode
374         1,                                      // bNumDescriptors
375         0x22,                                   // bDescriptorType
376         LSB(sizeof(joystick_report_desc)),      // wDescriptorLength
377         MSB(sizeof(joystick_report_desc)),
378         // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
379         7,                                      // bLength
380         5,                                      // bDescriptorType
381         JOYSTICK_ENDPOINT | 0x80,               // bEndpointAddress
382         0x03,                                   // bmAttributes (0x03=intr)
383         JOYSTICK_SIZE, 0,                       // wMaxPacketSize
384         JOYSTICK_INTERVAL,                      // bInterval
385 #endif
386 };
387
388
389
390 // **************************************************************
391 //   String Descriptors
392 // **************************************************************
393
394 // The descriptors above can provide human readable strings,
395 // referenced by index numbers.  These descriptors are the
396 // actual string data
397
398 struct usb_string_descriptor_struct {
399         uint8_t bLength;
400         uint8_t bDescriptorType;
401         uint16_t wString[];
402 };
403
404 static struct usb_string_descriptor_struct string0 = {
405         4,
406         3,
407         {0x0409}
408 };
409
410 static struct usb_string_descriptor_struct string1 = {
411         sizeof(STR_MANUFACTURER),
412         3,
413         STR_MANUFACTURER
414 };
415 static struct usb_string_descriptor_struct string2 = {
416         sizeof(STR_PRODUCT),
417         3,
418         STR_PRODUCT
419 };
420 static struct usb_string_descriptor_struct string3 = {
421         sizeof(STR_SERIAL),
422         3,
423         STR_SERIAL
424 };
425
426
427 // **************************************************************
428 //   Descriptors List
429 // **************************************************************
430
431 // This table provides access to all the descriptor data above.
432
433 const usb_descriptor_list_t usb_descriptor_list[] = {
434         //wValue, wIndex, address,          length
435         {0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)},
436         {0x0200, 0x0000, config_descriptor, sizeof(config_descriptor)},
437 #ifdef KEYBOARD_INTERFACE
438         {0x2200, KEYBOARD_INTERFACE, keyboard_report_desc, sizeof(keyboard_report_desc)},
439         {0x2100, KEYBOARD_INTERFACE, config_descriptor+KEYBOARD_DESC_OFFSET, 9},
440 #endif
441 #ifdef MOUSE_INTERFACE
442         {0x2200, MOUSE_INTERFACE, mouse_report_desc, sizeof(mouse_report_desc)},
443         {0x2100, MOUSE_INTERFACE, config_descriptor+MOUSE_DESC_OFFSET, 9},
444 #endif
445 #ifdef JOYSTICK_INTERFACE
446         {0x2200, JOYSTICK_INTERFACE, joystick_report_desc, sizeof(joystick_report_desc)},
447         {0x2100, JOYSTICK_INTERFACE, config_descriptor+JOYSTICK_DESC_OFFSET, 9},
448 #endif
449         {0x0300, 0x0000, (const uint8_t *)&string0, 4},
450         {0x0301, 0x0409, (const uint8_t *)&string1, sizeof(STR_MANUFACTURER)},
451         {0x0302, 0x0409, (const uint8_t *)&string2, sizeof(STR_PRODUCT)},
452         {0x0303, 0x0409, (const uint8_t *)&string3, sizeof(STR_SERIAL)},
453         {0, 0, NULL, 0}
454 };
455
456
457 // **************************************************************
458 //   Endpoint Configuration
459 // **************************************************************
460
461 #if 0
462 // 0x00 = not used
463 // 0x19 = Recieve only
464 // 0x15 = Transmit only
465 // 0x1D = Transmit & Recieve
466 // 
467 const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS] = 
468 {
469         0x00, 0x15, 0x19, 0x15, 0x00, 0x00, 0x00, 0x00, 
470         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
471 };
472 #endif
473
474
475 const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS] = 
476 {
477 #if (defined(ENDPOINT1_CONFIG) && NUM_ENDPOINTS >= 1)
478         ENDPOINT1_CONFIG,
479 #elif (NUM_ENDPOINTS >= 1)
480         ENDPOINT_UNUSED,
481 #endif
482 #if (defined(ENDPOINT2_CONFIG) && NUM_ENDPOINTS >= 2)
483         ENDPOINT2_CONFIG,
484 #elif (NUM_ENDPOINTS >= 2)
485         ENDPOINT_UNUSED,
486 #endif
487 #if (defined(ENDPOINT3_CONFIG) && NUM_ENDPOINTS >= 3)
488         ENDPOINT3_CONFIG,
489 #elif (NUM_ENDPOINTS >= 3)
490         ENDPOINT_UNUSED,
491 #endif
492 #if (defined(ENDPOINT4_CONFIG) && NUM_ENDPOINTS >= 4)
493         ENDPOINT4_CONFIG,
494 #elif (NUM_ENDPOINTS >= 4)
495         ENDPOINT_UNUSED,
496 #endif
497 #if (defined(ENDPOINT5_CONFIG) && NUM_ENDPOINTS >= 5)
498         ENDPOINT5_CONFIG,
499 #elif (NUM_ENDPOINTS >= 5)
500         ENDPOINT_UNUSED,
501 #endif
502 #if (defined(ENDPOINT6_CONFIG) && NUM_ENDPOINTS >= 6)
503         ENDPOINT6_CONFIG,
504 #elif (NUM_ENDPOINTS >= 6)
505         ENDPOINT_UNUSED,
506 #endif
507 #if (defined(ENDPOINT7_CONFIG) && NUM_ENDPOINTS >= 7)
508         ENDPOINT7_CONFIG,
509 #elif (NUM_ENDPOINTS >= 7)
510         ENDPOINT_UNUSED,
511 #endif
512 #if (defined(ENDPOINT8_CONFIG) && NUM_ENDPOINTS >= 8)
513         ENDPOINT8_CONFIG,
514 #elif (NUM_ENDPOINTS >= 8)
515         ENDPOINT_UNUSED,
516 #endif
517 #if (defined(ENDPOINT9_CONFIG) && NUM_ENDPOINTS >= 9)
518         ENDPOINT9_CONFIG,
519 #elif (NUM_ENDPOINTS >= 9)
520         ENDPOINT_UNUSED,
521 #endif
522 #if (defined(ENDPOINT10_CONFIG) && NUM_ENDPOINTS >= 10)
523         ENDPOINT10_CONFIG,
524 #elif (NUM_ENDPOINTS >= 10)
525         ENDPOINT_UNUSED,
526 #endif
527 #if (defined(ENDPOINT11_CONFIG) && NUM_ENDPOINTS >= 11)
528         ENDPOINT11_CONFIG,
529 #elif (NUM_ENDPOINTS >= 11)
530         ENDPOINT_UNUSED,
531 #endif
532 #if (defined(ENDPOINT12_CONFIG) && NUM_ENDPOINTS >= 12)
533         ENDPOINT12_CONFIG,
534 #elif (NUM_ENDPOINTS >= 12)
535         ENDPOINT_UNUSED,
536 #endif
537 #if (defined(ENDPOINT13_CONFIG) && NUM_ENDPOINTS >= 13)
538         ENDPOINT13_CONFIG,
539 #elif (NUM_ENDPOINTS >= 13)
540         ENDPOINT_UNUSED,
541 #endif
542 #if (defined(ENDPOINT14_CONFIG) && NUM_ENDPOINTS >= 14)
543         ENDPOINT14_CONFIG,
544 #elif (NUM_ENDPOINTS >= 14)
545         ENDPOINT_UNUSED,
546 #endif
547 #if (defined(ENDPOINT15_CONFIG) && NUM_ENDPOINTS >= 15)
548         ENDPOINT15_CONFIG,
549 #elif (NUM_ENDPOINTS >= 15)
550         ENDPOINT_UNUSED,
551 #endif
552 };
553
554
555
556