old FATFilesystem

Dependents:   SDFileSystem

Fork of FatFileSystem by mbed unsupported

Committer:
cwang365
Date:
Wed Mar 06 00:30:59 2013 +0000
Revision:
4:af33732dbdc7
Parent:
0:97df4125f18d
lab3-news_reader

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