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).
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the USB host Mass Storage interface for control access module. | |
Quick Start Guide(s) | |
In this section you can find a list of all Quick Start guides related to the USB host Mass Storage interface for control access module. | |
Implementation of USB host Mass Storage | |
interface for control access module | |
Functions | |
uint8_t | uhi_msc_mem_get_lun (void) |
Gives the number of available LUN. More... | |
Ctrl_status | uhi_msc_mem_read_10_ram (uint32_t addr, void *ram) |
Reads 512 bytes from the current LUN. More... | |
Ctrl_status | uhi_msc_mem_read_capacity (uint8_t lun, uint32_t *u32_nb_sector) |
Returns the capacity of the LUN. More... | |
uint8_t | uhi_msc_mem_read_sector_size (uint8_t lun) |
Returns the sector size of the LUN. More... | |
bool | uhi_msc_mem_removal (void) |
Checks if the device is removed. More... | |
Ctrl_status | uhi_msc_mem_test_unit_ready (uint8_t lun) |
Checks and update the status of the LUN. More... | |
bool | uhi_msc_mem_wr_protect (uint8_t lun) |
Checks if the LUN is write protected. More... | |
Ctrl_status | uhi_msc_mem_write_10_ram (uint32_t addr, const void *ram) |
Writes 512 bytes to the current LUN. More... | |
uint8_t uhi_msc_mem_get_lun | ( | void | ) |
Gives the number of available LUN.
References uhi_msc_get_lun(), and uhi_msc_is_available().
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.
addr | Disk address (unit 512B) |
ram | Pointer to store the data |
References sbc_read_capacity10_data::block_len, uhi_msc_lun_t::capacity, CTRL_FAIL, CTRL_GOOD, NULL, uhi_msc_lun_t::status, uhi_msc_get_lun_desc(), uhi_msc_is_available(), uhi_msc_mem_command_ongoing, uhi_msc_mem_command_status, uhi_msc_mem_lun, uhi_msc_mem_stop_pooling(), uhi_msc_mem_translate_status(), and uhi_msc_scsi_read_10().
Ctrl_status uhi_msc_mem_read_capacity | ( | uint8_t | lun, |
uint32_t * | u32_nb_sector | ||
) |
Returns the capacity of the LUN.
lun | LUN number |
u32_nb_sector | Pointer to store the last sector address possible on this LUN |
References sbc_read_capacity10_data::block_len, uhi_msc_lun_t::capacity, CTRL_FAIL, sbc_read_capacity10_data::max_lba, NULL, uhi_msc_lun_t::status, uhi_msc_get_lun_desc(), uhi_msc_is_available(), uhi_msc_mem_lun, and uhi_msc_mem_translate_status().
uint8_t uhi_msc_mem_read_sector_size | ( | uint8_t | lun | ) |
Returns the sector size of the LUN.
lun | LUN number |
References sbc_read_capacity10_data::block_len, uhi_msc_lun_t::capacity, NULL, uhi_msc_get_lun_desc(), uhi_msc_is_available(), and uhi_msc_mem_lun.
bool uhi_msc_mem_removal | ( | void | ) |
Checks if the device is removed.
Ctrl_status uhi_msc_mem_test_unit_ready | ( | uint8_t | lun | ) |
Checks and update the status of the LUN.
lun | LUN number |
References CTRL_FAIL, uhi_msc_lun_t::status, uhi_msc_get_lun_desc(), uhi_msc_is_available(), uhi_msc_mem_command_ongoing, uhi_msc_mem_command_status, uhi_msc_mem_lun, uhi_msc_mem_stop_pooling(), uhi_msc_mem_translate_status(), and uhi_msc_scsi_test_unit_ready().
bool uhi_msc_mem_wr_protect | ( | uint8_t | lun | ) |
Checks if the LUN is write protected.
lun | LUN number |
References uhi_msc_lun_t::b_write_protected, sbc_read_capacity10_data::block_len, uhi_msc_lun_t::capacity, NULL, uhi_msc_get_lun_desc(), uhi_msc_is_available(), and uhi_msc_mem_lun.
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.
addr | Disk address (unit 512B) |
ram | Pointer on the data |
References sbc_read_capacity10_data::block_len, uhi_msc_lun_t::capacity, CTRL_FAIL, CTRL_GOOD, NULL, uhi_msc_lun_t::status, uhi_msc_get_lun_desc(), uhi_msc_is_available(), uhi_msc_mem_command_ongoing, uhi_msc_mem_command_status, uhi_msc_mem_lun, uhi_msc_mem_stop_pooling(), uhi_msc_mem_translate_status(), and uhi_msc_scsi_write_10().