MAV'RIC
diskio.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------/
2 / Low level disk interface module include file (C)ChaN, 2013 /
3 /-----------------------------------------------------------------------*/
4 
12 #ifndef _DISKIO_DEFINED
13 #define _DISKIO_DEFINED
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #define _USE_WRITE 1
20 #define _USE_IOCTL 1
21 
22 #include "integer.h"
23 #include "ff.h"
24 
25 
26 typedef BYTE DSTATUS;
27 
31 typedef enum
32 {
33  RES_OK = 0,
38 } DRESULT;
39 
41 #define STA_NOINIT 0x01
42 #define STA_NODISK 0x02
43 #define STA_PROTECT 0x04
44 
45 
47 
49 #define CTRL_SYNC 0
50 #define GET_SECTOR_COUNT 1
51 #define GET_SECTOR_SIZE 2
52 #define GET_BLOCK_SIZE 3
53 #define CTRL_ERASE_SECTOR 4
54 
55 #define CTRL_POWER 5
57 #define CTRL_LOCK 6
58 #define CTRL_EJECT 7
59 #define CTRL_FORMAT 8
60 
61 #define MMC_GET_TYPE 10
63 #define MMC_GET_CSD 11
64 #define MMC_GET_CID 12
65 #define MMC_GET_OCR 13
66 #define MMC_GET_SDSTAT 14
67 
68 #define ATA_GET_REV 20
70 #define ATA_GET_MODEL 21
71 #define ATA_GET_SN 22
72 
73 
80 DSTATUS disk_initialize (BYTE pdrv);
81 
89 DSTATUS disk_status (BYTE pdrv);
90 
101 DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
102 
113 DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
114 
124 DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
125 
131 DWORD get_fattime(void);
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
137 #endif
3: Not Ready
Definition: diskio.h:36
DRESULT disk_write(BYTE pdrv, const BYTE *buff, DWORD sector, UINT count)
Write the value of buff on the sector.
Definition: diskio.c:229
1: R/W Error
Definition: diskio.h:34
4: Invalid Parameter
Definition: diskio.h:37
DSTATUS disk_status(BYTE pdrv)
Get Disk Status.
Definition: diskio.c:97
BYTE DSTATUS
Status of Disk Functions.
Definition: diskio.h:26
DRESULT
Results of Disk Functions.
Definition: diskio.h:31
DRESULT disk_read(BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
Read a sector from the device and write to buff.
Definition: diskio.c:158
0: Successful
Definition: diskio.h:33
DSTATUS disk_initialize(BYTE pdrv)
Initialise the disk.
Definition: diskio.c:39
DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
Miscellaneous Functions, function to get information from the device.
Definition: diskio.c:317
DWORD get_fattime(void)
The time to write the metadata of the files.
Definition: diskio.c:388
2: Write Protected
Definition: diskio.h:35