Compact Flash I/O test
Embed:
(wiki syntax)
Show/hide line numbers
diskio.h
00001 /*----------------------------------------------------------------------- 00002 / Low level disk interface modlue include file 00003 /-----------------------------------------------------------------------*/ 00004 #include "integer.h" 00005 00006 #ifndef _DISKIO 00007 #define _READONLY 0 /* 1: Remove write functions */ 00008 #define _USE_IOCTL 1 /* 1: Use disk_ioctl fucntion */ 00009 00010 00011 void InitCompactFlashInterface(); 00012 void CompactFlashIO_Test(); 00013 00014 /* Status of Disk Functions */ 00015 typedef BYTE DSTATUS; 00016 00017 /* Results of Disk Functions */ 00018 typedef enum { 00019 RES_OK = 0, /* 0: Successful */ 00020 RES_ERROR, /* 1: R/W Error */ 00021 RES_WRPRT, /* 2: Write Protected */ 00022 RES_NOTRDY, /* 3: Not Ready */ 00023 RES_PARERR /* 4: Invalid Parameter */ 00024 } DRESULT; 00025 00026 00027 /*---------------------------------------*/ 00028 /* Prototypes for disk control functions */ 00029 00030 int assign_drives (int, int); 00031 00032 00033 DSTATUS disk_initialize (BYTE); 00034 DSTATUS disk_status (BYTE); 00035 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE); 00036 #if _READONLY == 0 00037 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE); 00038 #endif 00039 DRESULT disk_ioctl (BYTE, BYTE, void*); 00040 00041 DWORD get_fattime(); 00042 00043 /* Disk Status Bits (DSTATUS) */ 00044 00045 #define STA_NOINIT 0x01 /* Drive not initialized */ 00046 #define STA_NODISK 0x02 /* No medium in the drive */ 00047 #define STA_PROTECT 0x04 /* Write protected */ 00048 00049 00050 /* Command code for disk_ioctrl fucntion */ 00051 00052 /* Generic command (defined for FatFs) */ 00053 #define CTRL_SYNC 0 /* Flush disk cache (for write functions) */ 00054 #define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */ 00055 #define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */ 00056 #define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */ 00057 #define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */ 00058 00059 /* Generic command */ 00060 #define CTRL_POWER 5 /* Get/Set power status */ 00061 #define CTRL_LOCK 6 /* Lock/Unlock media removal */ 00062 #define CTRL_EJECT 7 /* Eject media */ 00063 00064 /* MMC/SDC specific ioctl command */ 00065 #define MMC_GET_TYPE 10 /* Get card type */ 00066 #define MMC_GET_CSD 11 /* Get CSD */ 00067 #define MMC_GET_CID 12 /* Get CID */ 00068 #define MMC_GET_OCR 13 /* Get OCR */ 00069 #define MMC_GET_SDSTAT 14 /* Get SD status */ 00070 00071 /* ATA/CF specific ioctl command */ 00072 #define ATA_GET_REV 20 /* Get F/W revision */ 00073 #define ATA_GET_MODEL 21 /* Get model name */ 00074 #define ATA_GET_SN 22 /* Get serial number */ 00075 00076 /* NAND specific ioctl command */ 00077 #define NAND_FORMAT 30 /* Create physical format */ 00078 00079 00080 //Available Drives 00081 #define CF 0 00082 #define COMPACT_FLASH CF 00083 #define USB 1 00084 #define RAM 2 00085 00086 #define _DISKIO 00087 #endif
Generated on Sat Jul 16 2022 16:37:46 by
1.7.2
Eli Hughes