usb_common.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. /*
  2. * File : usb_common.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2012, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2012-10-01 Yi Qiu first version
  23. * 2013-04-26 aozima add DEVICEQUALIFIER support.
  24. * 2017-11-15 ZYH fix ep0 transform error
  25. */
  26. #ifndef __USB_COMMON_H__
  27. #define __USB_COMMON_H__
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #include <rtthread.h>
  32. #define RT_DEBUG_USB 0x00
  33. #define USB_DYNAMIC 0x00
  34. #define USB_CLASS_DEVICE 0x00
  35. #define USB_CLASS_AUDIO 0x01
  36. #define USB_CLASS_CDC 0x02
  37. #define USB_CLASS_HID 0x03
  38. #define USB_CLASS_PHYSICAL 0x05
  39. #define USB_CLASS_IMAGE 0x06
  40. #define USB_CLASS_PRINTER 0x07
  41. #define USB_CLASS_MASS_STORAGE 0x08
  42. #define USB_CLASS_HUB 0x09
  43. #define USB_CLASS_CDC_DATA 0x0a
  44. #define USB_CLASS_SMART_CARD 0x0b
  45. #define USB_CLASS_SECURITY 0x0d
  46. #define USB_CLASS_VIDEO 0x0e
  47. #define USB_CLASS_HEALTHCARE 0x0f
  48. #define USB_CLASS_DIAG_DEVICE 0xdc
  49. #define USB_CLASS_WIRELESS 0xe0
  50. #define USB_CLASS_MISC 0xef
  51. #define USB_CLASS_APP_SPECIFIC 0xfe
  52. #define USB_CLASS_VEND_SPECIFIC 0xff
  53. #define USB_DESC_TYPE_DEVICE 0x01
  54. #define USB_DESC_TYPE_CONFIGURATION 0x02
  55. #define USB_DESC_TYPE_STRING 0x03
  56. #define USB_DESC_TYPE_INTERFACE 0x04
  57. #define USB_DESC_TYPE_ENDPOINT 0x05
  58. #define USB_DESC_TYPE_DEVICEQUALIFIER 0x06
  59. #define USB_DESC_TYPE_OTHERSPEED 0x07
  60. #define USB_DESC_TYPE_IAD 0x0b
  61. #define USB_DESC_TYPE_HID 0x21
  62. #define USB_DESC_TYPE_REPORT 0x22
  63. #define USB_DESC_TYPE_PHYSICAL 0x23
  64. #define USB_DESC_TYPE_HUB 0x29
  65. #define USB_DESC_LENGTH_DEVICE 0x12
  66. #define USB_DESC_LENGTH_CONFIG 0x9
  67. #define USB_DESC_LENGTH_IAD 0x8
  68. #define USB_DESC_LENGTH_STRING 0x4
  69. #define USB_DESC_LENGTH_INTERFACE 0x9
  70. #define USB_DESC_LENGTH_ENDPOINT 0x7
  71. #define USB_REQ_TYPE_STANDARD 0x00
  72. #define USB_REQ_TYPE_CLASS 0x20
  73. #define USB_REQ_TYPE_VENDOR 0x40
  74. #define USB_REQ_TYPE_MASK 0x60
  75. #define USB_REQ_TYPE_DIR_OUT 0x00
  76. #define USB_REQ_TYPE_DIR_IN 0x80
  77. #define USB_REQ_TYPE_DEVICE 0x00
  78. #define USB_REQ_TYPE_INTERFACE 0x01
  79. #define USB_REQ_TYPE_ENDPOINT 0x02
  80. #define USB_REQ_TYPE_OTHER 0x03
  81. #define USB_REQ_TYPE_RECIPIENT_MASK 0x1f
  82. #define USB_FEATURE_ENDPOINT_HALT 0x00
  83. #define USB_FEATURE_DEV_REMOTE_WAKEUP 0x01
  84. #define USB_FEATURE_TEST_MODE 0x02
  85. #define USB_REQ_GET_STATUS 0x00
  86. #define USB_REQ_CLEAR_FEATURE 0x01
  87. #define USB_REQ_SET_FEATURE 0x03
  88. #define USB_REQ_SET_ADDRESS 0x05
  89. #define USB_REQ_GET_DESCRIPTOR 0x06
  90. #define USB_REQ_SET_DESCRIPTOR 0x07
  91. #define USB_REQ_GET_CONFIGURATION 0x08
  92. #define USB_REQ_SET_CONFIGURATION 0x09
  93. #define USB_REQ_GET_INTERFACE 0x0A
  94. #define USB_REQ_SET_INTERFACE 0x0B
  95. #define USB_REQ_SYNCH_FRAME 0x0C
  96. #define USB_REQ_SET_ENCRYPTION 0x0D
  97. #define USB_REQ_GET_ENCRYPTION 0x0E
  98. #define USB_REQ_RPIPE_ABORT 0x0E
  99. #define USB_REQ_SET_HANDSHAKE 0x0F
  100. #define USB_REQ_RPIPE_RESET 0x0F
  101. #define USB_REQ_GET_HANDSHAKE 0x10
  102. #define USB_REQ_SET_CONNECTION 0x11
  103. #define USB_REQ_SET_SECURITY_DATA 0x12
  104. #define USB_REQ_GET_SECURITY_DATA 0x13
  105. #define USB_REQ_SET_WUSB_DATA 0x14
  106. #define USB_REQ_LOOPBACK_DATA_WRITE 0x15
  107. #define USB_REQ_LOOPBACK_DATA_READ 0x16
  108. #define USB_REQ_SET_INTERFACE_DS 0x17
  109. #define USB_STRING_LANGID_INDEX 0x00
  110. #define USB_STRING_MANU_INDEX 0x01
  111. #define USB_STRING_PRODUCT_INDEX 0x02
  112. #define USB_STRING_SERIAL_INDEX 0x03
  113. #define USB_STRING_CONFIG_INDEX 0x04
  114. #define USB_STRING_INTERFACE_INDEX 0x05
  115. #define USB_STRING_OS_INDEX 0x06
  116. #define USB_STRING_MAX USB_STRING_OS_INDEX
  117. #define USB_STRING_OS "MSFT100A"
  118. #define USB_PID_OUT 0x01
  119. #define USB_PID_ACK 0x02
  120. #define USB_PID_DATA0 0x03
  121. #define USB_PID_SOF 0x05
  122. #define USB_PID_IN 0x09
  123. #define USB_PID_NACK 0x0A
  124. #define USB_PID_DATA1 0x0B
  125. #define USB_PID_PRE 0x0C
  126. #define USB_PID_SETUP 0x0D
  127. #define USB_PID_STALL 0x0E
  128. #define USB_EP_DESC_OUT 0x00
  129. #define USB_EP_DESC_IN 0x80
  130. #define USB_EP_DESC_NUM_MASK 0x0f
  131. #define USB_EP_ATTR_CONTROL 0x00
  132. #define USB_EP_ATTR_ISOC 0x01
  133. #define USB_EP_ATTR_BULK 0x02
  134. #define USB_EP_ATTR_INT 0x03
  135. #define USB_EP_ATTR_TYPE_MASK 0x03
  136. #define USB_EPNO_MASK 0x7f
  137. #define USB_DIR_OUT 0x00
  138. #define USB_DIR_IN 0x80
  139. #define USB_DIR_INOUT 0x40
  140. #define USB_DIR_MASK 0x80
  141. #define ID_UNASSIGNED 0
  142. #define ID_ASSIGNED 1
  143. #define RH_GET_PORT_STATUS 0
  144. #define RH_SET_PORT_STATUS 1
  145. #define RH_CLEAR_PORT_FEATURE 2
  146. #define RH_SET_PORT_FEATURE 3
  147. #define USB_BUS_POWERED 0
  148. #define USB_SELF_POWERED 1
  149. #define USB_REMOTE_WAKEUP 1
  150. #define USB_EP_HALT 0
  151. /*
  152. * Port feature numbers
  153. */
  154. #define PORT_FEAT_CONNECTION 0
  155. #define PORT_FEAT_ENABLE 1
  156. #define PORT_FEAT_SUSPEND 2
  157. #define PORT_FEAT_OVER_CURRENT 3
  158. #define PORT_FEAT_RESET 4
  159. #define PORT_FEAT_POWER 8
  160. #define PORT_FEAT_LOWSPEED 9
  161. #define PORT_FEAT_HIGHSPEED 10
  162. #define PORT_FEAT_C_CONNECTION 16
  163. #define PORT_FEAT_C_ENABLE 17
  164. #define PORT_FEAT_C_SUSPEND 18
  165. #define PORT_FEAT_C_OVER_CURRENT 19
  166. #define PORT_FEAT_C_RESET 20
  167. /*
  168. The HcRhPortStatus[1:NDP] register is used to control and report port events on a per-port
  169. basis. NumberDownstreamPorts represents the number of HcRhPortStatus registers that are
  170. implemented in hardware. The lower word is used to reflect the port status, whereas the upper
  171. word reflects the status change bits. Some status bits are implemented with special write behavior
  172. (see below). If a transaction (token through handshake) is in progress when a write to change
  173. port status occurs, the resulting port status change must be postponed until the transaction
  174. completes. Reserved bits should always be written '0'.
  175. */
  176. #define PORT_CCS 0x00000001UL /* R:CurrentConnectStatus - W:ClearPortEnable */
  177. #define PORT_PES 0x00000002UL /* R:PortEnableStatus - W:SetPortEnable */
  178. #define PORT_PSS 0x00000004UL /* R:PortSuspendStatus - W:SetPortSuspend */
  179. #define PORT_POCI 0x00000008UL /* R:PortOverCurrentIndicator - W:ClearSuspendStatus */
  180. #define PORT_PRS 0x00000010UL /* R:PortResetStatus - W: SetPortReset */
  181. #define PORT_PPS 0x00000100UL /* R:PortPowerStatus - W: SetPortPower */
  182. #define PORT_LSDA 0x00000200UL /* R:LowSpeedDeviceAttached - W:ClearPortPower */
  183. #define PORT_CCSC 0x00010000UL
  184. #define PORT_PESC 0x00020000UL
  185. #define PORT_PSSC 0x00040000UL
  186. #define PORT_POCIC 0x00080000UL
  187. #define PORT_PRSC 0x00100000UL
  188. /*
  189. *Hub Status & Hub Change bit masks
  190. */
  191. #define HUB_STATUS_LOCAL_POWER 0x0001
  192. #define HUB_STATUS_OVERCURRENT 0x0002
  193. #define HUB_CHANGE_LOCAL_POWER 0x0001
  194. #define HUB_CHANGE_OVERCURRENT 0x0002
  195. #define USB_EP_ATTR(attr) (attr & USB_EP_ATTR_TYPE_MASK)
  196. #define USB_EP_DESC_NUM(addr) (addr & USB_EP_DESC_NUM_MASK)
  197. #define USB_EP_DIR(addr) ((addr & USB_DIR_MASK)>>7)
  198. #ifdef RT_USB_DEVICE_HID
  199. #ifdef RT_USB_DEVICE_HID_KEYBOARD
  200. #define HID_REPORT_ID_KEYBOARD1 1
  201. #if RT_USB_DEVICE_HID_KEYBOARD_NUMBER>1
  202. #define HID_REPORT_ID_KEYBOARD2 2
  203. #if RT_USB_DEVICE_HID_KEYBOARD_NUMBER>2
  204. #define HID_REPORT_ID_KEYBOARD3 3
  205. #endif
  206. #endif
  207. #endif
  208. #ifdef RT_USB_DEVICE_HID_MEDIA
  209. #define HID_REPORT_ID_MEDIA 4
  210. #endif
  211. #ifdef RT_USB_DEVICE_HID_GENERAL
  212. #define HID_REPORT_ID_GENERAL 5
  213. #endif
  214. #ifdef RT_USB_DEVICE_HID_MOUSE
  215. #define HID_REPORT_ID_MOUSE 6
  216. #endif
  217. #endif
  218. #define uswap_32(x) \
  219. ((((x) & 0xff000000) >> 24) | \
  220. (((x) & 0x00ff0000) >> 8) | \
  221. (((x) & 0x0000ff00) << 8) | \
  222. (((x) & 0x000000ff) << 24))
  223. #define uswap_8(x) \
  224. (((rt_uint16_t)(*((rt_uint8_t *)(x)))) + \
  225. (((rt_uint16_t)(*(((rt_uint8_t *)(x)) + 1))) << 8))
  226. typedef void (*func_callback)(void *context);
  227. typedef enum
  228. {
  229. USB_STATE_NOTATTACHED = 0,
  230. USB_STATE_ATTACHED,
  231. USB_STATE_POWERED,
  232. USB_STATE_RECONNECTING,
  233. USB_STATE_UNAUTHENTICATED,
  234. USB_STATE_DEFAULT,
  235. USB_STATE_ADDRESS,
  236. USB_STATE_CONFIGURED,
  237. USB_STATE_SUSPENDED
  238. }udevice_state_t;
  239. typedef enum
  240. {
  241. STAGE_IDLE,
  242. STAGE_SETUP,
  243. STAGE_STATUS_IN,
  244. STAGE_STATUS_OUT,
  245. STAGE_DIN,
  246. STAGE_DOUT
  247. } uep0_stage_t;
  248. #pragma pack(1)
  249. struct usb_descriptor
  250. {
  251. rt_uint8_t bLength;
  252. rt_uint8_t type;
  253. };
  254. typedef struct usb_descriptor* udesc_t;
  255. struct udevice_descriptor
  256. {
  257. rt_uint8_t bLength;
  258. rt_uint8_t type;
  259. rt_uint16_t bcdUSB;
  260. rt_uint8_t bDeviceClass;
  261. rt_uint8_t bDeviceSubClass;
  262. rt_uint8_t bDeviceProtocol;
  263. rt_uint8_t bMaxPacketSize0;
  264. rt_uint16_t idVendor;
  265. rt_uint16_t idProduct;
  266. rt_uint16_t bcdDevice;
  267. rt_uint8_t iManufacturer;
  268. rt_uint8_t iProduct;
  269. rt_uint8_t iSerialNumber;
  270. rt_uint8_t bNumConfigurations;
  271. };
  272. typedef struct udevice_descriptor* udev_desc_t;
  273. struct uconfig_descriptor
  274. {
  275. rt_uint8_t bLength;
  276. rt_uint8_t type;
  277. rt_uint16_t wTotalLength;
  278. rt_uint8_t bNumInterfaces;
  279. rt_uint8_t bConfigurationValue;
  280. rt_uint8_t iConfiguration;
  281. rt_uint8_t bmAttributes;
  282. rt_uint8_t MaxPower;
  283. rt_uint8_t data[256];
  284. };
  285. typedef struct uconfig_descriptor* ucfg_desc_t;
  286. struct uinterface_descriptor
  287. {
  288. rt_uint8_t bLength;
  289. rt_uint8_t type;
  290. rt_uint8_t bInterfaceNumber;
  291. rt_uint8_t bAlternateSetting;
  292. rt_uint8_t bNumEndpoints;
  293. rt_uint8_t bInterfaceClass;
  294. rt_uint8_t bInterfaceSubClass;
  295. rt_uint8_t bInterfaceProtocol;
  296. rt_uint8_t iInterface;
  297. };
  298. typedef struct uinterface_descriptor* uintf_desc_t;
  299. /* Interface Association Descriptor (IAD) */
  300. struct uiad_descriptor
  301. {
  302. rt_uint8_t bLength;
  303. rt_uint8_t bDescriptorType;
  304. rt_uint8_t bFirstInterface;
  305. rt_uint8_t bInterfaceCount;
  306. rt_uint8_t bFunctionClass;
  307. rt_uint8_t bFunctionSubClass;
  308. rt_uint8_t bFunctionProtocol;
  309. rt_uint8_t iFunction;
  310. };
  311. typedef struct uiad_descriptor* uiad_desc_t;
  312. struct uendpoint_descriptor
  313. {
  314. rt_uint8_t bLength;
  315. rt_uint8_t type;
  316. rt_uint8_t bEndpointAddress;
  317. rt_uint8_t bmAttributes;
  318. rt_uint16_t wMaxPacketSize;
  319. rt_uint8_t bInterval;
  320. };
  321. typedef struct uendpoint_descriptor* uep_desc_t;
  322. struct ustring_descriptor
  323. {
  324. rt_uint8_t bLength;
  325. rt_uint8_t type;
  326. rt_uint8_t String[64];
  327. };
  328. typedef struct ustring_descriptor* ustr_desc_t;
  329. struct uhub_descriptor
  330. {
  331. rt_uint8_t length;
  332. rt_uint8_t type;
  333. rt_uint8_t num_ports;
  334. rt_uint16_t characteristics;
  335. rt_uint8_t pwron_to_good; /* power on to power good */
  336. rt_uint8_t current;
  337. rt_uint8_t removable[8];
  338. rt_uint8_t pwr_ctl[8];
  339. };
  340. typedef struct uhub_descriptor* uhub_desc_t;
  341. /* USB_DESC_TYPE_DEVICEQUALIFIER: Device Qualifier descriptor */
  342. struct usb_qualifier_descriptor
  343. {
  344. rt_uint8_t bLength;
  345. rt_uint8_t bDescriptorType;
  346. rt_uint16_t bcdUSB; // TODO: big-endian.
  347. rt_uint8_t bDeviceClass;
  348. rt_uint8_t bDeviceSubClass;
  349. rt_uint8_t bDeviceProtocol;
  350. rt_uint8_t bMaxPacketSize0;
  351. rt_uint8_t bNumConfigurations;
  352. rt_uint8_t bRESERVED;
  353. } __attribute__ ((packed));
  354. struct usb_os_header_comp_id_descriptor
  355. {
  356. rt_uint32_t dwLength;
  357. rt_uint16_t bcdVersion;
  358. rt_uint16_t wIndex;
  359. rt_uint8_t bCount;
  360. rt_uint8_t reserved[7];
  361. };
  362. typedef struct usb_os_header_comp_id_descriptor * usb_os_header_desc_t;
  363. struct usb_os_function_comp_id_descriptor
  364. {
  365. rt_list_t list;
  366. rt_uint8_t bFirstInterfaceNumber;
  367. rt_uint8_t reserved1;
  368. rt_uint8_t compatibleID[8];
  369. rt_uint8_t subCompatibleID[8];
  370. rt_uint8_t reserved2[6];
  371. };
  372. typedef struct usb_os_function_comp_id_descriptor * usb_os_func_comp_id_desc_t;
  373. struct usb_os_comp_id_descriptor
  374. {
  375. struct usb_os_header_comp_id_descriptor head_desc;
  376. rt_list_t func_desc;
  377. };
  378. typedef struct usb_os_comp_id_descriptor * usb_os_comp_id_desc_t;
  379. #ifndef HID_SUB_DESCRIPTOR_MAX
  380. #define HID_SUB_DESCRIPTOR_MAX 1
  381. #endif
  382. #ifdef RT_USB_DEVICE_HID
  383. struct uhid_descriptor
  384. {
  385. rt_uint8_t bLength;
  386. rt_uint8_t type;
  387. rt_uint16_t bcdHID;
  388. rt_uint8_t bCountryCode;
  389. rt_uint8_t bNumDescriptors;
  390. struct hid_descriptor_list
  391. {
  392. rt_uint8_t type;
  393. rt_uint16_t wLength;
  394. }Descriptor[HID_SUB_DESCRIPTOR_MAX];
  395. };
  396. typedef struct uhid_descriptor* uhid_desc_t;
  397. struct hid_report
  398. {
  399. rt_uint8_t report_id;
  400. rt_uint8_t report[63];
  401. rt_uint8_t size;
  402. };
  403. typedef struct hid_report* hid_report_t;
  404. extern void HID_Report_Received(hid_report_t report);
  405. #endif
  406. struct urequest
  407. {
  408. rt_uint8_t request_type;
  409. rt_uint8_t bRequest;
  410. rt_uint16_t wValue;
  411. rt_uint16_t wIndex;
  412. rt_uint16_t wLength;
  413. };
  414. typedef struct urequest* ureq_t;
  415. #ifndef MIN
  416. #define MIN(a, b) (a < b ? a : b)
  417. #endif
  418. #ifndef MAX
  419. #define MAX(a, b) (a > b ? a : b)
  420. #endif
  421. /*
  422. * the define related to mass storage
  423. */
  424. #define USBREQ_GET_MAX_LUN 0xfe
  425. #define USBREQ_MASS_STORAGE_RESET 0xff
  426. #define SIZEOF_CSW 0x0d
  427. #define SIZEOF_CBW 0x1f
  428. #define SIZEOF_INQUIRY_CMD 0x24
  429. #define SIZEOF_MODE_SENSE_6 0x4
  430. #define SIZEOF_READ_CAPACITIES 0xc
  431. #define SIZEOF_READ_CAPACITY 0x8
  432. #define SIZEOF_REQUEST_SENSE 0x12
  433. #define CBWFLAGS_DIR_M 0x80
  434. #define CBWFLAGS_DIR_IN 0x80
  435. #define CBWFLAGS_DIR_OUT 0x00
  436. #define SCSI_TEST_UNIT_READY 0x00
  437. #define SCSI_REQUEST_SENSE 0x03
  438. #define SCSI_INQUIRY_CMD 0x12
  439. #define SCSI_ALLOW_REMOVAL 0x1e
  440. #define SCSI_MODE_SENSE_6 0x1a
  441. #define SCSI_START_STOP 0x1b
  442. #define SCSI_READ_CAPACITIES 0x23
  443. #define SCSI_READ_CAPACITY 0x25
  444. #define SCSI_READ_10 0x28
  445. #define SCSI_WRITE_10 0x2a
  446. #define SCSI_VERIFY_10 0x2f
  447. #define CBW_SIGNATURE 0x43425355
  448. #define CSW_SIGNATURE 0x53425355
  449. #define CBW_TAG_VALUE 0x12345678
  450. struct ustorage_cbw
  451. {
  452. rt_uint32_t signature;
  453. rt_uint32_t tag;
  454. rt_uint32_t xfer_len;
  455. rt_uint8_t dflags;
  456. rt_uint8_t lun;
  457. rt_uint8_t cb_len;
  458. rt_uint8_t cb[16];
  459. };
  460. typedef struct ustorage_cbw* ustorage_cbw_t;
  461. struct ustorage_csw
  462. {
  463. rt_uint32_t signature;
  464. rt_uint32_t tag;
  465. rt_int32_t data_reside;
  466. rt_uint8_t status;
  467. };
  468. typedef struct ustorage_csw* ustorage_csw_t;
  469. #pragma pack()
  470. /*
  471. * USB device event loop thread configurations
  472. */
  473. /* the stack size of USB thread */
  474. #ifndef RT_USBD_THREAD_STACK_SZ
  475. #define RT_USBD_THREAD_STACK_SZ 2048
  476. #endif
  477. /* the priority of USB thread */
  478. #ifndef RT_USBD_THREAD_PRIO
  479. #define RT_USBD_THREAD_PRIO 8
  480. #endif
  481. #ifdef __cplusplus
  482. }
  483. #endif
  484. #endif