Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

968 lines
37KB

  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 0x048B
  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 // SerialUSB1
  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_TRIPLE_SERIAL)
  157. #define VENDOR_ID 0x16C0
  158. #define PRODUCT_ID 0x048C
  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 {'T','r','i','p','l','e',' ','S','e','r','i','a','l'}
  162. #define PRODUCT_NAME_LEN 13
  163. #define EP0_SIZE 64
  164. #define NUM_ENDPOINTS 10
  165. #define NUM_USB_BUFFERS 32
  166. #define NUM_INTERFACE 6
  167. #define CDC_IAD_DESCRIPTOR 1 // Serial
  168. #define CDC_STATUS_INTERFACE 0
  169. #define CDC_DATA_INTERFACE 1
  170. #define CDC_ACM_ENDPOINT 2
  171. #define CDC_RX_ENDPOINT 3
  172. #define CDC_TX_ENDPOINT 4
  173. #define CDC_ACM_SIZE 16
  174. #define CDC_RX_SIZE 64
  175. #define CDC_TX_SIZE 64
  176. #define CDC2_STATUS_INTERFACE 2 // SerialUSB1
  177. #define CDC2_DATA_INTERFACE 3
  178. #define CDC2_ACM_ENDPOINT 5
  179. #define CDC2_RX_ENDPOINT 6
  180. #define CDC2_TX_ENDPOINT 7
  181. #define CDC2_ACM_SIZE 16
  182. #define CDC2_RX_SIZE 64
  183. #define CDC2_TX_SIZE 64
  184. #define CDC3_STATUS_INTERFACE 4 // SerialUSB2
  185. #define CDC3_DATA_INTERFACE 5
  186. #define CDC3_ACM_ENDPOINT 8
  187. #define CDC3_RX_ENDPOINT 9
  188. #define CDC3_TX_ENDPOINT 10
  189. #define CDC3_ACM_SIZE 16
  190. #define CDC3_RX_SIZE 64
  191. #define CDC3_TX_SIZE 64
  192. #define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_ONLY
  193. #define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
  194. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  195. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  196. #define ENDPOINT6_CONFIG ENDPOINT_RECEIVE_ONLY
  197. #define ENDPOINT7_CONFIG ENDPOINT_TRANSMIT_ONLY
  198. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ONLY
  199. #define ENDPOINT9_CONFIG ENDPOINT_RECEIVE_ONLY
  200. #define ENDPOINT10_CONFIG ENDPOINT_TRANSMIT_ONLY
  201. #elif defined(USB_KEYBOARDONLY)
  202. #define VENDOR_ID 0x16C0
  203. #define PRODUCT_ID 0x04D0
  204. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  205. #define MANUFACTURER_NAME_LEN 11
  206. #define PRODUCT_NAME {'K','e','y','b','o','a','r','d'}
  207. #define PRODUCT_NAME_LEN 8
  208. #define EP0_SIZE 64
  209. #define NUM_ENDPOINTS 4
  210. #define NUM_USB_BUFFERS 14
  211. #define NUM_INTERFACE 3
  212. #define SEREMU_INTERFACE 1 // Serial emulation
  213. #define SEREMU_TX_ENDPOINT 1
  214. #define SEREMU_TX_SIZE 64
  215. #define SEREMU_TX_INTERVAL 1
  216. #define SEREMU_RX_ENDPOINT 2
  217. #define SEREMU_RX_SIZE 32
  218. #define SEREMU_RX_INTERVAL 2
  219. #define KEYBOARD_INTERFACE 0 // Keyboard
  220. #define KEYBOARD_ENDPOINT 3
  221. #define KEYBOARD_SIZE 8
  222. #define KEYBOARD_INTERVAL 1
  223. #define KEYMEDIA_INTERFACE 2 // Keyboard Media Keys
  224. #define KEYMEDIA_ENDPOINT 4
  225. #define KEYMEDIA_SIZE 8
  226. #define KEYMEDIA_INTERVAL 4
  227. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  228. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  229. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  230. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  231. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  232. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ONLY
  233. #elif defined(USB_HID)
  234. #define VENDOR_ID 0x16C0
  235. #define PRODUCT_ID 0x0482
  236. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  237. #define MANUFACTURER_NAME_LEN 11
  238. #define PRODUCT_NAME {'K','e','y','b','o','a','r','d','/','M','o','u','s','e','/','J','o','y','s','t','i','c','k'}
  239. #define PRODUCT_NAME_LEN 23
  240. #define EP0_SIZE 64
  241. #define NUM_ENDPOINTS 6
  242. #define NUM_USB_BUFFERS 24
  243. #define NUM_INTERFACE 5
  244. #define SEREMU_INTERFACE 2 // Serial emulation
  245. #define SEREMU_TX_ENDPOINT 1
  246. #define SEREMU_TX_SIZE 64
  247. #define SEREMU_TX_INTERVAL 1
  248. #define SEREMU_RX_ENDPOINT 2
  249. #define SEREMU_RX_SIZE 32
  250. #define SEREMU_RX_INTERVAL 2
  251. #define KEYBOARD_INTERFACE 0 // Keyboard
  252. #define KEYBOARD_ENDPOINT 3
  253. #define KEYBOARD_SIZE 8
  254. #define KEYBOARD_INTERVAL 1
  255. #define KEYMEDIA_INTERFACE 4 // Keyboard Media Keys
  256. #define KEYMEDIA_ENDPOINT 6
  257. #define KEYMEDIA_SIZE 8
  258. #define KEYMEDIA_INTERVAL 4
  259. #define MOUSE_INTERFACE 1 // Mouse
  260. #define MOUSE_ENDPOINT 5
  261. #define MOUSE_SIZE 8
  262. #define MOUSE_INTERVAL 1
  263. #define JOYSTICK_INTERFACE 3 // Joystick
  264. #define JOYSTICK_ENDPOINT 4
  265. #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
  266. #define JOYSTICK_INTERVAL 2
  267. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  268. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  269. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  270. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  271. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  272. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ONLY
  273. #elif defined(USB_SERIAL_HID)
  274. #define VENDOR_ID 0x16C0
  275. #define PRODUCT_ID 0x0487
  276. #define DEVICE_CLASS 0xEF
  277. #define DEVICE_SUBCLASS 0x02
  278. #define DEVICE_PROTOCOL 0x01
  279. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  280. #define MANUFACTURER_NAME_LEN 11
  281. #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'}
  282. #define PRODUCT_NAME_LEN 30
  283. #define EP0_SIZE 64
  284. #define NUM_ENDPOINTS 7
  285. #define NUM_USB_BUFFERS 30
  286. #define NUM_INTERFACE 6
  287. #define CDC_IAD_DESCRIPTOR 1
  288. #define CDC_STATUS_INTERFACE 0
  289. #define CDC_DATA_INTERFACE 1 // Serial
  290. #define CDC_ACM_ENDPOINT 2
  291. #define CDC_RX_ENDPOINT 3
  292. #define CDC_TX_ENDPOINT 4
  293. #define CDC_ACM_SIZE 16
  294. #define CDC_RX_SIZE 64
  295. #define CDC_TX_SIZE 64
  296. #define KEYBOARD_INTERFACE 2 // Keyboard
  297. #define KEYBOARD_ENDPOINT 1
  298. #define KEYBOARD_SIZE 8
  299. #define KEYBOARD_INTERVAL 1
  300. #define KEYMEDIA_INTERFACE 5 // Keyboard Media Keys
  301. #define KEYMEDIA_ENDPOINT 7
  302. #define KEYMEDIA_SIZE 8
  303. #define KEYMEDIA_INTERVAL 4
  304. #define MOUSE_INTERFACE 3 // Mouse
  305. #define MOUSE_ENDPOINT 5
  306. #define MOUSE_SIZE 8
  307. #define MOUSE_INTERVAL 2
  308. #define JOYSTICK_INTERFACE 4 // Joystick
  309. #define JOYSTICK_ENDPOINT 6
  310. #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
  311. #define JOYSTICK_INTERVAL 1
  312. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  313. #define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_ONLY
  314. #define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
  315. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  316. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  317. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ONLY
  318. #define ENDPOINT7_CONFIG ENDPOINT_TRANSMIT_ONLY
  319. #elif defined(USB_TOUCHSCREEN)
  320. #define VENDOR_ID 0x16C0
  321. #define PRODUCT_ID 0x04D3
  322. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  323. #define MANUFACTURER_NAME_LEN 11
  324. #define PRODUCT_NAME {'K','e','y','b','o','a','r','d','/','T','o','u','c','h','s','c','r','e','e','n'}
  325. #define PRODUCT_NAME_LEN 20
  326. #define EP0_SIZE 64
  327. #define NUM_ENDPOINTS 5
  328. #define NUM_USB_BUFFERS 15
  329. #define NUM_INTERFACE 4
  330. #define SEREMU_INTERFACE 1 // Serial emulation
  331. #define SEREMU_TX_ENDPOINT 1
  332. #define SEREMU_TX_SIZE 64
  333. #define SEREMU_TX_INTERVAL 1
  334. #define SEREMU_RX_ENDPOINT 2
  335. #define SEREMU_RX_SIZE 32
  336. #define SEREMU_RX_INTERVAL 2
  337. #define KEYBOARD_INTERFACE 0 // Keyboard
  338. #define KEYBOARD_ENDPOINT 3
  339. #define KEYBOARD_SIZE 8
  340. #define KEYBOARD_INTERVAL 1
  341. #define KEYMEDIA_INTERFACE 2 // Keyboard Media Keys
  342. #define KEYMEDIA_ENDPOINT 4
  343. #define KEYMEDIA_SIZE 8
  344. #define KEYMEDIA_INTERVAL 4
  345. #define MULTITOUCH_INTERFACE 3 // Touchscreen
  346. #define MULTITOUCH_ENDPOINT 5
  347. #define MULTITOUCH_SIZE 16
  348. #define MULTITOUCH_FINGERS 10
  349. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  350. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  351. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  352. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  353. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  354. #elif defined(USB_HID_TOUCHSCREEN)
  355. #define VENDOR_ID 0x16C0
  356. #define PRODUCT_ID 0x04D4
  357. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  358. #define MANUFACTURER_NAME_LEN 11
  359. #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'}
  360. #define PRODUCT_NAME_LEN 26
  361. #define EP0_SIZE 64
  362. #define NUM_ENDPOINTS 6
  363. #define NUM_USB_BUFFERS 20
  364. #define NUM_INTERFACE 5
  365. #define SEREMU_INTERFACE 2 // Serial emulation
  366. #define SEREMU_TX_ENDPOINT 1
  367. #define SEREMU_TX_SIZE 64
  368. #define SEREMU_TX_INTERVAL 1
  369. #define SEREMU_RX_ENDPOINT 2
  370. #define SEREMU_RX_SIZE 32
  371. #define SEREMU_RX_INTERVAL 2
  372. #define KEYBOARD_INTERFACE 0 // Keyboard
  373. #define KEYBOARD_ENDPOINT 3
  374. #define KEYBOARD_SIZE 8
  375. #define KEYBOARD_INTERVAL 1
  376. #define KEYMEDIA_INTERFACE 3 // Keyboard Media Keys
  377. #define KEYMEDIA_ENDPOINT 4
  378. #define KEYMEDIA_SIZE 8
  379. #define KEYMEDIA_INTERVAL 4
  380. #define MOUSE_INTERFACE 1 // Mouse
  381. #define MOUSE_ENDPOINT 6
  382. #define MOUSE_SIZE 8
  383. #define MOUSE_INTERVAL 2
  384. #define MULTITOUCH_INTERFACE 4 // Touchscreen
  385. #define MULTITOUCH_ENDPOINT 5
  386. #define MULTITOUCH_SIZE 16
  387. #define MULTITOUCH_FINGERS 10
  388. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  389. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  390. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  391. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  392. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  393. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ONLY
  394. #elif defined(USB_MIDI)
  395. #define VENDOR_ID 0x16C0
  396. #define PRODUCT_ID 0x0485
  397. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  398. #define MANUFACTURER_NAME_LEN 11
  399. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I'}
  400. #define PRODUCT_NAME_LEN 11
  401. #define EP0_SIZE 64
  402. #define NUM_ENDPOINTS 4
  403. #define NUM_USB_BUFFERS 16
  404. #define NUM_INTERFACE 2
  405. #define SEREMU_INTERFACE 1 // Serial emulation
  406. #define SEREMU_TX_ENDPOINT 1
  407. #define SEREMU_TX_SIZE 64
  408. #define SEREMU_TX_INTERVAL 1
  409. #define SEREMU_RX_ENDPOINT 2
  410. #define SEREMU_RX_SIZE 32
  411. #define SEREMU_RX_INTERVAL 2
  412. #define MIDI_INTERFACE 0 // MIDI
  413. #define MIDI_NUM_CABLES 1
  414. #define MIDI_TX_ENDPOINT 3
  415. #define MIDI_TX_SIZE 64
  416. #define MIDI_RX_ENDPOINT 4
  417. #define MIDI_RX_SIZE 64
  418. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  419. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  420. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  421. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  422. #elif defined(USB_MIDI4)
  423. #define VENDOR_ID 0x16C0
  424. #define PRODUCT_ID 0x0485
  425. #define BCD_DEVICE 0x0211
  426. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  427. #define MANUFACTURER_NAME_LEN 11
  428. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','4'}
  429. #define PRODUCT_NAME_LEN 13
  430. #define EP0_SIZE 64
  431. #define NUM_ENDPOINTS 4
  432. #define NUM_USB_BUFFERS 16
  433. #define NUM_INTERFACE 2
  434. #define SEREMU_INTERFACE 1 // Serial emulation
  435. #define SEREMU_TX_ENDPOINT 1
  436. #define SEREMU_TX_SIZE 64
  437. #define SEREMU_TX_INTERVAL 1
  438. #define SEREMU_RX_ENDPOINT 2
  439. #define SEREMU_RX_SIZE 32
  440. #define SEREMU_RX_INTERVAL 2
  441. #define MIDI_INTERFACE 0 // MIDI
  442. #define MIDI_NUM_CABLES 4
  443. #define MIDI_TX_ENDPOINT 3
  444. #define MIDI_TX_SIZE 64
  445. #define MIDI_RX_ENDPOINT 4
  446. #define MIDI_RX_SIZE 64
  447. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  448. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  449. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  450. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  451. #elif defined(USB_MIDI16)
  452. #define VENDOR_ID 0x16C0
  453. #define PRODUCT_ID 0x0485
  454. #define BCD_DEVICE 0x0212
  455. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  456. #define MANUFACTURER_NAME_LEN 11
  457. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','1','6'}
  458. #define PRODUCT_NAME_LEN 14
  459. #define EP0_SIZE 64
  460. #define NUM_ENDPOINTS 4
  461. #define NUM_USB_BUFFERS 16
  462. #define NUM_INTERFACE 2
  463. #define SEREMU_INTERFACE 1 // Serial emulation
  464. #define SEREMU_TX_ENDPOINT 1
  465. #define SEREMU_TX_SIZE 64
  466. #define SEREMU_TX_INTERVAL 1
  467. #define SEREMU_RX_ENDPOINT 2
  468. #define SEREMU_RX_SIZE 32
  469. #define SEREMU_RX_INTERVAL 2
  470. #define MIDI_INTERFACE 0 // MIDI
  471. #define MIDI_NUM_CABLES 16
  472. #define MIDI_TX_ENDPOINT 3
  473. #define MIDI_TX_SIZE 64
  474. #define MIDI_RX_ENDPOINT 4
  475. #define MIDI_RX_SIZE 64
  476. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  477. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  478. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  479. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  480. #elif defined(USB_MIDI_SERIAL)
  481. #define VENDOR_ID 0x16C0
  482. #define PRODUCT_ID 0x0489
  483. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  484. #define MANUFACTURER_NAME_LEN 11
  485. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I'}
  486. #define PRODUCT_NAME_LEN 11
  487. #define EP0_SIZE 64
  488. #define NUM_ENDPOINTS 5
  489. #define NUM_USB_BUFFERS 30
  490. #define NUM_INTERFACE 3
  491. #define CDC_IAD_DESCRIPTOR 1
  492. #define CDC_STATUS_INTERFACE 0
  493. #define CDC_DATA_INTERFACE 1 // Serial
  494. #define CDC_ACM_ENDPOINT 1
  495. #define CDC_RX_ENDPOINT 2
  496. #define CDC_TX_ENDPOINT 3
  497. #define CDC_ACM_SIZE 16
  498. #define CDC_RX_SIZE 64
  499. #define CDC_TX_SIZE 64
  500. #define MIDI_INTERFACE 2 // MIDI
  501. #define MIDI_NUM_CABLES 1
  502. #define MIDI_TX_ENDPOINT 4
  503. #define MIDI_TX_SIZE 64
  504. #define MIDI_RX_ENDPOINT 5
  505. #define MIDI_RX_SIZE 64
  506. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  507. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  508. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  509. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  510. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  511. #elif defined(USB_MIDI4_SERIAL)
  512. #define VENDOR_ID 0x16C0
  513. #define PRODUCT_ID 0x0489
  514. #define BCD_DEVICE 0x0211
  515. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  516. #define MANUFACTURER_NAME_LEN 11
  517. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','4'}
  518. #define PRODUCT_NAME_LEN 13
  519. #define EP0_SIZE 64
  520. #define NUM_ENDPOINTS 5
  521. #define NUM_USB_BUFFERS 30
  522. #define NUM_INTERFACE 3
  523. #define CDC_IAD_DESCRIPTOR 1
  524. #define CDC_STATUS_INTERFACE 0
  525. #define CDC_DATA_INTERFACE 1 // Serial
  526. #define CDC_ACM_ENDPOINT 1
  527. #define CDC_RX_ENDPOINT 2
  528. #define CDC_TX_ENDPOINT 3
  529. #define CDC_ACM_SIZE 16
  530. #define CDC_RX_SIZE 64
  531. #define CDC_TX_SIZE 64
  532. #define MIDI_INTERFACE 2 // MIDI
  533. #define MIDI_NUM_CABLES 4
  534. #define MIDI_TX_ENDPOINT 4
  535. #define MIDI_TX_SIZE 64
  536. #define MIDI_RX_ENDPOINT 5
  537. #define MIDI_RX_SIZE 64
  538. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  539. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  540. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  541. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  542. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  543. #elif defined(USB_MIDI16_SERIAL)
  544. #define VENDOR_ID 0x16C0
  545. #define PRODUCT_ID 0x0489
  546. #define BCD_DEVICE 0x0212
  547. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  548. #define MANUFACTURER_NAME_LEN 11
  549. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','1','6'}
  550. #define PRODUCT_NAME_LEN 14
  551. #define EP0_SIZE 64
  552. #define NUM_ENDPOINTS 5
  553. #define NUM_USB_BUFFERS 30
  554. #define NUM_INTERFACE 3
  555. #define CDC_IAD_DESCRIPTOR 1
  556. #define CDC_STATUS_INTERFACE 0
  557. #define CDC_DATA_INTERFACE 1 // Serial
  558. #define CDC_ACM_ENDPOINT 1
  559. #define CDC_RX_ENDPOINT 2
  560. #define CDC_TX_ENDPOINT 3
  561. #define CDC_ACM_SIZE 16
  562. #define CDC_RX_SIZE 64
  563. #define CDC_TX_SIZE 64
  564. #define MIDI_INTERFACE 2 // MIDI
  565. #define MIDI_NUM_CABLES 16
  566. #define MIDI_TX_ENDPOINT 4
  567. #define MIDI_TX_SIZE 64
  568. #define MIDI_RX_ENDPOINT 5
  569. #define MIDI_RX_SIZE 64
  570. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  571. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  572. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  573. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  574. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  575. #elif defined(USB_RAWHID)
  576. #define VENDOR_ID 0x16C0
  577. #define PRODUCT_ID 0x0486
  578. #define RAWHID_USAGE_PAGE 0xFFAB // recommended: 0xFF00 to 0xFFFF
  579. #define RAWHID_USAGE 0x0200 // recommended: 0x0100 to 0xFFFF
  580. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  581. #define MANUFACTURER_NAME_LEN 11
  582. #define PRODUCT_NAME {'T','e','e','n','s','y','d','u','i','n','o',' ','R','a','w','H','I','D'}
  583. #define PRODUCT_NAME_LEN 18
  584. #define EP0_SIZE 64
  585. #define NUM_ENDPOINTS 4
  586. #define NUM_USB_BUFFERS 12
  587. #define NUM_INTERFACE 2
  588. #define RAWHID_INTERFACE 0 // RawHID
  589. #define RAWHID_TX_ENDPOINT 3
  590. #define RAWHID_TX_SIZE 64
  591. #define RAWHID_TX_INTERVAL 1
  592. #define RAWHID_RX_ENDPOINT 4
  593. #define RAWHID_RX_SIZE 64
  594. #define RAWHID_RX_INTERVAL 1
  595. #define SEREMU_INTERFACE 1 // Serial emulation
  596. #define SEREMU_TX_ENDPOINT 1
  597. #define SEREMU_TX_SIZE 64
  598. #define SEREMU_TX_INTERVAL 1
  599. #define SEREMU_RX_ENDPOINT 2
  600. #define SEREMU_RX_SIZE 32
  601. #define SEREMU_RX_INTERVAL 2
  602. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  603. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  604. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  605. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  606. #elif defined(USB_FLIGHTSIM)
  607. #define VENDOR_ID 0x16C0
  608. #define PRODUCT_ID 0x0488
  609. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  610. #define MANUFACTURER_NAME_LEN 11
  611. #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'}
  612. #define PRODUCT_NAME_LEN 26
  613. #define EP0_SIZE 64
  614. #define NUM_ENDPOINTS 4
  615. #define NUM_USB_BUFFERS 20
  616. #define NUM_INTERFACE 2
  617. #define FLIGHTSIM_INTERFACE 0 // Flight Sim Control
  618. #define FLIGHTSIM_TX_ENDPOINT 3
  619. #define FLIGHTSIM_TX_SIZE 64
  620. #define FLIGHTSIM_TX_INTERVAL 1
  621. #define FLIGHTSIM_RX_ENDPOINT 4
  622. #define FLIGHTSIM_RX_SIZE 64
  623. #define FLIGHTSIM_RX_INTERVAL 1
  624. #define SEREMU_INTERFACE 1 // Serial emulation
  625. #define SEREMU_TX_ENDPOINT 1
  626. #define SEREMU_TX_SIZE 64
  627. #define SEREMU_TX_INTERVAL 1
  628. #define SEREMU_RX_ENDPOINT 2
  629. #define SEREMU_RX_SIZE 32
  630. #define SEREMU_RX_INTERVAL 2
  631. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  632. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  633. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  634. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  635. #elif defined(USB_FLIGHTSIM_JOYSTICK)
  636. #define VENDOR_ID 0x16C0
  637. #define PRODUCT_ID 0x0488
  638. #define BCD_DEVICE 0x0211
  639. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  640. #define MANUFACTURER_NAME_LEN 11
  641. #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'}
  642. #define PRODUCT_NAME_LEN 26
  643. #define EP0_SIZE 64
  644. #define NUM_ENDPOINTS 5
  645. #define NUM_USB_BUFFERS 20
  646. #define NUM_INTERFACE 3
  647. #define FLIGHTSIM_INTERFACE 0 // Flight Sim Control
  648. #define FLIGHTSIM_TX_ENDPOINT 3
  649. #define FLIGHTSIM_TX_SIZE 64
  650. #define FLIGHTSIM_TX_INTERVAL 1
  651. #define FLIGHTSIM_RX_ENDPOINT 4
  652. #define FLIGHTSIM_RX_SIZE 64
  653. #define FLIGHTSIM_RX_INTERVAL 1
  654. #define SEREMU_INTERFACE 1 // Serial emulation
  655. #define SEREMU_TX_ENDPOINT 1
  656. #define SEREMU_TX_SIZE 64
  657. #define SEREMU_TX_INTERVAL 1
  658. #define SEREMU_RX_ENDPOINT 2
  659. #define SEREMU_RX_SIZE 32
  660. #define SEREMU_RX_INTERVAL 2
  661. #define JOYSTICK_INTERFACE 2 // Joystick
  662. #define JOYSTICK_ENDPOINT 5
  663. #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
  664. #define JOYSTICK_INTERVAL 1
  665. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  666. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  667. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  668. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  669. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  670. #elif defined(USB_MTPDISK)
  671. #define VENDOR_ID 0x16C0
  672. #define PRODUCT_ID 0x04D1
  673. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  674. #define MANUFACTURER_NAME_LEN 11
  675. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','T','P',' ','D','i','s','k'}
  676. #define PRODUCT_NAME_LEN 15
  677. #define EP0_SIZE 64
  678. #define NUM_ENDPOINTS 4
  679. #define NUM_USB_BUFFERS 20
  680. #define NUM_INTERFACE 2
  681. #define MTP_INTERFACE 0 // MTP Disk
  682. #define MTP_TX_ENDPOINT 3
  683. #define MTP_TX_SIZE 64
  684. #define MTP_RX_ENDPOINT 3
  685. #define MTP_RX_SIZE 64
  686. #define MTP_EVENT_ENDPOINT 4
  687. #define MTP_EVENT_SIZE 32
  688. #define MTP_EVENT_INTERVAL 10
  689. #define SEREMU_INTERFACE 1 // Serial emulation
  690. #define SEREMU_TX_ENDPOINT 1
  691. #define SEREMU_TX_SIZE 64
  692. #define SEREMU_TX_INTERVAL 1
  693. #define SEREMU_RX_ENDPOINT 2
  694. #define SEREMU_RX_SIZE 32
  695. #define SEREMU_RX_INTERVAL 2
  696. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  697. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  698. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  699. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  700. #elif defined(USB_AUDIO)
  701. #define VENDOR_ID 0x16C0
  702. #define PRODUCT_ID 0x04D2
  703. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  704. #define MANUFACTURER_NAME_LEN 11
  705. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','A','u','d','i','o'}
  706. #define PRODUCT_NAME_LEN 12
  707. #define EP0_SIZE 64
  708. #define NUM_ENDPOINTS 5
  709. #define NUM_USB_BUFFERS 16
  710. #define NUM_INTERFACE 4
  711. #define SEREMU_INTERFACE 0 // Serial emulation
  712. #define SEREMU_TX_ENDPOINT 1
  713. #define SEREMU_TX_SIZE 64
  714. #define SEREMU_TX_INTERVAL 1
  715. #define SEREMU_RX_ENDPOINT 2
  716. #define SEREMU_RX_SIZE 32
  717. #define SEREMU_RX_INTERVAL 2
  718. #define AUDIO_INTERFACE 1 // Audio (uses 3 consecutive interfaces)
  719. #define AUDIO_TX_ENDPOINT 3
  720. #define AUDIO_TX_SIZE 180
  721. #define AUDIO_RX_ENDPOINT 4
  722. #define AUDIO_RX_SIZE 180
  723. #define AUDIO_SYNC_ENDPOINT 5
  724. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  725. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  726. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  727. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS
  728. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  729. #elif defined(USB_MIDI_AUDIO_SERIAL)
  730. #define VENDOR_ID 0x16C0
  731. #define PRODUCT_ID 0x048A
  732. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  733. #define MANUFACTURER_NAME_LEN 11
  734. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','/','A','u','d','i','o'}
  735. #define PRODUCT_NAME_LEN 17
  736. #define EP0_SIZE 64
  737. #define NUM_ENDPOINTS 8
  738. #define NUM_USB_BUFFERS 30
  739. #define NUM_INTERFACE 6
  740. #define CDC_IAD_DESCRIPTOR 1
  741. #define CDC_STATUS_INTERFACE 0
  742. #define CDC_DATA_INTERFACE 1 // Serial
  743. #define CDC_ACM_ENDPOINT 1
  744. #define CDC_RX_ENDPOINT 2
  745. #define CDC_TX_ENDPOINT 3
  746. #define CDC_ACM_SIZE 16
  747. #define CDC_RX_SIZE 64
  748. #define CDC_TX_SIZE 64
  749. #define MIDI_INTERFACE 2 // MIDI
  750. #define MIDI_NUM_CABLES 1
  751. #define MIDI_TX_ENDPOINT 4
  752. #define MIDI_TX_SIZE 64
  753. #define MIDI_RX_ENDPOINT 5
  754. #define MIDI_RX_SIZE 64
  755. #define AUDIO_INTERFACE 3 // Audio (uses 3 consecutive interfaces)
  756. #define AUDIO_TX_ENDPOINT 6
  757. #define AUDIO_TX_SIZE 180
  758. #define AUDIO_RX_ENDPOINT 7
  759. #define AUDIO_RX_SIZE 180
  760. #define AUDIO_SYNC_ENDPOINT 8
  761. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  762. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  763. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  764. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  765. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  766. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  767. #define ENDPOINT7_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS
  768. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  769. #elif defined(USB_MIDI16_AUDIO_SERIAL)
  770. #define VENDOR_ID 0x16C0
  771. #define PRODUCT_ID 0x048A
  772. #define BCD_DEVICE 0x0212
  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 {'T','e','e','n','s','y',' ','M','I','D','I','x','1','6','/','A','u','d','i','o'}
  776. #define PRODUCT_NAME_LEN 20
  777. #define EP0_SIZE 64
  778. #define NUM_ENDPOINTS 8
  779. #define NUM_USB_BUFFERS 30
  780. #define NUM_INTERFACE 6
  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 3
  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 4
  793. #define MIDI_TX_SIZE 64
  794. #define MIDI_RX_ENDPOINT 5
  795. #define MIDI_RX_SIZE 64
  796. #define AUDIO_INTERFACE 3 // Audio (uses 3 consecutive interfaces)
  797. #define AUDIO_TX_ENDPOINT 6
  798. #define AUDIO_TX_SIZE 180
  799. #define AUDIO_RX_ENDPOINT 7
  800. #define AUDIO_RX_SIZE 180
  801. #define AUDIO_SYNC_ENDPOINT 8
  802. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  803. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  804. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  805. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  806. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  807. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  808. #define ENDPOINT7_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS
  809. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  810. #elif defined(USB_EVERYTHING)
  811. #define VENDOR_ID 0x16C0
  812. #define PRODUCT_ID 0x0476
  813. #define RAWHID_USAGE_PAGE 0xFFAB // recommended: 0xFF00 to 0xFFFF
  814. #define RAWHID_USAGE 0x0200 // recommended: 0x0100 to 0xFFFF
  815. #define DEVICE_CLASS 0xEF
  816. #define DEVICE_SUBCLASS 0x02
  817. #define DEVICE_PROTOCOL 0x01
  818. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  819. #define MANUFACTURER_NAME_LEN 11
  820. #define PRODUCT_NAME {'A','l','l',' ','T','h','e',' ','T','h','i','n','g','s'}
  821. #define PRODUCT_NAME_LEN 14
  822. #define EP0_SIZE 64
  823. #define NUM_ENDPOINTS 15
  824. #define NUM_USB_BUFFERS 31
  825. #define NUM_INTERFACE 13
  826. #define CDC_IAD_DESCRIPTOR 1
  827. #define CDC_STATUS_INTERFACE 0
  828. #define CDC_DATA_INTERFACE 1 // Serial
  829. #define CDC_ACM_ENDPOINT 1
  830. #define CDC_RX_ENDPOINT 2
  831. #define CDC_TX_ENDPOINT 2
  832. #define CDC_ACM_SIZE 16
  833. #define CDC_RX_SIZE 64
  834. #define CDC_TX_SIZE 64
  835. #define MIDI_INTERFACE 2 // MIDI
  836. #define MIDI_NUM_CABLES 16
  837. #define MIDI_TX_ENDPOINT 3
  838. #define MIDI_TX_SIZE 64
  839. #define MIDI_RX_ENDPOINT 3
  840. #define MIDI_RX_SIZE 64
  841. #define KEYBOARD_INTERFACE 3 // Keyboard
  842. #define KEYBOARD_ENDPOINT 4
  843. #define KEYBOARD_SIZE 8
  844. #define KEYBOARD_INTERVAL 1
  845. #define MOUSE_INTERFACE 4 // Mouse
  846. #define MOUSE_ENDPOINT 5
  847. #define MOUSE_SIZE 8
  848. #define MOUSE_INTERVAL 2
  849. #define RAWHID_INTERFACE 5 // RawHID
  850. #define RAWHID_TX_ENDPOINT 6
  851. #define RAWHID_TX_SIZE 64
  852. #define RAWHID_TX_INTERVAL 1
  853. #define RAWHID_RX_ENDPOINT 6
  854. #define RAWHID_RX_SIZE 64
  855. #define RAWHID_RX_INTERVAL 1
  856. #define FLIGHTSIM_INTERFACE 6 // Flight Sim Control
  857. #define FLIGHTSIM_TX_ENDPOINT 9
  858. #define FLIGHTSIM_TX_SIZE 64
  859. #define FLIGHTSIM_TX_INTERVAL 1
  860. #define FLIGHTSIM_RX_ENDPOINT 9
  861. #define FLIGHTSIM_RX_SIZE 64
  862. #define FLIGHTSIM_RX_INTERVAL 1
  863. #define JOYSTICK_INTERFACE 7 // Joystick
  864. #define JOYSTICK_ENDPOINT 10
  865. #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
  866. #define JOYSTICK_INTERVAL 1
  867. /*
  868. #define MTP_INTERFACE 8 // MTP Disk
  869. #define MTP_TX_ENDPOINT 11
  870. #define MTP_TX_SIZE 64
  871. #define MTP_RX_ENDPOINT 3
  872. #define MTP_RX_SIZE 64
  873. #define MTP_EVENT_ENDPOINT 11
  874. #define MTP_EVENT_SIZE 16
  875. #define MTP_EVENT_INTERVAL 10
  876. */
  877. #define KEYMEDIA_INTERFACE 8 // Keyboard Media Keys
  878. #define KEYMEDIA_ENDPOINT 12
  879. #define KEYMEDIA_SIZE 8
  880. #define KEYMEDIA_INTERVAL 4
  881. #define AUDIO_INTERFACE 9 // Audio (uses 3 consecutive interfaces)
  882. #define AUDIO_TX_ENDPOINT 13
  883. #define AUDIO_TX_SIZE 180
  884. #define AUDIO_RX_ENDPOINT 13
  885. #define AUDIO_RX_SIZE 180
  886. #define AUDIO_SYNC_ENDPOINT 14
  887. #define MULTITOUCH_INTERFACE 12 // Touchscreen
  888. #define MULTITOUCH_ENDPOINT 15
  889. #define MULTITOUCH_SIZE 8
  890. #define MULTITOUCH_FINGERS 10
  891. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  892. #define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  893. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  894. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  895. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  896. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  897. #define ENDPOINT7_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  898. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ONLY
  899. #define ENDPOINT9_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  900. #define ENDPOINT10_CONFIG ENDPOINT_TRANSMIT_ONLY
  901. #define ENDPOINT11_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  902. #define ENDPOINT12_CONFIG ENDPOINT_TRANSMIT_ONLY
  903. #define ENDPOINT13_CONFIG (ENDPOINT_RECEIVE_ISOCHRONOUS|ENDPOINT_TRANSMIT_ISOCHRONOUS)
  904. #define ENDPOINT14_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  905. #define ENDPOINT15_CONFIG ENDPOINT_TRANSMIT_ONLY
  906. #endif
  907. #ifdef USB_DESC_LIST_DEFINE
  908. #if defined(NUM_ENDPOINTS) && NUM_ENDPOINTS > 0
  909. // NUM_ENDPOINTS = number of non-zero endpoints (0 to 15)
  910. extern const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS];
  911. typedef struct {
  912. uint16_t wValue;
  913. uint16_t wIndex;
  914. const uint8_t *addr;
  915. uint16_t length;
  916. } usb_descriptor_list_t;
  917. extern const usb_descriptor_list_t usb_descriptor_list[];
  918. #endif // NUM_ENDPOINTS
  919. #endif // USB_DESC_LIST_DEFINE
  920. #endif