#ifndef   __SD_Card_H__
#define   __SD_Card_H__
//-------------------------------------------------------------------------
//  SD Card Set I/O Direction
#define SD_CMD_IN   IOWR(SD_CMD_BASE, 1, 0)
#define SD_CMD_OUT  IOWR(SD_CMD_BASE, 1, 1)
#define SD_DAT_IN   IOWR(SD_DAT_BASE, 1, 0)
#define SD_DAT_OUT  IOWR(SD_DAT_BASE, 1, 1)
//  SD Card Output High/Low
#define SD_CMD_LOW  IOWR(SD_CMD_BASE, 0, 0)
#define SD_CMD_HIGH IOWR(SD_CMD_BASE, 0, 1)
#define SD_DAT_LOW  IOWR(SD_DAT_BASE, 0, 0)
#define SD_DAT_HIGH IOWR(SD_DAT_BASE, 0, 1)
#define SD_CLK_LOW  IOWR(SD_CLK_BASE, 0, 0)
#define SD_CLK_HIGH IOWR(SD_CLK_BASE, 0, 1)
//  SD Card Input Read
#define SD_TEST_CMD IORD(SD_CMD_BASE, 0)
#define SD_TEST_DAT IORD(SD_DAT_BASE, 0)
//-------------------------------------------------------------------------
#define BYTE    unsigned char
#define UINT16  unsigned int
#define UINT32  unsigned long

//-------------------------------------------------------------------------
void Ncr(void);
void Ncc(void);
void N_busy(void);
//------------SD¿¨µÍ²ãÇý¶¯º¯Êý------------------------------------------
BYTE SD_card_init(void);
BYTE send_cmd(BYTE *);
BYTE response_R(BYTE);
BYTE SD_read_lba(UINT32 Unit,UINT32 Sector, BYTE  *pBuffer);
BYTE SD_write_lba(UINT32 Unit,UINT32 Sector, BYTE  *pBuffer);  
//BYTE SD_GetCardInfo(void);
BYTE SD_EraseBlock(UINT32,UINT32);
//-------------------------------------------------------------------------
#endif