port-work; won't compile or even work
[ppcskel.git] / diskio.h
1 /*-----------------------------------------------------------------------
2 /  Low level disk interface modlue include file  R0.07   (C)ChaN, 2009
3 /-----------------------------------------------------------------------*/
4
5 #ifndef _DISKIO
6
7 #define _READONLY       0       /* 1: Read-only mode */
8 #define _USE_IOCTL      1
9
10 #include "types.h"
11
12 /* Status of Disk Functions */
13 typedef BYTE    DSTATUS;
14
15 /* Results of Disk Functions */
16 typedef enum {
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 */
22 } DRESULT;
23
24 /*---------------------------------------*/
25 /* Prototypes for disk control functions */
26
27 DSTATUS disk_initialize (BYTE);
28 DSTATUS disk_status (BYTE);
29 DRESULT disk_read (BYTE, BYTE*, DWORD, u32);
30 #if     _READONLY == 0
31 DRESULT disk_write (BYTE, const BYTE*, DWORD, u32);
32 #endif
33 DRESULT disk_ioctl (BYTE, BYTE, void*);
34
35 DWORD get_fattime(void);
36
37 /* Disk Status Bits (DSTATUS) */
38
39 #define STA_NOINIT              0x01    /* Drive not initialized */
40 #define STA_NODISK              0x02    /* No medium in the drive */
41 #define STA_PROTECT             0x04    /* Write protected */
42
43
44 /* Command code for disk_ioctrl() */
45
46 /* Generic command */
47 #define CTRL_SYNC                       0       /* Mandatory for write functions */
48 #define GET_SECTOR_COUNT        1       /* Mandatory for only f_mkfs() */
49 #define GET_SECTOR_SIZE         2
50 #define GET_BLOCK_SIZE          3       /* Mandatory for only f_mkfs() */
51
52 #define _DISKIO
53 #endif