1 /*-----------------------------------------------------------------------
2 / Low level disk interface modlue include file R0.06 (C)ChaN, 2007
3 /-----------------------------------------------------------------------*/
7 #define _READONLY 0 /* 1: Read-only mode */
16 /* Status of Disk Functions */
19 /* Results of Disk Functions */
21 RES_OK = 0, /* 0: Successful */
22 RES_ERROR, /* 1: R/W Error */
23 RES_WRPRT, /* 2: Write Protected */
24 RES_NOTRDY, /* 3: Not Ready */
25 RES_PARERR /* 4: Invalid Parameter */
29 /*---------------------------------------*/
30 /* Prototypes for disk control functions */
32 DSTATUS disk_initialize (BYTE);
33 DSTATUS disk_status (BYTE);
34 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
36 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
38 DRESULT disk_ioctl (BYTE, BYTE, void*);
39 void disk_timerproc (void);
46 /* Disk Status Bits (DSTATUS) */
48 #define STA_NOINIT 0x01 /* Drive not initialized */
49 #define STA_NODISK 0x02 /* No medium in the drive */
50 #define STA_PROTECT 0x04 /* Write protected */
53 /* Command code for disk_ioctrl() */
56 #define CTRL_SYNC 0 /* Mandatory for read/write configuration */
57 #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */
58 #define GET_SECTOR_SIZE 2
59 #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */
64 #define MMC_GET_TYPE 10
65 #define MMC_GET_CSD 11
66 #define MMC_GET_CID 12
67 #define MMC_GET_OCR 13
68 #define MMC_GET_SDSTAT 14
70 #define ATA_GET_REV 20
71 #define ATA_GET_MODEL 21