USBD_CDC_Add
Description
Creates a CDC instance.
Files
usbd_cdc.h/usbd_cdc.c
Prototype
CPU_INT08U USBD_CDC_Add(CPU_INT08U subclass,
USBD_CDC_SUBCLASS_DRV *p_subclass_drv,
void *p_subclass_arg,
CPU_INT08U protocol,
CPU_BOOLEAN notify_en,
CPU_INT16U notify_interval,
USBD_ERR *p_err);
Arguments
subclass
CDC subclass code.
Subclass code | Description |
|---|---|
| Direct Line Control Model |
| Abstract Control Model |
| Telephone Control Model |
| Multi-Channel Control Model |
| CAPI Control Model |
| Wireless Handset Control Model |
| Device Management |
| Mobile Direct Line Model |
| Obex |
| Ethernet Emulation Model |
| Network Control Model |
| Vendor specific |
CDC subclass codes are defined in the Universal Serial Bus Class Definitions for Communication Devices Revision 2.1 Table 4.
p_subclass_drv
Pointer to CDC subclass driver.
p_subclass_arg
Pointer to CDC subclass driver argument.
protocol
CDC protocol code:
Protocol code | Description |
|---|---|
| None |
| AT commands V250 |
| AT commands defined by PCCA 101 |
| AT commands defined by PCCA 101 & annex O |
| AT commands defined by GSM 7.07 |
| AT commands defined by 3GPP 27.007 |
| AT commands defined by TIA for CDMA |
| Ethernet Emulation Model |
| External protocol |
| Vendor specific |
CDC protocol codes are defined in the Universal Serial Bus Class Definitions for Communication Devices Revision 2.1 Table 5.
notify_en
Notification enabled.
DEF_ENABLED, CDC notifications are enabled.
DEF_DISABLED, CDC notifications are disabled.
notify_interval
Notification interval in milliseconds. It must be a power of 2.
p_err
Pointer to variable that will receive the return error code from this function.
USBD_ERR_NONE
USBD_ERR_ALLOC
Returned Value
CDC class interface number, if CDC class successfully created.
USBD_CDC_NBR_NONE, otherwise.
Callers
CDC Subclass drivers.
Notes / Warnings
The CDC defines a communication class interface consisting of a management element and optionally a notification element. The notification element transports event to the host. The enable_en enable notifications in the CDC. The notification are sent to the host using an interrupt endpoint, the interval of the interrupt endpoint is specified by the
notify_intervalparameter.