9 #define PAGE_SIZE256 256
10 #define PAGE_SIZE512 512
13 #define MANUFACTURER_ID(drv_no) ((u8)(g_CID[drv_no][0]))
16 #define READ_BL_LEN(drv_no) ((u8)(g_CSD[drv_no][5]&0x0f))
17 #define WRITE_BL_LEN(drv_no) ((u8)((g_CSD[drv_no][12]&0x03)<<2)|((g_CSD[drv_no][13]>>6)&0x03))
18 #define C_SIZE(drv_no) ((u16)(((g_CSD[drv_no][6]&0x03)<<10)|(g_CSD[drv_no][7]<<2)|((g_CSD[drv_no][8]>>6)&0x03)))
19 #define C_SIZE_MULT(drv_no) ((u8)((g_CSD[drv_no][9]&0x03)<<1)|((g_CSD[drv_no][10]>>7)&0x01))
23 #endif /* __cplusplus */
25 extern u8 g_CSD
[MAX_DRIVE
][16];
26 extern u8 g_CID
[MAX_DRIVE
][16];
27 extern u8 g_mCode
[MAX_MI_NUM
];
28 extern u16 g_dCode
[MAX_MI_NUM
][MAX_DI_NUM
];
31 void sdgecko_initIODefault();
32 s32
sdgecko_initIO(s32 drv_no
);
33 s32
sdgecko_preIO(s32 drv_no
);
34 s32
sdgecko_readCID(s32 drv_no
);
35 s32
sdgecko_readCSD(s32 drv_no
);
36 s32
sdgecko_readStatus(s32 drv_no
);
37 s32
sdgecko_readSectors(s32 drv_no
,u32 sector_no
,u32 num_sectors
,void *buf
);
38 s32
sdgecko_writeSector(s32 drv_no
,u32 sector_no
,const void *buf
,u32 len
);
39 s32
sdgecko_writeSectors(s32 drv_no
,u32 sector_no
,u32 num_sectors
,const void *buf
);
41 s32
sdgecko_doUnmount(s32 drv_no
);
43 void sdgecko_insertedCB(s32 drv_no
);
44 void sdgecko_ejectedCB(s32 drv_no
);
49 #endif /* __cplusplus */