AN050
GD32 USBFS&USBHS Firmware Library User Guide
42
5.7.4.
MSC
MSC device is mass storage device, include U-disk and CDROM.
MSC descriptor introduction
Device descriptor include MSC device VID(0x28e9) and PID(0x028f). In configuration
descriptor set, include configure descriptor, interface descriptor and endpoint descriptor,
which is shown as below.
MSC device class interface
MSC device class interface is shown in below structure, and structure function is shown in
Table 5-16. MSC device class interface functions
usb_class_core msc_class
=
{
.
init
=
msc_core_init
,
.
deinit
=
msc_core_deinit
,
.
req_proc
=
msc_core_req
,
.
data_in
=
msc_core_in
,
.
data_out
=
msc_core_out
};
Table 5-16
. MSC device class interface functions
Function name
Functional description
msc_core_init
Initialize MSC device
msc_core_deinit
Deinitialize MSC device
msc_core_req
MSC device class request function
msc_core_in
IN data transfer callback
msc_core_out
OUT data transfer callback
MSC device class request
MSC include device class request is shown in
Table 5-17. MSC device class request
Table 5-17
. MSC device class request
Request name
value
Functional description
BBB_GET_MAX_LUN
0xFE
Gets the maximum logical unit number
BBB_RESET
0xFF
Reset
MSC user interface
MSC user interface is the initialization, read, write and get information operation of memory
medium, which is shown in below structure.