dd

Dependencies:   C12832 LM75B mbed

Committer:
pfe
Date:
Tue Apr 21 10:16:20 2015 +0000
Revision:
0:05a20e3e3179
dd

Who changed what in which revision?

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