1 /*-----------------------------------------------------------------------
2 / Low level disk interface modlue include file R0.04a (C)ChaN, 2007
3 /-----------------------------------------------------------------------*/
7 #define _READONLY 0 /* 1: Read-only mode */
12 /* Status of Disk Functions */
15 /* Results of Disk Functions */
17 RES_OK
= 0, /* 0: Successful */
18 RES_ERROR
, /* 1: R/W Error */
19 RES_WRPRT
, /* 2: Write Protected */
20 RES_NOTRDY
, /* 3: Not Ready */
21 RES_PARERR
/* 4: Invalid Parameter */
25 /*---------------------------------------*/
26 /* Prototypes for disk control functions */
28 DSTATUS
disk_initialize (BYTE
);
29 DSTATUS
disk_status (BYTE
);
30 DRESULT
disk_read (BYTE
, BYTE
*, DWORD
, BYTE
);
31 DRESULT
disk_ioctl (BYTE
, BYTE
, void*);
32 void disk_timerproc (void);
37 /* Disk Status Bits (DSTATUS) */
39 #define STA_NOINIT 0x01 /* Drive not initialized */
40 #define STA_NODISK 0x02 /* No medium in the drive */
41 #define STA_PROTECT 0x04 /* Write protected */
44 /* Command code for disk_ioctrl() */
46 #define GET_SECTOR_COUNT 1
47 #define GET_SECTOR_SIZE 2
52 #define MMC_GET_CSD 10
53 #define MMC_GET_CID 11
54 #define MMC_GET_OCR 12
55 #define ATA_GET_REV 20
56 #define ATA_GET_MODEL 21