00001
00002
00003
00004
00005 #ifndef _DISKIO
00006
00007 #define _READONLY 0
00008
00009 #include "integer.h"
00010
00011
00012
00013 typedef BYTE DSTATUS;
00014
00015
00016 typedef enum {
00017 RES_OK = 0,
00018 RES_ERROR,
00019 RES_WRPRT,
00020 RES_NOTRDY,
00021 RES_PARERR
00022 } DRESULT;
00023
00024
00025
00026
00027
00028 DSTATUS disk_initialize (BYTE);
00029 DSTATUS disk_status (BYTE);
00030 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
00031 #if _READONLY == 0
00032 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
00033 #endif
00034 DRESULT disk_ioctl (BYTE, BYTE, void*);
00035 void disk_timerproc (void);
00036
00037
00038
00039
00040
00041
00042 #define STA_NOINIT 0x01
00043 #define STA_NODISK 0x02
00044 #define STA_PROTECT 0x04
00045
00046
00047
00048
00049 #define GET_SECTOR_COUNT 1
00050 #define GET_SECTOR_SIZE 2
00051 #define CTRL_SYNC 3
00052 #define CTRL_POWER 4
00053 #define CTRL_LOCK 5
00054 #define CTRL_EJECT 6
00055 #define MMC_GET_CSD 10
00056 #define MMC_GET_CID 11
00057 #define MMC_GET_OCR 12
00058 #define ATA_GET_REV 20
00059 #define ATA_GET_MODEL 21
00060 #define ATA_GET_SN 22
00061
00062
00063 #define _DISKIO
00064 #endif