Macros | Functions
Port of low level driver for FatFS

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...
 

Detailed Description

Low level driver for FatFS. The driver is based on the ctrl access module of the specific MCU device.

Macro Definition Documentation

◆ SECTOR_SIZE_1024

#define SECTOR_SIZE_1024   2

Definition at line 98 of file diskio.c.

◆ SECTOR_SIZE_2048

#define SECTOR_SIZE_2048   4

Definition at line 99 of file diskio.c.

◆ SECTOR_SIZE_4096

#define SECTOR_SIZE_4096   8

Definition at line 100 of file diskio.c.

◆ SECTOR_SIZE_512

#define SECTOR_SIZE_512   1

Supported sector size. These values are based on the LUN function: mem_sector_size().

Definition at line 97 of file diskio.c.

◆ SECTOR_SIZE_DEFAULT

#define SECTOR_SIZE_DEFAULT   512

Default sector size

Definition at line 93 of file diskio.c.

Function Documentation

◆ disk_initialize()

DSTATUS disk_initialize ( BYTE  drv)

Initialize a disk.

Parameters
drvPhysical drive number (0..).
Returns
0 or disk status in combination of DSTATUS bits (STA_NOINIT, STA_PROTECT).

Definition at line 110 of file diskio.c.

◆ disk_ioctl()

DRESULT disk_ioctl ( BYTE  drv,
BYTE  ctrl,
void *  buff 
)

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.

Parameters
drvPhysical drive number (0..).
ctrlControl code.
buffBuffer to send/receive control data.
Returns
RES_OK for success, otherwise DRESULT error code.

Definition at line 296 of file diskio.c.

◆ disk_read()

DRESULT disk_read ( BYTE  drv,
BYTE buff,
DWORD  sector,
BYTE  count 
)

Read sector(s).

Parameters
drvPhysical drive number (0..).
buffData buffer to store read data.
sectorSector address (LBA).
countNumber of sectors to read (1..255).
Returns
RES_OK for success, otherwise DRESULT error code.

Definition at line 185 of file diskio.c.

◆ disk_status()

DSTATUS disk_status ( BYTE  drv)

Return disk status.

Parameters
drvPhysical drive number (0..).
Returns
0 or disk status in combination of DSTATUS bits (STA_NOINIT, STA_NODISK, STA_PROTECT).

Definition at line 163 of file diskio.c.

◆ disk_write()

DRESULT disk_write ( BYTE  drv,
BYTE const *  buff,
DWORD  sector,
BYTE  count 
)

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.

Parameters
drvPhysical drive number (0..).
buffData buffer to store read data.
sectorSector address (LBA).
countNumber of sectors to read (1..255).
Returns
RES_OK for success, otherwise DRESULT error code.

Definition at line 235 of file diskio.c.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:01