Macros | |
#define | SECTOR_SIZE_1024 2 |
#define | SECTOR_SIZE_2048 4 |
#define | SECTOR_SIZE_4096 8 |
#define | SECTOR_SIZE_512 1 |
#define | SECTOR_SIZE_DEFAULT 512 |
Functions | |
DSTATUS | disk_initialize (BYTE drv) |
Initialize a disk. More... | |
DRESULT | disk_ioctl (BYTE drv, BYTE ctrl, void *buff) |
Miscellaneous functions, which support the following commands: More... | |
DRESULT | disk_read (BYTE drv, BYTE *buff, DWORD sector, BYTE count) |
Read sector(s). More... | |
DSTATUS | disk_status (BYTE drv) |
Return disk status. More... | |
DRESULT | disk_write (BYTE drv, BYTE const *buff, DWORD sector, BYTE count) |
Write sector(s). More... | |
Low level driver for FatFS. The driver is based on the ctrl access module of the specific MCU device.
#define SECTOR_SIZE_512 1 |
Supported sector size. These values are based on the LUN function: mem_sector_size().
Miscellaneous functions, which support the following commands:
CTRL_SYNC Make sure that the disk drive has finished pending write process. When the disk I/O module has a write back cache, flush the dirty sector immediately. In read-only configuration, this command is not needed.
GET_SECTOR_COUNT Return total sectors on the drive into the DWORD variable pointed by buffer. This command is used only in f_mkfs function.
GET_BLOCK_SIZE Return erase block size of the memory array in unit of sector into the DWORD variable pointed by Buffer. When the erase block size is unknown or magnetic disk device, return 1. This command is used only in f_mkfs function.
GET_SECTOR_SIZE Return sector size of the memory array.
drv | Physical drive number (0..). |
ctrl | Control code. |
buff | Buffer to send/receive control data. |
Write sector(s).
The FatFs module will issue multiple sector transfer request (count > 1) to the disk I/O layer. The disk function should process the multiple sector transfer properly. Do not translate it into multiple sector transfers to the media, or the data read/write performance may be drastically decreased.
drv | Physical drive number (0..). |
buff | Data buffer to store read data. |
sector | Sector address (LBA). |
count | Number of sectors to read (1..255). |