Atmel Software Framework

avr32/services/usb/_asf_v1/class/mass_storage/examples/virtual_mem/virtual_mem.h File Reference
#include "conf_access.h"
#include "ctrl_access.h"

Macros

#define ENTRY_SIZE   32
 FAT specification. More...
 
#define FAT_SECTOR   (PBR_SECTOR + VMEM_RESERVED_SIZE)
 
#define FILE_SECTOR   (ROOT_SECTOR + VMEM_NB_ROOT_ENTRY * ENTRY_SIZE / VMEM_SECTOR_SIZE)
 
#define FILE_SIZE   16
 
#define PBR_SECTOR   0
 
#define ROOT_SECTOR   (FAT_SECTOR + VMEM_NB_FATS * VMEM_SIZE_FAT)
 
#define VMEM_CLUSTER_SIZE   1
 
#define VMEM_MEDIA_TYPE   0xF8
 
#define VMEM_NB_FATS   2
 
#define VMEM_NB_HEAD   1
 
#define VMEM_NB_HIDDEN_SECT   0
 
#define VMEM_NB_ROOT_ENTRY   16
 
#define VMEM_NB_SECTOR   (FILE_SIZE * VMEM_CLUSTER_SIZE + FILE_SECTOR)
 
#define VMEM_RESERVED_SIZE   1
 
#define VMEM_SECT_PER_TRACK   1
 
#define VMEM_SECTOR_SIZE   512
 Value of virtual PBR. More...
 
#define VMEM_SIZE_FAT   1
 
#define VMEN_DRIVE_NUMBER   0x80
 

Functions

Ctrl_status virtual_mem_2_ram (uint32_t addr, void *ram)
 This function transfers 1 data sector from memory to RAM sector = 512 bytes. More...
 
Ctrl_status virtual_ram_2_mem (uint32_t addr, const void *ram)
 This function transfers 1 data sector from memory to RAM sector = 512 bytes. More...
 
Ctrl_status virtual_read_capacity (uint32_t *u32_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...
 
Ctrl_status virtual_usb_read_10 (uint32_t addr, uint16_t nb_sector)
 This function transfers the memory data (programmed in sbc_read_10) directly to the USB interface sector = 512 bytes. More...
 
Ctrl_status virtual_usb_write_10 (uint32_t addr, uint16_t nb_sector)
 This function transfers the USB data (programmed in sbc_write_10) directly to the memory interface sector = 512 bytes. More...
 
bool virtual_wr_protect (void)
 This function returns the write-protected mode Only used by memory removal with a HARDWARE-SPECIFIC write-protected detection. More...
 

#define ENTRY_SIZE   32

FAT specification.

#define FAT_SECTOR   (PBR_SECTOR + VMEM_RESERVED_SIZE)

Referenced by virtual_check_init().

#define FILE_SECTOR   (ROOT_SECTOR + VMEM_NB_ROOT_ENTRY * ENTRY_SIZE / VMEM_SECTOR_SIZE)
#define FILE_SIZE   16
#define PBR_SECTOR   0

Referenced by virtual_check_init().

#define ROOT_SECTOR   (FAT_SECTOR + VMEM_NB_FATS * VMEM_SIZE_FAT)
#define VMEM_CLUSTER_SIZE   1

Referenced by virtual_check_init().

#define VMEM_MEDIA_TYPE   0xF8

Referenced by virtual_check_init().

#define VMEM_NB_FATS   2

Referenced by virtual_check_init().

#define VMEM_NB_HEAD   1

Referenced by virtual_check_init().

#define VMEM_NB_HIDDEN_SECT   0

Referenced by virtual_check_init().

#define VMEM_NB_ROOT_ENTRY   16

Referenced by virtual_check_init().

#define VMEM_RESERVED_SIZE   1

Referenced by virtual_check_init().

#define VMEM_SECT_PER_TRACK   1

Referenced by virtual_check_init().

#define VMEM_SECTOR_SIZE   512
#define VMEM_SIZE_FAT   1

Referenced by virtual_check_init().

#define VMEN_DRIVE_NUMBER   0x80

Referenced by virtual_check_init().