|
MAV'RIC
|
#include "integer.h"#include "ff.h"
Go to the source code of this file.
Macros | |
| #define | _USE_WRITE 1 |
| 1: Enable disk_write function | |
| #define | _USE_IOCTL 1 |
| 1: Enable disk_ioctl function | |
| #define | STA_NOINIT 0x01 |
| Drive not initialized. | |
| #define | STA_NODISK 0x02 |
| No medium in the drive. | |
| #define | STA_PROTECT 0x04 |
| Write protected. More... | |
| #define | CTRL_SYNC 0 |
| Flush disk cache (for write functions) | |
| #define | GET_SECTOR_COUNT 1 |
| Get media size (for only f_mkfs()) | |
| #define | GET_SECTOR_SIZE 2 |
| Get sector size (for multiple sector size (_MAX_SS >= 1024)) | |
| #define | GET_BLOCK_SIZE 3 |
| Get erase block size (for only f_mkfs()) | |
| #define | CTRL_ERASE_SECTOR 4 |
| Force erased a block of sectors (for only _USE_ERASE) More... | |
| #define | CTRL_POWER 5 |
| Get/Set power status. | |
| #define | CTRL_LOCK 6 |
| Lock/Unlock media removal. | |
| #define | CTRL_EJECT 7 |
| Eject media. | |
| #define | CTRL_FORMAT 8 |
| Create physical format on the media. More... | |
| #define | MMC_GET_TYPE 10 |
| Get card type. | |
| #define | MMC_GET_CSD 11 |
| Get CSD. | |
| #define | MMC_GET_CID 12 |
| Get CID. | |
| #define | MMC_GET_OCR 13 |
| Get OCR. | |
| #define | MMC_GET_SDSTAT 14 |
| Get SD status. More... | |
| #define | ATA_GET_REV 20 |
| Get F/W revision. | |
| #define | ATA_GET_MODEL 21 |
| Get model name. | |
| #define | ATA_GET_SN 22 |
| Get serial number. | |
Typedefs | |
| typedef BYTE | DSTATUS |
| Status of Disk Functions. | |
Enumerations | |
| enum | DRESULT { RES_OK = 0, RES_ERROR, RES_WRPRT, RES_NOTRDY, RES_PARERR } |
| Results of Disk Functions. More... | |
Functions | |
| DSTATUS | disk_initialize (BYTE pdrv) |
| Initialise the disk. More... | |
| DSTATUS | disk_status (BYTE pdrv) |
| Get Disk Status. More... | |
| DRESULT | disk_read (BYTE pdrv, BYTE *buff, DWORD sector, UINT count) |
| Read a sector from the device and write to buff. More... | |
| DRESULT | disk_write (BYTE pdrv, const BYTE *buff, DWORD sector, UINT count) |
| Write the value of buff on the sector. More... | |
| DRESULT | disk_ioctl (BYTE pdrv, BYTE cmd, void *buff) |
| Miscellaneous Functions, function to get information from the device. More... | |
| DWORD | get_fattime (void) |
| The time to write the metadata of the files. More... | |
Link the FatFs level with the low level command of the disk If a working storage control module is available, it should be attached to the FatFs via a glue function rather than modifying it. This is an example of glue functions to attach various exsisting storage control module to the FatFs module with a defined API.
Link the FatFs level with the low level command of the disk
| #define CTRL_ERASE_SECTOR 4 |
Force erased a block of sectors (for only _USE_ERASE)
Generic command (not used by FatFs)
| #define CTRL_FORMAT 8 |
Create physical format on the media.
MMC/SDC specific ioctl command
| #define MMC_GET_SDSTAT 14 |
Get SD status.
ATA/CF specific ioctl command
| #define STA_PROTECT 0x04 |
Write protected.
Command code for disk_ioctrl fucntion Generic command (used by FatFs)
| enum DRESULT |
| DSTATUS disk_initialize | ( | BYTE | pdrv | ) |
Initialise the disk.
| pdrv | The drive number (0..) |

| DRESULT disk_ioctl | ( | BYTE | pdrv, |
| BYTE | cmd, | ||
| void * | buff | ||
| ) |
Miscellaneous Functions, function to get information from the device.
| pdrv | The drive number (0..) |
| cmd | The command of the feature |
| buff | The pointer to the buffer on which the result will be written |

| DRESULT disk_read | ( | BYTE | pdrv, |
| BYTE * | buff, | ||
| DWORD | sector, | ||
| UINT | count | ||
| ) |
Read a sector from the device and write to buff.
| pdrv | The drive number (0..) |
| buff | The data buffer to store read data |
| sector | The start sector address to be read (LBA) |
| count | The number of sectors to be read |

| DSTATUS disk_status | ( | BYTE | pdrv | ) |
Get Disk Status.
| pdrv | The drive number (0..) |
| DRESULT disk_write | ( | BYTE | pdrv, |
| const BYTE * | buff, | ||
| DWORD | sector, | ||
| UINT | count | ||
| ) |
Write the value of buff on the sector.
| pdrv | The drive number (0..) |
| buff | The pointer to the buffer to take the data to write from |
| sector | The start sector on which it will be written (LBA) |
| count | The number of sectors on which it will be written |

| DWORD get_fattime | ( | void | ) |
The time to write the metadata of the files.
1.8.9.1