SAMV71 Xplained Ultra Software Package 1.3

USB host Mass Storage interface for control access module
[UHI for Mass Storage Class]

Collaboration diagram for USB host Mass Storage interface for control access module:

Modules

 Implementation of USB host Mass Storage

Functions

uint8_t uhi_msc_mem_get_lun (void)
 Gives the number of available LUN.
Ctrl_status uhi_msc_mem_test_unit_ready (uint8_t lun)
 Checks and update the status of the LUN.
Ctrl_status uhi_msc_mem_read_capacity (uint8_t lun, uint32_t *u32_nb_sector)
 Returns the capacity of the LUN.
uint8_t uhi_msc_mem_read_sector_size (uint8_t lun)
 Returns the sector size of the LUN.
bool uhi_msc_mem_wr_protect (uint8_t lun)
 Checks if the LUN is write protected.
bool uhi_msc_mem_removal (void)
 Checks if the device is removed.
Ctrl_status uhi_msc_mem_read_10_ram (uint32_t addr, void *ram)
 Reads 512 bytes from the current LUN.
Ctrl_status uhi_msc_mem_write_10_ram (uint32_t addr, const void *ram)
 Writes 512 bytes to the current LUN.

Detailed Description

Layer added on UHI MSC interface to allow the usage of control access module. The control access module provides a common access at all memories and it is used by the File Systems available in ASF.

See Quick start guide for USB host mass-storage module (UHI MSC).


Function Documentation

uint8_t uhi_msc_mem_get_lun ( void   ) 

Gives the number of available LUN.

Note:
A LUN can be available, but with a status not present. It is the case for a card reader without card.
Returns:
Number of available LUN

Definition at line 86 of file uhi_msc_mem.c.

Here is the call graph for this function:

Ctrl_status uhi_msc_mem_read_10_ram ( uint32_t  addr,
void *  ram 
)

Reads 512 bytes from the current LUN.

The LUN is selected by uhi_msc_mem_test_unit_ready() or uhi_msc_mem_read_capacity() function.

Parameters:
addr Disk address (unit 512B)
ram Pointer to store the data
Returns:
Status of the LUN

Definition at line 173 of file uhi_msc_mem.c.

Here is the call graph for this function:

Ctrl_status uhi_msc_mem_read_capacity ( uint8_t  lun,
uint32_t *  u32_nb_sector 
)

Returns the capacity of the LUN.

Parameters:
lun LUN number
u32_nb_sector Pointer to store the last sector address possible on this LUN
Returns:
Status of the LUN

Definition at line 111 of file uhi_msc_mem.c.

Here is the call graph for this function:

uint8_t uhi_msc_mem_read_sector_size ( uint8_t  lun  ) 

Returns the sector size of the LUN.

Parameters:
lun LUN number
Returns:
Sector size (unit 512B)

Definition at line 134 of file uhi_msc_mem.c.

Here is the call graph for this function:

bool uhi_msc_mem_removal ( void   ) 

Checks if the device is removed.

Returns:
Always true for USB Device

Definition at line 168 of file uhi_msc_mem.c.

Ctrl_status uhi_msc_mem_test_unit_ready ( uint8_t  lun  ) 

Checks and update the status of the LUN.

Parameters:
lun LUN number
Returns:
Status of the LUN

Definition at line 92 of file uhi_msc_mem.c.

Here is the call graph for this function:

bool uhi_msc_mem_wr_protect ( uint8_t  lun  ) 

Checks if the LUN is write protected.

Parameters:
lun LUN number
Returns:
true, if write protected

Definition at line 149 of file uhi_msc_mem.c.

Here is the call graph for this function:

Ctrl_status uhi_msc_mem_write_10_ram ( uint32_t  addr,
const void *  ram 
)

Writes 512 bytes to the current LUN.

The LUN is selected by uhi_msc_mem_test_unit_ready() or uhi_msc_mem_read_capacity() function.

Parameters:
addr Disk address (unit 512B)
ram Pointer on the data
Returns:
Status of the LUN

Definition at line 203 of file uhi_msc_mem.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines