00001
00002
00003
00004
00005 #ifndef _DISKIO_DEFINED
00006 #define _DISKIO_DEFINED
00007
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011
00012 #define _USE_WRITE 1
00013 #define _USE_IOCTL 1
00014
00015 #include "integer.h"
00016
00017
00018
00019 typedef BYTE DSTATUS;
00020
00021
00022 typedef enum {
00023 RES_OK = 0,
00024 RES_ERROR,
00025 RES_WRPRT,
00026 RES_NOTRDY,
00027 RES_PARERR
00028 } DRESULT;
00029
00030
00031
00032
00033
00034
00035 DSTATUS disk_initialize (BYTE pdrv);
00036 DSTATUS disk_status (BYTE pdrv);
00037 DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
00038 DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
00039 DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
00040
00041
00042
00043
00044 #define STA_NOINIT 0x01
00045 #define STA_NODISK 0x02
00046 #define STA_PROTECT 0x04
00047
00048
00049
00050
00051
00052 #define CTRL_SYNC 0
00053 #define GET_SECTOR_COUNT 1
00054 #define GET_SECTOR_SIZE 2
00055 #define GET_BLOCK_SIZE 3
00056 #define CTRL_ERASE_SECTOR 4
00057
00058
00059 #define CTRL_POWER 5
00060 #define CTRL_LOCK 6
00061 #define CTRL_EJECT 7
00062 #define CTRL_FORMAT 8
00063
00064
00065 #define MMC_GET_TYPE 10
00066 #define MMC_GET_CSD 11
00067 #define MMC_GET_CID 12
00068 #define MMC_GET_OCR 13
00069 #define MMC_GET_SDSTAT 14
00070
00071
00072 #define ATA_GET_REV 20
00073 #define ATA_GET_MODEL 21
00074 #define ATA_GET_SN 22
00075
00076 #ifdef __cplusplus
00077 }
00078 #endif
00079
00080 #endif