Dependencies:   PinDetect TextLCD mbed mRotaryEncoder

Committer:
cicklaus
Date:
Mon Feb 13 02:11:20 2012 +0000
Revision:
0:afb2650fb49a

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cicklaus 0:afb2650fb49a 1 /*-----------------------------------------------------------------------
cicklaus 0:afb2650fb49a 2 / Low level disk interface module include file R0.06 (C)ChaN, 2007
cicklaus 0:afb2650fb49a 3 /-----------------------------------------------------------------------*/
cicklaus 0:afb2650fb49a 4
cicklaus 0:afb2650fb49a 5 //Modified by Thomas Hamilton, Copyright 2010
cicklaus 0:afb2650fb49a 6
cicklaus 0:afb2650fb49a 7 #ifndef _DISKIO
cicklaus 0:afb2650fb49a 8 #define _DISKIO
cicklaus 0:afb2650fb49a 9
cicklaus 0:afb2650fb49a 10 #define _READONLY 0
cicklaus 0:afb2650fb49a 11 #define _USE_IOCTL 1
cicklaus 0:afb2650fb49a 12
cicklaus 0:afb2650fb49a 13 #include "integer.h"
cicklaus 0:afb2650fb49a 14 #include "FATFileSystem.h"
cicklaus 0:afb2650fb49a 15 #include <stdio.h>
cicklaus 0:afb2650fb49a 16
cicklaus 0:afb2650fb49a 17 /* Status of Disk Functions */
cicklaus 0:afb2650fb49a 18 typedef BYTE DSTATUS;
cicklaus 0:afb2650fb49a 19 #define STA_NOINIT 0x01 /* Drive not initialized */
cicklaus 0:afb2650fb49a 20 #define STA_NODISK 0x02 /* No medium in the drive */
cicklaus 0:afb2650fb49a 21 #define STA_PROTECT 0x04 /* Write protected */
cicklaus 0:afb2650fb49a 22 /* Results of Disk Functions */
cicklaus 0:afb2650fb49a 23 typedef enum
cicklaus 0:afb2650fb49a 24 {
cicklaus 0:afb2650fb49a 25 RES_OK = 0, /* 0: Successful */
cicklaus 0:afb2650fb49a 26 RES_ERROR, /* 1: R/W Error */
cicklaus 0:afb2650fb49a 27 RES_WRPRT, /* 2: Write Protected */
cicklaus 0:afb2650fb49a 28 RES_NOTRDY, /* 3: Not Ready */
cicklaus 0:afb2650fb49a 29 RES_PARERR /* 4: Invalid Parameter */
cicklaus 0:afb2650fb49a 30 } DRESULT;
cicklaus 0:afb2650fb49a 31
cicklaus 0:afb2650fb49a 32 /* Prototypes for disk control functions */
cicklaus 0:afb2650fb49a 33 DSTATUS disk_initialize (BYTE);
cicklaus 0:afb2650fb49a 34 DSTATUS disk_status (BYTE);
cicklaus 0:afb2650fb49a 35 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
cicklaus 0:afb2650fb49a 36 #if _READONLY == 0
cicklaus 0:afb2650fb49a 37 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
cicklaus 0:afb2650fb49a 38 #endif
cicklaus 0:afb2650fb49a 39 DRESULT disk_ioctl (BYTE, BYTE, void*);
cicklaus 0:afb2650fb49a 40 /* Command code for disk_ioctrl() */
cicklaus 0:afb2650fb49a 41 #define CTRL_SYNC 0 /* Mandatory for read/write configuration */
cicklaus 0:afb2650fb49a 42 #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */
cicklaus 0:afb2650fb49a 43 #define GET_SECTOR_SIZE 2
cicklaus 0:afb2650fb49a 44 #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */
cicklaus 0:afb2650fb49a 45 #define CTRL_POWER 4
cicklaus 0:afb2650fb49a 46 #define CTRL_LOCK 5
cicklaus 0:afb2650fb49a 47 #define CTRL_EJECT 6
cicklaus 0:afb2650fb49a 48 #define MMC_GET_TYPE 10 /* MMC/SDC command */
cicklaus 0:afb2650fb49a 49 #define MMC_GET_CSD 11
cicklaus 0:afb2650fb49a 50 #define MMC_GET_CID 12
cicklaus 0:afb2650fb49a 51 #define MMC_GET_OCR 13
cicklaus 0:afb2650fb49a 52 #define MMC_GET_SDSTAT 14
cicklaus 0:afb2650fb49a 53 #define ATA_GET_REV 20 /* ATA/CF command */
cicklaus 0:afb2650fb49a 54 #define ATA_GET_MODEL 21
cicklaus 0:afb2650fb49a 55 #define ATA_GET_SN 22
cicklaus 0:afb2650fb49a 56
cicklaus 0:afb2650fb49a 57 #endif