Commit | Line | Data |
---|---|---|
3b1e82d2 AW |
1 | /*-----------------------------------------------------------------------\r |
2 | / Low level disk interface modlue include file R0.06 (C)ChaN, 2007\r | |
3 | /-----------------------------------------------------------------------*/\r | |
4 | \r | |
5 | #ifndef _DISKIO\r | |
6 | \r | |
7 | #define _READONLY 0 /* 1: Read-only mode */\r | |
8 | #define _USE_IOCTL 1\r | |
9 | \r | |
10 | #include "integer.h"\r | |
11 | \r | |
12 | #ifdef __cplusplus\r | |
13 | extern "C" {\r | |
14 | #endif\r | |
15 | \r | |
16 | /* Status of Disk Functions */\r | |
17 | typedef BYTE DSTATUS;\r | |
18 | \r | |
19 | /* Results of Disk Functions */\r | |
20 | typedef enum {\r | |
21 | RES_OK = 0, /* 0: Successful */\r | |
22 | RES_ERROR, /* 1: R/W Error */\r | |
23 | RES_WRPRT, /* 2: Write Protected */\r | |
24 | RES_NOTRDY, /* 3: Not Ready */\r | |
25 | RES_PARERR /* 4: Invalid Parameter */\r | |
26 | } DRESULT;\r | |
27 | \r | |
28 | \r | |
29 | /*---------------------------------------*/\r | |
30 | /* Prototypes for disk control functions */\r | |
31 | \r | |
32 | DSTATUS disk_initialize (BYTE);\r | |
33 | DSTATUS disk_status (BYTE);\r | |
34 | DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);\r | |
35 | #if _READONLY == 0\r | |
36 | DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);\r | |
37 | #endif\r | |
38 | DRESULT disk_ioctl (BYTE, BYTE, void*);\r | |
39 | void disk_timerproc (void);\r | |
40 | \r | |
41 | #ifdef __cplusplus\r | |
42 | };\r | |
43 | #endif\r | |
44 | \r | |
45 | \r | |
46 | /* Disk Status Bits (DSTATUS) */\r | |
47 | \r | |
48 | #define STA_NOINIT 0x01 /* Drive not initialized */\r | |
49 | #define STA_NODISK 0x02 /* No medium in the drive */\r | |
50 | #define STA_PROTECT 0x04 /* Write protected */\r | |
51 | \r | |
52 | \r | |
53 | /* Command code for disk_ioctrl() */\r | |
54 | \r | |
55 | /* Generic command */\r | |
56 | #define CTRL_SYNC 0 /* Mandatory for read/write configuration */\r | |
57 | #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */\r | |
58 | #define GET_SECTOR_SIZE 2\r | |
59 | #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */\r | |
60 | #define CTRL_POWER 4\r | |
61 | #define CTRL_LOCK 5\r | |
62 | #define CTRL_EJECT 6\r | |
63 | /* MMC/SDC command */\r | |
64 | #define MMC_GET_TYPE 10\r | |
65 | #define MMC_GET_CSD 11\r | |
66 | #define MMC_GET_CID 12\r | |
67 | #define MMC_GET_OCR 13\r | |
68 | #define MMC_GET_SDSTAT 14\r | |
69 | /* ATA/CF command */\r | |
70 | #define ATA_GET_REV 20\r | |
71 | #define ATA_GET_MODEL 21\r | |
72 | #define ATA_GET_SN 22\r | |
73 | \r | |
74 | \r | |
75 | #define _DISKIO\r | |
76 | #endif\r |