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