| 248 |
Kevin |
1 |
/*-----------------------------------------------------------------------
|
|
|
2 |
/ PFF - Low level disk interface modlue include file (C)ChaN, 2009
|
|
|
3 |
/-----------------------------------------------------------------------*/
|
|
|
4 |
|
|
|
5 |
#ifndef _DISKIO
|
|
|
6 |
|
|
|
7 |
#include "integer.h"
|
|
|
8 |
|
|
|
9 |
/* Status of Disk Functions */
|
|
|
10 |
typedef BYTE DSTATUS;
|
|
|
11 |
|
|
|
12 |
/* Results of Disk Functions */
|
|
|
13 |
typedef enum {
|
|
|
14 |
RES_OK = 0, /* 0: Function succeeded */
|
|
|
15 |
RES_ERROR, /* 1: Disk error */
|
|
|
16 |
RES_NOTRDY, /* 2: Not ready */
|
|
|
17 |
RES_PARERR /* 3: Invalid parameter */
|
|
|
18 |
} DRESULT;
|
|
|
19 |
|
|
|
20 |
/*---------------------------------------*/
|
|
|
21 |
/* Prototypes for disk control functions */
|
|
|
22 |
|
|
|
23 |
DSTATUS disk_initialize (void);
|
|
|
24 |
DRESULT disk_readp (BYTE* dest, DWORD sector, WORD offset, WORD count);
|
|
|
25 |
//DRESULT disk_writep (BYTE*, DWORD);
|
|
|
26 |
|
|
|
27 |
#define STA_OK 0x00
|
|
|
28 |
#define STA_NOINIT 0x01 /* Drive not initialized */
|
|
|
29 |
#define STA_NODISK 0x02 /* No medium in the drive */
|
|
|
30 |
|
|
|
31 |
/* Card type flags (CardType) */
|
|
|
32 |
#define CT_MMC 0x01 /* MMC ver 3 */
|
|
|
33 |
#define CT_SD1 0x02 /* SD ver 1 */
|
|
|
34 |
#define CT_SD2 0x04 /* SD ver 2 */
|
|
|
35 |
#define CT_SDC (CT_SD1|CT_SD2) /* SD */
|
|
|
36 |
#define CT_BLOCK 0x08 /* Block addressing */
|
|
|
37 |
|
|
|
38 |
#define _DISKIO
|
|
|
39 |
#endif
|