SD Card Interface class. Log raw data bytes to memory addresses of your choice, or format the card and use the FAT file system to write files.
diskio.h
00001 /*----------------------------------------------------------------------- 00002 / Low level disk interface module include file R0.06 (C)ChaN, 2007 00003 /-----------------------------------------------------------------------*/ 00004 00005 //Modified by Thomas Hamilton, Copyright 2010 00006 00007 #ifndef _DISKIO 00008 #define _DISKIO 00009 00010 #define _READONLY 0 00011 #define _USE_IOCTL 1 00012 00013 #include "integer.h" 00014 #include "FATFileSystem.h" 00015 #include <stdio.h> 00016 00017 /* Status of Disk Functions */ 00018 typedef BYTE DSTATUS; 00019 #define STA_NOINIT 0x01 /* Drive not initialized */ 00020 #define STA_NODISK 0x02 /* No medium in the drive */ 00021 #define STA_PROTECT 0x04 /* Write protected */ 00022 /* Results of Disk Functions */ 00023 typedef enum 00024 { 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 /* Prototypes for disk control functions */ 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 /* Command code for disk_ioctrl() */ 00041 #define CTRL_SYNC 0 /* Mandatory for read/write configuration */ 00042 #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */ 00043 #define GET_SECTOR_SIZE 2 00044 #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */ 00045 #define CTRL_POWER 4 00046 #define CTRL_LOCK 5 00047 #define CTRL_EJECT 6 00048 #define MMC_GET_TYPE 10 /* MMC/SDC command */ 00049 #define MMC_GET_CSD 11 00050 #define MMC_GET_CID 12 00051 #define MMC_GET_OCR 13 00052 #define MMC_GET_SDSTAT 14 00053 #define ATA_GET_REV 20 /* ATA/CF command */ 00054 #define ATA_GET_MODEL 21 00055 #define ATA_GET_SN 22 00056 00057 #endif
Generated on Wed Jul 13 2022 05:31:45 by 1.7.2