AN050
GD32 USBFS&USBHS Firmware Library User Guide
43
usbd_mem_cb USBD_Internal_Storage_fops
=
{
.
mem_init
=
STORAGE_Init
,
.
mem_ready
=
STORAGE_IsReady
,
.
mem_protected
=
STORAGE_IsWriteProtected
,
.
mem_read
=
STORAGE_Read
,
.
mem_write
=
STORAGE_Write
,
.
mem_maxlun
=
STORAGE_GetMaxLun
,
.
mem_inquiry_data
=
{(
uint8_t
*)
STORAGE_InquiryData
},
.
mem_block_size
=
{
ISRAM_BLOCK_SIZE
},
.
mem_block_len
=
{
ISRAM_BLOCK_NUM
}
};
Individual functions and variable functions is shown as
Table 5-18. MSC user interface
Table 5-18
. MSC user interface functions
Function/variable name
Functional description
STORAGE_Init
Memory medium interface initialization
STORAGE_IsReady
Check whether memory medium is ready
STORAGE_IsWriteProtected
Check whether memory medium is write protected
STORAGE_Read
Memory medium read operation
STORAGE_Write
Memory medium write operation
STORAGE_GetMaxLun
Get supported logic unit number
STORAGE_InquiryData
Memory medium standard inquiry data
ISRAM_BLOCK_SIZE
Memory medium block size
ISRAM_BLOCK_NUM
Memory medium block number
The storage capacity is determined by the value of ISRAM_BLOCK_SIZE and
ISRAM_BLOCK_NUM.
MSC routine operation guide
Download the MSC rountine to EVAL board, a newly added mass storage device is visible in
device manager.