CDC Configuration
Some constants are available to customize the CDC base class. These constants are located in the USB device configuration file, usbd_cfg.h. Table - CDC Class Configuration Constants shows their description.
Table - CDC Class Configuration Constants | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Listing - CDC Initialization Example shows the App_USBD_CDC_Init() function defined in the application template file app_usbd_cdc.c. This function performs CDC and associated subclass initialization.
CPU_BOOLEAN App_USBD_CDC_Init (CPU_INT08U dev_nbr,
CPU_INT08U cfg_hs,
CPU_INT08U cfg_fs)
{
USBD_ERR err;
USBD_CDC_Init(&err); (1)
... (2)
}(1) Initialize CDC internal structures and variables. This is the first function you should call and you should do it only once.
(2) Call all the required functions to initialize the subclass(es). Refer to the ACM Subclass Configuration section for ACM subclass initialization.