The component manages a disk on a volatile memory (internal RAM).
This can be connected to a File System management or a USB Device Mass Storage Interface via the service Memory Control Access.
Functions | |
Ctrl_status | virtual_read_capacity (uint32_t *uint32_t_nb_sector) |
This function returns the address of the last valid sector. More... | |
bool | virtual_removal (void) |
This function informs about the memory type. More... | |
Ctrl_status | virtual_test_unit_ready (void) |
This function tests memory state, and starts memory initialization. More... | |
bool | virtual_unload (bool unload) |
This function unloads/loads the memory. More... | |
Ctrl_status | virtual_usb_read_10 (uint32_t addr, uint16_t nb_sector) |
This function transfers the memory data to the USB MSC interface. More... | |
static Ctrl_status | virtual_usb_trans (uint32_t addr, uint16_t nb_sector, bool b_read) |
This function transfers the data between memory and USB MSC interface. More... | |
Ctrl_status | virtual_usb_write_10 (uint32_t addr, uint16_t nb_sector) |
This function transfers the USB MSC data to the memory. More... | |
bool | virtual_wr_protect (void) |
This function returns the write-protected mode. More... | |
Variables | |
static bool | b_vmem_unloaded = false |
static COMPILER_WORD_ALIGNED uint8_t | vmem_data [VMEM_NB_SECTOR *VMEM_SECTOR_SIZE] |
Ctrl_status virtual_read_capacity | ( | uint32_t * | uint32_t_nb_sector | ) |
This function returns the address of the last valid sector.
uint32_t_nb_sector | Pointer to number of sectors (sector=512 bytes) |
References b_vmem_unloaded, CTRL_GOOD, CTRL_NO_PRESENT, and VMEM_NB_SECTOR.
bool virtual_removal | ( | void | ) |
This function informs about the memory type.
Ctrl_status virtual_test_unit_ready | ( | void | ) |
This function tests memory state, and starts memory initialization.
References b_vmem_unloaded, CTRL_GOOD, and CTRL_NO_PRESENT.
This function unloads/loads the memory.
References b_vmem_unloaded, and unload.
Ctrl_status virtual_usb_read_10 | ( | uint32_t | addr, |
uint16_t | nb_sector | ||
) |
This function transfers the memory data to the USB MSC interface.
addr | Sector address to start read |
nb_sector | Number of sectors to transfer (sector=512 bytes) |
References virtual_usb_trans().
|
static |
This function transfers the data between memory and USB MSC interface.
addr | Sector address to start read |
nb_sector | Number of sectors to transfer (sector=512 bytes) |
b_read | Memory to USB, if true |
References CTRL_FAIL, CTRL_GOOD, min, udi_msc_trans_block(), vmem_data, VMEM_NB_SECTOR, and VMEM_SECTOR_SIZE.
Referenced by virtual_usb_read_10(), and virtual_usb_write_10().
Ctrl_status virtual_usb_write_10 | ( | uint32_t | addr, |
uint16_t | nb_sector | ||
) |
This function transfers the USB MSC data to the memory.
addr | Sector address to start write |
nb_sector | Number of sectors to transfer (sector=512 bytes) |
References virtual_usb_trans().
bool virtual_wr_protect | ( | void | ) |
This function returns the write-protected mode.
Referenced by virtual_read_capacity(), virtual_test_unit_ready(), and virtual_unload().
|
static |
Referenced by virtual_usb_trans().