|
发表于 2018-2-16 01:00:07
|
显示全部楼层
這些是錯誤代碼
// error codes
/** timeout error for command CMD0 (initialize card in SPI mode), signal problem */
#define SD_CARD_ERROR_CMD0 0x01
/** CMD8 was not accepted - not a valid SD card */
#define SD_CARD_ERROR_CMD8 0x02
/** ACMD41 initialization process timeout */
#define SD_CARD_ERROR_ACMD41 0x03
/** card returned an error response for CMD58 (read OCR) */
#define SD_CARD_ERROR_CMD58 0x04
/** card returned an error response for CMD16 (set block len) */
#define SD_CARD_ERROR_CMD16 0x05
/** card operation voltage range doesn't match (2.7V - 3.6V) */
#define SD_CARD_ERROR_VOLTMATCH 0x06
/** timeout while waiting for start of read data */
#define SD_CARD_ERROR_READ_TIMEOUT 0x07
/** card returned error token when tried to read data */
#define SD_CARD_ERROR_READ 0x08
/** card returned an error response for CMD17 (read single block) */
#define SD_CARD_ERROR_CMD17 0x09
/** card returned an error token when tried to write data */
#define SD_CARD_ERROR_WRITE 0x0a
/** card returned an error response for CMD24 (write single block) */
#define SD_CARD_ERROR_CMD24 0x0b
/** timeout while waiting for writing data */
#define SD_CARD_ERROR_WRITE_TIMEOUT 0x0c
/** card returned an error in status after a data writing command */
#define SD_CARD_ERROR_WRITE_PROGR 0x0d
/** card returned an error response for CMD9 (read CSD) */
#define SD_CARD_ERROR_CMD9 0x0e
/** card returned an error response for CMD10 (read CID) */
#define SD_CARD_ERROR_CMD10 0x0f
/** card returned an error response for CMD18 (read multi block) */
#define SD_CARD_ERROR_CMD18 0x10
/** card returned an error response for CMD12 (stop block operation) */
#define SD_CARD_ERROR_CMD12 0x11
/** card returned an error response for ACMD23 (set pre-erase count) */
#define SD_CARD_ERROR_ACMD23 0x12
/** card returned an error response for CMD25 (write multi block) */
#define SD_CARD_ERROR_CMD25 0x13
/** card did not become ready for a multiple block write */
#define SD_CARD_ERROR_WRITE_MB 0x14
/** timeout after sending STOP_TRAN_TOKEN after write multi block data */
#define SD_CARD_ERROR_STOP_TRAN 0x15
// SD card commands
/** GO_IDLE_STATE - init card in spi mode if CS low */
#define SD_CMD0 0x00
/** SEND_IF_COND - verify SD Memory Card interface operating condition.*/
#define SD_CMD8 0x08
/** SEND_CSD - read the Card Specific Data (CSD register), response R1 */
#define SD_CMD9 0x09
/** SEND_CID - read the card identification information (CID register), response R1 */
#define SD_CMD10 0x0A
/** STOP_TRANSMISSION - end multiple block read sequence, response R1b */
#define SD_CMD12 0x0C
/** SEND_STATUS - read the card status register, response R2 */
#define SD_CMD13 0x0D
/** SET_BLOCKLEN arg0[31:0]: block length, response R1 */
#define SD_CMD16 0x10
/** READ_SINGLE_BLOCK - read a single data block from the card, response R1 */
#define SD_CMD17 0x11
/** READ_MULTIPLE_BLOCK - read a multiple data blocks from the card, response R1 */
#define SD_CMD18 0x12
/** WRITE_BLOCK - write a single data block to the card, response R1 */
#define SD_CMD24 0x18
/** WRITE_MULTIPLE_BLOCK - write blocks of data until a STOP_TRANSMISSION, response R1 */
#define SD_CMD25 0x19 |
|