Teensy 4.1 core updated for C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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