34 typedef signed int INT;
35 typedef unsigned int UINT;
38 typedef signed char CHAR;
39 typedef unsigned char UCHAR;
40 typedef unsigned char BYTE;
43 typedef signed short SHORT;
44 typedef unsigned short USHORT;
45 typedef unsigned short WORD;
48 typedef signed long LONG;
49 typedef unsigned long ULONG;
50 typedef unsigned long DWORD;
56 typedef enum { FALSE = 0, TRUE }
BOOL;
236 #define STA_NOINIT 0x01
237 #define STA_NODISK 0x02
238 #define STA_PROTECT 0x04
244 #define GET_SECTOR_COUNT 1
245 #define GET_SECTOR_SIZE 2
246 #define GET_BLOCK_SIZE 3
250 #define CTRL_FORMAT 5
251 #define CTRL_POWER_IDLE 6
252 #define CTRL_POWER_OFF 7
254 #define CTRL_UNLOCK 9
255 #define CTRL_EJECT 10
258 #define MMC_GET_TYPE 50
259 #define MMC_GET_CSD 51
260 #define MMC_GET_CID 52
261 #define MMC_GET_OCR 53
262 #define MMC_GET_SDSTAT 54
265 #define ATA_GET_REV 60
266 #define ATA_GET_MODEL 61
267 #define ATA_GET_SN 62
273 #define CT_SDC (CT_SD1|CT_SD2)
274 #define CT_BLOCK 0x08
void disk_timerproc(void)
This should be called every 10 ms.
DRESULT eDisk_Write(BYTE drv, const BYTE *buff, DWORD sector, UINT count)
Write bytes to SD card.
DSTATUS eDisk_Init(BYTE drive)
Initialize the interface between microcontroller and the SD card.
BOOL
Boolean type.
Definition: eDisk.h:56
DSTATUS eDisk_Status(BYTE drive)
Check the status of the SD card.
DRESULT eDisk_ReadBlock(BYTE *buff, DWORD sector)
Read 512-byte block from SD card.
DRESULT eDisk_Read(BYTE drv, BYTE *buff, DWORD sector, UINT count)
Read bytes from SD card.
DRESULT disk_ioctl(BYTE drv, BYTE cmd, void *buff)
Disk input/output.
BYTE DSTATUS
Status of Disk Functions.
Definition: eDisk.h:61
DRESULT eDisk_WriteBlock(const BYTE *buff, DWORD sector)
Write 512-byte block from SD card.
void CS_Init(void)
Configure SDC chip select.