SD_Error 枚举类型的出处

2019-08-13 19:18发布

最近在读原子的SDIO源码,对比官方的,发现SD_Error 差别很大,这是官方的 [mw_shl_code=c,true]typedef enum { /** * @brief SD reponses and error flags */ SD_RESPONSE_NO_ERROR = (0x00), SD_IN_IDLE_STATE = (0x01), SD_ERASE_RESET = (0x02), SD_ILLEGAL_COMMAND = (0x04), SD_COM_CRC_ERROR = (0x08), SD_ERASE_SEQUENCE_ERROR = (0x10), SD_ADDRESS_ERROR = (0x20), SD_PARAMETER_ERROR = (0x40), SD_RESPONSE_FAILURE = (0xFF), /** * @brief Data response error */ SD_DATA_OK = (0x05), SD_DATA_CRC_ERROR = (0x0B), SD_DATA_WRITE_ERROR = (0x0D), SD_DATA_OTHER_ERROR = (0xFF) } SD_Error;[/mw_shl_code] 这是原子的,
[mw_shl_code=c,true]typedef enum { /** * @brief SDIO specific error defines */ SD_CMD_CRC_FAIL = (1), /*!< Command response received (but CRC check failed) */ SD_DATA_CRC_FAIL = (2), /*!< Data bock sent/received (CRC check Failed) */ SD_CMD_RSP_TIMEOUT = (3), /*!< Command response timeout */ SD_DATA_TIMEOUT = (4), /*!< Data time out */ SD_TX_UNDERRUN = (5), /*!< Transmit FIFO under-run */ SD_RX_OVERRUN = (6), /*!< Receive FIFO over-run */ SD_START_BIT_ERR = (7), /*!< Start bit not detected on all data signals in widE bus mode */ SD_CMD_OUT_OF_RANGE = (8), /*!< CMD's argument was out of range.*/ SD_ADDR_MISALIGNED = (9), /*!< Misaligned address */ SD_BLOCK_LEN_ERR = (10), /*!< Transferred block length is not allowed for the card or the number of transferred bytes does not match the block length */ SD_ERASE_SEQ_ERR = (11), /*!< An error in the sequence of erase command occurs.*/ SD_BAD_ERASE_PARAM = (12), /*!< An Invalid selection for erase groups */ SD_WRITE_PROT_VIOLATION = (13), /*!< Attempt to program a write protect block */ SD_LOCK_UNLOCK_FAILED = (14), /*!< Sequence or password error has been detected in unlock command or if there was an attempt to access a locked card */ SD_COM_CRC_FAILED = (15), /*!< CRC check of the previous command failed */ SD_ILLEGAL_CMD = (16), /*!< Command is not legal for the card state */ SD_CARD_ECC_FAILED = (17), /*!< Card internal ECC was applied but failed to correct the data */ SD_CC_ERROR = (18), /*!< Internal card controller error */ SD_GENERAL_UNKNOWN_ERROR = (19), /*!< General or Unknown error */ SD_STREAM_READ_UNDERRUN = (20), /*!< The card could not sustain data transfer in stream read operation. */ SD_STREAM_WRITE_OVERRUN = (21), /*!< The card could not sustain data programming in stream mode */ SD_CID_CSD_OVERWRITE = (22), /*!< CID/CSD overwrite error */ SD_WP_ERASE_SKIP = (23), /*!< only partial address space was erased */ SD_CARD_ECC_DISABLED = (24), /*!< Command has been executed without using internal ECC */ SD_ERASE_RESET = (25), /*!< Erase sequence was cleared before executing because an out of erase sequence command was received */ SD_AKE_SEQ_ERROR = (26), /*!< Error in sequence of authentication. */ SD_INVALID_VOLTRANGE = (27), SD_ADDR_OUT_OF_RANGE = (28), SD_SWITCH_ERROR = (29), SD_SDIO_DISABLED = (30), SD_SDIO_FUNCTION_BUSY = (31), SD_SDIO_FUNCTION_FAILED = (32), SD_SDIO_UNKNOWN_FUNCTION = (33), /** * @brief Standard error defines */ SD_INTERNAL_ERROR, SD_NOT_CONFIGURED, SD_REQUEST_PENDING, SD_REQUEST_NOT_APPLICABLE, SD_INVALID_PARAMETER, SD_UNSUPPORTED_FEATURE, SD_UNSUPPORTED_HW, SD_ERROR, SD_OK = 0 } SD_Error;[/mw_shl_code] 请问 这段代码的出处是哪啊?   谢谢了
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
6条回答
正点原子
1楼-- · 2019-08-14 00:47
官方有很多版本的。。。。
每个版本可能有些不一样。
你要找对版本才行。
他说他不在
2楼-- · 2019-08-14 00:49
 精彩回答 2  元偷偷看……
huaiqiao
3楼-- · 2019-08-14 02:48
正点原子 发表于 2015-3-17 08:54
官方有很多版本的。。。。
每个版本可能有些不一样。
你要找对版本才行。

那么请问原子哥,这个SD_Error的这个结构体的出处在哪里呢?
怎么找,请指导下,PPT中我看也没有写入,所以。。。。。
huaiqiao
4楼-- · 2019-08-14 03:42
huaiqiao 发表于 2017-3-2 22:01
那么请问原子哥,这个SD_Error的这个结构体的出处在哪里呢?
怎么找,请指导下,PPT中我看也没有写入, ...

@正点原子
原子哥,劳驾帮忙回答下。

我是真的找不到这个的出处啊。
小陀螺爱炒蛋
5楼-- · 2019-08-14 05:54
enum只是个数据结构,如果不给寄存器赋值操作的话,定义多少没啥区别。。只是用于判定状态或者错误
天天mdk
6楼-- · 2019-08-14 08:12
在sdio_sdcard.h文件里定义的

一周热门 更多>