diff options
author | Leo C. | 2024-06-30 15:18:24 +0200 |
---|---|---|
committer | Leo C. | 2024-06-30 15:18:24 +0200 |
commit | 7aaec0f97677b451e024ef5d1cd2b675a914d440 (patch) | |
tree | e4c9711b2e8522825be34af52be3b73636f37728 /include/diskio.h | |
parent | 08749e4051ac14c6e9a2d85a37b3efdcedbb07f6 (diff) | |
download | z180-stamp-7aaec0f97677b451e024ef5d1cd2b675a914d440.zip |
Adaptions for fatfs R0.15
Diffstat (limited to 'include/diskio.h')
-rw-r--r-- | include/diskio.h | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/include/diskio.h b/include/diskio.h index fee87a5..ad89e4b 100644 --- a/include/diskio.h +++ b/include/diskio.h @@ -1,14 +1,15 @@ -/*----------------------------------------------------------------------- -/ Low level disk interface modlue include file R0.07 (C)ChaN, 2009 +/*-----------------------------------------------------------------------/ +/ Low level disk interface modlue include file (C)ChaN, 2019 / /-----------------------------------------------------------------------*/ -#ifndef _DISKIO_H -#define _DISKIO_H +#ifndef _DISKIO_DEFINED +#define _DISKIO_DEFINED -#define _USE_WRITE 1 /* 1: Enable disk_write function */ -#define _USE_IOCTL 1 /* 1: Enable disk_ioctl fucntion */ +#ifdef __cplusplus +extern "C" { +#endif -#include "integer.h" +#include "ff.h" /* Status of Disk Functions */ @@ -27,15 +28,11 @@ typedef enum { /*---------------------------------------*/ /* Prototypes for disk control functions */ -DSTATUS disk_initialize (BYTE drv); -DSTATUS disk_status (BYTE drv); -DRESULT disk_read (BYTE drv, BYTE* buff, DWORD sector, UINT count); -#if _USE_WRITE -DRESULT disk_write (BYTE drv, const BYTE* buff, DWORD sector, UINT count); -#endif -#if _USE_IOCTL -DRESULT disk_ioctl (BYTE drv, BYTE cmd, void* buff); -#endif +DSTATUS disk_initialize (BYTE pdrv); +DSTATUS disk_status (BYTE pdrv); +DRESULT disk_read (BYTE pdrv, BYTE* buff, LBA_t sector, UINT count); +DRESULT disk_write (BYTE pdrv, const BYTE* buff, LBA_t sector, UINT count); +DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff); void disk_timerproc (void); @@ -49,14 +46,14 @@ void disk_timerproc (void); #define STAT_MASK (STA_NOINIT | STA_NODISK | STA_PROTECT) -/* Command code for disk_ioctrl() */ +/* Command code for disk_ioctrl function */ /* Generic command (Used by FatFs) */ -#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */ -#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */ -#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */ -#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */ -#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */ +#define CTRL_SYNC 0 /* Complete pending write process (needed at FF_FS_READONLY == 0) */ +#define GET_SECTOR_COUNT 1 /* Get media size (needed at FF_USE_MKFS == 1) */ +#define GET_SECTOR_SIZE 2 /* Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */ +#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at FF_USE_MKFS == 1) */ +#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */ /* Generic command (Not used by FatFs) */ #define CTRL_FORMAT 5 /* Create physical format on the media */ |