Teensy 4.1 core updated for C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

887 lines
34KB

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