• Main Page
  • Data Structures
  • Files
  • File List
  • Globals

diskio.h

Go to the documentation of this file.
00001 /*-----------------------------------------------------------------------
00002 /  Low level disk interface modlue include file  R0.07   (C)ChaN, 2009
00003 /-----------------------------------------------------------------------*/
00004 
00005 #ifndef _DISKIO
00006 
00007 #define _READONLY       0       /* 1: Read-only mode */
00008 #define _USE_IOCTL      1
00009 
00010 #include "integer.h"
00011 
00012 #define CT_MMC 0x01
00013 #define CT_SD1 0x02
00014 #define CT_SD2 0x04
00015 #define CT_SDC (CT_SD1|CT_SD2)
00016 #define CT_BLOCK 0x08
00017 
00018 
00019 
00020 /* Status of Disk Functions */
00021 typedef BYTE    DSTATUS;
00022 
00023 /* Results of Disk Functions */
00024 typedef enum {
00025         RES_OK = 0,             /* 0: Successful */
00026         RES_ERROR,              /* 1: R/W Error */
00027         RES_WRPRT,              /* 2: Write Protected */
00028         RES_NOTRDY,             /* 3: Not Ready */
00029         RES_PARERR              /* 4: Invalid Parameter */
00030 } DRESULT;
00031 
00032 
00033 /*---------------------------------------*/
00034 /* Prototypes for disk control functions */
00035 
00036 BOOL assign_drives (int argc, char *argv[]);
00037 DSTATUS disk_initialize (BYTE);
00038 DSTATUS disk_status (BYTE);
00039 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
00040 #if     _READONLY == 0
00041 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
00042 #endif
00043 DRESULT disk_ioctl (BYTE, BYTE, void*);
00044 
00045 
00046 
00047 /* Disk Status Bits (DSTATUS) */
00048 
00049 #define STA_NOINIT              0x01    /* Drive not initialized */
00050 #define STA_NODISK              0x02    /* No medium in the drive */
00051 #define STA_PROTECT             0x04    /* Write protected */
00052 
00053 
00054 /* Command code for disk_ioctrl() */
00055 
00056 /* Generic command */
00057 #define CTRL_SYNC                       0       /* Mandatory for write functions */
00058 #define GET_SECTOR_COUNT        1       /* Mandatory for only f_mkfs() */
00059 #define GET_SECTOR_SIZE         2       /* Mandatory for multiple sector size cfg */
00060 #define GET_BLOCK_SIZE          3       /* Mandatory for only f_mkfs() */
00061 #define CTRL_POWER                      4
00062 #define CTRL_LOCK                       5
00063 #define CTRL_EJECT                      6
00064 /* MMC/SDC command */
00065 #define MMC_GET_TYPE            10
00066 #define MMC_GET_CSD                     11
00067 #define MMC_GET_CID                     12
00068 #define MMC_GET_OCR                     13
00069 #define MMC_GET_SDSTAT          14
00070 /* ATA/CF command */
00071 #define ATA_GET_REV                     20
00072 #define ATA_GET_MODEL           21
00073 #define ATA_GET_SN                      22
00074 
00075 
00076 #define _DISKIO
00077 #endif

Generated on Fri Sep 2 2011 09:12:08 by  doxygen 1.7.1