Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
diskio.h
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 /* Status of Disk Functions */ 00013 typedef BYTE DSTATUS; 00014 00015 /* Results of Disk Functions */ 00016 typedef enum { 00017 RES_OK = 0, /* 0: Successful */ 00018 RES_ERROR, /* 1: R/W Error */ 00019 RES_WRPRT, /* 2: Write Protected */ 00020 RES_NOTRDY, /* 3: Not Ready */ 00021 RES_PARERR /* 4: Invalid Parameter */ 00022 } DRESULT; 00023 00024 00025 /*---------------------------------------*/ 00026 /* Prototypes for disk control functions */ 00027 00028 extern BOOL assign_drives (int argc, char *argv[]); 00029 extern DSTATUS disk_initialize (BYTE); 00030 extern DSTATUS disk_status (BYTE); 00031 extern DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE); 00032 extern DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE); 00033 extern DRESULT disk_ioctl (BYTE, BYTE, void*); 00034 00035 extern int _sd_sectors(); 00036 00037 00038 /* Disk Status Bits (DSTATUS) */ 00039 00040 #define STA_NOINIT 0x01 /* Drive not initialized */ 00041 #define STA_NODISK 0x02 /* No medium in the drive */ 00042 #define STA_PROTECT 0x04 /* Write protected */ 00043 00044 00045 /* Command code for disk_ioctrl() */ 00046 00047 /* Generic command */ 00048 #define CTRL_SYNC 0 /* Mandatory for write functions */ 00049 #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */ 00050 #define GET_SECTOR_SIZE 2 /* Mandatory for multiple sector size cfg */ 00051 #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */ 00052 #define CTRL_POWER 4 00053 #define CTRL_LOCK 5 00054 #define CTRL_EJECT 6 00055 /* MMC/SDC command */ 00056 #define MMC_GET_TYPE 10 00057 #define MMC_GET_CSD 11 00058 #define MMC_GET_CID 12 00059 #define MMC_GET_OCR 13 00060 #define MMC_GET_SDSTAT 14 00061 /* ATA/CF command */ 00062 #define ATA_GET_REV 20 00063 #define ATA_GET_MODEL 21 00064 #define ATA_GET_SN 22 00065 00066 00067 #define _DISKIO 00068 #endif
Generated on Thu Jul 14 2022 09:05:34 by
1.7.2