.

Fork of FatFileSystem by mbed unsupported

Committer:
atyeomans
Date:
Wed Jan 30 17:41:29 2013 +0000
Revision:
4:d8cfad9dd1d2
Parent:
0:97df4125f18d
Added SDFileSystem

Who changed what in which revision?

UserRevisionLine numberNew 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
atyeomans 4:d8cfad9dd1d2 7 #define _READONLY 0 /* 1: Read-only mode */
atyeomans 4:d8cfad9dd1d2 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 */
atyeomans 4:d8cfad9dd1d2 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 {
atyeomans 4:d8cfad9dd1d2 21 RES_OK = 0, /* 0: Successful */
atyeomans 4:d8cfad9dd1d2 22 RES_ERROR, /* 1: R/W Error */
atyeomans 4:d8cfad9dd1d2 23 RES_WRPRT, /* 2: Write Protected */
atyeomans 4:d8cfad9dd1d2 24 RES_NOTRDY, /* 3: Not Ready */
atyeomans 4:d8cfad9dd1d2 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);
atyeomans 4:d8cfad9dd1d2 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*);
atyeomans 4:d8cfad9dd1d2 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
atyeomans 4:d8cfad9dd1d2 48 #define STA_NOINIT 0x01 /* Drive not initialized */
atyeomans 4:d8cfad9dd1d2 49 #define STA_NODISK 0x02 /* No medium in the drive */
atyeomans 4:d8cfad9dd1d2 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 */
atyeomans 4:d8cfad9dd1d2 56 #define CTRL_SYNC 0 /* Mandatory for read/write configuration */
atyeomans 4:d8cfad9dd1d2 57 #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */
atyeomans 4:d8cfad9dd1d2 58 #define GET_SECTOR_SIZE 2
atyeomans 4:d8cfad9dd1d2 59 #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */
atyeomans 4:d8cfad9dd1d2 60 #define CTRL_POWER 4
atyeomans 4:d8cfad9dd1d2 61 #define CTRL_LOCK 5
atyeomans 4:d8cfad9dd1d2 62 #define CTRL_EJECT 6
mbed_unsupported 0:97df4125f18d 63 /* MMC/SDC command */
atyeomans 4:d8cfad9dd1d2 64 #define MMC_GET_TYPE 10
atyeomans 4:d8cfad9dd1d2 65 #define MMC_GET_CSD 11
atyeomans 4:d8cfad9dd1d2 66 #define MMC_GET_CID 12
atyeomans 4:d8cfad9dd1d2 67 #define MMC_GET_OCR 13
atyeomans 4:d8cfad9dd1d2 68 #define MMC_GET_SDSTAT 14
mbed_unsupported 0:97df4125f18d 69 /* ATA/CF command */
atyeomans 4:d8cfad9dd1d2 70 #define ATA_GET_REV 20
atyeomans 4:d8cfad9dd1d2 71 #define ATA_GET_MODEL 21
atyeomans 4:d8cfad9dd1d2 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