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.

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