AN050
GD32 USBFS&USBHS Firmware Library User Guide
34
CDC descriptor introduction
Device descriptor include CDC device VID(0x28e9) and PID(0x018a). In configuration
descriptor set, include CDC corresponding descriptor item, two interface, one command
interface and one data interface, command interface corresponding descriptor is shown as
Table 5-8. CDC relevant descriptors
Table 5-8
. CDC relevant descriptors
Descriptor name
Functional description
usb_desc_header_func
header descriptor
usb_desc_call_managment_func
communication management descriptor
usb_desc_acm_func
abstract control management descriptor
usb_desc_union_func
union function descriptor
CDC device class interface
The CDC device class interface is shown in the following structure, whose function
implementation is shown in the following
Table 5-9. CDC device class interface functions
usb_class_core cdc_class
=
{
.
command
=
NO_CMD
,
.
alter_set
=
0U
,
.
init
=
cdc_acm_init
,
.
deinit
=
cdc_acm_deinit
,
.
req_proc
=
cdc_acm_req
,
.
ctlx_out
=
cdc_ctlx_out
,
.
data_in
=
cdc_acm_in
,
.
data_out
=
cdc_acm_out
};
Table 5-9
. CDC device class interface functions
Function name
Functional description
cdc_acm_init
Initialize AUDIO device
cdc_acm_deinit
Deinitialize AUDIO device
cdc_acm_req
AUDIO device class request function
cdc_ctlx_out
OUT control transfer callback
cdc_acm_in
IN data transfer callback
cdc_acm_out
OUT data transfer callback
CDC device class request
The CDC contains individual device class requests as shown in the following