usbd_cdc.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. /**
  2. * @file
  3. * @brief USB Communications Device Class (CDC) public header
  4. *
  5. * Header follows the Class Definitions for
  6. * Communications Devices Specification (CDC120-20101103-track.pdf),
  7. * PSTN Devices Specification (PSTN120.pdf) and
  8. * Ethernet Control Model Devices Specification (ECM120.pdf).
  9. * Header is limited to ACM and ECM Subclasses.
  10. */
  11. #ifndef _USBD_CDC_H
  12. #define _USBD_CDC_H
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /*------------------------------------------------------------------------------
  17. * Definitions based on usbcdc11.pdf (www.usb.org)
  18. *----------------------------------------------------------------------------*/
  19. /* Communication device class specification version 1.10 */
  20. #define CDC_V1_10 0x0110U
  21. // Communication device class specification version 1.2
  22. #define CDC_V1_2_0 0x0120U
  23. /* Communication interface class code */
  24. /* (usbcdc11.pdf, 4.2, Table 15) */
  25. #define CDC_COMMUNICATION_INTERFACE_CLASS 0x02U
  26. /* Communication interface class subclass codes */
  27. /* (usbcdc11.pdf, 4.3, Table 16) */
  28. #define CDC_DIRECT_LINE_CONTROL_MODEL 0x01U
  29. #define CDC_ABSTRACT_CONTROL_MODEL 0x02U
  30. #define CDC_TELEPHONE_CONTROL_MODEL 0x03U
  31. #define CDC_MULTI_CHANNEL_CONTROL_MODEL 0x04U
  32. #define CDC_CAPI_CONTROL_MODEL 0x05U
  33. #define CDC_ETHERNET_NETWORKING_CONTROL_MODEL 0x06U
  34. #define CDC_ATM_NETWORKING_CONTROL_MODEL 0x07U
  35. #define CDC_WIRELESS_HANDSET_CONTROL_MODEL 0x08U
  36. #define CDC_DEVICE_MANAGEMENT 0x09U
  37. #define CDC_MOBILE_DIRECT_LINE_MODEL 0x0AU
  38. #define CDC_OBEX 0x0BU
  39. #define CDC_ETHERNET_EMULATION_MODEL 0x0CU
  40. #define CDC_NETWORK_CONTROL_MODEL 0x0DU
  41. /* Communication interface class control protocol codes */
  42. /* (usbcdc11.pdf, 4.4, Table 17) */
  43. #define CDC_COMMON_PROTOCOL_NONE 0x00U
  44. #define CDC_COMMON_PROTOCOL_AT_COMMANDS 0x01U
  45. #define CDC_COMMON_PROTOCOL_AT_COMMANDS_PCCA_101 0x02U
  46. #define CDC_COMMON_PROTOCOL_AT_COMMANDS_PCCA_101_AND_ANNEXO 0x03U
  47. #define CDC_COMMON_PROTOCOL_AT_COMMANDS_GSM_707 0x04U
  48. #define CDC_COMMON_PROTOCOL_AT_COMMANDS_3GPP_27007 0x05U
  49. #define CDC_COMMON_PROTOCOL_AT_COMMANDS_CDMA 0x06U
  50. #define CDC_COMMON_PROTOCOL_ETHERNET_EMULATION_MODEL 0x07U
  51. // NCM Communication Interface Protocol Codes
  52. // (usbncm10.pdf, 4.2, Table 4-2)
  53. #define CDC_NCM_PROTOCOL_NONE 0x00U
  54. #define CDC_NCM_PROTOCOL_OEM 0xFEU
  55. /* Data interface class code */
  56. /* (usbcdc11.pdf, 4.5, Table 18) */
  57. #define CDC_DATA_INTERFACE_CLASS 0x0A
  58. /* Data interface class protocol codes */
  59. /* (usbcdc11.pdf, 4.7, Table 19) */
  60. #define CDC_DATA_PROTOCOL_ISDN_BRI 0x30
  61. #define CDC_DATA_PROTOCOL_HDLC 0x31
  62. #define CDC_DATA_PROTOCOL_TRANSPARENT 0x32
  63. #define CDC_DATA_PROTOCOL_Q921_MANAGEMENT 0x50
  64. #define CDC_DATA_PROTOCOL_Q921_DATA_LINK 0x51
  65. #define CDC_DATA_PROTOCOL_Q921_MULTIPLEXOR 0x52
  66. #define CDC_DATA_PROTOCOL_V42 0x90
  67. #define CDC_DATA_PROTOCOL_EURO_ISDN 0x91
  68. #define CDC_DATA_PROTOCOL_V24_RATE_ADAPTATION 0x92
  69. #define CDC_DATA_PROTOCOL_CAPI 0x93
  70. #define CDC_DATA_PROTOCOL_HOST_BASED_DRIVER 0xFD
  71. #define CDC_DATA_PROTOCOL_DESCRIBED_IN_PUFD 0xFE
  72. /* Type values for bDescriptorType field of functional descriptors */
  73. /* (usbcdc11.pdf, 5.2.3, Table 24) */
  74. #define CDC_CS_INTERFACE 0x24
  75. #define CDC_CS_ENDPOINT 0x25
  76. /* Type values for bDescriptorSubtype field of functional descriptors */
  77. /* (usbcdc11.pdf, 5.2.3, Table 25) */
  78. #define CDC_FUNC_DESC_HEADER 0x00
  79. #define CDC_FUNC_DESC_CALL_MANAGEMENT 0x01
  80. #define CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT 0x02
  81. #define CDC_FUNC_DESC_DIRECT_LINE_MANAGEMENT 0x03
  82. #define CDC_FUNC_DESC_TELEPHONE_RINGER 0x04
  83. #define CDC_FUNC_DESC_REPORTING_CAPABILITIES 0x05
  84. #define CDC_FUNC_DESC_UNION 0x06
  85. #define CDC_FUNC_DESC_COUNTRY_SELECTION 0x07
  86. #define CDC_FUNC_DESC_TELEPHONE_OPERATIONAL_MODES 0x08
  87. #define CDC_FUNC_DESC_USB_TERMINAL 0x09
  88. #define CDC_FUNC_DESC_NETWORK_CHANNEL 0x0A
  89. #define CDC_FUNC_DESC_PROTOCOL_UNIT 0x0B
  90. #define CDC_FUNC_DESC_EXTENSION_UNIT 0x0C
  91. #define CDC_FUNC_DESC_MULTI_CHANNEL_MANAGEMENT 0x0D
  92. #define CDC_FUNC_DESC_CAPI_CONTROL_MANAGEMENT 0x0E
  93. #define CDC_FUNC_DESC_ETHERNET_NETWORKING 0x0F
  94. #define CDC_FUNC_DESC_ATM_NETWORKING 0x10
  95. #define CDC_FUNC_DESC_WIRELESS_HANDSET_CONTROL_MODEL 0x11
  96. #define CDC_FUNC_DESC_MOBILE_DIRECT_LINE_MODEL 0x12
  97. #define CDC_FUNC_DESC_MOBILE_DIRECT_LINE_MODEL_DETAIL 0x13
  98. #define CDC_FUNC_DESC_DEVICE_MANAGEMENT_MODEL 0x14
  99. #define CDC_FUNC_DESC_OBEX 0x15
  100. #define CDC_FUNC_DESC_COMMAND_SET 0x16
  101. #define CDC_FUNC_DESC_COMMAND_SET_DETAIL 0x17
  102. #define CDC_FUNC_DESC_TELEPHONE_CONTROL_MODEL 0x18
  103. #define CDC_FUNC_DESC_OBEX_SERVICE_IDENTIFIER 0x19
  104. /* CDC class-specific request codes */
  105. /* (usbcdc11.pdf, 6.2, Table 46) */
  106. /* see Table 45 for info about the specific requests. */
  107. #define CDC_REQUEST_SEND_ENCAPSULATED_COMMAND 0x00
  108. #define CDC_REQUEST_GET_ENCAPSULATED_RESPONSE 0x01
  109. #define CDC_REQUEST_SET_COMM_FEATURE 0x02
  110. #define CDC_REQUEST_GET_COMM_FEATURE 0x03
  111. #define CDC_REQUEST_CLEAR_COMM_FEATURE 0x04
  112. #define CDC_REQUEST_SET_AUX_LINE_STATE 0x10
  113. #define CDC_REQUEST_SET_HOOK_STATE 0x11
  114. #define CDC_REQUEST_PULSE_SETUP 0x12
  115. #define CDC_REQUEST_SEND_PULSE 0x13
  116. #define CDC_REQUEST_SET_PULSE_TIME 0x14
  117. #define CDC_REQUEST_RING_AUX_JACK 0x15
  118. #define CDC_REQUEST_SET_LINE_CODING 0x20
  119. #define CDC_REQUEST_GET_LINE_CODING 0x21
  120. #define CDC_REQUEST_SET_CONTROL_LINE_STATE 0x22
  121. #define CDC_REQUEST_SEND_BREAK 0x23
  122. #define CDC_REQUEST_SET_RINGER_PARMS 0x30
  123. #define CDC_REQUEST_GET_RINGER_PARMS 0x31
  124. #define CDC_REQUEST_SET_OPERATION_PARMS 0x32
  125. #define CDC_REQUEST_GET_OPERATION_PARMS 0x33
  126. #define CDC_REQUEST_SET_LINE_PARMS 0x34
  127. #define CDC_REQUEST_GET_LINE_PARMS 0x35
  128. #define CDC_REQUEST_DIAL_DIGITS 0x36
  129. #define CDC_REQUEST_SET_UNIT_PARAMETER 0x37
  130. #define CDC_REQUEST_GET_UNIT_PARAMETER 0x38
  131. #define CDC_REQUEST_CLEAR_UNIT_PARAMETER 0x39
  132. #define CDC_REQUEST_GET_PROFILE 0x3A
  133. #define CDC_REQUEST_SET_ETHERNET_MULTICAST_FILTERS 0x40
  134. #define CDC_REQUEST_SET_ETHERNET_PMP_FILTER 0x41
  135. #define CDC_REQUEST_GET_ETHERNET_PMP_FILTER 0x42
  136. #define CDC_REQUEST_SET_ETHERNET_PACKET_FILTER 0x43
  137. #define CDC_REQUEST_GET_ETHERNET_STATISTIC 0x44
  138. #define CDC_REQUEST_SET_ATM_DATA_FORMAT 0x50
  139. #define CDC_REQUEST_GET_ATM_DEVICE_STATISTICS 0x51
  140. #define CDC_REQUEST_SET_ATM_DEFAULT_VC 0x52
  141. #define CDC_REQUEST_GET_ATM_VC_STATISTICS 0x53
  142. /* Communication feature selector codes */
  143. /* (usbcdc11.pdf, 6.2.2..6.2.4, Table 47) */
  144. #define CDC_ABSTRACT_STATE 0x01
  145. #define CDC_COUNTRY_SETTING 0x02
  146. /** Control Signal Bitmap Values for SetControlLineState */
  147. #define SET_CONTROL_LINE_STATE_RTS 0x02
  148. #define SET_CONTROL_LINE_STATE_DTR 0x01
  149. /* Feature Status returned for ABSTRACT_STATE Selector */
  150. /* (usbcdc11.pdf, 6.2.3, Table 48) */
  151. #define CDC_IDLE_SETTING (1 << 0)
  152. #define CDC_DATA_MULTPLEXED_STATE (1 << 1)
  153. /* Control signal bitmap values for the SetControlLineState request */
  154. /* (usbcdc11.pdf, 6.2.14, Table 51) */
  155. #define CDC_DTE_PRESENT (1 << 0)
  156. #define CDC_ACTIVATE_CARRIER (1 << 1)
  157. /* CDC class-specific notification codes */
  158. /* (usbcdc11.pdf, 6.3, Table 68) */
  159. /* see Table 67 for Info about class-specific notifications */
  160. #define CDC_NOTIFICATION_NETWORK_CONNECTION 0x00
  161. #define CDC_RESPONSE_AVAILABLE 0x01
  162. #define CDC_AUX_JACK_HOOK_STATE 0x08
  163. #define CDC_RING_DETECT 0x09
  164. #define CDC_NOTIFICATION_SERIAL_STATE 0x20
  165. #define CDC_CALL_STATE_CHANGE 0x28
  166. #define CDC_LINE_STATE_CHANGE 0x29
  167. #define CDC_CONNECTION_SPEED_CHANGE 0x2A
  168. /* UART state bitmap values (Serial state notification). */
  169. /* (usbcdc11.pdf, 6.3.5, Table 69) */
  170. #define CDC_SERIAL_STATE_OVERRUN (1 << 6) /* receive data overrun error has occurred */
  171. #define CDC_SERIAL_STATE_OVERRUN_Pos (6)
  172. #define CDC_SERIAL_STATE_OVERRUN_Msk (1 << CDC_SERIAL_STATE_OVERRUN_Pos)
  173. #define CDC_SERIAL_STATE_PARITY (1 << 5) /* parity error has occurred */
  174. #define CDC_SERIAL_STATE_PARITY_Pos (5)
  175. #define CDC_SERIAL_STATE_PARITY_Msk (1 << CDC_SERIAL_STATE_PARITY_Pos)
  176. #define CDC_SERIAL_STATE_FRAMING (1 << 4) /* framing error has occurred */
  177. #define CDC_SERIAL_STATE_FRAMING_Pos (4)
  178. #define CDC_SERIAL_STATE_FRAMING_Msk (1 << CDC_SERIAL_STATE_FRAMING_Pos)
  179. #define CDC_SERIAL_STATE_RING (1 << 3) /* state of ring signal detection */
  180. #define CDC_SERIAL_STATE_RING_Pos (3)
  181. #define CDC_SERIAL_STATE_RING_Msk (1 << CDC_SERIAL_STATE_RING_Pos)
  182. #define CDC_SERIAL_STATE_BREAK (1 << 2) /* state of break detection */
  183. #define CDC_SERIAL_STATE_BREAK_Pos (2)
  184. #define CDC_SERIAL_STATE_BREAK_Msk (1 << CDC_SERIAL_STATE_BREAK_Pos)
  185. #define CDC_SERIAL_STATE_TX_CARRIER (1 << 1) /* state of transmission carrier */
  186. #define CDC_SERIAL_STATE_TX_CARRIER_Pos (1)
  187. #define CDC_SERIAL_STATE_TX_CARRIER_Msk (1 << CDC_SERIAL_STATE_TX_CARRIER_Pos)
  188. #define CDC_SERIAL_STATE_RX_CARRIER (1 << 0) /* state of receiver carrier */
  189. #define CDC_SERIAL_STATE_RX_CARRIER_Pos (0)
  190. #define CDC_SERIAL_STATE_RX_CARRIER_Msk (1 << CDC_SERIAL_STATE_RX_CARRIER_Pos)
  191. /*------------------------------------------------------------------------------
  192. * Structures based on usbcdc11.pdf (www.usb.org)
  193. *----------------------------------------------------------------------------*/
  194. /* Header functional descriptor */
  195. /* (usbcdc11.pdf, 5.2.3.1) */
  196. /* This header must precede any list of class-specific descriptors. */
  197. struct cdc_header_descriptor {
  198. uint8_t bFunctionLength; /* size of this descriptor in bytes */
  199. uint8_t bDescriptorType; /* CS_INTERFACE descriptor type */
  200. uint8_t bDescriptorSubtype; /* Header functional descriptor subtype */
  201. uint16_t bcdCDC; /* USB CDC specification release version */
  202. } __packed;
  203. /* Call management functional descriptor */
  204. /* (usbcdc11.pdf, 5.2.3.2) */
  205. /* Describes the processing of calls for the communication class interface. */
  206. struct cdc_call_management_descriptor {
  207. uint8_t bFunctionLength; /* size of this descriptor in bytes */
  208. uint8_t bDescriptorType; /* CS_INTERFACE descriptor type */
  209. uint8_t bDescriptorSubtype; /* call management functional descriptor subtype */
  210. uint8_t bmCapabilities; /* capabilities that this configuration supports */
  211. uint8_t bDataInterface; /* interface number of the data class interface used for call management (optional) */
  212. } __packed;
  213. /* Abstract control management functional descriptor */
  214. /* (usbcdc11.pdf, 5.2.3.3) */
  215. /* Describes the command supported by the communication interface class with the Abstract Control Model subclass code. */
  216. struct cdc_abstract_control_management_descriptor {
  217. uint8_t bFunctionLength; /* size of this descriptor in bytes */
  218. uint8_t bDescriptorType; /* CS_INTERFACE descriptor type */
  219. uint8_t bDescriptorSubtype; /* abstract control management functional descriptor subtype */
  220. uint8_t bmCapabilities; /* capabilities supported by this configuration */
  221. } __packed;
  222. /* Union functional descriptors */
  223. /* (usbcdc11.pdf, 5.2.3.8) */
  224. /* Describes the relationship between a group of interfaces that can be considered to form a functional unit. */
  225. struct cdc_union_descriptor {
  226. uint8_t bFunctionLength; /* size of this descriptor in bytes */
  227. uint8_t bDescriptorType; /* CS_INTERFACE descriptor type */
  228. uint8_t bDescriptorSubtype; /* union functional descriptor subtype */
  229. uint8_t bMasterInterface; /* interface number designated as master */
  230. } __packed;
  231. /* Union functional descriptors with one slave interface */
  232. /* (usbcdc11.pdf, 5.2.3.8) */
  233. struct cdc_union_1slave_descriptor {
  234. uint8_t bFunctionLength;
  235. uint8_t bDescriptorType;
  236. uint8_t bDescriptorSubtype;
  237. uint8_t bControlInterface;
  238. uint8_t bSubordinateInterface0;
  239. } __packed;
  240. /* Line coding structure for GET_LINE_CODING / SET_LINE_CODING class requests*/
  241. /* Format of the data returned when a GetLineCoding request is received */
  242. /* (usbcdc11.pdf, 6.2.13) */
  243. struct cdc_line_coding {
  244. uint32_t dwDTERate; /* Data terminal rate in bits per second */
  245. uint8_t bCharFormat; /* Number of stop bits */
  246. uint8_t bParityType; /* Parity bit type */
  247. uint8_t bDataBits; /* Number of data bits */
  248. } __packed;
  249. /** Data structure for the notification about SerialState */
  250. struct cdc_acm_notification {
  251. uint8_t bmRequestType;
  252. uint8_t bNotificationType;
  253. uint16_t wValue;
  254. uint16_t wIndex;
  255. uint16_t wLength;
  256. uint16_t data;
  257. } __packed;
  258. /** Ethernet Networking Functional Descriptor */
  259. struct cdc_ecm_descriptor {
  260. uint8_t bFunctionLength;
  261. uint8_t bDescriptorType;
  262. uint8_t bDescriptorSubtype;
  263. uint8_t iMACAddress;
  264. uint32_t bmEthernetStatistics;
  265. uint16_t wMaxSegmentSize;
  266. uint16_t wNumberMCFilters;
  267. uint8_t bNumberPowerFilters;
  268. } __packed;
  269. /*Length of template descriptor: 66 bytes*/
  270. #define CDC_ACM_DESCRIPTOR_LEN (8 + 9 + 5 + 5 + 4 + 5 + 7 + 9 + 7 + 7)
  271. #define CDC_ACM_DESCRIPTOR_INIT(bFirstInterface, int_ep, out_ep, in_ep, str_idx) \
  272. /* Interface Associate */ \
  273. 0x08, /* bLength */ \
  274. USB_DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION, /* bDescriptorType */ \
  275. bFirstInterface, /* bFirstInterface */ \
  276. 0x02, /* bInterfaceCount */ \
  277. USB_DEVICE_CLASS_CDC, /* bFunctionClass */ \
  278. CDC_ABSTRACT_CONTROL_MODEL, /* bFunctionSubClass */ \
  279. CDC_COMMON_PROTOCOL_AT_COMMANDS, /* bFunctionProtocol */ \
  280. 0x00, /* iFunction */ /* CDC Control Interface */ \
  281. 0x09, /* bLength */ \
  282. USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \
  283. bFirstInterface, /* bInterfaceNumber */ \
  284. 0x00, /* bAlternateSetting */ \
  285. 0x01, /* bNumEndpoints */ \
  286. USB_DEVICE_CLASS_CDC, /* bInterfaceClass */ \
  287. CDC_ABSTRACT_CONTROL_MODEL, /* bInterfaceSubClass */ \
  288. CDC_COMMON_PROTOCOL_AT_COMMANDS, /* bInterfaceProtocol */ \
  289. str_idx, /* iInterface */ /* CDC Header */ \
  290. 0x05, /* bLength */ \
  291. CDC_CS_INTERFACE, /* bDescriptorType */ \
  292. CDC_FUNC_DESC_HEADER, /* bDescriptorSubtype */ \
  293. WBVAL(CDC_V1_10), /* bcdCDC */ /* CDC Call */ \
  294. 0x05, /* bLength */ \
  295. CDC_CS_INTERFACE, /* bDescriptorType */ \
  296. CDC_FUNC_DESC_CALL_MANAGEMENT, /* bDescriptorSubtype */ \
  297. bFirstInterface, /* bmCapabilities */ \
  298. (uint8_t)(bFirstInterface + 1), /* bDataInterface */ /* CDC ACM: support line request */ \
  299. 0x04, /* bLength */ \
  300. CDC_CS_INTERFACE, /* bDescriptorType */ \
  301. CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, /* bDescriptorSubtype */ \
  302. 0x02, /* bmCapabilities */ /* CDC Union */ \
  303. 0x05, /* bLength */ \
  304. CDC_CS_INTERFACE, /* bDescriptorType */ \
  305. CDC_FUNC_DESC_UNION, /* bDescriptorSubtype */ \
  306. bFirstInterface, /* bMasterInterface */ \
  307. (uint8_t)(bFirstInterface + 1), /* bSlaveInterface0 */ /* Endpoint Notification */ \
  308. 0x07, /* bLength */ \
  309. USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
  310. int_ep, /* bEndpointAddress */ \
  311. 0x03, /* bmAttributes */ \
  312. 0x40, 0x00, /* wMaxPacketSize */ \
  313. 0x01, /* bInterval */ /* CDC Data Interface */ \
  314. 0x09, /* bLength */ \
  315. USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \
  316. (uint8_t)(bFirstInterface + 1), /* bInterfaceNumber */ \
  317. 0x00, /* bAlternateSetting */ \
  318. 0x02, /* bNumEndpoints */ \
  319. CDC_DATA_INTERFACE_CLASS, /* bInterfaceClass */ \
  320. 0x00, /* bInterfaceSubClass */ \
  321. 0x00, /* bInterfaceProtocol */ \
  322. 0x00, /* iInterface */ /* Endpoint Out */ \
  323. 0x07, /* bLength */ \
  324. USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
  325. out_ep, /* bEndpointAddress */ \
  326. 0x02, /* bmAttributes */ \
  327. 0x40, 0x00, /* wMaxPacketSize */ \
  328. 0x01, /* bInterval */ /* Endpoint In */ \
  329. 0x07, /* bLength */ \
  330. USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
  331. in_ep, /* bEndpointAddress */ \
  332. 0x02, /* bmAttributes */ \
  333. 0x40, 0x00, /* wMaxPacketSize */ \
  334. 0x01 /* bInterval */
  335. void usbd_cdc_add_acm_interface(usbd_class_t *class, usbd_interface_t *intf);
  336. void usbd_cdc_acm_set_line_coding(uint32_t baudrate, uint8_t databits, uint8_t parity, uint8_t stopbits);
  337. void usbd_cdc_acm_set_dtr(bool dtr);
  338. void usbd_cdc_acm_set_rts(bool rts);
  339. #ifdef __cplusplus
  340. }
  341. #endif
  342. #endif /* USB_CDC_H_ */