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

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