AN050
GD32 USBFS&USBHS Firmware Library User Guide
29
usbd_out_transc function. data_out callback function actually call the cdc_acm_out function.
Once enter in cdc_acm_out function, it is indicated that some data are received by device,
and then call function cdc_acm_data_receive, so as to prepare next data packet.
uint8_t
usbd_out_transc
(
usb_core_driver
*
udev
,
uint8_t
ep_num
)
{
if
(
0U
==
ep_num
)
{
usb_transc
*
transc
=
&
udev
->
dev
.
transc_out
[
0
];
/* ...... */
}
else
if
((
udev
->
dev
.
class_core
->
data_out
!=
NULL
)
&&
(
udev
->
dev
.
cur_status
==
(
uint8_t
)
USBD_CONFIGURED
))
{
(
void
)
udev
->
dev
.
class_core
->
data_out
(
udev
,
ep_num
);
}
else
{
/* no operation */
}
return
(
uint8_t
)
USBD_OK
;
}
5.7.
USB device class routine
5.7.1.
AUDIO
AUDIO device include speaker and micphone interface, which could be selected in project
configuration and shown as
Figure 5-4. AUDIO macro configuration
Figure 5-4. AUDIO macro configuration
Audio descriptor introduction
Device descriptor include VID(0x28e9)/PID(0x9574) of AUDIO device. In configuration
descriptor set, include speaker and micphone corresponding descriptor item. Speaker and
micphone of AUDIO corresponds to one interface, interface descriptor is shown as
Table 5-4
. AUDIO relevant descriptors
Descriptor name
Functional description
usb_desc_AC_itf
AC interface descriptor