test fork
Dependencies: SPI_TFTx2 SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2 mbed
Fork of CANary_9341 by
CHAN_FS/diskio.h@187:447874df5cbe, 2014-05-12 (annotated)
- Committer:
- TickTock
- Date:
- Mon May 12 11:32:13 2014 +0000
- Revision:
- 187:447874df5cbe
- Parent:
- 109:3e6f0e8fca0d
Added SPI_TFTx2 library. Breaks compilation although not directly referenced.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
TickTock | 109:3e6f0e8fca0d | 1 | /*----------------------------------------------------------------------- |
TickTock | 109:3e6f0e8fca0d | 2 | / Low level disk interface modlue include file R0.07 (C)ChaN, 2009 |
TickTock | 109:3e6f0e8fca0d | 3 | /-----------------------------------------------------------------------*/ |
TickTock | 109:3e6f0e8fca0d | 4 | |
TickTock | 109:3e6f0e8fca0d | 5 | #ifndef _DISKIO |
TickTock | 109:3e6f0e8fca0d | 6 | |
TickTock | 109:3e6f0e8fca0d | 7 | #define _READONLY 0 /* 1: Read-only mode */ |
TickTock | 109:3e6f0e8fca0d | 8 | #define _USE_IOCTL 1 |
TickTock | 109:3e6f0e8fca0d | 9 | |
TickTock | 109:3e6f0e8fca0d | 10 | #include "integer.h" |
TickTock | 109:3e6f0e8fca0d | 11 | |
TickTock | 109:3e6f0e8fca0d | 12 | /* Status of Disk Functions */ |
TickTock | 109:3e6f0e8fca0d | 13 | typedef BYTE DSTATUS; |
TickTock | 109:3e6f0e8fca0d | 14 | |
TickTock | 109:3e6f0e8fca0d | 15 | /* Results of Disk Functions */ |
TickTock | 109:3e6f0e8fca0d | 16 | typedef enum { |
TickTock | 109:3e6f0e8fca0d | 17 | RES_OK = 0, /* 0: Successful */ |
TickTock | 109:3e6f0e8fca0d | 18 | RES_ERROR, /* 1: R/W Error */ |
TickTock | 109:3e6f0e8fca0d | 19 | RES_WRPRT, /* 2: Write Protected */ |
TickTock | 109:3e6f0e8fca0d | 20 | RES_NOTRDY, /* 3: Not Ready */ |
TickTock | 109:3e6f0e8fca0d | 21 | RES_PARERR /* 4: Invalid Parameter */ |
TickTock | 109:3e6f0e8fca0d | 22 | } DRESULT; |
TickTock | 109:3e6f0e8fca0d | 23 | |
TickTock | 109:3e6f0e8fca0d | 24 | |
TickTock | 109:3e6f0e8fca0d | 25 | /*---------------------------------------*/ |
TickTock | 109:3e6f0e8fca0d | 26 | /* Prototypes for disk control functions */ |
TickTock | 109:3e6f0e8fca0d | 27 | |
TickTock | 109:3e6f0e8fca0d | 28 | extern BOOL assign_drives (int argc, char *argv[]); |
TickTock | 109:3e6f0e8fca0d | 29 | extern DSTATUS disk_initialize (BYTE); |
TickTock | 109:3e6f0e8fca0d | 30 | extern DSTATUS disk_status (BYTE); |
TickTock | 109:3e6f0e8fca0d | 31 | extern DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE); |
TickTock | 109:3e6f0e8fca0d | 32 | extern DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE); |
TickTock | 109:3e6f0e8fca0d | 33 | extern DRESULT disk_ioctl (BYTE, BYTE, void*); |
TickTock | 109:3e6f0e8fca0d | 34 | |
TickTock | 109:3e6f0e8fca0d | 35 | extern int _sd_sectors(); |
TickTock | 109:3e6f0e8fca0d | 36 | |
TickTock | 109:3e6f0e8fca0d | 37 | |
TickTock | 109:3e6f0e8fca0d | 38 | /* Disk Status Bits (DSTATUS) */ |
TickTock | 109:3e6f0e8fca0d | 39 | |
TickTock | 109:3e6f0e8fca0d | 40 | #define STA_NOINIT 0x01 /* Drive not initialized */ |
TickTock | 109:3e6f0e8fca0d | 41 | #define STA_NODISK 0x02 /* No medium in the drive */ |
TickTock | 109:3e6f0e8fca0d | 42 | #define STA_PROTECT 0x04 /* Write protected */ |
TickTock | 109:3e6f0e8fca0d | 43 | |
TickTock | 109:3e6f0e8fca0d | 44 | |
TickTock | 109:3e6f0e8fca0d | 45 | /* Command code for disk_ioctrl() */ |
TickTock | 109:3e6f0e8fca0d | 46 | |
TickTock | 109:3e6f0e8fca0d | 47 | /* Generic command */ |
TickTock | 109:3e6f0e8fca0d | 48 | #define CTRL_SYNC 0 /* Mandatory for write functions */ |
TickTock | 109:3e6f0e8fca0d | 49 | #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */ |
TickTock | 109:3e6f0e8fca0d | 50 | #define GET_SECTOR_SIZE 2 /* Mandatory for multiple sector size cfg */ |
TickTock | 109:3e6f0e8fca0d | 51 | #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */ |
TickTock | 109:3e6f0e8fca0d | 52 | #define CTRL_POWER 4 |
TickTock | 109:3e6f0e8fca0d | 53 | #define CTRL_LOCK 5 |
TickTock | 109:3e6f0e8fca0d | 54 | #define CTRL_EJECT 6 |
TickTock | 109:3e6f0e8fca0d | 55 | /* MMC/SDC command */ |
TickTock | 109:3e6f0e8fca0d | 56 | #define MMC_GET_TYPE 10 |
TickTock | 109:3e6f0e8fca0d | 57 | #define MMC_GET_CSD 11 |
TickTock | 109:3e6f0e8fca0d | 58 | #define MMC_GET_CID 12 |
TickTock | 109:3e6f0e8fca0d | 59 | #define MMC_GET_OCR 13 |
TickTock | 109:3e6f0e8fca0d | 60 | #define MMC_GET_SDSTAT 14 |
TickTock | 109:3e6f0e8fca0d | 61 | /* ATA/CF command */ |
TickTock | 109:3e6f0e8fca0d | 62 | #define ATA_GET_REV 20 |
TickTock | 109:3e6f0e8fca0d | 63 | #define ATA_GET_MODEL 21 |
TickTock | 109:3e6f0e8fca0d | 64 | #define ATA_GET_SN 22 |
TickTock | 109:3e6f0e8fca0d | 65 | |
TickTock | 109:3e6f0e8fca0d | 66 | |
TickTock | 109:3e6f0e8fca0d | 67 | #define _DISKIO |
TickTock | 109:3e6f0e8fca0d | 68 | #endif |