MAVRK Embedded Software 0.91
Software Libraries for the MAVRK motherboard and related components
|
00001 /*----------------------------------------------------------------------- 00002 / Low level disk interface modlue include file (C)ChaN, 2009 00003 /-----------------------------------------------------------------------*/ 00004 00005 #ifndef _DISKIO 00006 #define _DISKIO 00007 00008 #include "integer.h" 00009 00010 00011 /* Status of Disk Functions */ 00012 typedef unsigned char DSTATUS; 00013 00014 /* Results of Disk Functions */ 00015 typedef enum { 00016 RES_OK = 0, /* 0: Successful */ 00017 RES_ERROR, /* 1: R/W Error */ 00018 RES_WRPRT, /* 2: Write Protected */ 00019 RES_NOTRDY, /* 3: Not Ready */ 00020 RES_PARERR /* 4: Invalid Parameter */ 00021 } DRESULT; 00022 00023 00024 /*---------------------------------------*/ 00025 /* Prototypes for disk control functions */ 00026 00027 int assign_drives (int, int); 00028 DSTATUS disk_initialize (unsigned char); 00029 DSTATUS disk_status (unsigned char); 00030 DRESULT disk_read (unsigned char, unsigned char*, DWORD, unsigned char); 00031 DRESULT disk_write (unsigned char, const unsigned char*, DWORD, unsigned char); 00032 DRESULT disk_ioctl (unsigned char, unsigned char, void*); 00033 00034 00035 00036 /* Disk Status Bits (DSTATUS) */ 00037 00038 #define STA_NOINIT 0x01 /* Drive not initialized */ 00039 #define STA_NODISK 0x02 /* No medium in the drive */ 00040 #define STA_PROTECT 0x04 /* Write protected */ 00041 00042 00043 /* Command code for disk_ioctrl fucntion */ 00044 00045 /* Generic command (mandatory for FatFs) */ 00046 #define CTRL_SYNC 0 /* Flush disk cache (for write functions) */ 00047 #define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */ 00048 #define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */ 00049 #define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */ 00050 00051 #endif