📄 mmc.h
字号:
#define DUMMY 0xff
//定义常量
#define MMC_START_DATA_BLOCK_TOKEN 0xfe
#define MMC_START_DATA_MULTIPLE_BLOCK_READ 0xfe
#define MMC_START_DATA_BLOCK_WRITE 0xfe
#define MMC_START_DATA_MULTIPLE_BLOCK_WRITE 0xfc
#define MMC_STOP_DATA_MULTIPLE_BLOCK_WRITE 0xfd
#define MMC_R1_RESPONSE 0x00
#define MMC_SUCCESS 0x00
#define MMC_BLOCK_SET_ERROR 0x01
#define MMC_RESPONSE_ERROR 0x02
#define MMC_DATA_TOKEN_ERROR 0x03
#define MMC_INIT_ERROR 0x04
#define MMC_CRC_ERROR 0x10
#define MMC_WRITE_ERROR 0x11
#define MMC_OTHER_ERROR 0x12
#define MMC_TIMEOUT_ERROR 0xFF
//命令常量
#define MMC_GO_IDLE_STATE 0x40
#define MMC_SEND_OP_COND 0x41
#define MMC_READ_CSD 0x49
#define MMC_SEND_CID 0x4a
#define MMC_STOP_TRANSMISSION 0x4c
#define MMC_SEND_STATUS 0x4d
#define MMC_SET_BLOCKLEN 0x50
#define MMC_READ_SINGLE_BLOCK 0x51
#define MMC_READ_MULTIPLE_BLOCK 0x52
#define MMC_CMD_WRITEBLOCK 0x54
#define MMC_WRITE_BLOCK 0x58
#define MMC_WRITE_MULTIPLE_BLOCK 0x59
#define MMC_WRITE_CSD 0x5b
#define MMC_SET_WRITE_PROT 0x5c
#define MMC_CLR_WRITE_PROT 0x5d
#define MMC_SEND_WRITE_PROT 0x5e
#define MMC_TAG_SECTOR_START 0x60
#define MMC_TAG_SECTOR_END 0x61
#define MMC_UNTAG_SECTOR 0x62
#define MMC_TAG_EREASE_GROUP_START 0x63
#define MMC_TAG_EREASE_GROUP_END 0x64
#define MMC_UNTAG_EREASE_GROUP 0x65
#define MMC_EREASE 0x66
#define MMC_READ_OCR 0x67
#define MMC_CRC_ON_OFF 0x68
char initMMC (void);
char mmc_check(void);
void mmcSendCmd (const char cmd, unsigned long data, const char crc);
char mmc_GoIdle();
char mmcSetBlockLength (const unsigned long);
char mmcReadBlock(const unsigned long address, const unsigned long count, unsigned char *pBuffer);
char mmcWriteBlock (const unsigned long address, const unsigned long count, unsigned char *pBuffer);
char mmcReadRegister(const char, const unsigned char, unsigned char *pBuffer);
unsigned long MMC_ReadCardSize(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -