1 /*-----------------------------------------------------------------------
2 / Low level disk interface modlue include file R0.05 (C)ChaN, 2007
3 /-----------------------------------------------------------------------*/
7 #define _READONLY 0 /* 1: Read-only mode */
13 /* Status of Disk Functions */
16 /* 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 */
26 /*---------------------------------------*/
27 /* Prototypes for disk control functions */
29 DSTATUS
disk_initialize (BYTE
);
30 DSTATUS
disk_status (BYTE
);
31 DRESULT
disk_read (BYTE
, BYTE
*, DWORD
, BYTE
);
33 DRESULT
disk_write (BYTE
, const BYTE
*, DWORD
, BYTE
);
35 DRESULT
disk_ioctl (BYTE
, BYTE
, void*);
36 void disk_timerproc (void);
41 /* Disk Status Bits (DSTATUS) */
43 #define STA_NOINIT 0x01 /* Drive not initialized */
44 #define STA_NODISK 0x02 /* No medium in the drive */
45 #define STA_PROTECT 0x04 /* Write protected */
49 /* Command code for disk_ioctrl() */
52 #define CTRL_SYNC 0 /* Mandatory for write functions */
53 #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */
54 #define GET_SECTOR_SIZE 2
55 #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */
60 #define MMC_GET_TYPE 10
61 #define MMC_GET_CSD 11
62 #define MMC_GET_CID 12
63 #define MMC_GET_OCR 13
64 #define MMC_GET_SDSTAT 14
66 #define ATA_GET_REV 20
67 #define ATA_GET_MODEL 21
72 /* Card type flags (CardType) */
73 #define CT_MMC 0x01 /* MMC ver 3 */
74 #define CT_SD1 0x02 /* SD ver 1 */
75 #define CT_SD2 0x04 /* SD ver 2 */
76 #define CT_SDC (CT_SD1|CT_SD2) /* SD */
77 #define CT_BLOCK 0x08 /* Block addressing */
This page took 0.04631 seconds and 5 git commands to generate.