1 /*-----------------------------------------------------------------------
2 / Low level disk interface modlue include file R0.04a (C)ChaN, 2007
3 /-----------------------------------------------------------------------*/
9 // Status of Disk Functions
14 // Results of Disk Functions
18 RES_OK = 0, /* 0: Successful */
19 RES_ERROR, /* 1: R/W Error */
20 RES_WRPRT, /* 2: Write Protected */
21 RES_NOTRDY, /* 3: Not Ready */
22 RES_PARERR /* 4: Invalid Parameter */
27 // Disk Status Bits (DSTATUS)
29 #define STA_NOINIT 0x01 /* Drive not initialized */
30 #define STA_NODISK 0x02 /* No medium in the drive */
31 #define STA_PROTECT 0x04 /* Write protected */
34 // Command code for disk_ioctl()
36 #define GET_SECTOR_COUNT 1
37 #define GET_SECTOR_SIZE 2
42 #define MMC_GET_CSD 10
43 #define MMC_GET_CID 11
44 #define MMC_GET_OCR 12
45 #define ATA_GET_REV 20
46 #define ATA_GET_MODEL 21
52 DSTATUS diskInitialize (U8);
53 DSTATUS diskShutdown (void);
54 DSTATUS diskStatus (U8);
55 DRESULT diskRead (U8, U8 *, U32, U8);
57 DRESULT diskWrite (U8, const U8 *, U32, U8);
59 DRESULT diskIoctl (U8, U8, void *);