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