1 /*-----------------------------------------------------------------------
2 / Low level disk interface module include file
3 /-----------------------------------------------------------------------*/
7 #define _READONLY 0 /* 1: Read-only mode */
12 #include "../DataflashManager.h"
15 /* Status of Disk Functions */
18 /* Results of Disk Functions */
20 RES_OK
= 0, /* 0: Successful */
21 RES_ERROR
, /* 1: R/W Error */
22 RES_WRPRT
, /* 2: Write Protected */
23 RES_NOTRDY
, /* 3: Not Ready */
24 RES_PARERR
/* 4: Invalid Parameter */
28 /*---------------------------------------*/
29 /* Prototypes for disk control functions */
31 DSTATUS
disk_initialize (BYTE
);
32 DSTATUS
disk_status (BYTE
);
33 DRESULT
disk_read (BYTE
, BYTE
*, DWORD
, BYTE
);
35 DRESULT
disk_write (BYTE
, const BYTE
*, DWORD
, BYTE
);
37 DRESULT
disk_ioctl (BYTE
, BYTE
, void*);
40 /* Disk Status Bits (DSTATUS) */
42 #define STA_NOINIT 0x01 /* Drive not initialized */
43 #define STA_NODISK 0x02 /* No medium in the drive */
44 #define STA_PROTECT 0x04 /* Write protected */
47 #define CTRL_SYNC 0 /* Mandatory for write functions */
48 #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */
49 #define GET_SECTOR_SIZE 2 /* Mandatory for multiple sector size cfg */
50 #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */
55 #define MMC_GET_TYPE 10
56 #define MMC_GET_CSD 11
57 #define MMC_GET_CID 12
58 #define MMC_GET_OCR 13
59 #define MMC_GET_SDSTAT 14
61 #define ATA_GET_REV 20
62 #define ATA_GET_MODEL 21