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

diskio_007.h

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

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