You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 11 години
преди 7 години
преди 11 години
преди 10 години
преди 11 години
преди 10 години
преди 11 години
преди 6 години
преди 11 години
преди 11 години
преди 11 години
преди 11 години
преди 11 години
преди 11 години
преди 11 години
преди 6 години
преди 11 години
преди 6 години
преди 11 години
преди 8 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 11 години
преди 8 години
преди 11 години
преди 8 години
преди 11 години
преди 8 години
преди 11 години
преди 11 години
преди 6 години
преди 11 години
преди 6 години
преди 11 години
преди 11 години
преди 11 години
преди 11 години
преди 11 години
преди 6 години
преди 11 години
преди 6 години
преди 11 години
преди 6 години
преди 6 години
преди 8 години
преди 8 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 11 години
преди 7 години
преди 6 години
преди 7 години
преди 6 години
преди 7 години
преди 7 години
преди 7 години
преди 7 години
преди 6 години
преди 6 години
преди 11 години
преди 6 години
преди 11 години
преди 6 години
преди 11 години
преди 8 години
преди 8 години
преди 7 години
преди 6 години
преди 7 години
преди 6 години
преди 7 години
преди 7 години
преди 7 години
преди 7 години
преди 6 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 11 години
преди 11 години
преди 6 години
преди 11 години
преди 6 години
преди 11 години
преди 6 години
преди 11 години
преди 6 години
преди 11 години
преди 8 години
преди 8 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 9 години
преди 9 години
преди 6 години
преди 9 години
преди 4 години
преди 9 години
преди 6 години
преди 8 години
преди 8 години
преди 7 години
преди 6 години
преди 7 години
преди 6 години
преди 7 години
преди 7 години
преди 7 години
преди 7 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 8 години
преди 8 години
преди 8 години
преди 8 години
преди 8 години
преди 8 години
преди 8 години
преди 8 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 6 години
преди 8 години
преди 11 години
преди 11 години
преди 11 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  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 16
  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. // TODO: Should ENDPOINT4_CONFIG be ENDPOINT_TRANSMIT_ONLY ???
  700. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ONLY
  701. #elif defined(USB_AUDIO)
  702. #define VENDOR_ID 0x16C0
  703. #define PRODUCT_ID 0x04D2
  704. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  705. #define MANUFACTURER_NAME_LEN 11
  706. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','A','u','d','i','o'}
  707. #define PRODUCT_NAME_LEN 12
  708. #define EP0_SIZE 64
  709. #define NUM_ENDPOINTS 5
  710. #define NUM_USB_BUFFERS 16
  711. #define NUM_INTERFACE 4
  712. #define SEREMU_INTERFACE 0 // Serial emulation
  713. #define SEREMU_TX_ENDPOINT 1
  714. #define SEREMU_TX_SIZE 64
  715. #define SEREMU_TX_INTERVAL 1
  716. #define SEREMU_RX_ENDPOINT 2
  717. #define SEREMU_RX_SIZE 32
  718. #define SEREMU_RX_INTERVAL 2
  719. #define AUDIO_INTERFACE 1 // Audio (uses 3 consecutive interfaces)
  720. #define AUDIO_TX_ENDPOINT 3
  721. #define AUDIO_TX_SIZE 180
  722. #define AUDIO_RX_ENDPOINT 4
  723. #define AUDIO_RX_SIZE 180
  724. #define AUDIO_SYNC_ENDPOINT 5
  725. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  726. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  727. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  728. #define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS
  729. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  730. #elif defined(USB_MIDI_AUDIO_SERIAL)
  731. #define VENDOR_ID 0x16C0
  732. #define PRODUCT_ID 0x048A
  733. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  734. #define MANUFACTURER_NAME_LEN 11
  735. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','/','A','u','d','i','o'}
  736. #define PRODUCT_NAME_LEN 17
  737. #define EP0_SIZE 64
  738. #define NUM_ENDPOINTS 8
  739. #define NUM_USB_BUFFERS 30
  740. #define NUM_INTERFACE 6
  741. #define CDC_IAD_DESCRIPTOR 1
  742. #define CDC_STATUS_INTERFACE 0
  743. #define CDC_DATA_INTERFACE 1 // Serial
  744. #define CDC_ACM_ENDPOINT 1
  745. #define CDC_RX_ENDPOINT 2
  746. #define CDC_TX_ENDPOINT 3
  747. #define CDC_ACM_SIZE 16
  748. #define CDC_RX_SIZE 64
  749. #define CDC_TX_SIZE 64
  750. #define MIDI_INTERFACE 2 // MIDI
  751. #define MIDI_NUM_CABLES 1
  752. #define MIDI_TX_ENDPOINT 4
  753. #define MIDI_TX_SIZE 64
  754. #define MIDI_RX_ENDPOINT 5
  755. #define MIDI_RX_SIZE 64
  756. #define AUDIO_INTERFACE 3 // Audio (uses 3 consecutive interfaces)
  757. #define AUDIO_TX_ENDPOINT 6
  758. #define AUDIO_TX_SIZE 180
  759. #define AUDIO_RX_ENDPOINT 7
  760. #define AUDIO_RX_SIZE 180
  761. #define AUDIO_SYNC_ENDPOINT 8
  762. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  763. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  764. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  765. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  766. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  767. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  768. #define ENDPOINT7_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS
  769. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  770. #elif defined(USB_MIDI16_AUDIO_SERIAL)
  771. #define VENDOR_ID 0x16C0
  772. #define PRODUCT_ID 0x048A
  773. #define BCD_DEVICE 0x0212
  774. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  775. #define MANUFACTURER_NAME_LEN 11
  776. #define PRODUCT_NAME {'T','e','e','n','s','y',' ','M','I','D','I','x','1','6','/','A','u','d','i','o'}
  777. #define PRODUCT_NAME_LEN 20
  778. #define EP0_SIZE 64
  779. #define NUM_ENDPOINTS 8
  780. #define NUM_USB_BUFFERS 30
  781. #define NUM_INTERFACE 6
  782. #define CDC_IAD_DESCRIPTOR 1
  783. #define CDC_STATUS_INTERFACE 0
  784. #define CDC_DATA_INTERFACE 1 // Serial
  785. #define CDC_ACM_ENDPOINT 1
  786. #define CDC_RX_ENDPOINT 2
  787. #define CDC_TX_ENDPOINT 3
  788. #define CDC_ACM_SIZE 16
  789. #define CDC_RX_SIZE 64
  790. #define CDC_TX_SIZE 64
  791. #define MIDI_INTERFACE 2 // MIDI
  792. #define MIDI_NUM_CABLES 16
  793. #define MIDI_TX_ENDPOINT 4
  794. #define MIDI_TX_SIZE 64
  795. #define MIDI_RX_ENDPOINT 5
  796. #define MIDI_RX_SIZE 64
  797. #define AUDIO_INTERFACE 3 // Audio (uses 3 consecutive interfaces)
  798. #define AUDIO_TX_ENDPOINT 6
  799. #define AUDIO_TX_SIZE 180
  800. #define AUDIO_RX_ENDPOINT 7
  801. #define AUDIO_RX_SIZE 180
  802. #define AUDIO_SYNC_ENDPOINT 8
  803. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  804. #define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
  805. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_ONLY
  806. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  807. #define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_ONLY
  808. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  809. #define ENDPOINT7_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS
  810. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  811. #elif defined(USB_EVERYTHING)
  812. #define VENDOR_ID 0x16C0
  813. #define PRODUCT_ID 0x0476
  814. #define RAWHID_USAGE_PAGE 0xFFAB // recommended: 0xFF00 to 0xFFFF
  815. #define RAWHID_USAGE 0x0200 // recommended: 0x0100 to 0xFFFF
  816. #define DEVICE_CLASS 0xEF
  817. #define DEVICE_SUBCLASS 0x02
  818. #define DEVICE_PROTOCOL 0x01
  819. #define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
  820. #define MANUFACTURER_NAME_LEN 11
  821. #define PRODUCT_NAME {'A','l','l',' ','T','h','e',' ','T','h','i','n','g','s'}
  822. #define PRODUCT_NAME_LEN 14
  823. #define EP0_SIZE 64
  824. #define NUM_ENDPOINTS 15
  825. #define NUM_USB_BUFFERS 31
  826. #define NUM_INTERFACE 13
  827. #define CDC_IAD_DESCRIPTOR 1
  828. #define CDC_STATUS_INTERFACE 0
  829. #define CDC_DATA_INTERFACE 1 // Serial
  830. #define CDC_ACM_ENDPOINT 1
  831. #define CDC_RX_ENDPOINT 2
  832. #define CDC_TX_ENDPOINT 2
  833. #define CDC_ACM_SIZE 16
  834. #define CDC_RX_SIZE 64
  835. #define CDC_TX_SIZE 64
  836. #define MIDI_INTERFACE 2 // MIDI
  837. #define MIDI_NUM_CABLES 16
  838. #define MIDI_TX_ENDPOINT 3
  839. #define MIDI_TX_SIZE 64
  840. #define MIDI_RX_ENDPOINT 3
  841. #define MIDI_RX_SIZE 64
  842. #define KEYBOARD_INTERFACE 3 // Keyboard
  843. #define KEYBOARD_ENDPOINT 4
  844. #define KEYBOARD_SIZE 8
  845. #define KEYBOARD_INTERVAL 1
  846. #define MOUSE_INTERFACE 4 // Mouse
  847. #define MOUSE_ENDPOINT 5
  848. #define MOUSE_SIZE 8
  849. #define MOUSE_INTERVAL 2
  850. #define RAWHID_INTERFACE 5 // RawHID
  851. #define RAWHID_TX_ENDPOINT 6
  852. #define RAWHID_TX_SIZE 64
  853. #define RAWHID_TX_INTERVAL 1
  854. #define RAWHID_RX_ENDPOINT 6
  855. #define RAWHID_RX_SIZE 64
  856. #define RAWHID_RX_INTERVAL 1
  857. #define FLIGHTSIM_INTERFACE 6 // Flight Sim Control
  858. #define FLIGHTSIM_TX_ENDPOINT 9
  859. #define FLIGHTSIM_TX_SIZE 64
  860. #define FLIGHTSIM_TX_INTERVAL 1
  861. #define FLIGHTSIM_RX_ENDPOINT 9
  862. #define FLIGHTSIM_RX_SIZE 64
  863. #define FLIGHTSIM_RX_INTERVAL 1
  864. #define JOYSTICK_INTERFACE 7 // Joystick
  865. #define JOYSTICK_ENDPOINT 10
  866. #define JOYSTICK_SIZE 12 // 12 = normal, 64 = extreme joystick
  867. #define JOYSTICK_INTERVAL 1
  868. /*
  869. #define MTP_INTERFACE 8 // MTP Disk
  870. #define MTP_TX_ENDPOINT 11
  871. #define MTP_TX_SIZE 64
  872. #define MTP_RX_ENDPOINT 3
  873. #define MTP_RX_SIZE 64
  874. #define MTP_EVENT_ENDPOINT 11
  875. #define MTP_EVENT_SIZE 16
  876. #define MTP_EVENT_INTERVAL 10
  877. */
  878. #define KEYMEDIA_INTERFACE 8 // Keyboard Media Keys
  879. #define KEYMEDIA_ENDPOINT 12
  880. #define KEYMEDIA_SIZE 8
  881. #define KEYMEDIA_INTERVAL 4
  882. #define AUDIO_INTERFACE 9 // Audio (uses 3 consecutive interfaces)
  883. #define AUDIO_TX_ENDPOINT 13
  884. #define AUDIO_TX_SIZE 180
  885. #define AUDIO_RX_ENDPOINT 13
  886. #define AUDIO_RX_SIZE 180
  887. #define AUDIO_SYNC_ENDPOINT 14
  888. #define MULTITOUCH_INTERFACE 12 // Touchscreen
  889. #define MULTITOUCH_ENDPOINT 15
  890. #define MULTITOUCH_SIZE 8
  891. #define MULTITOUCH_FINGERS 10
  892. #define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
  893. #define ENDPOINT2_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  894. #define ENDPOINT3_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  895. #define ENDPOINT4_CONFIG ENDPOINT_TRANSMIT_ONLY
  896. #define ENDPOINT5_CONFIG ENDPOINT_TRANSMIT_ONLY
  897. #define ENDPOINT6_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  898. #define ENDPOINT7_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  899. #define ENDPOINT8_CONFIG ENDPOINT_TRANSMIT_ONLY
  900. #define ENDPOINT9_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  901. #define ENDPOINT10_CONFIG ENDPOINT_TRANSMIT_ONLY
  902. #define ENDPOINT11_CONFIG ENDPOINT_TRANSMIT_AND_RECEIVE
  903. #define ENDPOINT12_CONFIG ENDPOINT_TRANSMIT_ONLY
  904. #define ENDPOINT13_CONFIG (ENDPOINT_RECEIVE_ISOCHRONOUS|ENDPOINT_TRANSMIT_ISOCHRONOUS)
  905. #define ENDPOINT14_CONFIG ENDPOINT_TRANSMIT_ISOCHRONOUS
  906. #define ENDPOINT15_CONFIG ENDPOINT_TRANSMIT_ONLY
  907. #endif
  908. #ifdef USB_DESC_LIST_DEFINE
  909. #if defined(NUM_ENDPOINTS) && NUM_ENDPOINTS > 0
  910. // NUM_ENDPOINTS = number of non-zero endpoints (0 to 15)
  911. extern const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS];
  912. typedef struct {
  913. uint16_t wValue;
  914. uint16_t wIndex;
  915. const uint8_t *addr;
  916. uint16_t length;
  917. } usb_descriptor_list_t;
  918. extern const usb_descriptor_list_t usb_descriptor_list[];
  919. #endif // NUM_ENDPOINTS
  920. #endif // USB_DESC_LIST_DEFINE
  921. #endif