]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - include/diskio.h
Adaptions for fatfs R0.15
[z180-stamp.git] / include / diskio.h
index fee87a536438b4fb057de1647e200d447ed964e6..ad89e4b781722f2c214c218e7c38cc99a258d136 100644 (file)
@@ -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 */