USB Device Interface (UDI) for Mass Storage Class (MSC) provides an interface for the configuration and management of USB MSC storage device.
The outline of this documentation is as follows:
For more details for Atmel® Software Framework (ASF) USB Device Stack, refer to following application notes:
Data Structures | |
struct | udi_msc_desc_t |
Interface descriptor structure for MSC. More... | |
Functions | |
bool | udi_msc_process_trans (void) |
Process the background read/write commands. More... | |
bool | udi_msc_trans_block (bool b_read, uint8_t *block, iram_size_t block_size, void(*callback)(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)) |
Transfers data to/from USB MSC endpoints. More... | |
UDI MSC Interface for UDC | |
UDC_DESC_STORAGE udi_api_t | udi_api_msc |
Global structure which contains standard UDI interface for UDC. More... | |
USB Interface Descriptors | |
The following structures provide predefined USB interface descriptors. It must be used to define the final USB descriptors. | |
#define | UDI_MSC_STRING_ID 0 |
By default no string is associated to this interface. More... | |
#define | UDI_MSC_EPS_SIZE_FS 64 |
MSC endpoints size for full speed. More... | |
#define | UDI_MSC_EPS_SIZE_HS 512 |
MSC endpoints size for high speed. More... | |
#define | UDI_MSC_DESC |
Content of MSC interface descriptor for all speeds. More... | |
#define | UDI_MSC_DESC_FS |
Content of MSC interface descriptor for full speed only. More... | |
#define | UDI_MSC_DESC_HS |
Content of MSC interface descriptor for high speed only. More... | |
#define UDI_MSC_DESC |
Content of MSC interface descriptor for all speeds.
#define UDI_MSC_DESC_FS |
Content of MSC interface descriptor for full speed only.
#define UDI_MSC_DESC_HS |
Content of MSC interface descriptor for high speed only.
#define UDI_MSC_EPS_SIZE_FS 64 |
MSC endpoints size for full speed.
#define UDI_MSC_EPS_SIZE_HS 512 |
MSC endpoints size for high speed.
#define UDI_MSC_STRING_ID 0 |
By default no string is associated to this interface.
bool udi_msc_process_trans | ( | void | ) |
Process the background read/write commands.
Routine called by the main loop.
Routine called by the main loop
References CTRL_BUSY, CTRL_FAIL, CTRL_GOOD, CTRL_NO_PRESENT, memory_2_usb(), status, udi_msc_csw_process(), udi_msc_sense_fail_busy_or_change(), udi_msc_sense_fail_hardware(), udi_msc_sense_fail_not_present(), udi_msc_sense_pass(), and usb_2_memory().
Referenced by main(), and run_usb_msc_test().
bool udi_msc_trans_block | ( | bool | b_read, |
uint8_t * | block, | ||
iram_size_t | block_size, | ||
void(*)(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) | callback | ||
) |
Transfers data to/from USB MSC endpoints.
[in] | b_read | Memory to USB, if true |
[in,out] | block | Buffer on Internal RAM to send or fill |
[in] | block_size | Buffer size to send or fill |
[in] | callback | Function to call at the end of transfer. If NULL then the routine exit when transfer is finish. |
1
if function was successfully done, otherwise 0
.b_read | Memory to USB, if true |
block | Buffer on Internal RAM to send or fill |
block_size | Buffer size to send or fill |
callback | Function to call at the end of transfer. If NULL then the routine exit when transfer is finish. |
1
if function was successfully done, otherwise 0
. References callback, NULL, udd_ep_run(), UDI_MSC_EP_IN, UDI_MSC_EP_OUT, and udi_msc_trans_ack().
Referenced by sd_mmc_usb_read_10(), sd_mmc_usb_write_10(), and virtual_usb_trans().
UDC_DESC_STORAGE udi_api_t udi_api_msc |
Global structure which contains standard UDI interface for UDC.
Global structure which contains standard UDI interface for UDC.