Kiibohd Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

usb_desc.c 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. /* Teensyduino Core Library
  2. * http://www.pjrc.com/teensy/
  3. * Copyright (c) 2013 PJRC.COM, LLC.
  4. * Modified by Jacob Alexander (2013-2014)
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining
  7. * a copy of this software and associated documentation files (the
  8. * "Software"), to deal in the Software without restriction, including
  9. * without limitation the rights to use, copy, modify, merge, publish,
  10. * distribute, sublicense, and/or sell copies of the Software, and to
  11. * permit persons to whom the Software is furnished to do so, subject to
  12. * the following conditions:
  13. *
  14. * 1. The above copyright notice and this permission notice shall be
  15. * included in all copies or substantial portions of the Software.
  16. *
  17. * 2. If the Software is incorporated into a build system that allows
  18. * selection among a list of target devices, then similar target
  19. * devices manufactured by PJRC.COM must be included in the list of
  20. * target devices and selectable in the same manner.
  21. *
  22. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  26. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  27. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  28. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  29. * SOFTWARE.
  30. */
  31. #include "usb_desc.h"
  32. // USB Descriptors are binary data which the USB host reads to
  33. // automatically detect a USB device's capabilities. The format
  34. // and meaning of every field is documented in numerous USB
  35. // standards. When working with USB descriptors, despite the
  36. // complexity of the standards and poor writing quality in many
  37. // of those documents, remember descriptors are nothing more
  38. // than constant binary data that tells the USB host what the
  39. // device can do. Computers will load drivers based on this data.
  40. // Those drivers then communicate on the endpoints specified by
  41. // the descriptors.
  42. // To configure a new combination of interfaces or make minor
  43. // changes to existing configuration (eg, change the name or ID
  44. // numbers), usually you would edit "usb_desc.h". This file
  45. // is meant to be configured by the header, so generally it is
  46. // only edited to add completely new USB interfaces or features.
  47. // **************************************************************
  48. // USB Device
  49. // **************************************************************
  50. #define LSB(n) ((n) & 255)
  51. #define MSB(n) (((n) >> 8) & 255)
  52. // USB Device Descriptor. The USB host reads this first, to learn
  53. // what type of device is connected.
  54. static uint8_t device_descriptor[] = {
  55. 18, // bLength
  56. 1, // bDescriptorType
  57. 0x00, 0x02, // bcdUSB
  58. #ifdef DEVICE_CLASS
  59. DEVICE_CLASS, // bDeviceClass
  60. #else
  61. 0,
  62. #endif
  63. #ifdef DEVICE_SUBCLASS
  64. DEVICE_SUBCLASS, // bDeviceSubClass
  65. #else
  66. 0,
  67. #endif
  68. #ifdef DEVICE_PROTOCOL
  69. DEVICE_PROTOCOL, // bDeviceProtocol
  70. #else
  71. 0,
  72. #endif
  73. EP0_SIZE, // bMaxPacketSize0
  74. LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
  75. LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
  76. 0x00, 0x01, // bcdDevice
  77. 1, // iManufacturer
  78. 2, // iProduct
  79. 3, // iSerialNumber
  80. 1 // bNumConfigurations
  81. };
  82. // These descriptors must NOT be "const", because the USB DMA
  83. // has trouble accessing flash memory with enough bandwidth
  84. // while the processor is executing from flash.
  85. // **************************************************************
  86. // HID Report Descriptors
  87. // **************************************************************
  88. // Each HID interface needs a special report descriptor that tells
  89. // the meaning and format of the data.
  90. #ifdef KEYBOARD_INTERFACE
  91. // Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
  92. static uint8_t keyboard_report_desc[] = {
  93. 0x05, 0x01, // Usage Page (Generic Desktop),
  94. 0x09, 0x06, // Usage (Keyboard),
  95. 0xA1, 0x01, // Collection (Application),
  96. 0x75, 0x01, // Report Size (1),
  97. 0x95, 0x08, // Report Count (8),
  98. 0x05, 0x07, // Usage Page (Key Codes),
  99. 0x19, 0xE0, // Usage Minimum (224),
  100. 0x29, 0xE7, // Usage Maximum (231),
  101. 0x15, 0x00, // Logical Minimum (0),
  102. 0x25, 0x01, // Logical Maximum (1),
  103. 0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte
  104. 0x95, 0x08, // Report Count (8),
  105. 0x75, 0x01, // Report Size (1),
  106. 0x15, 0x00, // Logical Minimum (0),
  107. 0x25, 0x01, // Logical Maximum (1),
  108. 0x05, 0x0C, // Usage Page (Consumer),
  109. 0x09, 0xE9, // Usage (Volume Increment),
  110. 0x09, 0xEA, // Usage (Volume Decrement),
  111. 0x09, 0xE2, // Usage (Mute),
  112. 0x09, 0xCD, // Usage (Play/Pause),
  113. 0x09, 0xB5, // Usage (Scan Next Track),
  114. 0x09, 0xB6, // Usage (Scan Previous Track),
  115. 0x09, 0xB7, // Usage (Stop),
  116. 0x09, 0xB8, // Usage (Eject),
  117. 0x81, 0x02, // Input (Data, Variable, Absolute), ;Media keys
  118. 0x95, 0x05, // Report Count (5),
  119. 0x75, 0x01, // Report Size (1),
  120. 0x05, 0x08, // Usage Page (LEDs),
  121. 0x19, 0x01, // Usage Minimum (1),
  122. 0x29, 0x05, // Usage Maximum (5),
  123. 0x91, 0x02, // Output (Data, Variable, Absolute), ;LED report
  124. 0x95, 0x01, // Report Count (1),
  125. 0x75, 0x03, // Report Size (3),
  126. 0x91, 0x03, // Output (Constant), ;LED report padding
  127. 0x95, 0x06, // Report Count (6),
  128. 0x75, 0x08, // Report Size (8),
  129. 0x15, 0x00, // Logical Minimum (0),
  130. 0x25, 0x7F, // Logical Maximum(104),
  131. 0x05, 0x07, // Usage Page (Key Codes),
  132. 0x19, 0x00, // Usage Minimum (0),
  133. 0x29, 0x7F, // Usage Maximum (104),
  134. 0x81, 0x00, // Input (Data, Array), ;Normal keys
  135. 0xc0 // End Collection
  136. };
  137. #endif
  138. #ifdef MOUSE_INTERFACE
  139. // Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension
  140. static uint8_t mouse_report_desc[] = {
  141. 0x05, 0x01, // Usage Page (Generic Desktop)
  142. 0x09, 0x02, // Usage (Mouse)
  143. 0xA1, 0x01, // Collection (Application)
  144. 0x05, 0x09, // Usage Page (Button)
  145. 0x19, 0x01, // Usage Minimum (Button #1)
  146. 0x29, 0x03, // Usage Maximum (Button #3)
  147. 0x15, 0x00, // Logical Minimum (0)
  148. 0x25, 0x01, // Logical Maximum (1)
  149. 0x95, 0x03, // Report Count (3)
  150. 0x75, 0x01, // Report Size (1)
  151. 0x81, 0x02, // Input (Data, Variable, Absolute)
  152. 0x95, 0x01, // Report Count (1)
  153. 0x75, 0x05, // Report Size (5)
  154. 0x81, 0x03, // Input (Constant)
  155. 0x05, 0x01, // Usage Page (Generic Desktop)
  156. 0x09, 0x30, // Usage (X)
  157. 0x09, 0x31, // Usage (Y)
  158. 0x15, 0x00, // Logical Minimum (0)
  159. 0x26, 0xFF, 0x7F, // Logical Maximum (32767)
  160. 0x75, 0x10, // Report Size (16),
  161. 0x95, 0x02, // Report Count (2),
  162. 0x81, 0x02, // Input (Data, Variable, Absolute)
  163. 0x09, 0x38, // Usage (Wheel)
  164. 0x15, 0x81, // Logical Minimum (-127)
  165. 0x25, 0x7F, // Logical Maximum (127)
  166. 0x75, 0x08, // Report Size (8),
  167. 0x95, 0x01, // Report Count (1),
  168. 0x81, 0x06, // Input (Data, Variable, Relative)
  169. 0xC0 // End Collection
  170. };
  171. #endif
  172. // **************************************************************
  173. // USB Configuration
  174. // **************************************************************
  175. // USB Configuration Descriptor. This huge descriptor tells all
  176. // of the devices capbilities.
  177. static uint8_t config_descriptor[CONFIG_DESC_SIZE] = {
  178. // configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10
  179. 9, // bLength;
  180. 2, // bDescriptorType;
  181. LSB(CONFIG_DESC_SIZE), // wTotalLength
  182. MSB(CONFIG_DESC_SIZE),
  183. NUM_INTERFACE, // bNumInterfaces
  184. 1, // bConfigurationValue
  185. 0, // iConfiguration
  186. 0xC0, // bmAttributes
  187. 50, // bMaxPower
  188. #ifdef CDC_IAD_DESCRIPTOR
  189. // interface association descriptor, USB ECN, Table 9-Z
  190. 8, // bLength
  191. 11, // bDescriptorType
  192. CDC_STATUS_INTERFACE, // bFirstInterface
  193. 2, // bInterfaceCount
  194. 0x02, // bFunctionClass
  195. 0x02, // bFunctionSubClass
  196. 0x01, // bFunctionProtocol
  197. 4, // iFunction
  198. #endif
  199. #ifdef CDC_DATA_INTERFACE
  200. // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
  201. 9, // bLength
  202. 4, // bDescriptorType
  203. CDC_STATUS_INTERFACE, // bInterfaceNumber
  204. 0, // bAlternateSetting
  205. 1, // bNumEndpoints
  206. 0x02, // bInterfaceClass
  207. 0x02, // bInterfaceSubClass
  208. 0x01, // bInterfaceProtocol
  209. 0, // iInterface
  210. // CDC Header Functional Descriptor, CDC Spec 5.2.3.1, Table 26
  211. 5, // bFunctionLength
  212. 0x24, // bDescriptorType
  213. 0x00, // bDescriptorSubtype
  214. 0x10, 0x01, // bcdCDC
  215. // Call Management Functional Descriptor, CDC Spec 5.2.3.2, Table 27
  216. 5, // bFunctionLength
  217. 0x24, // bDescriptorType
  218. 0x01, // bDescriptorSubtype
  219. 0x01, // bmCapabilities
  220. 1, // bDataInterface
  221. // Abstract Control Management Functional Descriptor, CDC Spec 5.2.3.3, Table 28
  222. 4, // bFunctionLength
  223. 0x24, // bDescriptorType
  224. 0x02, // bDescriptorSubtype
  225. 0x06, // bmCapabilities
  226. // Union Functional Descriptor, CDC Spec 5.2.3.8, Table 33
  227. 5, // bFunctionLength
  228. 0x24, // bDescriptorType
  229. 0x06, // bDescriptorSubtype
  230. CDC_STATUS_INTERFACE, // bMasterInterface
  231. CDC_DATA_INTERFACE, // bSlaveInterface0
  232. // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
  233. 7, // bLength
  234. 5, // bDescriptorType
  235. CDC_ACM_ENDPOINT | 0x80, // bEndpointAddress
  236. 0x03, // bmAttributes (0x03=intr)
  237. CDC_ACM_SIZE, 0, // wMaxPacketSize
  238. 64, // bInterval
  239. // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
  240. 9, // bLength
  241. 4, // bDescriptorType
  242. CDC_DATA_INTERFACE, // bInterfaceNumber
  243. 0, // bAlternateSetting
  244. 2, // bNumEndpoints
  245. 0x0A, // bInterfaceClass
  246. 0x00, // bInterfaceSubClass
  247. 0x00, // bInterfaceProtocol
  248. 0, // iInterface
  249. // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
  250. 7, // bLength
  251. 5, // bDescriptorType
  252. CDC_RX_ENDPOINT, // bEndpointAddress
  253. 0x02, // bmAttributes (0x02=bulk)
  254. CDC_RX_SIZE, 0, // wMaxPacketSize
  255. 0, // bInterval
  256. // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
  257. 7, // bLength
  258. 5, // bDescriptorType
  259. CDC_TX_ENDPOINT | 0x80, // bEndpointAddress
  260. 0x02, // bmAttributes (0x02=bulk)
  261. CDC_TX_SIZE, 0, // wMaxPacketSize
  262. 0, // bInterval
  263. #endif // CDC_DATA_INTERFACE
  264. #ifdef KEYBOARD_INTERFACE
  265. // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
  266. 9, // bLength
  267. 4, // bDescriptorType
  268. KEYBOARD_INTERFACE, // bInterfaceNumber
  269. 0, // bAlternateSetting
  270. 1, // bNumEndpoints
  271. 0x03, // bInterfaceClass (0x03 = HID)
  272. 0x01, // bInterfaceSubClass (0x01 = Boot)
  273. 0x01, // bInterfaceProtocol (0x01 = Keyboard)
  274. 0, // iInterface
  275. // HID interface descriptor, HID 1.11 spec, section 6.2.1
  276. 9, // bLength
  277. 0x21, // bDescriptorType
  278. 0x11, 0x01, // bcdHID
  279. 0, // bCountryCode
  280. 1, // bNumDescriptors
  281. 0x22, // bDescriptorType
  282. LSB(sizeof(keyboard_report_desc)), // wDescriptorLength
  283. MSB(sizeof(keyboard_report_desc)),
  284. // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
  285. 7, // bLength
  286. 5, // bDescriptorType
  287. KEYBOARD_ENDPOINT | 0x80, // bEndpointAddress
  288. 0x03, // bmAttributes (0x03=intr)
  289. KEYBOARD_SIZE, 0, // wMaxPacketSize
  290. KEYBOARD_INTERVAL, // bInterval
  291. #endif // KEYBOARD_INTERFACE
  292. #ifdef MOUSE_INTERFACE
  293. // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
  294. 9, // bLength
  295. 4, // bDescriptorType
  296. MOUSE_INTERFACE, // bInterfaceNumber
  297. 0, // bAlternateSetting
  298. 1, // bNumEndpoints
  299. 0x03, // bInterfaceClass (0x03 = HID)
  300. 0x00, // bInterfaceSubClass (0x01 = Boot)
  301. 0x00, // bInterfaceProtocol (0x02 = Mouse)
  302. 0, // iInterface
  303. // HID interface descriptor, HID 1.11 spec, section 6.2.1
  304. 9, // bLength
  305. 0x21, // bDescriptorType
  306. 0x11, 0x01, // bcdHID
  307. 0, // bCountryCode
  308. 1, // bNumDescriptors
  309. 0x22, // bDescriptorType
  310. LSB(sizeof(mouse_report_desc)), // wDescriptorLength
  311. MSB(sizeof(mouse_report_desc)),
  312. // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
  313. 7, // bLength
  314. 5, // bDescriptorType
  315. MOUSE_ENDPOINT | 0x80, // bEndpointAddress
  316. 0x03, // bmAttributes (0x03=intr)
  317. MOUSE_SIZE, 0, // wMaxPacketSize
  318. MOUSE_INTERVAL, // bInterval
  319. #endif // MOUSE_INTERFACE
  320. };
  321. // **************************************************************
  322. // String Descriptors
  323. // **************************************************************
  324. // The descriptors above can provide human readable strings,
  325. // referenced by index numbers. These descriptors are the
  326. // actual string data
  327. struct usb_string_descriptor_struct {
  328. uint8_t bLength;
  329. uint8_t bDescriptorType;
  330. uint16_t wString[];
  331. };
  332. extern struct usb_string_descriptor_struct usb_string_manufacturer_name
  333. __attribute__ ((weak, alias("usb_string_manufacturer_name_default")));
  334. extern struct usb_string_descriptor_struct usb_string_product_name
  335. __attribute__ ((weak, alias("usb_string_product_name_default")));
  336. extern struct usb_string_descriptor_struct usb_string_serial_number
  337. __attribute__ ((weak, alias("usb_string_serial_number_default")));
  338. struct usb_string_descriptor_struct string0 = {
  339. 4,
  340. 3,
  341. {0x0409}
  342. };
  343. struct usb_string_descriptor_struct usb_string_manufacturer_name_default = {
  344. sizeof(STR_MANUFACTURER),
  345. 3,
  346. STR_MANUFACTURER
  347. };
  348. struct usb_string_descriptor_struct usb_string_product_name_default = {
  349. sizeof(STR_PRODUCT),
  350. 3,
  351. STR_PRODUCT
  352. };
  353. struct usb_string_descriptor_struct usb_string_serial_number_default = {
  354. sizeof(STR_SERIAL),
  355. 3,
  356. STR_SERIAL
  357. };
  358. // **************************************************************
  359. // Descriptors List
  360. // **************************************************************
  361. // This table provides access to all the descriptor data above.
  362. const usb_descriptor_list_t usb_descriptor_list[] = {
  363. //wValue, wIndex, address, length
  364. {0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)},
  365. {0x0200, 0x0000, config_descriptor, sizeof(config_descriptor)},
  366. #ifdef KEYBOARD_INTERFACE
  367. {0x2200, KEYBOARD_INTERFACE, keyboard_report_desc, sizeof(keyboard_report_desc)},
  368. {0x2100, KEYBOARD_INTERFACE, config_descriptor+KEYBOARD_DESC_OFFSET, 9},
  369. #endif
  370. #ifdef MOUSE_INTERFACE
  371. {0x2200, MOUSE_INTERFACE, mouse_report_desc, sizeof(mouse_report_desc)},
  372. {0x2100, MOUSE_INTERFACE, config_descriptor+MOUSE_DESC_OFFSET, 9},
  373. #endif
  374. {0x0300, 0x0000, (const uint8_t *)&string0, 0},
  375. {0x0301, 0x0409, (const uint8_t *)&usb_string_manufacturer_name, 0},
  376. {0x0302, 0x0409, (const uint8_t *)&usb_string_product_name, 0},
  377. {0x0303, 0x0409, (const uint8_t *)&usb_string_serial_number, 0},
  378. {0, 0, NULL, 0}
  379. };
  380. // **************************************************************
  381. // Endpoint Configuration
  382. // **************************************************************
  383. #if 0
  384. // 0x00 = not used
  385. // 0x19 = Recieve only
  386. // 0x15 = Transmit only
  387. // 0x1D = Transmit & Recieve
  388. //
  389. const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS] =
  390. {
  391. 0x00, 0x15, 0x19, 0x15, 0x00, 0x00, 0x00, 0x00,
  392. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  393. };
  394. #endif
  395. const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS] =
  396. {
  397. #if (defined(ENDPOINT1_CONFIG) && NUM_ENDPOINTS >= 1)
  398. ENDPOINT1_CONFIG,
  399. #elif (NUM_ENDPOINTS >= 1)
  400. ENDPOINT_UNUSED,
  401. #endif
  402. #if (defined(ENDPOINT2_CONFIG) && NUM_ENDPOINTS >= 2)
  403. ENDPOINT2_CONFIG,
  404. #elif (NUM_ENDPOINTS >= 2)
  405. ENDPOINT_UNUSED,
  406. #endif
  407. #if (defined(ENDPOINT3_CONFIG) && NUM_ENDPOINTS >= 3)
  408. ENDPOINT3_CONFIG,
  409. #elif (NUM_ENDPOINTS >= 3)
  410. ENDPOINT_UNUSED,
  411. #endif
  412. #if (defined(ENDPOINT4_CONFIG) && NUM_ENDPOINTS >= 4)
  413. ENDPOINT4_CONFIG,
  414. #elif (NUM_ENDPOINTS >= 4)
  415. ENDPOINT_UNUSED,
  416. #endif
  417. #if (defined(ENDPOINT5_CONFIG) && NUM_ENDPOINTS >= 5)
  418. ENDPOINT5_CONFIG,
  419. #elif (NUM_ENDPOINTS >= 5)
  420. ENDPOINT_UNUSED,
  421. #endif
  422. #if (defined(ENDPOINT6_CONFIG) && NUM_ENDPOINTS >= 6)
  423. ENDPOINT6_CONFIG,
  424. #elif (NUM_ENDPOINTS >= 6)
  425. ENDPOINT_UNUSED,
  426. #endif
  427. #if (defined(ENDPOINT7_CONFIG) && NUM_ENDPOINTS >= 7)
  428. ENDPOINT7_CONFIG,
  429. #elif (NUM_ENDPOINTS >= 7)
  430. ENDPOINT_UNUSED,
  431. #endif
  432. #if (defined(ENDPOINT8_CONFIG) && NUM_ENDPOINTS >= 8)
  433. ENDPOINT8_CONFIG,
  434. #elif (NUM_ENDPOINTS >= 8)
  435. ENDPOINT_UNUSED,
  436. #endif
  437. #if (defined(ENDPOINT9_CONFIG) && NUM_ENDPOINTS >= 9)
  438. ENDPOINT9_CONFIG,
  439. #elif (NUM_ENDPOINTS >= 9)
  440. ENDPOINT_UNUSED,
  441. #endif
  442. #if (defined(ENDPOINT10_CONFIG) && NUM_ENDPOINTS >= 10)
  443. ENDPOINT10_CONFIG,
  444. #elif (NUM_ENDPOINTS >= 10)
  445. ENDPOINT_UNUSED,
  446. #endif
  447. #if (defined(ENDPOINT11_CONFIG) && NUM_ENDPOINTS >= 11)
  448. ENDPOINT11_CONFIG,
  449. #elif (NUM_ENDPOINTS >= 11)
  450. ENDPOINT_UNUSED,
  451. #endif
  452. #if (defined(ENDPOINT12_CONFIG) && NUM_ENDPOINTS >= 12)
  453. ENDPOINT12_CONFIG,
  454. #elif (NUM_ENDPOINTS >= 12)
  455. ENDPOINT_UNUSED,
  456. #endif
  457. #if (defined(ENDPOINT13_CONFIG) && NUM_ENDPOINTS >= 13)
  458. ENDPOINT13_CONFIG,
  459. #elif (NUM_ENDPOINTS >= 13)
  460. ENDPOINT_UNUSED,
  461. #endif
  462. #if (defined(ENDPOINT14_CONFIG) && NUM_ENDPOINTS >= 14)
  463. ENDPOINT14_CONFIG,
  464. #elif (NUM_ENDPOINTS >= 14)
  465. ENDPOINT_UNUSED,
  466. #endif
  467. #if (defined(ENDPOINT15_CONFIG) && NUM_ENDPOINTS >= 15)
  468. ENDPOINT15_CONFIG,
  469. #elif (NUM_ENDPOINTS >= 15)
  470. ENDPOINT_UNUSED,
  471. #endif
  472. };