1 /*-----------------------------------------------------------------------
2 / Low level disk interface modlue include file R0.07 (C)ChaN, 2009
3 /-----------------------------------------------------------------------*/
7 #define _READONLY 1 /* 1: Read-only mode */
12 /* Status of Disk Functions */
15 /* Results of Disk Functions */
17 RES_OK
= 0, /* 0: Successful */
18 RES_ERROR
, /* 1: R/W Error */
19 RES_WRPRT
, /* 2: Write Protected */
20 RES_NOTRDY
, /* 3: Not Ready */
21 RES_PARERR
/* 4: Invalid Parameter */
24 /*---------------------------------------*/
25 /* Prototypes for disk control functions */
27 DSTATUS
disk_initialize (BYTE
);
28 void disk_shutdown (BYTE
);
29 DSTATUS
disk_status (BYTE
);
30 DRESULT
disk_read (BYTE
, BYTE
*, DWORD
, u32
);
32 DRESULT
disk_write (BYTE
, const BYTE
*, DWORD
, u32
);
34 DRESULT
disk_ioctl (BYTE
, BYTE
, void*);
37 DWORD
get_fattime(void);
40 /* Disk Status Bits (DSTATUS) */
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 */
47 /* Command code for disk_ioctrl() */
50 #define CTRL_SYNC 0 /* Mandatory for write functions */
51 #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */
52 #define GET_SECTOR_SIZE 2
53 #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */