AN050
GD32 USBFS&USBHS Firmware Library User Guide
60
6.6.2.
MSC device class
The MSC device is initialized as follows:
usbh_class usbh_msc
=
{
USB_CLASS_MSC
,
usbh_msc_itf_init
,
usbh_msc_itf_deinit
,
usbh_msc_req
,
usbh_msc_handle
,
};
The initialization function of structure is shown in usbh_msc_core.c file, except for include
structure initialization, and include other MSC device class function and corresponding
function, shown in
Table 6-6. MSC host class library function
Table 6-6. MSC host class library function
Device class
File name
Function name
Description
MSC host class
usbh_msc_bb
b.h/c
usbh_msc_init
initialize the mass storage
parameters
usbh_msc_bot_process
manage the different states of
BOT transfer and updates the
status to upper layer
usbh_msc_bot_abort
manages the different error
handling for stall
usbh_msc_bot_reset
reset msc bot request
usbh_msc_csw_decode
decode the CSW received by
the device and updates the
same to upper layer
usbh_msc_co
re.h/c
usbh_msc_lun_info_get
get msc logic unit information
usbh_msc_read
msc read interface
usbh_msc_write
msc write interface
usbh_msc_itf_deinit
de-initialize interface by freeing
host channels allocated to
interface
usbh_msc_itf_init
interface initialization for MSC
class
usbh_msc_req
initialize the MSC state machine
usbh_msc_handle
MSC state machine handler
usbh_msc_maxlun_get
get max lun of the mass storage
device
usbh_msc_rdwr_process
mass storage device read and
write process
usbh_msc_sc
usbh_msc_scsi_inquiry
send 'Inquiry' command to the