USB Component
Version 6.6
MDK-Professional Middleware for USB Device and Host
|
Implement application specific behavior of a Communication Device Class (CDC) USB Device using the sub-class Abstract Control Model (ACM). More...
Content | |
User API | |
User API reference of the Communication Device Class (ACM). | |
Configuration | |
Configuration of the USB Device CDC (ACM) Class in µVision. | |
Implement application specific behavior of a Communication Device Class (CDC) USB Device using the sub-class Abstract Control Model (ACM).
The CDC (ACM) class in the USB Component is used for data communication. You can typically use it in applications that previously used a serial COM or UART communication.
Refer to:
The USB Component allows multiple instances of the CDC class. This feature is used to create USB Composite Devices. Each CDC class instance has a separate files and interface functions:
This documentation uses n as a placeholder for the instance number 0 - 3. Most applications only require one instance of a CDC ACM class. For the first CDC ACM class instance the instance number is 0:
Descriptor Requirements
The following descriptors are required in an USB CDC ACM Device:
The necessary descriptors are automatically generated by the USB Middleware Component. The page USB Descriptors provides more information on the topic.
Software Structure
The handling for the CDC class endpoint events is implemented in USBD_CDCn_Int_Thread and USBD_CDCn_Bulk_Thread which are started by USBD_Initialize. Each instance of a CDC class runs an instance of USBD_CDCn_Int_Thread and USBD_CDCn_Bulk_Thread.
The thread USBD_CDCn_Int_Thread handles Interrupt IN Endpoint whereas the USBD_CDCn_Bulk_Thread handles the Bulk IN and Bulk OUT Endpoints.
To create an USB Device with a CDC ACM class:
User Code Template USBD_User_CDC_ACM_n.c
The following source code contains all the required callback functions and can be used to implement the application specific behavior of a USB CDC (ACM) Device.