AN050
GD32 USBFS&USBHS Firmware Library User Guide
35
Table 5-10
. CDC device class request
Request name
Functional description
SEND_ENCAPSULATED_COMMAND
Not used
GET_ENCAPSULATED_RESPONSE
Not used
SET_COMM_FEATURE
Not used
GET_COMM_FEATURE
Not used
CLEAR_COMM_FEATURE
Not used
SET_LINE_CODING
set serial port parameters
GET_LINE_CODING
get serial port parameters
SET_CONTROL_LINE_STATE
Not used
SEND_BREAK
Not used
CDC user interface
The user interface for CDC contains the following functions:
/* function declarations */
/* check CDC ACM is ready for data transfer */
uint8_t
cdc_acm_check_ready
(
usb_dev
*
udev
);
/* send CDC ACM data */
void
cdc_acm_data_send
(
usb_dev
*
udev
);
/* receive CDC ACM data */
void
cdc_acm_data_receive
(
usb_dev
*
udev
);
The functions are shown in the following
Table 5-11. CDC user interface functions
Table 5-11
. CDC user interface functions
Function name
Functional description
cdc_acm_check_ready
CDC check ready for data transfer
cdc_acm_data_send
CDC data send
cdc_acm_data_receive
CDC data receive
CDC routine operation guide
Download the CDC_ACM rountine to develop board, a newly added COM is visible in device
manager.
Figure 5-9. CDC device class
Select the newly added COM ID in serial debugging assistant, open the COM, considering
the loopback function, send a charater string, and then receive the same charater string.