/ Low level disk interface modlue include file (C)ChaN, 2019 /
/-----------------------------------------------------------------------*/
#ifndef _DISKIO_DEFINED
#define _DISKIO_DEFINED
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#ifndef __LITEOS_M__
#include "integer.h"
#include "ffconf.h"
#else
#include "ff.h"
#endif
typedef BYTE DSTATUS;
typedef enum {
RES_OK = 0,
RES_ERROR,
RES_WRPRT,
RES_NOTRDY,
RES_PARERR
} DRESULT;
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);
#ifndef __LITEOS_M__
DRESULT disk_read_readdir (BYTE pdrv, BYTE* buff, LBA_t sector, UINT count);
DRESULT disk_raw_read (int id, void* buff, LBA_t sector, UINT32 count);
DRESULT disk_raw_write (int id, void* buff, LBA_t sector, UINT32 count);
#endif
DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
#ifdef __LITEOS_M__
DRESULT disk_read_readdir (BYTE pdrv, BYTE* buff, LBA_t sector, UINT count);
DWORD get_fattime (void);
#endif
#define STA_NOINIT 0x01
#define STA_NODISK 0x02
#define STA_PROTECT 0x04
#define CTRL_SYNC 0
#define GET_SECTOR_COUNT 1
#define GET_SECTOR_SIZE 2
#define GET_BLOCK_SIZE 3
#define CTRL_TRIM 4
#define CTRL_POWER 5
#define CTRL_LOCK 6
#define CTRL_EJECT 7
#define CTRL_FORMAT 8
#define MMC_GET_TYPE 10
#define MMC_GET_CSD 11
#define MMC_GET_CID 12
#define MMC_GET_OCR 13
#define MMC_GET_SDSTAT 14
#ifdef __LITEOS_M__
#define ISDIO_READ 55
#define ISDIO_WRITE 56
#define ISDIO_MRITE 57
#endif
#define ATA_GET_REV 20
#define ATA_GET_MODEL 21
#define ATA_GET_SN 22
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif