Teensy 4.1 core updated for C++20
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.

922 lines
35KB

  1. /* Teensyduino Core Library
  2. * http://www.pjrc.com/teensy/
  3. * Copyright (c) 2017 PJRC.COM, LLC.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining
  6. * a copy of this software and associated documentation files (the
  7. * "Software"), to deal in the Software without restriction, including
  8. * without limitation the rights to use, copy, modify, merge, publish,
  9. * distribute, sublicense, and/or sell copies of the Software, and to
  10. * permit persons to whom the Software is furnished to do so, subject to
  11. * the following conditions:
  12. *
  13. * 1. The above copyright notice and this permission notice shall be
  14. * included in all copies or substantial portions of the Software.
  15. *
  16. * 2. If the Software is incorporated into a build system that allows
  17. * selection among a list of target devices, then similar target
  18. * devices manufactured by PJRC.COM must be included in the list of
  19. * target devices and selectable in the same manner.
  20. *
  21. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  25. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  26. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  27. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  28. * SOFTWARE.
  29. */
  30. #ifndef _usb_desc_h_
  31. #define _usb_desc_h_
  32. // This header is NOT meant to be included when compiling
  33. // user sketches in Arduino. The low-level functions
  34. // provided by usb_dev.c are meant to be called only by
  35. // code which provides higher-level interfaces to the user.
  36. #include <stdint.h>
  37. #include <stddef.h>
  38. #define ENDPOINT_UNUSED 0x00
  39. #define ENDPOINT_TRANSMIT_ONLY 0x15
  40. #define ENDPOINT_RECEIVE_ONLY 0x19
  41. #define ENDPOINT_TRANSMIT_AND_RECEIVE 0x1D
  42. #define ENDPOINT_RECEIVE_ISOCHRONOUS 0x18
  43. #define ENDPOINT_TRANSMIT_ISOCHRONOUS 0x14
  44. /*
  45. Each group of #define lines below corresponds to one of the
  46. settings in the Tools > USB Type menu. This file defines what
  47. type of USB device is actually created for each of those menu
  48. options.
  49. Each "interface" is a set of functionality your PC or Mac will
  50. use and treat as if it is a unique device. Within each interface,
  51. the "endpoints" are the actual communication channels. Most
  52. interfaces use 1, 2 or 3 endpoints. By editing only this file,
  53. you can customize the USB Types to be any collection of interfaces.
  54. To modify a USB Type, delete the XYZ_INTERFACE lines for any
  55. interfaces you wish to remove, and copy them from another USB Type
  56. for any you want to add.
  57. Give each interface a unique number, and edit NUM_INTERFACE to
  58. reflect the total number of interfaces.
  59. Next, assign unique endpoint numbers to all the endpoints across
  60. all the interfaces your device has. You can reuse an endpoint
  61. number for transmit and receive, but the same endpoint number must
  62. not be used twice to transmit, or twice to receive.
  63. Most endpoints also require their maximum size, and some also
  64. need an interval specification (the number of milliseconds the
  65. PC will check for data from that endpoint). For existing
  66. interfaces, usually these other settings should not be changed.
  67. Edit NUM_ENDPOINTS to be at least the largest endpoint number used.
  68. Edit NUM_USB_BUFFERS to control how much memory the USB stack will
  69. allocate. At least 2 should be used for each endpoint. More
  70. memory will allow higher throughput for user programs that have
  71. high latency (eg, spending time doing things other than interacting
  72. with the USB).
  73. Edit the ENDPOINT*_CONFIG lines so each endpoint is configured
  74. the proper way (transmit, receive, or both).
  75. If you are using existing interfaces (making your own device with
  76. a different set of interfaces) the code in all other files should
  77. automatically adapt to the new endpoints you specify here.
  78. If you need to create a new type of interface, you'll need to write
  79. the code which sends and receives packets, and presents an API to
  80. the user. Usually, a pair of files are added for the actual code,
  81. and code is also added in usb_dev.c for any control transfers,
  82. interrupt-level code, or other very low-level stuff not possible
  83. from the packet send/receive functons. Code also is added in
  84. usb_inst.c to create an instance of your C++ object. This message
  85. gives a quick summary of things you will need to know:
  86. https://forum.pjrc.com/threads/49045?p=164512&viewfull=1#post164512
  87. You may edit the Vendor and Product ID numbers, and strings. If
  88. the numbers are changed, Teensyduino may not be able to automatically
  89. find and reboot your board when you click the Upload button in
  90. the Arduino IDE. You will need to press the Program button on
  91. Teensy to initiate programming.
  92. Some operating systems, especially Windows, may cache USB device
  93. info. Changes to the device name may not update on the same
  94. computer unless the vendor or product ID numbers change, or the
  95. "bcdDevice" revision code is increased.
  96. If these instructions are missing steps or could be improved, please
  97. let me know? http://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports
  98. */
  99. #if defined(USB_SERIAL)
  100. #define VENDOR_ID 0x16C0
  101. #define PRODUCT_ID 0x0483
  102. #define DEVICE_CLASS 2 // 2 = Communication Class
  103. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  104. #define MANUFACTURER_NAME_LEN 11
  105. #define PRODUCT_NAME {'U','S','B',' ','S','e','r','i','a','l'}
  106. #define PRODUCT_NAME_LEN 10
  107. #define EP0_SIZE 64
  108. #define NUM_ENDPOINTS 4
  109. #define NUM_USB_BUFFERS 12
  110. #define NUM_INTERFACE 2
  111. #define CDC_STATUS_INTERFACE 0
  112. #define CDC_DATA_INTERFACE 1
  113. #define CDC_ACM_ENDPOINT 2
  114. #define CDC_RX_ENDPOINT 3
  115. #define CDC_TX_ENDPOINT 4
  116. #define CDC_ACM_SIZE 16
  117. #define CDC_RX_SIZE 64
  118. #define CDC_TX_SIZE 64
  119. #define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_ONLY
  120. #define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
  121. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  122. #elif defined(USB_DUAL_SERIAL)
  123. #define VENDOR_ID 0x16C0
  124. #define PRODUCT_ID 0x0483
  125. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  126. #define MANUFACTURER_NAME_LEN 11
  127. #define PRODUCT_NAME {'D','u','a','l',' ','S','e','r','i','a','l'}
  128. #define PRODUCT_NAME_LEN 11
  129. #define EP0_SIZE 64
  130. #define NUM_ENDPOINTS 7
  131. #define NUM_USB_BUFFERS 22
  132. #define NUM_INTERFACE 4
  133. #define CDC_IAD_DESCRIPTOR 1 // Serial
  134. #define CDC_STATUS_INTERFACE 0
  135. #define CDC_DATA_INTERFACE 1
  136. #define CDC_ACM_ENDPOINT 2
  137. #define CDC_RX_ENDPOINT 3
  138. #define CDC_TX_ENDPOINT 4
  139. #define CDC_ACM_SIZE 16
  140. #define CDC_RX_SIZE 64
  141. #define CDC_TX_SIZE 64
  142. #define CDC2_STATUS_INTERFACE 2 // SerialA
  143. #define CDC2_DATA_INTERFACE 3
  144. #define CDC2_ACM_ENDPOINT 5
  145. #define CDC2_RX_ENDPOINT 6
  146. #define CDC2_TX_ENDPOINT 7
  147. #define CDC2_ACM_SIZE 16
  148. #define CDC2_RX_SIZE 64
  149. #define CDC2_TX_SIZE 64
  150. #define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_ONLY
  151. #define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
  152. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  153. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  154. #define ENDPOINT6_CONFIG ENDPOINT_RECEIVE_ONLY
  155. #define ENDPOINT7_CONFIG ENDPOINT_TRANSMIT_ONLY
  156. #elif defined(USB_KEYBOARDONLY)
  157. #define VENDOR_ID 0x16C0
  158. #define PRODUCT_ID 0x04D0
  159. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  160. #define MANUFACTURER_NAME_LEN 11
  161. #define PRODUCT_NAME {'K','e','y','b','o','a','r','d'}
  162. #define PRODUCT_NAME_LEN 8
  163. #define EP0_SIZE 64
  164. #define NUM_ENDPOINTS 4
  165. #define NUM_USB_BUFFERS 14
  166. #define NUM_INTERFACE 3
  167. #define SEREMU_INTERFACE 1 // Serial emulation
  168. #define SEREMU_TX_ENDPOINT 1
  169. #define SEREMU_TX_SIZE 64
  170. #define SEREMU_TX_INTERVAL 1
  171. #define SEREMU_RX_ENDPOINT 2
  172. #define SEREMU_RX_SIZE 32
  173. #define SEREMU_RX_INTERVAL 2
  174. #define KEYBOARD_INTERFACE 0 // Keyboard
  175. #define KEYBOARD_ENDPOINT 3
  176. #define KEYBOARD_SIZE 8
  177. #define KEYBOARD_INTERVAL 1
  178. #define KEYMEDIA_INTERFACE 2 // Keyboard Media Keys
  179. #define KEYMEDIA_ENDPOINT 4
  180. #define KEYMEDIA_SIZE 8
  181. #define KEYMEDIA_INTERVAL 4
  182. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  183. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  184. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  185. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  186. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  187. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ONLY
  188. #elif defined(USB_HID)
  189. #define VENDOR_ID 0x16C0
  190. #define PRODUCT_ID 0x0482
  191. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  192. #define MANUFACTURER_NAME_LEN 11
  193. #define PRODUCT_NAME {'K','e','y','b','o','a','r','d','/','M','o','u','s','e','/','J','o','y','s','t','i','c','k'}
  194. #define PRODUCT_NAME_LEN 23
  195. #define EP0_SIZE 64
  196. #define NUM_ENDPOINTS 6
  197. #define NUM_USB_BUFFERS 24
  198. #define NUM_INTERFACE 5
  199. #define SEREMU_INTERFACE 2 // Serial emulation
  200. #define SEREMU_TX_ENDPOINT 1
  201. #define SEREMU_TX_SIZE 64
  202. #define SEREMU_TX_INTERVAL 1
  203. #define SEREMU_RX_ENDPOINT 2
  204. #define SEREMU_RX_SIZE 32
  205. #define SEREMU_RX_INTERVAL 2
  206. #define KEYBOARD_INTERFACE 0 // Keyboard
  207. #define KEYBOARD_ENDPOINT 3
  208. #define KEYBOARD_SIZE 8
  209. #define KEYBOARD_INTERVAL 1
  210. #define KEYMEDIA_INTERFACE 4 // Keyboard Media Keys
  211. #define KEYMEDIA_ENDPOINT 6
  212. #define KEYMEDIA_SIZE 8
  213. #define KEYMEDIA_INTERVAL 4
  214. #define MOUSE_INTERFACE 1 // Mouse
  215. #define MOUSE_ENDPOINT 5
  216. #define MOUSE_SIZE 8
  217. #define MOUSE_INTERVAL 1
  218. #define JOYSTICK_INTERFACE 3 // Joystick
  219. #define JOYSTICK_ENDPOINT 4
  220. #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
  221. #define JOYSTICK_INTERVAL 2
  222. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  223. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  224. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  225. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  226. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  227. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ONLY
  228. #elif defined(USB_SERIAL_HID)
  229. #define VENDOR_ID 0x16C0
  230. #define PRODUCT_ID 0x0487
  231. #define DEVICE_CLASS 0xEF
  232. #define DEVICE_SUBCLASS 0x02
  233. #define DEVICE_PROTOCOL 0x01
  234. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  235. #define MANUFACTURER_NAME_LEN 11
  236. #define PRODUCT_NAME {'S','e','r','i','a','l','/','K','e','y','b','o','a','r','d','/','M','o','u','s','e','/','J','o','y','s','t','i','c','k'}
  237. #define PRODUCT_NAME_LEN 30
  238. #define EP0_SIZE 64
  239. #define NUM_ENDPOINTS 7
  240. #define NUM_USB_BUFFERS 30
  241. #define NUM_INTERFACE 6
  242. #define CDC_IAD_DESCRIPTOR 1
  243. #define CDC_STATUS_INTERFACE 0
  244. #define CDC_DATA_INTERFACE 1 // Serial
  245. #define CDC_ACM_ENDPOINT 2
  246. #define CDC_RX_ENDPOINT 3
  247. #define CDC_TX_ENDPOINT 4
  248. #define CDC_ACM_SIZE 16
  249. #define CDC_RX_SIZE 64
  250. #define CDC_TX_SIZE 64
  251. #define KEYBOARD_INTERFACE 2 // Keyboard
  252. #define KEYBOARD_ENDPOINT 1
  253. #define KEYBOARD_SIZE 8
  254. #define KEYBOARD_INTERVAL 1
  255. #define KEYMEDIA_INTERFACE 5 // Keyboard Media Keys
  256. #define KEYMEDIA_ENDPOINT 7
  257. #define KEYMEDIA_SIZE 8
  258. #define KEYMEDIA_INTERVAL 4
  259. #define MOUSE_INTERFACE 3 // Mouse
  260. #define MOUSE_ENDPOINT 5
  261. #define MOUSE_SIZE 8
  262. #define MOUSE_INTERVAL 2
  263. #define JOYSTICK_INTERFACE 4 // Joystick
  264. #define JOYSTICK_ENDPOINT 6
  265. #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
  266. #define JOYSTICK_INTERVAL 1
  267. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  268. #define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_ONLY
  269. #define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
  270. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  271. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  272. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ONLY
  273. #define ENDPOINT7_CONFIG ENDPOINT_TRANSMIT_ONLY
  274. #elif defined(USB_TOUCHSCREEN)
  275. #define VENDOR_ID 0x16C0
  276. #define PRODUCT_ID 0x04D3
  277. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  278. #define MANUFACTURER_NAME_LEN 11
  279. #define PRODUCT_NAME {'K','e','y','b','o','a','r','d','/','T','o','u','c','h','s','c','r','e','e','n'}
  280. #define PRODUCT_NAME_LEN 20
  281. #define EP0_SIZE 64
  282. #define NUM_ENDPOINTS 5
  283. #define NUM_USB_BUFFERS 15
  284. #define NUM_INTERFACE 4
  285. #define SEREMU_INTERFACE 1 // Serial emulation
  286. #define SEREMU_TX_ENDPOINT 1
  287. #define SEREMU_TX_SIZE 64
  288. #define SEREMU_TX_INTERVAL 1
  289. #define SEREMU_RX_ENDPOINT 2
  290. #define SEREMU_RX_SIZE 32
  291. #define SEREMU_RX_INTERVAL 2
  292. #define KEYBOARD_INTERFACE 0 // Keyboard
  293. #define KEYBOARD_ENDPOINT 3
  294. #define KEYBOARD_SIZE 8
  295. #define KEYBOARD_INTERVAL 1
  296. #define KEYMEDIA_INTERFACE 2 // Keyboard Media Keys
  297. #define KEYMEDIA_ENDPOINT 4
  298. #define KEYMEDIA_SIZE 8
  299. #define KEYMEDIA_INTERVAL 4
  300. #define MULTITOUCH_INTERFACE 3 // Touchscreen
  301. #define MULTITOUCH_ENDPOINT 5
  302. #define MULTITOUCH_SIZE 8
  303. #define MULTITOUCH_FINGERS 10
  304. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  305. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  306. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  307. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  308. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  309. #elif defined(USB_HID_TOUCHSCREEN)
  310. #define VENDOR_ID 0x16C0
  311. #define PRODUCT_ID 0x04D4
  312. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  313. #define MANUFACTURER_NAME_LEN 11
  314. #define PRODUCT_NAME {'K','e','y','b','o','a','r','d','/','M','o','u','s','e','/','T','o','u','c','h','s','c','r','e','e','n'}
  315. #define PRODUCT_NAME_LEN 26
  316. #define EP0_SIZE 64
  317. #define NUM_ENDPOINTS 6
  318. #define NUM_USB_BUFFERS 20
  319. #define NUM_INTERFACE 5
  320. #define SEREMU_INTERFACE 2 // Serial emulation
  321. #define SEREMU_TX_ENDPOINT 1
  322. #define SEREMU_TX_SIZE 64
  323. #define SEREMU_TX_INTERVAL 1
  324. #define SEREMU_RX_ENDPOINT 2
  325. #define SEREMU_RX_SIZE 32
  326. #define SEREMU_RX_INTERVAL 2
  327. #define KEYBOARD_INTERFACE 0 // Keyboard
  328. #define KEYBOARD_ENDPOINT 3
  329. #define KEYBOARD_SIZE 8
  330. #define KEYBOARD_INTERVAL 1
  331. #define KEYMEDIA_INTERFACE 3 // Keyboard Media Keys
  332. #define KEYMEDIA_ENDPOINT 4
  333. #define KEYMEDIA_SIZE 8
  334. #define KEYMEDIA_INTERVAL 4
  335. #define MOUSE_INTERFACE 1 // Mouse
  336. #define MOUSE_ENDPOINT 6
  337. #define MOUSE_SIZE 8
  338. #define MOUSE_INTERVAL 2
  339. #define MULTITOUCH_INTERFACE 4 // Touchscreen
  340. #define MULTITOUCH_ENDPOINT 5
  341. #define MULTITOUCH_SIZE 8
  342. #define MULTITOUCH_FINGERS 10
  343. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  344. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  345. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  346. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  347. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  348. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ONLY
  349. #elif defined(USB_MIDI)
  350. #define VENDOR_ID 0x16C0
  351. #define PRODUCT_ID 0x0485
  352. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  353. #define MANUFACTURER_NAME_LEN 11
  354. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I'}
  355. #define PRODUCT_NAME_LEN 11
  356. #define EP0_SIZE 64
  357. #define NUM_ENDPOINTS 4
  358. #define NUM_USB_BUFFERS 16
  359. #define NUM_INTERFACE 2
  360. #define SEREMU_INTERFACE 1 // Serial emulation
  361. #define SEREMU_TX_ENDPOINT 1
  362. #define SEREMU_TX_SIZE 64
  363. #define SEREMU_TX_INTERVAL 1
  364. #define SEREMU_RX_ENDPOINT 2
  365. #define SEREMU_RX_SIZE 32
  366. #define SEREMU_RX_INTERVAL 2
  367. #define MIDI_INTERFACE 0 // MIDI
  368. #define MIDI_NUM_CABLES 1
  369. #define MIDI_TX_ENDPOINT 3
  370. #define MIDI_TX_SIZE 64
  371. #define MIDI_RX_ENDPOINT 4
  372. #define MIDI_RX_SIZE 64
  373. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  374. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  375. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  376. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  377. #elif defined(USB_MIDI4)
  378. #define VENDOR_ID 0x16C0
  379. #define PRODUCT_ID 0x0485
  380. #define BCD_DEVICE 0x0211
  381. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  382. #define MANUFACTURER_NAME_LEN 11
  383. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','4'}
  384. #define PRODUCT_NAME_LEN 13
  385. #define EP0_SIZE 64
  386. #define NUM_ENDPOINTS 4
  387. #define NUM_USB_BUFFERS 16
  388. #define NUM_INTERFACE 2
  389. #define SEREMU_INTERFACE 1 // Serial emulation
  390. #define SEREMU_TX_ENDPOINT 1
  391. #define SEREMU_TX_SIZE 64
  392. #define SEREMU_TX_INTERVAL 1
  393. #define SEREMU_RX_ENDPOINT 2
  394. #define SEREMU_RX_SIZE 32
  395. #define SEREMU_RX_INTERVAL 2
  396. #define MIDI_INTERFACE 0 // MIDI
  397. #define MIDI_NUM_CABLES 4
  398. #define MIDI_TX_ENDPOINT 3
  399. #define MIDI_TX_SIZE 64
  400. #define MIDI_RX_ENDPOINT 4
  401. #define MIDI_RX_SIZE 64
  402. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  403. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  404. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  405. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  406. #elif defined(USB_MIDI16)
  407. #define VENDOR_ID 0x16C0
  408. #define PRODUCT_ID 0x0485
  409. #define BCD_DEVICE 0x0212
  410. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  411. #define MANUFACTURER_NAME_LEN 11
  412. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','1','6'}
  413. #define PRODUCT_NAME_LEN 14
  414. #define EP0_SIZE 64
  415. #define NUM_ENDPOINTS 4
  416. #define NUM_USB_BUFFERS 16
  417. #define NUM_INTERFACE 2
  418. #define SEREMU_INTERFACE 1 // Serial emulation
  419. #define SEREMU_TX_ENDPOINT 1
  420. #define SEREMU_TX_SIZE 64
  421. #define SEREMU_TX_INTERVAL 1
  422. #define SEREMU_RX_ENDPOINT 2
  423. #define SEREMU_RX_SIZE 32
  424. #define SEREMU_RX_INTERVAL 2
  425. #define MIDI_INTERFACE 0 // MIDI
  426. #define MIDI_NUM_CABLES 16
  427. #define MIDI_TX_ENDPOINT 3
  428. #define MIDI_TX_SIZE 64
  429. #define MIDI_RX_ENDPOINT 4
  430. #define MIDI_RX_SIZE 64
  431. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  432. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  433. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  434. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  435. #elif defined(USB_MIDI_SERIAL)
  436. #define VENDOR_ID 0x16C0
  437. #define PRODUCT_ID 0x0489
  438. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  439. #define MANUFACTURER_NAME_LEN 11
  440. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I'}
  441. #define PRODUCT_NAME_LEN 11
  442. #define EP0_SIZE 64
  443. #define NUM_ENDPOINTS 5
  444. #define NUM_USB_BUFFERS 30
  445. #define NUM_INTERFACE 3
  446. #define CDC_IAD_DESCRIPTOR 1
  447. #define CDC_STATUS_INTERFACE 0
  448. #define CDC_DATA_INTERFACE 1 // Serial
  449. #define CDC_ACM_ENDPOINT 1
  450. #define CDC_RX_ENDPOINT 2
  451. #define CDC_TX_ENDPOINT 3
  452. #define CDC_ACM_SIZE 16
  453. #define CDC_RX_SIZE 64
  454. #define CDC_TX_SIZE 64
  455. #define MIDI_INTERFACE 2 // MIDI
  456. #define MIDI_NUM_CABLES 1
  457. #define MIDI_TX_ENDPOINT 4
  458. #define MIDI_TX_SIZE 64
  459. #define MIDI_RX_ENDPOINT 5
  460. #define MIDI_RX_SIZE 64
  461. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  462. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  463. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  464. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  465. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  466. #elif defined(USB_MIDI4_SERIAL)
  467. #define VENDOR_ID 0x16C0
  468. #define PRODUCT_ID 0x0489
  469. #define BCD_DEVICE 0x0211
  470. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  471. #define MANUFACTURER_NAME_LEN 11
  472. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','4'}
  473. #define PRODUCT_NAME_LEN 13
  474. #define EP0_SIZE 64
  475. #define NUM_ENDPOINTS 5
  476. #define NUM_USB_BUFFERS 30
  477. #define NUM_INTERFACE 3
  478. #define CDC_IAD_DESCRIPTOR 1
  479. #define CDC_STATUS_INTERFACE 0
  480. #define CDC_DATA_INTERFACE 1 // Serial
  481. #define CDC_ACM_ENDPOINT 1
  482. #define CDC_RX_ENDPOINT 2
  483. #define CDC_TX_ENDPOINT 3
  484. #define CDC_ACM_SIZE 16
  485. #define CDC_RX_SIZE 64
  486. #define CDC_TX_SIZE 64
  487. #define MIDI_INTERFACE 2 // MIDI
  488. #define MIDI_NUM_CABLES 4
  489. #define MIDI_TX_ENDPOINT 4
  490. #define MIDI_TX_SIZE 64
  491. #define MIDI_RX_ENDPOINT 5
  492. #define MIDI_RX_SIZE 64
  493. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  494. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  495. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  496. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  497. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  498. #elif defined(USB_MIDI16_SERIAL)
  499. #define VENDOR_ID 0x16C0
  500. #define PRODUCT_ID 0x0489
  501. #define BCD_DEVICE 0x0212
  502. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  503. #define MANUFACTURER_NAME_LEN 11
  504. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','1','6'}
  505. #define PRODUCT_NAME_LEN 14
  506. #define EP0_SIZE 64
  507. #define NUM_ENDPOINTS 5
  508. #define NUM_USB_BUFFERS 30
  509. #define NUM_INTERFACE 3
  510. #define CDC_IAD_DESCRIPTOR 1
  511. #define CDC_STATUS_INTERFACE 0
  512. #define CDC_DATA_INTERFACE 1 // Serial
  513. #define CDC_ACM_ENDPOINT 1
  514. #define CDC_RX_ENDPOINT 2
  515. #define CDC_TX_ENDPOINT 3
  516. #define CDC_ACM_SIZE 16
  517. #define CDC_RX_SIZE 64
  518. #define CDC_TX_SIZE 64
  519. #define MIDI_INTERFACE 2 // MIDI
  520. #define MIDI_NUM_CABLES 16
  521. #define MIDI_TX_ENDPOINT 4
  522. #define MIDI_TX_SIZE 64
  523. #define MIDI_RX_ENDPOINT 5
  524. #define MIDI_RX_SIZE 64
  525. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  526. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  527. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  528. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  529. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  530. #elif defined(USB_RAWHID)
  531. #define VENDOR_ID 0x16C0
  532. #define PRODUCT_ID 0x0486
  533. #define RAWHID_USAGE_PAGE 0xFFAB // recommended: 0xFF00 to 0xFFFF
  534. #define RAWHID_USAGE 0x0200 // recommended: 0x0100 to 0xFFFF
  535. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  536. #define MANUFACTURER_NAME_LEN 11
  537. #define PRODUCT_NAME {'T','e','e','n','s','y','d','u','i','n','o',' ','R','a','w','H','I','D'}
  538. #define PRODUCT_NAME_LEN 18
  539. #define EP0_SIZE 64
  540. #define NUM_ENDPOINTS 4
  541. #define NUM_USB_BUFFERS 12
  542. #define NUM_INTERFACE 2
  543. #define RAWHID_INTERFACE 0 // RawHID
  544. #define RAWHID_TX_ENDPOINT 3
  545. #define RAWHID_TX_SIZE 64
  546. #define RAWHID_TX_INTERVAL 1
  547. #define RAWHID_RX_ENDPOINT 4
  548. #define RAWHID_RX_SIZE 64
  549. #define RAWHID_RX_INTERVAL 1
  550. #define SEREMU_INTERFACE 1 // Serial emulation
  551. #define SEREMU_TX_ENDPOINT 1
  552. #define SEREMU_TX_SIZE 64
  553. #define SEREMU_TX_INTERVAL 1
  554. #define SEREMU_RX_ENDPOINT 2
  555. #define SEREMU_RX_SIZE 32
  556. #define SEREMU_RX_INTERVAL 2
  557. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  558. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  559. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  560. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  561. #elif defined(USB_FLIGHTSIM)
  562. #define VENDOR_ID 0x16C0
  563. #define PRODUCT_ID 0x0488
  564. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  565. #define MANUFACTURER_NAME_LEN 11
  566. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','F','l','i','g','h','t',' ','S','i','m',' ','C','o','n','t','r','o','l','s'}
  567. #define PRODUCT_NAME_LEN 26
  568. #define EP0_SIZE 64
  569. #define NUM_ENDPOINTS 4
  570. #define NUM_USB_BUFFERS 20
  571. #define NUM_INTERFACE 2
  572. #define FLIGHTSIM_INTERFACE 0 // Flight Sim Control
  573. #define FLIGHTSIM_TX_ENDPOINT 3
  574. #define FLIGHTSIM_TX_SIZE 64
  575. #define FLIGHTSIM_TX_INTERVAL 1
  576. #define FLIGHTSIM_RX_ENDPOINT 4
  577. #define FLIGHTSIM_RX_SIZE 64
  578. #define FLIGHTSIM_RX_INTERVAL 1
  579. #define SEREMU_INTERFACE 1 // Serial emulation
  580. #define SEREMU_TX_ENDPOINT 1
  581. #define SEREMU_TX_SIZE 64
  582. #define SEREMU_TX_INTERVAL 1
  583. #define SEREMU_RX_ENDPOINT 2
  584. #define SEREMU_RX_SIZE 32
  585. #define SEREMU_RX_INTERVAL 2
  586. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  587. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  588. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  589. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  590. #elif defined(USB_FLIGHTSIM_JOYSTICK)
  591. #define VENDOR_ID 0x16C0
  592. #define PRODUCT_ID 0x0488
  593. #define BCD_DEVICE 0x0211
  594. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  595. #define MANUFACTURER_NAME_LEN 11
  596. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','F','l','i','g','h','t',' ','S','i','m',' ','C','o','n','t','r','o','l','s'}
  597. #define PRODUCT_NAME_LEN 26
  598. #define EP0_SIZE 64
  599. #define NUM_ENDPOINTS 5
  600. #define NUM_USB_BUFFERS 20
  601. #define NUM_INTERFACE 3
  602. #define FLIGHTSIM_INTERFACE 0 // Flight Sim Control
  603. #define FLIGHTSIM_TX_ENDPOINT 3
  604. #define FLIGHTSIM_TX_SIZE 64
  605. #define FLIGHTSIM_TX_INTERVAL 1
  606. #define FLIGHTSIM_RX_ENDPOINT 4
  607. #define FLIGHTSIM_RX_SIZE 64
  608. #define FLIGHTSIM_RX_INTERVAL 1
  609. #define SEREMU_INTERFACE 1 // Serial emulation
  610. #define SEREMU_TX_ENDPOINT 1
  611. #define SEREMU_TX_SIZE 64
  612. #define SEREMU_TX_INTERVAL 1
  613. #define SEREMU_RX_ENDPOINT 2
  614. #define SEREMU_RX_SIZE 32
  615. #define SEREMU_RX_INTERVAL 2
  616. #define JOYSTICK_INTERFACE 2 // Joystick
  617. #define JOYSTICK_ENDPOINT 5
  618. #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
  619. #define JOYSTICK_INTERVAL 1
  620. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  621. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  622. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  623. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  624. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  625. #elif defined(USB_MTPDISK)
  626. #define VENDOR_ID 0x16C0
  627. #define PRODUCT_ID 0x04D1
  628. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  629. #define MANUFACTURER_NAME_LEN 11
  630. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','T','P',' ','D','i','s','k'}
  631. #define PRODUCT_NAME_LEN 15
  632. #define EP0_SIZE 64
  633. #define NUM_ENDPOINTS 4
  634. #define NUM_USB_BUFFERS 20
  635. #define NUM_INTERFACE 2
  636. #define MTP_INTERFACE 0 // MTP Disk
  637. #define MTP_TX_ENDPOINT 3
  638. #define MTP_TX_SIZE 64
  639. #define MTP_RX_ENDPOINT 3
  640. #define MTP_RX_SIZE 64
  641. #define MTP_EVENT_ENDPOINT 4
  642. #define MTP_EVENT_SIZE 16
  643. #define MTP_EVENT_INTERVAL 10
  644. #define SEREMU_INTERFACE 1 // Serial emulation
  645. #define SEREMU_TX_ENDPOINT 1
  646. #define SEREMU_TX_SIZE 64
  647. #define SEREMU_TX_INTERVAL 1
  648. #define SEREMU_RX_ENDPOINT 2
  649. #define SEREMU_RX_SIZE 32
  650. #define SEREMU_RX_INTERVAL 2
  651. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  652. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  653. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  654. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  655. #elif defined(USB_AUDIO)
  656. #define VENDOR_ID 0x16C0
  657. #define PRODUCT_ID 0x04D2
  658. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  659. #define MANUFACTURER_NAME_LEN 11
  660. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','A','u','d','i','o'}
  661. #define PRODUCT_NAME_LEN 12
  662. #define EP0_SIZE 64
  663. #define NUM_ENDPOINTS 5
  664. #define NUM_USB_BUFFERS 16
  665. #define NUM_INTERFACE 4
  666. #define SEREMU_INTERFACE 0 // Serial emulation
  667. #define SEREMU_TX_ENDPOINT 1
  668. #define SEREMU_TX_SIZE 64
  669. #define SEREMU_TX_INTERVAL 1
  670. #define SEREMU_RX_ENDPOINT 2
  671. #define SEREMU_RX_SIZE 32
  672. #define SEREMU_RX_INTERVAL 2
  673. #define AUDIO_INTERFACE 1 // Audio (uses 3 consecutive interfaces)
  674. #define AUDIO_TX_ENDPOINT 3
  675. #define AUDIO_TX_SIZE 180
  676. #define AUDIO_RX_ENDPOINT 4
  677. #define AUDIO_RX_SIZE 180
  678. #define AUDIO_SYNC_ENDPOINT 5
  679. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  680. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  681. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  682. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS
  683. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  684. #elif defined(USB_MIDI_AUDIO_SERIAL)
  685. #define VENDOR_ID 0x16C0
  686. #define PRODUCT_ID 0x048A
  687. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  688. #define MANUFACTURER_NAME_LEN 11
  689. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','/','A','u','d','i','o'}
  690. #define PRODUCT_NAME_LEN 17
  691. #define EP0_SIZE 64
  692. #define NUM_ENDPOINTS 8
  693. #define NUM_USB_BUFFERS 30
  694. #define NUM_INTERFACE 6
  695. #define CDC_IAD_DESCRIPTOR 1
  696. #define CDC_STATUS_INTERFACE 0
  697. #define CDC_DATA_INTERFACE 1 // Serial
  698. #define CDC_ACM_ENDPOINT 1
  699. #define CDC_RX_ENDPOINT 2
  700. #define CDC_TX_ENDPOINT 3
  701. #define CDC_ACM_SIZE 16
  702. #define CDC_RX_SIZE 64
  703. #define CDC_TX_SIZE 64
  704. #define MIDI_INTERFACE 2 // MIDI
  705. #define MIDI_NUM_CABLES 1
  706. #define MIDI_TX_ENDPOINT 4
  707. #define MIDI_TX_SIZE 64
  708. #define MIDI_RX_ENDPOINT 5
  709. #define MIDI_RX_SIZE 64
  710. #define AUDIO_INTERFACE 3 // Audio (uses 3 consecutive interfaces)
  711. #define AUDIO_TX_ENDPOINT 6
  712. #define AUDIO_TX_SIZE 180
  713. #define AUDIO_RX_ENDPOINT 7
  714. #define AUDIO_RX_SIZE 180
  715. #define AUDIO_SYNC_ENDPOINT 8
  716. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  717. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  718. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  719. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  720. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  721. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  722. #define ENDPOINT7_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS
  723. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  724. #elif defined(USB_MIDI16_AUDIO_SERIAL)
  725. #define VENDOR_ID 0x16C0
  726. #define PRODUCT_ID 0x048A
  727. #define BCD_DEVICE 0x0212
  728. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  729. #define MANUFACTURER_NAME_LEN 11
  730. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','1','6','/','A','u','d','i','o'}
  731. #define PRODUCT_NAME_LEN 20
  732. #define EP0_SIZE 64
  733. #define NUM_ENDPOINTS 8
  734. #define NUM_USB_BUFFERS 30
  735. #define NUM_INTERFACE 6
  736. #define CDC_IAD_DESCRIPTOR 1
  737. #define CDC_STATUS_INTERFACE 0
  738. #define CDC_DATA_INTERFACE 1 // Serial
  739. #define CDC_ACM_ENDPOINT 1
  740. #define CDC_RX_ENDPOINT 2
  741. #define CDC_TX_ENDPOINT 3
  742. #define CDC_ACM_SIZE 16
  743. #define CDC_RX_SIZE 64
  744. #define CDC_TX_SIZE 64
  745. #define MIDI_INTERFACE 2 // MIDI
  746. #define MIDI_NUM_CABLES 16
  747. #define MIDI_TX_ENDPOINT 4
  748. #define MIDI_TX_SIZE 64
  749. #define MIDI_RX_ENDPOINT 5
  750. #define MIDI_RX_SIZE 64
  751. #define AUDIO_INTERFACE 3 // Audio (uses 3 consecutive interfaces)
  752. #define AUDIO_TX_ENDPOINT 6
  753. #define AUDIO_TX_SIZE 180
  754. #define AUDIO_RX_ENDPOINT 7
  755. #define AUDIO_RX_SIZE 180
  756. #define AUDIO_SYNC_ENDPOINT 8
  757. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  758. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  759. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  760. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  761. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  762. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  763. #define ENDPOINT7_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS
  764. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  765. #elif defined(USB_EVERYTHING)
  766. #define VENDOR_ID 0x16C0
  767. #define PRODUCT_ID 0x0476
  768. #define RAWHID_USAGE_PAGE 0xFFAB // recommended: 0xFF00 to 0xFFFF
  769. #define RAWHID_USAGE 0x0200 // recommended: 0x0100 to 0xFFFF
  770. #define DEVICE_CLASS 0xEF
  771. #define DEVICE_SUBCLASS 0x02
  772. #define DEVICE_PROTOCOL 0x01
  773. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  774. #define MANUFACTURER_NAME_LEN 11
  775. #define PRODUCT_NAME {'A','l','l',' ','T','h','e',' ','T','h','i','n','g','s'}
  776. #define PRODUCT_NAME_LEN 14
  777. #define EP0_SIZE 64
  778. #define NUM_ENDPOINTS 15
  779. #define NUM_USB_BUFFERS 31
  780. #define NUM_INTERFACE 13
  781. #define CDC_IAD_DESCRIPTOR 1
  782. #define CDC_STATUS_INTERFACE 0
  783. #define CDC_DATA_INTERFACE 1 // Serial
  784. #define CDC_ACM_ENDPOINT 1
  785. #define CDC_RX_ENDPOINT 2
  786. #define CDC_TX_ENDPOINT 2
  787. #define CDC_ACM_SIZE 16
  788. #define CDC_RX_SIZE 64
  789. #define CDC_TX_SIZE 64
  790. #define MIDI_INTERFACE 2 // MIDI
  791. #define MIDI_NUM_CABLES 16
  792. #define MIDI_TX_ENDPOINT 3
  793. #define MIDI_TX_SIZE 64
  794. #define MIDI_RX_ENDPOINT 3
  795. #define MIDI_RX_SIZE 64
  796. #define KEYBOARD_INTERFACE 3 // Keyboard
  797. #define KEYBOARD_ENDPOINT 4
  798. #define KEYBOARD_SIZE 8
  799. #define KEYBOARD_INTERVAL 1
  800. #define MOUSE_INTERFACE 4 // Mouse
  801. #define MOUSE_ENDPOINT 5
  802. #define MOUSE_SIZE 8
  803. #define MOUSE_INTERVAL 2
  804. #define RAWHID_INTERFACE 5 // RawHID
  805. #define RAWHID_TX_ENDPOINT 6
  806. #define RAWHID_TX_SIZE 64
  807. #define RAWHID_TX_INTERVAL 1
  808. #define RAWHID_RX_ENDPOINT 6
  809. #define RAWHID_RX_SIZE 64
  810. #define RAWHID_RX_INTERVAL 1
  811. #define FLIGHTSIM_INTERFACE 6 // Flight Sim Control
  812. #define FLIGHTSIM_TX_ENDPOINT 9
  813. #define FLIGHTSIM_TX_SIZE 64
  814. #define FLIGHTSIM_TX_INTERVAL 1
  815. #define FLIGHTSIM_RX_ENDPOINT 9
  816. #define FLIGHTSIM_RX_SIZE 64
  817. #define FLIGHTSIM_RX_INTERVAL 1
  818. #define JOYSTICK_INTERFACE 7 // Joystick
  819. #define JOYSTICK_ENDPOINT 10
  820. #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
  821. #define JOYSTICK_INTERVAL 1
  822. /*
  823. #define MTP_INTERFACE 8 // MTP Disk
  824. #define MTP_TX_ENDPOINT 11
  825. #define MTP_TX_SIZE 64
  826. #define MTP_RX_ENDPOINT 3
  827. #define MTP_RX_SIZE 64
  828. #define MTP_EVENT_ENDPOINT 11
  829. #define MTP_EVENT_SIZE 16
  830. #define MTP_EVENT_INTERVAL 10
  831. */
  832. #define KEYMEDIA_INTERFACE 8 // Keyboard Media Keys
  833. #define KEYMEDIA_ENDPOINT 12
  834. #define KEYMEDIA_SIZE 8
  835. #define KEYMEDIA_INTERVAL 4
  836. #define AUDIO_INTERFACE 9 // Audio (uses 3 consecutive interfaces)
  837. #define AUDIO_TX_ENDPOINT 13
  838. #define AUDIO_TX_SIZE 180
  839. #define AUDIO_RX_ENDPOINT 13
  840. #define AUDIO_RX_SIZE 180
  841. #define AUDIO_SYNC_ENDPOINT 14
  842. #define MULTITOUCH_INTERFACE 12 // Touchscreen
  843. #define MULTITOUCH_ENDPOINT 15
  844. #define MULTITOUCH_SIZE 8
  845. #define MULTITOUCH_FINGERS 10
  846. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  847. #define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  848. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  849. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  850. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  851. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  852. #define ENDPOINT7_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  853. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ONLY
  854. #define ENDPOINT9_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  855. #define ENDPOINT10_CONFIG ENDPOINT_TRANSMIT_ONLY
  856. #define ENDPOINT11_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  857. #define ENDPOINT12_CONFIG ENDPOINT_TRANSMIT_ONLY
  858. #define ENDPOINT13_CONFIG (ENDPOINT_RECEIVE_ISOCHRONOUS|ENDPOINT_TRANSMIT_ISOCHRONOUS)
  859. #define ENDPOINT14_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  860. #define ENDPOINT15_CONFIG ENDPOINT_TRANSMIT_ONLY
  861. #endif
  862. #ifdef USB_DESC_LIST_DEFINE
  863. #if defined(NUM_ENDPOINTS) && NUM_ENDPOINTS > 0
  864. // NUM_ENDPOINTS = number of non-zero endpoints (0 to 15)
  865. extern const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS];
  866. typedef struct {
  867. uint16_t wValue;
  868. uint16_t wIndex;
  869. const uint8_t *addr;
  870. uint16_t length;
  871. } usb_descriptor_list_t;
  872. extern const usb_descriptor_list_t usb_descriptor_list[];
  873. #endif // NUM_ENDPOINTS
  874. #endif // USB_DESC_LIST_DEFINE
  875. #endif