00001 #include <avr/io.h>
00002
00003
00004
00005
00006
00007 #ifndef _DISKIO
00008
00009 #define _READONLY 0
00010 #define _USE_IOCTL 1
00011
00012 #include "integer.h"
00013
00014
00015
00016 #define CT_MMC 0x01
00017 #define CT_SD1 0x02
00018 #define CT_SD2 0x04
00019 #define CT_SDC (CT_SD1|CT_SD2)
00020 #define CT_BLOCK 0x08
00021
00022
00023
00024
00025
00026
00027
00028 typedef BYTE DSTATUS;
00029
00030
00031 typedef enum {
00032 RES_OK = 0,
00033 RES_ERROR,
00034 RES_WRPRT,
00035 RES_NOTRDY,
00036 RES_PARERR
00037 } DRESULT;
00038
00039
00040
00041
00042
00043 BOOL assign_drives (int argc, char *argv[]);
00044 DSTATUS disk_initialize (BYTE);
00045 DSTATUS disk_status (BYTE);
00046 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
00047 #if _READONLY == 0
00048 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
00049 #endif
00050 DRESULT disk_ioctl (BYTE, BYTE, void*);
00051
00052
00053
00054
00055
00056 #define STA_NOINIT 0x01
00057 #define STA_NODISK 0x02
00058 #define STA_PROTECT 0x04
00059
00060
00061
00062
00063
00064 #define CTRL_SYNC 0
00065 #define GET_SECTOR_COUNT 1
00066 #define GET_SECTOR_SIZE 2
00067 #define GET_BLOCK_SIZE 3
00068 #define CTRL_POWER 4
00069 #define CTRL_LOCK 5
00070 #define CTRL_EJECT 6
00071
00072 #define MMC_GET_TYPE 10
00073 #define MMC_GET_CSD 11
00074 #define MMC_GET_CID 12
00075 #define MMC_GET_OCR 13
00076 #define MMC_GET_SDSTAT 14
00077
00078 #define ATA_GET_REV 20
00079 #define ATA_GET_MODEL 21
00080 #define ATA_GET_SN 22
00081
00082
00083 #define _DISKIO
00084 #endif