-

Dependents:   RSALB_hbridge_helloworld RSALB_lobster WavPlayer_test AudioCODEC_HelloWorld ... more

Fork of FatFileSystemCpp by Igor Skochinsky

Committer:
p07gbar
Date:
Wed Sep 19 11:03:35 2012 +0000
Revision:
2:e869ee8f3c3d
Parent:
0:6ceefe1c53e4
-

Who changed what in which revision?

UserRevisionLine numberNew contents of line
p07gbar 2:e869ee8f3c3d 1 /*-----------------------------------------------------------------------
p07gbar 2:e869ee8f3c3d 2 / Low level disk interface modlue include file
p07gbar 2:e869ee8f3c3d 3 /-----------------------------------------------------------------------*/
p07gbar 2:e869ee8f3c3d 4
p07gbar 2:e869ee8f3c3d 5 #ifndef _DISKIO
p07gbar 2:e869ee8f3c3d 6
p07gbar 2:e869ee8f3c3d 7 #define _READONLY 0 /* 1: Remove write functions */
p07gbar 2:e869ee8f3c3d 8 #define _USE_IOCTL 1 /* 1: Use disk_ioctl fucntion */
p07gbar 2:e869ee8f3c3d 9
p07gbar 2:e869ee8f3c3d 10 #include "integer.h"
p07gbar 2:e869ee8f3c3d 11
p07gbar 2:e869ee8f3c3d 12
p07gbar 2:e869ee8f3c3d 13 /* Status of Disk Functions */
p07gbar 2:e869ee8f3c3d 14 typedef BYTE DSTATUS;
p07gbar 2:e869ee8f3c3d 15
p07gbar 2:e869ee8f3c3d 16 /* Results of Disk Functions */
p07gbar 2:e869ee8f3c3d 17 typedef enum {
p07gbar 2:e869ee8f3c3d 18 RES_OK = 0, /* 0: Successful */
p07gbar 2:e869ee8f3c3d 19 RES_ERROR, /* 1: R/W Error */
p07gbar 2:e869ee8f3c3d 20 RES_WRPRT, /* 2: Write Protected */
p07gbar 2:e869ee8f3c3d 21 RES_NOTRDY, /* 3: Not Ready */
p07gbar 2:e869ee8f3c3d 22 RES_PARERR /* 4: Invalid Parameter */
p07gbar 2:e869ee8f3c3d 23 } DRESULT;
p07gbar 2:e869ee8f3c3d 24
p07gbar 2:e869ee8f3c3d 25
p07gbar 2:e869ee8f3c3d 26 /*---------------------------------------*/
p07gbar 2:e869ee8f3c3d 27 /* Prototypes for disk control functions */
p07gbar 2:e869ee8f3c3d 28
p07gbar 2:e869ee8f3c3d 29 int assign_drives (int, int);
p07gbar 2:e869ee8f3c3d 30 DSTATUS disk_initialize (BYTE);
p07gbar 2:e869ee8f3c3d 31 DSTATUS disk_status (BYTE);
p07gbar 2:e869ee8f3c3d 32 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
p07gbar 2:e869ee8f3c3d 33 #if _READONLY == 0
p07gbar 2:e869ee8f3c3d 34 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
p07gbar 2:e869ee8f3c3d 35 #endif
p07gbar 2:e869ee8f3c3d 36 DRESULT disk_ioctl (BYTE, BYTE, void*);
p07gbar 2:e869ee8f3c3d 37
p07gbar 2:e869ee8f3c3d 38
p07gbar 2:e869ee8f3c3d 39
p07gbar 2:e869ee8f3c3d 40 /* Disk Status Bits (DSTATUS) */
p07gbar 2:e869ee8f3c3d 41
p07gbar 2:e869ee8f3c3d 42 #define STA_NOINIT 0x01 /* Drive not initialized */
p07gbar 2:e869ee8f3c3d 43 #define STA_NODISK 0x02 /* No medium in the drive */
p07gbar 2:e869ee8f3c3d 44 #define STA_PROTECT 0x04 /* Write protected */
p07gbar 2:e869ee8f3c3d 45
p07gbar 2:e869ee8f3c3d 46
p07gbar 2:e869ee8f3c3d 47 /* Command code for disk_ioctrl fucntion */
p07gbar 2:e869ee8f3c3d 48
p07gbar 2:e869ee8f3c3d 49 /* Generic command (defined for FatFs) */
p07gbar 2:e869ee8f3c3d 50 #define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
p07gbar 2:e869ee8f3c3d 51 #define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
p07gbar 2:e869ee8f3c3d 52 #define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
p07gbar 2:e869ee8f3c3d 53 #define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
p07gbar 2:e869ee8f3c3d 54 #define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
p07gbar 2:e869ee8f3c3d 55
p07gbar 2:e869ee8f3c3d 56 /* Generic command */
p07gbar 2:e869ee8f3c3d 57 #define CTRL_POWER 5 /* Get/Set power status */
p07gbar 2:e869ee8f3c3d 58 #define CTRL_LOCK 6 /* Lock/Unlock media removal */
p07gbar 2:e869ee8f3c3d 59 #define CTRL_EJECT 7 /* Eject media */
p07gbar 2:e869ee8f3c3d 60
p07gbar 2:e869ee8f3c3d 61 /* MMC/SDC specific ioctl command */
p07gbar 2:e869ee8f3c3d 62 #define MMC_GET_TYPE 10 /* Get card type */
p07gbar 2:e869ee8f3c3d 63 #define MMC_GET_CSD 11 /* Get CSD */
p07gbar 2:e869ee8f3c3d 64 #define MMC_GET_CID 12 /* Get CID */
p07gbar 2:e869ee8f3c3d 65 #define MMC_GET_OCR 13 /* Get OCR */
p07gbar 2:e869ee8f3c3d 66 #define MMC_GET_SDSTAT 14 /* Get SD status */
p07gbar 2:e869ee8f3c3d 67
p07gbar 2:e869ee8f3c3d 68 /* ATA/CF specific ioctl command */
p07gbar 2:e869ee8f3c3d 69 #define ATA_GET_REV 20 /* Get F/W revision */
p07gbar 2:e869ee8f3c3d 70 #define ATA_GET_MODEL 21 /* Get model name */
p07gbar 2:e869ee8f3c3d 71 #define ATA_GET_SN 22 /* Get serial number */
p07gbar 2:e869ee8f3c3d 72
p07gbar 2:e869ee8f3c3d 73 /* NAND specific ioctl command */
p07gbar 2:e869ee8f3c3d 74 #define NAND_FORMAT 30 /* Create physical format */
p07gbar 2:e869ee8f3c3d 75
p07gbar 2:e869ee8f3c3d 76
p07gbar 2:e869ee8f3c3d 77 #define _DISKIO
p07gbar 2:e869ee8f3c3d 78 #endif