USB Component
Version 6.6
MDK-Professional Middleware for USB Device and Host
|
User API reference of the Mass Storage Class. More...
Functions | |
usbStatus | USBH_MSC_GetDeviceStatus (uint8_t instance) |
Get status of Mass Storage Device. | |
usbStatus | USBH_MSC_Read (uint8_t instance, uint32_t lba, uint32_t cnt, uint8_t *buf) |
Read requested number of blocks from Mass Storage Device. | |
usbStatus | USBH_MSC_Write (uint8_t instance, uint32_t lba, uint32_t cnt, const uint8_t *buf) |
Write requested number of blocks to Mass Storage Device. | |
usbStatus | USBH_MSC_ReadCapacity (uint8_t instance, uint32_t *block_count, uint32_t *block_size) |
Read capacity of Mass Storage Device. | |
User API reference of the Mass Storage Class.
usbStatus USBH_MSC_GetDeviceStatus | ( | uint8_t | instance | ) |
Get status of Mass Storage Device.
[in] | instance | instance of MSC Device. |
The function USBH_MSC_GetDeviceStatus checks if a mass storage device is connected and initialized.
The argument instance specifies the MSC device instance.
Code Example
usbStatus USBH_MSC_Read | ( | uint8_t | instance, |
uint32_t | lba, | ||
uint32_t | cnt, | ||
uint8_t * | buf | ||
) |
Read requested number of blocks from Mass Storage Device.
[in] | instance | instance of MSC Device. |
[in] | lba | logical block address of first block to read. |
[in] | cnt | number of contiguous blocks to read. |
[out] | buf | data buffer in which to read data. |
The function USBH_MSC_Read reads data from physical memory blocks of a mass storage device.
The argument instance specifies the MSC device instance.
The argument lba is the physical address of the first block to be read.
The argument cnt is the number of blocks to be read.
The argument buf is a pointer to the location where the data will be stored.
Code Example
usbStatus USBH_MSC_ReadCapacity | ( | uint8_t | instance, |
uint32_t * | block_count, | ||
uint32_t * | block_size | ||
) |
Read capacity of Mass Storage Device.
[in] | instance | instance of MSC Device. |
[out] | block_count | pointer to where total number of blocks available will be read. |
[out] | block_size | pointer to where block size will be read. |
The function USBH_MSC_ReadCapacity gets information about the capacity of a mass storage device.
The argument instance specifies the MSC device instance.
The argument block_count is a pointer to a variable that stores the total number of available blocks.
The argument block_size is a pointer to a variable that stores the block size (in bytes).
Code Example
usbStatus USBH_MSC_Write | ( | uint8_t | instance, |
uint32_t | lba, | ||
uint32_t | cnt, | ||
const uint8_t * | buf | ||
) |
Write requested number of blocks to Mass Storage Device.
[in] | instance | instance of MSC Device. |
[in] | lba | logical address of first block to write. |
[in] | cnt | number of contiguous blocks to write. |
[in] | buf | data buffer containing data to write. |
The function USBH_MSC_Write writes data to physical memory blocks of the mass storage device.
The argument instance specifies the MSC device instance.
The argument lba is the physical address of the first block to be written.
The argument cnt is the number of blocks to be written.
The argument buf is a pointer to the location that contains the data to be written.
Code Example