5df77502c90e6944156e22b730c2c7662bc792fb
[pub/USBasp.git] / Projects / TempDataLogger / Lib / FATFs / diskio.h
1 /*-----------------------------------------------------------------------
2 / Low level disk interface module include file
3 /-----------------------------------------------------------------------*/
4
5 #ifndef _DISKIO
6
7 #define _READONLY 0 /* 1: Read-only mode */
8 #define _USE_IOCTL 1
9
10 #include "integer.h"
11
12 #include "../DataflashManager.h"
13
14
15 /* Status of Disk Functions */
16 typedef BYTE DSTATUS;
17
18 /* Results of Disk Functions */
19 typedef enum {
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 */
25 } DRESULT;
26
27
28 /*---------------------------------------*/
29 /* Prototypes for disk control functions */
30
31 DSTATUS disk_initialize (BYTE);
32 DSTATUS disk_status (BYTE);
33 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
34 #if _READONLY == 0
35 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
36 #endif
37 DRESULT disk_ioctl (BYTE, BYTE, void*);
38
39
40 /* Disk Status Bits (DSTATUS) */
41
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 */
45
46
47 #define _DISKIO
48 #endif
49