選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

933 行
38KB

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