Macros
sd_mmc_protocol.h File Reference

SD/MMC protocol definitions. More...

#include "compiler.h"
Include dependency graph for sd_mmc_protocol.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SDMMC_CLOCK_INIT   400000
 
Flags used to define a SD/MMC/SDIO command
#define SDMMC_CMD_GET_INDEX(cmd)   (cmd & 0x3F)
 
#define SDMMC_RESP_PRESENT   (1lu << 8)
 Have response (MCI only) More...
 
#define SDMMC_RESP_8   (1lu << 9)
 8 bit response (SPI only) More...
 
#define SDMMC_RESP_32   (1lu << 10)
 32 bit response (SPI only) More...
 
#define SDMMC_RESP_136   (1lu << 11)
 136 bit response (MCI only) More...
 
#define SDMMC_RESP_CRC   (1lu << 12)
 Expect valid crc (MCI only) More...
 
#define SDMMC_RESP_BUSY   (1lu << 13)
 Card may send busy. More...
 
#define SDMMC_CMD_OPENDRAIN   (1lu << 14)
 
#define SDMMC_CMD_WRITE   (1lu << 15)
 To signal a data write operation. More...
 
#define SDMMC_CMD_SDIO_BYTE   (1lu << 16)
 To signal a SDIO tranfer in multi byte mode. More...
 
#define SDMMC_CMD_SDIO_BLOCK   (1lu << 17)
 To signal a SDIO tranfer in block mode. More...
 
#define SDMMC_CMD_STREAM   (1lu << 18)
 To signal a data transfer in stream mode. More...
 
#define SDMMC_CMD_SINGLE_BLOCK   (1lu << 19)
 To signal a data transfer in single block mode. More...
 
#define SDMMC_CMD_MULTI_BLOCK   (1lu << 20)
 To signal a data transfer in multi block mode. More...
 
Set of flags to define a reponse type
#define SDMMC_CMD_NO_RESP   (0)
 
#define SDMMC_CMD_R1   (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC)
 
#define SDMMC_CMD_R1B   (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC | SDMMC_RESP_BUSY)
 
#define SDMMC_CMD_R2   (SDMMC_RESP_PRESENT | SDMMC_RESP_8 | SDMMC_RESP_136 | SDMMC_RESP_CRC)
 
#define SDMMC_CMD_R3   (SDMMC_RESP_PRESENT | SDMMC_RESP_32)
 
#define SDMMC_CMD_R4   (SDMMC_RESP_PRESENT | SDMMC_RESP_32)
 
#define SDMMC_CMD_R5   (SDMMC_RESP_PRESENT | SDMMC_RESP_8 | SDMMC_RESP_CRC)
 
#define SDMMC_CMD_R6   (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC)
 
#define SDMMC_CMD_R7   (SDMMC_RESP_PRESENT | SDMMC_RESP_32 | SDMMC_RESP_CRC)
 
SD/MMC/SDIO command definitions

SDMMC_CMDx are include in SD and MMC norms MMC_CMDx are include in MMC norms only SD_CMDx are include in SD norms only SDIO_CMDx are include in SDIO norms only

#define SDMMC_SPI_CMD0_GO_IDLE_STATE   (0 | SDMMC_CMD_R1)
 
#define SDMMC_MCI_CMD0_GO_IDLE_STATE   (0 | SDMMC_CMD_NO_RESP | SDMMC_CMD_OPENDRAIN)
 
#define MMC_SPI_CMD1_SEND_OP_COND   (1 | SDMMC_CMD_R1)
 
#define MMC_MCI_CMD1_SEND_OP_COND   (1 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN)
 
#define SDMMC_CMD2_ALL_SEND_CID   (2 | SDMMC_CMD_R2 | SDMMC_CMD_OPENDRAIN)
 
#define SD_CMD3_SEND_RELATIVE_ADDR   (3 | SDMMC_CMD_R6 | SDMMC_CMD_OPENDRAIN)
 
#define MMC_CMD3_SET_RELATIVE_ADDR   (3 | SDMMC_CMD_R1)
 
#define SDMMC_CMD4_SET_DSR   (4 | SDMMC_CMD_NO_RESP)
 
#define MMC_CMD5_SLEEP_AWAKE   (5 | SDMMC_CMD_R1B)
 
#define SDMMC_CMD7_SELECT_CARD_CMD   (7 | SDMMC_CMD_R1B)
 
#define SDMMC_CMD7_DESELECT_CARD_CMD   (7 | SDMMC_CMD_R1)
 
#define MMC_CMD8_SEND_EXT_CSD   (8 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)
 
#define SD_CMD8_SEND_IF_COND   (8 | SDMMC_CMD_R7 | SDMMC_CMD_OPENDRAIN)
 
#define SDMMC_SPI_CMD9_SEND_CSD   (9 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)
 
#define SDMMC_MCI_CMD9_SEND_CSD   (9 | SDMMC_CMD_R2)
 
#define SDMMC_CMD10_SEND_CID   (10 | SDMMC_CMD_R2)
 
#define MMC_CMD11_READ_DAT_UNTIL_STOP   (11 | SDMMC_CMD_R1)
 
#define SD_CMD11_READ_DAT_UNTIL_STOP   (11 | SDMMC_CMD_R1)
 
#define SDMMC_CMD12_STOP_TRANSMISSION   (12 | SDMMC_CMD_R1B)
 
#define SDMMC_SPI_CMD13_SEND_STATUS   (13 | SDMMC_CMD_R2)
 
#define SDMMC_MCI_CMD13_SEND_STATUS   (13 | SDMMC_CMD_R1)
 
#define MMC_CMD14_BUSTEST_R   (14 | SDMMC_CMD_R1)
 
#define SDMMC_CMD15_GO_INACTIVE_STATE   (15 | SDMMC_CMD_NO_RESP | SDMMC_CMD_OPENDRAIN)
 
#define MMC_CMD19_BUSTEST_W   (19 | SDMMC_CMD_R1)
 
#define SDMMC_SPI_CMD58_READ_OCR   (58 | SDMMC_CMD_R3)
 
#define SDMMC_SPI_CMD59_CRC_ON_OFF   (59 | SDMMC_CMD_R1)
 
#define SDMMC_CMD16_SET_BLOCKLEN   (16 | SDMMC_CMD_R1)
 
#define SDMMC_CMD17_READ_SINGLE_BLOCK   (17 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)
 
#define SDMMC_CMD18_READ_MULTIPLE_BLOCK   (18 | SDMMC_CMD_R1 | SDMMC_CMD_MULTI_BLOCK)
 
#define MMC_CMD20_WRITE_DAT_UNTIL_STOP   (20 | SDMMC_CMD_R1)
 
#define MMC_CMD23_SET_BLOCK_COUNT   (23 | SDMMC_CMD_R1)
 
#define SDMMC_CMD24_WRITE_BLOCK   (24 | SDMMC_CMD_R1 | SDMMC_CMD_WRITE | SDMMC_CMD_SINGLE_BLOCK)
 
#define SDMMC_CMD25_WRITE_MULTIPLE_BLOCK   (25 | SDMMC_CMD_R1 | SDMMC_CMD_WRITE | SDMMC_CMD_MULTI_BLOCK)
 
#define MMC_CMD26_PROGRAM_CID   (26 | SDMMC_CMD_R1)
 
#define SDMMC_CMD27_PROGRAM_CSD   (27 | SDMMC_CMD_R1)
 
#define SD_CMD32_ERASE_WR_BLK_START   (32 | SDMMC_CMD_R1)
 
#define SD_CMD33_ERASE_WR_BLK_END   (33 | SDMMC_CMD_R1)
 
#define MMC_CMD35_ERASE_GROUP_START   (35 | SDMMC_CMD_R1)
 
#define MMC_CMD36_ERASE_GROUP_END   (36 | SDMMC_CMD_R1)
 
#define SDMMC_CMD38_ERASE   (38 | SDMMC_CMD_R1B)
 
#define SDMMC_CMD28_SET_WRITE_PROT   (28 | SDMMC_CMD_R1B)
 
#define SDMMC_CMD29_CLR_WRITE_PROT   (29 | SDMMC_CMD_R1B)
 
#define SDMMC_CMD30_SEND_WRITE_PROT   (30 | SDMMC_CMD_R1)
 
#define SDMMC_CMD42_LOCK_UNLOCK   (42 | SDMMC_CMD_R1)
 
#define SDMMC_CMD55_APP_CMD   (55 | SDMMC_CMD_R1)
 
#define SDMMC_CMD56_GEN_CMD   (56 | SDMMC_CMD_R1)
 
#define MMC_CMD6_SWITCH   (6 | SDMMC_CMD_R1B)
 
#define SD_CMD6_SWITCH_FUNC   (6 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)
 
#define SD_ACMD6_SET_BUS_WIDTH   (6 | SDMMC_CMD_R1)
 
#define SD_ACMD13_SD_STATUS   (13 | SDMMC_CMD_R1)
 
#define SD_ACMD22_SEND_NUM_WR_BLOCKS   (22 | SDMMC_CMD_R1)
 
#define SD_ACMD23_SET_WR_BLK_ERASE_COUNT   (23 | SDMMC_CMD_R1)
 
#define SD_MCI_ACMD41_SD_SEND_OP_COND   (41 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN)
 
#define SD_SPI_ACMD41_SD_SEND_OP_COND   (41 | SDMMC_CMD_R1)
 
#define SD_ACMD42_SET_CLR_CARD_DETECT   (42 | SDMMC_CMD_R1)
 
#define SD_ACMD51_SEND_SCR   (51 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)
 
#define MMC_CMD39_FAST_IO   (39 | SDMMC_CMD_R4)
 
#define MMC_CMD40_GO_IRQ_STATE   (40 | SDMMC_CMD_R5 | SDMMC_CMD_OPENDRAIN)
 
#define SDIO_CMD5_SEND_OP_COND   (5 | SDMMC_CMD_R4 | SDMMC_CMD_OPENDRAIN)
 
#define SDIO_CMD52_IO_RW_DIRECT   (52 | SDMMC_CMD_R5)
 
#define SDIO_CMD53_IO_R_BYTE_EXTENDED   (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BYTE)
 
#define SDIO_CMD53_IO_W_BYTE_EXTENDED   (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BYTE | SDMMC_CMD_WRITE)
 
#define SDIO_CMD53_IO_R_BLOCK_EXTENDED   (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BLOCK)
 
#define SDIO_CMD53_IO_W_BLOCK_EXTENDED   (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BLOCK | SDMMC_CMD_WRITE)
 
MMC CMD6 argument structure
#define MMC_CMD6_ACCESS_COMMAND_SET   (0lu << 24)
 
#define MMC_CMD6_ACCESS_SET_BITS   (1lu << 24)
 
#define MMC_CMD6_ACCESS_CLEAR_BITS   (2lu << 24)
 
#define MMC_CMD6_ACCESS_WRITE_BYTE   (3lu << 24)
 
#define MMC_CMD6_INDEX_CMD_SET   (EXT_CSD_CMD_SET_INDEX << 16)
 [23:16] Index for Mode Segment More...
 
#define MMC_CMD6_INDEX_CMD_SET_REV   (EXT_CSD_CMD_SET_REV_INDEX << 16)
 
#define MMC_CMD6_INDEX_POWER_CLASS   (EXT_CSD_POWER_CLASS_INDEX << 16)
 
#define MMC_CMD6_INDEX_HS_TIMING   (EXT_CSD_HS_TIMING_INDEX << 16)
 
#define MMC_CMD6_INDEX_BUS_WIDTH   (EXT_CSD_BUS_WIDTH_INDEX << 16)
 
#define MMC_CMD6_INDEX_ERASED_MEM_CONT   (EXT_CSD_ERASED_MEM_CONT_INDEX << 16)
 
#define MMC_CMD6_INDEX_BOOT_CONFIG   (EXT_CSD_BOOT_CONFIG_INDEX << 16)
 
#define MMC_CMD6_INDEX_BOOT_BUS_WIDTH   (EXT_CSD_BOOT_BUS_WIDTH_INDEX << 16)
 
#define MMC_CMD6_INDEX_ERASE_GROUP_DEF   (EXT_CSD_ERASE_GROUP_DEF_INDEX << 16)
 
#define MMC_CMD6_VALUE_BUS_WIDTH_1BIT   (0x0lu << 8)
 [15:8] Value More...
 
#define MMC_CMD6_VALUE_BUS_WIDTH_4BIT   (0x1lu << 8)
 
#define MMC_CMD6_VALUE_BUS_WIDTH_8BIT   (0x2lu << 8)
 
#define MMC_CMD6_VALUE_HS_TIMING_ENABLE   (0x1lu << 8)
 
#define MMC_CMD6_VALUE_HS_TIMING_DISABLE   (0x0lu << 8)
 
SD CMD6 argument structure

[7:3] Set to 0 [2:0] Cmd Set

#define SD_CMD6_GRP1_HIGH_SPEED   (0x1lu << 0)
 CMD6 arg[ 3: 0] function group 1, access mode. More...
 
#define SD_CMD6_GRP1_DEFAULT   (0x0lu << 0)
 
#define SD_CMD6_GRP2_NO_INFLUENCE   (0xFlu << 4)
 CMD6 arg[ 7: 4] function group 2, command system. More...
 
#define SD_CMD6_GRP2_DEFAULT   (0x0lu << 4)
 
#define SD_CMD6_GRP3_NO_INFLUENCE   (0xFlu << 8)
 CMD6 arg[11: 8] function group 3, 0xF or 0x0. More...
 
#define SD_CMD6_GRP3_DEFAULT   (0x0lu << 8)
 
#define SD_CMD6_GRP4_NO_INFLUENCE   (0xFlu << 12)
 CMD6 arg[15:12] function group 4, 0xF or 0x0. More...
 
#define SD_CMD6_GRP4_DEFAULT   (0x0lu << 12)
 
#define SD_CMD6_GRP5_NO_INFLUENCE   (0xFlu << 16)
 CMD6 arg[19:16] function group 5, 0xF or 0x0. More...
 
#define SD_CMD6_GRP5_DEFAULT   (0x0lu << 16)
 
#define SD_CMD6_GRP6_NO_INFLUENCE   (0xFlu << 20)
 CMD6 arg[23:20] function group 6, 0xF or 0x0. More...
 
#define SD_CMD6_GRP6_DEFAULT   (0x0lu << 20)
 
#define SD_CMD6_MODE_CHECK   (0lu << 31)
 
#define SD_CMD6_MODE_SWITCH   (1lu << 31)
 
SD CMD8 argument structure
#define SD_CMD8_PATTERN   0xAA
 
#define SD_CMD8_MASK_PATTERN   0xFF
 
#define SD_CMD8_HIGH_VOLTAGE   0x100
 
#define SD_CMD8_MASK_VOLTAGE   0xF00
 
SD ACMD41 arguments
#define SD_ACMD41_HCS   (1lu << 30)
 
SDIO state (in R5)
#define SDIO_R5_COM_CRC_ERROR   (1lu << 15)
 
#define SDIO_R5_ILLEGAL_COMMAND   (1lu << 14)
 
#define SDIO_R5_STATE   (3lu << 12)
 
#define SDIO_R5_STATE_DIS   (0lu << 12)
 
#define SDIO_R5_STATE_CMD   (1lu << 12)
 
#define SDIO_R5_STATE_TRN   (2lu << 12)
 
#define SDIO_R5_STATE_RFU   (3lu << 12)
 
#define SDIO_R5_ERROR   (1lu << 11)
 
#define SDIO_R5_FUNC_NUM   (1lu << 9)
 
#define SDIO_R5_OUT_OF_RANGE   (1lu << 8)
 
#define SDIO_R5_STATUS_ERR
 
SDIO state (in R6)
#define SDIO_R6_COM_CRC_ERROR   (1lu << 15)
 
#define SDIO_R6_ILLEGAL_COMMAND   (1lu << 14)
 
#define SDIO_R6_ERROR   (1lu << 13)
 
#define SDIO_STATUS_R6
 
SDIO CMD52 argument bit offset
#define SDIO_CMD52_WR_DATA   0
 CMD52 arg[ 7: 0] Write data or stuff bits. More...
 
#define SDIO_CMD52_STUFF0   8
 CMD52 arg[ 8] Reserved. More...
 
#define SDIO_CMD52_REG_ADRR   9
 CMD52 arg[25: 9] Register address. More...
 
#define SDIO_CMD52_STUFF1   26
 CMD52 arg[ 26] Reserved. More...
 
#define SDIO_CMD52_RAW_FLAG   27
 CMD52 arg[ 27] Read after Write flag. More...
 
#define SDIO_CMD52_FUNCTION_NUM   28
 CMD52 arg[30:28] Number of the function. More...
 
#define SDIO_CMD52_RW_FLAG   31
 CMD52 arg[ 31] Direction, 1:write, 0:read. More...
 
#define SDIO_CMD52_READ_FLAG   0
 
#define SDIO_CMD52_WRITE_FLAG   1
 
SDIO CMD53 argument structure
#define SDIO_CMD53_COUNT   0
 
#define SDIO_CMD53_REG_ADDR   9
 CMD53 arg[25: 9] Start Address I/O register. More...
 
#define SDIO_CMD53_OP_CODE   26
 CMD53 arg[ 26] 1:Incrementing address, 0: fixed. More...
 
#define SDIO_CMD53_BLOCK_MODE   27
 CMD53 arg[ 27] (Optional) 1:block mode. More...
 
#define SDIO_CMD53_FUNCTION_NUM   28
 CMD53 arg[30:28] Number of the function. More...
 
#define SDIO_CMD53_RW_FLAG   31
 CMD53 arg[ 31] Direction, 1:WR, 0:RD. More...
 
#define SDIO_CMD53_READ_FLAG   0
 
#define SDIO_CMD53_WRITE_FLAG   1
 
SDIO Functions
#define SDIO_CIA   0
 
#define SDIO_FN0   0
 
#define SDIO_FN1   1
 
#define SDIO_FN2   2
 
#define SDIO_FN3   3
 
#define SDIO_FN4   4
 
#define SDIO_FN5   5
 
#define SDIO_FN6   6
 
#define SDIO_FN7   7
 
SDIO Card Common Control Registers (CCCR)
#define SDIO_CCCR_SDIO_REV   0x00
 
#define SDIO_CCCR_REV_1_00   (0x0lu << 0)
 
#define SDIO_CCCR_REV_1_10   (0x1lu << 0)
 
#define SDIO_CCCR_REV_2_00   (0x2lu << 0)
 
#define SDIO_CCCR_REV_3_00   (0x3lu << 0)
 
#define SDIO_SDIO_REV_1_00   (0x0lu << 4)
 
#define SDIO_SDIO_REV_1_10   (0x1lu << 4)
 
#define SDIO_SDIO_REV_1_20   (0x2lu << 4)
 
#define SDIO_SDIO_REV_2_00   (0x3lu << 4)
 
#define SDIO_SDIO_REV_3_00   (0x4lu << 4)
 
#define SDIO_CCCR_SD_REV   0x01
 
#define SDIO_SD_REV_1_01   (0x0lu << 0)
 
#define SDIO_SD_REV_1_10   (0x1lu << 0)
 
#define SDIO_SD_REV_2_00   (0x2lu << 0)
 
#define SDIO_SD_REV_3_00   (0x3lu << 0)
 
#define SDIO_CCCR_IOE   0x02
 
#define SDIO_IOE_FN1   (0x1lu << 1)
 
#define SDIO_IOE_FN2   (0x1lu << 2)
 
#define SDIO_IOE_FN3   (0x1lu << 3)
 
#define SDIO_IOE_FN4   (0x1lu << 4)
 
#define SDIO_IOE_FN5   (0x1lu << 5)
 
#define SDIO_IOE_FN6   (0x1lu << 6)
 
#define SDIO_IOE_FN7   (0x1lu << 7)
 
#define SDIO_CCCR_IOR   0x03
 
#define SDIO_IOR_FN1   (0x1lu << 1)
 
#define SDIO_IOR_FN2   (0x1lu << 2)
 
#define SDIO_IOR_FN3   (0x1lu << 3)
 
#define SDIO_IOR_FN4   (0x1lu << 4)
 
#define SDIO_IOR_FN5   (0x1lu << 5)
 
#define SDIO_IOR_FN6   (0x1lu << 6)
 
#define SDIO_IOR_FN7   (0x1lu << 7)
 
#define SDIO_CCCR_IEN   0x04
 
#define SDIO_IENM   (0x1lu << 0)
 
#define SDIO_IEN_FN1   (0x1lu << 1)
 
#define SDIO_IEN_FN2   (0x1lu << 2)
 
#define SDIO_IEN_FN3   (0x1lu << 3)
 
#define SDIO_IEN_FN4   (0x1lu << 4)
 
#define SDIO_IEN_FN5   (0x1lu << 5)
 
#define SDIO_IEN_FN6   (0x1lu << 6)
 
#define SDIO_IEN_FN7   (0x1lu << 7)
 
#define SDIO_CCCR_INT   0x05
 
#define SDIO_INT_FN1   (0x1lu << 1)
 
#define SDIO_INT_FN2   (0x1lu << 2)
 
#define SDIO_INT_FN3   (0x1lu << 3)
 
#define SDIO_INT_FN4   (0x1lu << 4)
 
#define SDIO_INT_FN5   (0x1lu << 5)
 
#define SDIO_INT_FN6   (0x1lu << 6)
 
#define SDIO_INT_FN7   (0x1lu << 7)
 
#define SDIO_CCCR_IOA   0x06
 
#define SDIO_AS_FN1   (0x1lu << 0)
 
#define SDIO_AS_FN2   (0x2lu << 0)
 
#define SDIO_AS_FN3   (0x3lu << 0)
 
#define SDIO_AS_FN4   (0x4lu << 0)
 
#define SDIO_AS_FN5   (0x5lu << 0)
 
#define SDIO_AS_FN6   (0x6lu << 0)
 
#define SDIO_AS_FN7   (0x7lu << 0)
 
#define SDIO_RES   (0x1lu << 3)
 
#define SDIO_CCCR_BUS_CTRL   0x07
 
#define SDIO_BUSWIDTH_1B   (0x0lu << 0)
 
#define SDIO_BUSWIDTH_4B   (0x2lu << 0)
 
#define SDIO_BUS_ECSI   (0x1lu << 5)
 
#define SDIO_BUS_SCSI   (0x1lu << 6)
 
#define SDIO_BUS_CD_DISABLE   (0x1lu << 7)
 
#define SDIO_CCCR_CAP   0x08
 
#define SDIO_CAP_SDC   (0x1lu << 0)
 
#define SDIO_CAP_SMB   (0x1lu << 1)
 
#define SDIO_CAP_SRW   (0x1lu << 2)
 
#define SDIO_CAP_SBS   (0x1lu << 3)
 
#define SDIO_CAP_S4MI   (0x1lu << 4)
 
#define SDIO_CAP_E4MI   (0x1lu << 5)
 
#define SDIO_CAP_LSC   (0x1lu << 6)
 
#define SDIO_CAP_4BLS   (0x1lu << 7)
 
#define SDIO_CCCR_CIS_PTR   0x09
 
#define SDIO_CCCR_BUS_SUSPEND   0x0C
 
#define SDIO_BS   (0x1lu << 0)
 
#define SDIO_BR   (0x1lu << 1)
 
#define SDIO_CCCR_FUN_SEL   0x0D
 
#define SDIO_DF   (0x1lu << 7)
 
#define SDIO_FS_CIA   (0x0lu << 0)
 
#define SDIO_FS_FN1   (0x1lu << 0)
 
#define SDIO_FS_FN2   (0x2lu << 0)
 
#define SDIO_FS_FN3   (0x3lu << 0)
 
#define SDIO_FS_FN4   (0x4lu << 0)
 
#define SDIO_FS_FN5   (0x5lu << 0)
 
#define SDIO_FS_FN6   (0x6lu << 0)
 
#define SDIO_FS_FN7   (0x7lu << 0)
 
#define SDIO_FS_MEM   (0x8lu << 0)
 
#define SDIO_CCCR_EXEC   0x0E
 
#define SDIO_EXM   (0x1lu << 0)
 
#define SDIO_EX_FN1   (0x1lu << 1)
 
#define SDIO_EX_FN2   (0x1lu << 2)
 
#define SDIO_EX_FN3   (0x1lu << 3)
 
#define SDIO_EX_FN4   (0x1lu << 4)
 
#define SDIO_EX_FN5   (0x1lu << 5)
 
#define SDIO_EX_FN6   (0x1lu << 6)
 
#define SDIO_EX_FN7   (0x1lu << 7)
 
#define SDIO_CCCR_READY   0x0F
 
#define SDIO_RFM   (0x1lu << 0)
 
#define SDIO_RF_FN1   (0x1lu << 1)
 
#define SDIO_RF_FN2   (0x1lu << 2)
 
#define SDIO_RF_FN3   (0x1lu << 3)
 
#define SDIO_RF_FN4   (0x1lu << 4)
 
#define SDIO_RF_FN5   (0x1lu << 5)
 
#define SDIO_RF_FN6   (0x1lu << 6)
 
#define SDIO_RF_FN7   (0x1lu << 7)
 
#define SDIO_CCCR_FN0_BLKSIZ   0x10
 
#define SDIO_CCCR_POWER   0x12
 
#define SDIO_POWER_SMPC   (0x1lu << 0)
 
#define SDIO_POWER_EMPC   (0x1lu << 1)
 
#define SDIO_CCCR_HS   0x13
 
#define SDIO_SHS   (0x1lu << 0)
 
#define SDIO_EHS   (0x1lu << 1)
 
SDIO Card Metaformat
#define SDIO_CISTPL_NULL   0x00
 
#define SDIO_CISTPL_DEVICE   0x01
 
#define SDIO_CISTPL_CHECKSUM   0x10
 
#define SDIO_CISTPL_VERS_1   0x15
 
#define SDIO_CISTPL_ALTSTR   0x16
 
#define SDIO_CISTPL_MANFID   0x20
 
#define SDIO_CISTPL_FUNCID   0x21
 
#define SDIO_CISTPL_FUNCE   0x22
 
#define SDIO_CISTPL_SDIO_STD   0x91
 
#define SDIO_CISTPL_SDIO_EXT   0x92
 
#define SDIO_CISTPL_END   0xFF
 
CSD Fields
#define CSD_REG_BIT_SIZE   128
 128 bits More...
 
#define CSD_REG_BSIZE   (CSD_REG_BIT_SIZE / 8)
 16 bytes More...
 
#define CSD_STRUCTURE(csd, pos, size)   SDMMC_UNSTUFF_BITS(csd, CSD_REG_BIT_SIZE, pos, size)
 
#define CSD_STRUCTURE_VERSION(csd)   CSD_STRUCTURE(csd, 126, 2)
 
#define SD_CSD_VER_1_0   0
 
#define SD_CSD_VER_2_0   1
 
#define MMC_CSD_VER_1_0   0
 
#define MMC_CSD_VER_1_1   1
 
#define MMC_CSD_VER_1_2   2
 
#define CSD_TRAN_SPEED(csd)   CSD_STRUCTURE(csd, 96, 8)
 
#define SD_CSD_1_0_C_SIZE(csd)   CSD_STRUCTURE(csd, 62, 12)
 
#define SD_CSD_1_0_C_SIZE_MULT(csd)   CSD_STRUCTURE(csd, 47, 3)
 
#define SD_CSD_1_0_READ_BL_LEN(csd)   CSD_STRUCTURE(csd, 80, 4)
 
#define SD_CSD_2_0_C_SIZE(csd)   CSD_STRUCTURE(csd, 48, 22)
 
#define MMC_CSD_C_SIZE(csd)   CSD_STRUCTURE(csd, 62, 12)
 
#define MMC_CSD_C_SIZE_MULT(csd)   CSD_STRUCTURE(csd, 47, 3)
 
#define MMC_CSD_READ_BL_LEN(csd)   CSD_STRUCTURE(csd, 80, 4)
 
#define MMC_CSD_SPEC_VERS(csd)   CSD_STRUCTURE(csd, 122, 4)
 
OCR Register Fields
#define OCR_REG_BSIZE   (32 / 8)
 
#define OCR_VDD_170_195   (1lu << 7)
 
#define OCR_VDD_20_21   (1lu << 8)
 
#define OCR_VDD_21_22   (1lu << 9)
 
#define OCR_VDD_22_23   (1lu << 10)
 
#define OCR_VDD_23_24   (1lu << 11)
 
#define OCR_VDD_24_25   (1lu << 12)
 
#define OCR_VDD_25_26   (1lu << 13)
 
#define OCR_VDD_26_27   (1lu << 14)
 
#define OCR_VDD_27_28   (1lu << 15)
 
#define OCR_VDD_28_29   (1lu << 16)
 
#define OCR_VDD_29_30   (1lu << 17)
 
#define OCR_VDD_30_31   (1lu << 18)
 
#define OCR_VDD_31_32   (1lu << 19)
 
#define OCR_VDD_32_33   (1lu << 20)
 
#define OCR_VDD_33_34   (1lu << 21)
 
#define OCR_VDD_34_35   (1lu << 22)
 
#define OCR_VDD_35_36   (1lu << 23)
 
#define OCR_SDIO_S18R   (1lu << 24)
 
#define OCR_SDIO_MP   (1lu << 27)
 
#define OCR_SDIO_NF   (7lu << 28)
 
#define OCR_ACCESS_MODE_MASK   (3lu << 29)
 
#define OCR_ACCESS_MODE_BYTE   (0lu << 29)
 
#define OCR_ACCESS_MODE_SECTOR   (2lu << 29)
 
#define OCR_CCS   (1lu << 30)
 
#define OCR_POWER_UP_BUSY   (1lu << 31)
 
SD SCR Register Fields
#define SD_SCR_REG_BIT_SIZE   64
 64 bits More...
 
#define SD_SCR_REG_BSIZE   (SD_SCR_REG_BIT_SIZE / 8)
 8 bytes More...
 
#define SD_SCR_STRUCTURE(scr, pos, size)   SDMMC_UNSTUFF_BITS(scr, SD_SCR_REG_BIT_SIZE, pos, size)
 
#define SD_SCR_SCR_STRUCTURE(scr)   SD_SCR_STRUCTURE(scr, 60, 4)
 
#define SD_SCR_SCR_STRUCTURE_1_0   0
 
#define SD_SCR_SD_SPEC(scr)   SD_SCR_STRUCTURE(scr, 56, 4)
 
#define SD_SCR_SD_SPEC_1_0_01   0
 
#define SD_SCR_SD_SPEC_1_10   1
 
#define SD_SCR_SD_SPEC_2_00   2
 
#define SD_SCR_DATA_STATUS_AFTER_ERASE(scr)   SD_SCR_STRUCTURE(scr, 55, 1)
 
#define SD_SCR_SD_SECURITY(scr)   SD_SCR_STRUCTURE(scr, 52, 3)
 
#define SD_SCR_SD_SECURITY_NO   0
 
#define SD_SCR_SD_SECURITY_NOTUSED   1
 
#define SD_SCR_SD_SECURITY_1_01   2
 
#define SD_SCR_SD_SECURITY_2_00   3
 
#define SD_SCR_SD_SECURITY_3_00   4
 
#define SD_SCR_SD_BUS_WIDTHS(scr)   SD_SCR_STRUCTURE(scr, 48, 4)
 
#define SD_SCR_SD_BUS_WIDTH_1BITS   (1lu << 0)
 
#define SD_SCR_SD_BUS_WIDTH_4BITS   (1lu << 2)
 
#define SD_SCR_SD_SPEC3(scr)   SD_SCR_STRUCTURE(scr, 47, 1)
 
#define SD_SCR_SD_SPEC_3_00   1
 
#define SD_SCR_SD_EX_SECURITY(scr)   SD_SCR_STRUCTURE(scr, 43, 4)
 
#define SD_SCR_SD_CMD_SUPPORT(scr)   SD_SCR_STRUCTURE(scr, 32, 2)
 
SD Switch Status Fields
#define SD_SW_STATUS_BIT_SIZE   512
 512 bits More...
 
#define SD_SW_STATUS_BSIZE   (SD_SW_STATUS_BIT_SIZE / 8)
 64 bytes More...
 
#define SD_SW_STATUS_STRUCTURE(sd_sw_status, pos, size)   SDMMC_UNSTUFF_BITS(sd_sw_status, SD_SW_STATUS_BIT_SIZE, pos, size)
 
#define SD_SW_STATUS_MAX_CURRENT_CONSUMPTION(status)   SD_SW_STATUS_STRUCTURE(status, 496, 16)
 
#define SD_SW_STATUS_FUN_GRP6_INFO(status)   SD_SW_STATUS_STRUCTURE(status, 480, 16)
 
#define SD_SW_STATUS_FUN_GRP5_INFO(status)   SD_SW_STATUS_STRUCTURE(status, 464, 16)
 
#define SD_SW_STATUS_FUN_GRP4_INFO(status)   SD_SW_STATUS_STRUCTURE(status, 448, 16)
 
#define SD_SW_STATUS_FUN_GRP3_INFO(status)   SD_SW_STATUS_STRUCTURE(status, 432, 16)
 
#define SD_SW_STATUS_FUN_GRP2_INFO(status)   SD_SW_STATUS_STRUCTURE(status, 416, 16)
 
#define SD_SW_STATUS_FUN_GRP1_INFO(status)   SD_SW_STATUS_STRUCTURE(status, 400, 16)
 
#define SD_SW_STATUS_FUN_GRP6_RC(status)   SD_SW_STATUS_STRUCTURE(status, 396, 4)
 
#define SD_SW_STATUS_FUN_GRP5_RC(status)   SD_SW_STATUS_STRUCTURE(status, 392, 4)
 
#define SD_SW_STATUS_FUN_GRP4_RC(status)   SD_SW_STATUS_STRUCTURE(status, 388, 4)
 
#define SD_SW_STATUS_FUN_GRP3_RC(status)   SD_SW_STATUS_STRUCTURE(status, 384, 4)
 
#define SD_SW_STATUS_FUN_GRP2_RC(status)   SD_SW_STATUS_STRUCTURE(status, 380, 4)
 
#define SD_SW_STATUS_FUN_GRP1_RC(status)   SD_SW_STATUS_STRUCTURE(status, 376, 4)
 
#define SD_SW_STATUS_FUN_GRP_RC_ERROR   0xFU
 
#define SD_SW_STATUS_DATA_STRUCT_VER(status)   SD_SW_STATUS_STRUCTURE(status, 368, 8)
 
#define SD_SW_STATUS_FUN_GRP6_BUSY(status)   SD_SW_STATUS_STRUCTURE(status, 352, 16)
 
#define SD_SW_STATUS_FUN_GRP5_BUSY(status)   SD_SW_STATUS_STRUCTURE(status, 336, 16)
 
#define SD_SW_STATUS_FUN_GRP4_BUSY(status)   SD_SW_STATUS_STRUCTURE(status, 320, 16)
 
#define SD_SW_STATUS_FUN_GRP3_BUSY(status)   SD_SW_STATUS_STRUCTURE(status, 304, 16)
 
#define SD_SW_STATUS_FUN_GRP2_BUSY(status)   SD_SW_STATUS_STRUCTURE(status, 288, 16)
 
#define SD_SW_STATUS_FUN_GRP1_BUSY(status)   SD_SW_STATUS_STRUCTURE(status, 272, 16)
 
Card Status Fields
#define CARD_STATUS_APP_CMD   (1lu << 5)
 
#define CARD_STATUS_SWITCH_ERROR   (1lu << 7)
 
#define CARD_STATUS_READY_FOR_DATA   (1lu << 8)
 
#define CARD_STATUS_STATE_IDLE   (0lu << 9)
 
#define CARD_STATUS_STATE_READY   (1lu << 9)
 
#define CARD_STATUS_STATE_IDENT   (2lu << 9)
 
#define CARD_STATUS_STATE_STBY   (3lu << 9)
 
#define CARD_STATUS_STATE_TRAN   (4lu << 9)
 
#define CARD_STATUS_STATE_DATA   (5lu << 9)
 
#define CARD_STATUS_STATE_RCV   (6lu << 9)
 
#define CARD_STATUS_STATE_PRG   (7lu << 9)
 
#define CARD_STATUS_STATE_DIS   (8lu << 9)
 
#define CARD_STATUS_STATE   (0xFlu << 9)
 
#define CARD_STATUS_ERASE_RESET   (1lu << 13)
 
#define CARD_STATUS_WP_ERASE_SKIP   (1lu << 15)
 
#define CARD_STATUS_CIDCSD_OVERWRITE   (1lu << 16)
 
#define CARD_STATUS_OVERRUN   (1lu << 17)
 
#define CARD_STATUS_UNERRUN   (1lu << 18)
 
#define CARD_STATUS_ERROR   (1lu << 19)
 
#define CARD_STATUS_CC_ERROR   (1lu << 20)
 
#define CARD_STATUS_CARD_ECC_FAILED   (1lu << 21)
 
#define CARD_STATUS_ILLEGAL_COMMAND   (1lu << 22)
 
#define CARD_STATUS_COM_CRC_ERROR   (1lu << 23)
 
#define CARD_STATUS_UNLOCK_FAILED   (1lu << 24)
 
#define CARD_STATUS_CARD_IS_LOCKED   (1lu << 25)
 
#define CARD_STATUS_WP_VIOLATION   (1lu << 26)
 
#define CARD_STATUS_ERASE_PARAM   (1lu << 27)
 
#define CARD_STATUS_ERASE_SEQ_ERROR   (1lu << 28)
 
#define CARD_STATUS_BLOCK_LEN_ERROR   (1lu << 29)
 
#define CARD_STATUS_ADDRESS_MISALIGN   (1lu << 30)
 
#define CARD_STATUS_ADDR_OUT_OF_RANGE   (1lu << 31)
 
#define CARD_STATUS_ERR_RD_WR
 
SD Status Field
#define SD_STATUS_BSIZE   (512 / 8)
 
MMC Extended CSD Register Field
#define EXT_CSD_BSIZE   512
 
#define EXT_CSD_S_CMD_SET_INDEX   504lu
 
#define EXT_CSD_BOOT_INFO_INDEX   228lu
 
#define EXT_CSD_BOOT_SIZE_MULTI_INDEX   226lu
 
#define EXT_CSD_ACC_SIZE_INDEX   225lu
 
#define EXT_CSD_HC_ERASE_GRP_SIZE_INDEX   224lu
 
#define EXT_CSD_ERASE_TIMEOUT_MULT_INDEX   223lu
 
#define EXT_CSD_REL_WR_SEC_C_INDEX   222lu
 
#define EXT_CSD_HC_WP_GRP_SIZE_INDEX   221lu
 
#define EXT_CSD_S_C_VCC_INDEX   220lu
 
#define EXT_CSD_S_C_VCCQ_INDEX   219lu
 
#define EXT_CSD_S_A_TIMEOUT_INDEX   217lu
 
#define EXT_CSD_SEC_COUNT_INDEX   212lu
 
#define EXT_CSD_MIN_PERF_W_8_52_INDEX   210lu
 
#define EXT_CSD_MIN_PERF_R_8_52_INDEX   209lu
 
#define EXT_CSD_MIN_PERF_W_8_26_4_52_INDEX   208lu
 
#define EXT_CSD_MIN_PERF_R_8_26_4_52_INDEX   207lu
 
#define EXT_CSD_MIN_PERF_W_4_26_INDEX   206lu
 
#define EXT_CSD_MIN_PERF_R_4_26_INDEX   205lu
 
#define EXT_CSD_PWR_CL_26_360_INDEX   203lu
 
#define EXT_CSD_PWR_CL_52_360_INDEX   202lu
 
#define EXT_CSD_PWR_CL_26_195_INDEX   201lu
 
#define EXT_CSD_PWR_CL_52_195_INDEX   200lu
 
#define EXT_CSD_CARD_TYPE_INDEX   196lu
 
#define MMC_CTYPE_26MHZ   0x1
 
#define MMC_CTYPE_52MHZ   0x2
 
#define EXT_CSD_CSD_STRUCTURE_INDEX   194lu
 
#define EXT_CSD_EXT_CSD_REV_INDEX   192lu
 
#define EXT_CSD_CMD_SET_INDEX   191lu
 
#define EXT_CSD_CMD_SET_REV_INDEX   189lu
 
#define EXT_CSD_POWER_CLASS_INDEX   187lu
 
#define EXT_CSD_HS_TIMING_INDEX   185lu
 
#define EXT_CSD_BUS_WIDTH_INDEX   183lu
 
#define EXT_CSD_ERASED_MEM_CONT_INDEX   181lu
 
#define EXT_CSD_BOOT_CONFIG_INDEX   179lu
 
#define EXT_CSD_BOOT_BUS_WIDTH_INDEX   177lu
 
#define EXT_CSD_ERASE_GROUP_DEF_INDEX   175lu
 
Definition for SPI mode only
#define SPI_CMD_ENCODE(x)   (0x40 | (x & 0x3F))
 SPI commands start with a start bit "0" and a transmit bit "1". More...
 
Register R1 definition for SPI mode

The R1 register is always send after a command.

#define R1_SPI_IDLE   (1lu << 0)
 
#define R1_SPI_ERASE_RESET   (1lu << 1)
 
#define R1_SPI_ILLEGAL_COMMAND   (1lu << 2)
 
#define R1_SPI_COM_CRC   (1lu << 3)
 
#define R1_SPI_ERASE_SEQ   (1lu << 4)
 
#define R1_SPI_ADDRESS   (1lu << 5)
 
#define R1_SPI_PARAMETER   (1lu << 6)
 
#define R1_SPI_ERROR   (1lu << 7)
 
Register R2 definition for SPI mode

The R2 register can be send after R1 register.

#define R2_SPI_CARD_LOCKED   (1lu << 0)
 
#define R2_SPI_WP_ERASE_SKIP   (1lu << 1)
 
#define R2_SPI_LOCK_UNLOCK_FAIL   R2_SPI_WP_ERASE_SKIP
 
#define R2_SPI_ERROR   (1lu << 2)
 
#define R2_SPI_CC_ERROR   (1lu << 3)
 
#define R2_SPI_CARD_ECC_ERROR   (1lu << 4)
 
#define R2_SPI_WP_VIOLATION   (1lu << 5)
 
#define R2_SPI_ERASE_PARAM   (1lu << 6)
 
#define R2_SPI_OUT_OF_RANGE   (1lu << 7)
 
#define R2_SPI_CSD_OVERWRITE   R2_SPI_OUT_OF_RANGE
 
Tokens used for a read operation
#define SPI_TOKEN_SINGLE_MULTI_READ   0xFE
 
#define SPI_TOKEN_DATA_ERROR_VALID(token)   (((token) & 0xF0) == 0)
 
#define SPI_TOKEN_DATA_ERROR_ERRORS   (0x0F)
 
#define SPI_TOKEN_DATA_ERROR_ERROR   (1lu << 0)
 
#define SPI_TOKEN_DATA_ERROR_CC_ERROR   (1lu << 1)
 
#define SPI_TOKEN_DATA_ERROR_ECC_ERROR   (1lu << 2)
 
#define SPI_TOKEN_DATA_ERROR_OUT_RANGE   (1lu << 3)
 
Tokens used for a write operation
#define SPI_TOKEN_SINGLE_WRITE   0xFE
 
#define SPI_TOKEN_MULTI_WRITE   0xFC
 
#define SPI_TOKEN_STOP_TRAN   0xFD
 
#define SPI_TOKEN_DATA_RESP_VALID(token)   ((((token) & (1 << 4)) == 0) && (((token) & (1 << 0)) == 1))
 
#define SPI_TOKEN_DATA_RESP_CODE(token)   ((token) & 0x1E)
 
#define SPI_TOKEN_DATA_RESP_ACCEPTED   (2lu << 1)
 
#define SPI_TOKEN_DATA_RESP_CRC_ERR   (5lu << 1)
 
#define SPI_TOKEN_DATA_RESP_WRITE_ERR   (6lu << 1)
 

Typedefs

Macros for command definition

Commands types:

  • broadcast commands (bc), no response
  • broadcast commands with response (bcr) (Note: No open drain on SD card)
  • addressed (point-to-point) commands (ac), no data transfer on DAT lines
  • addressed (point-to-point) data transfer commands (adtc), data transfer on DAT lines

Specific MMC norms: CMD1, CMD2 & CMD3 are processed in the open-drain mode. The CMD line is driven with push-pull drivers.

Specific SD norms: There is no open drain mode in SD memory card.

Responses types:

R1, R3, R4 & R5 use a 48 bits response protected by a 7bit CRC checksum

  • R1 receiv data not specified
  • R3 receiv OCR
  • R4, R5 RCA management (MMC only)
  • R6, R7 RCA management (SD only)

R1b assert the BUSY signal and respond with R1. If the busy signal is asserted, it is done two clock cycles (Nsr time) after the end bit of the command. The DAT0 line is driven low. DAT1-DAT7 lines are driven by the card though their values are not relevant.

R2 use a 136 bits response protected by a 7bit CRC checksum The content is CID or CSD

Specific MMC norms:

  • R4 (Fast I/O) return RCA
  • R5 (interrupt request) return RCA null

Specific SD norms:

  • R6 (Published RCA) return RCA
  • R7 (Card interface condition) return RCA null
typedef uint32_t sdmmc_cmd_def_t
 Value to define a SD/MMC/SDIO command. More...
 

Functions

CSD, OCR, SCR, Switch status, extend CSD definitions
static uint32_t SDMMC_UNSTUFF_BITS (uint8_t *reg, uint16_t reg_size, uint16_t pos, uint8_t size)
 Macro function to extract a bits field from a large SD MMC register Used by : CSD, SCR, Switch status. More...
 

Detailed Description

SD/MMC protocol definitions.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

Definition in file sd_mmc_protocol.h.

Macro Definition Documentation

◆ CARD_STATUS_ADDR_OUT_OF_RANGE

#define CARD_STATUS_ADDR_OUT_OF_RANGE   (1lu << 31)

Definition at line 865 of file sd_mmc_protocol.h.

◆ CARD_STATUS_ADDRESS_MISALIGN

#define CARD_STATUS_ADDRESS_MISALIGN   (1lu << 30)

Definition at line 864 of file sd_mmc_protocol.h.

◆ CARD_STATUS_APP_CMD

#define CARD_STATUS_APP_CMD   (1lu << 5)

Definition at line 835 of file sd_mmc_protocol.h.

◆ CARD_STATUS_BLOCK_LEN_ERROR

#define CARD_STATUS_BLOCK_LEN_ERROR   (1lu << 29)

Definition at line 863 of file sd_mmc_protocol.h.

◆ CARD_STATUS_CARD_ECC_FAILED

#define CARD_STATUS_CARD_ECC_FAILED   (1lu << 21)

Definition at line 855 of file sd_mmc_protocol.h.

◆ CARD_STATUS_CARD_IS_LOCKED

#define CARD_STATUS_CARD_IS_LOCKED   (1lu << 25)

Definition at line 859 of file sd_mmc_protocol.h.

◆ CARD_STATUS_CC_ERROR

#define CARD_STATUS_CC_ERROR   (1lu << 20)

Definition at line 854 of file sd_mmc_protocol.h.

◆ CARD_STATUS_CIDCSD_OVERWRITE

#define CARD_STATUS_CIDCSD_OVERWRITE   (1lu << 16)

Definition at line 850 of file sd_mmc_protocol.h.

◆ CARD_STATUS_COM_CRC_ERROR

#define CARD_STATUS_COM_CRC_ERROR   (1lu << 23)

Definition at line 857 of file sd_mmc_protocol.h.

◆ CARD_STATUS_ERASE_PARAM

#define CARD_STATUS_ERASE_PARAM   (1lu << 27)

Definition at line 861 of file sd_mmc_protocol.h.

◆ CARD_STATUS_ERASE_RESET

#define CARD_STATUS_ERASE_RESET   (1lu << 13)

Definition at line 848 of file sd_mmc_protocol.h.

◆ CARD_STATUS_ERASE_SEQ_ERROR

#define CARD_STATUS_ERASE_SEQ_ERROR   (1lu << 28)

Definition at line 862 of file sd_mmc_protocol.h.

◆ CARD_STATUS_ERR_RD_WR

#define CARD_STATUS_ERR_RD_WR
Value:
#define CARD_STATUS_CC_ERROR
#define CARD_STATUS_WP_VIOLATION
#define CARD_STATUS_ADDRESS_MISALIGN
#define CARD_STATUS_ADDR_OUT_OF_RANGE
#define CARD_STATUS_ERROR
#define CARD_STATUS_ILLEGAL_COMMAND
#define CARD_STATUS_BLOCK_LEN_ERROR

Definition at line 867 of file sd_mmc_protocol.h.

◆ CARD_STATUS_ERROR

#define CARD_STATUS_ERROR   (1lu << 19)

Definition at line 853 of file sd_mmc_protocol.h.

◆ CARD_STATUS_ILLEGAL_COMMAND

#define CARD_STATUS_ILLEGAL_COMMAND   (1lu << 22)

Definition at line 856 of file sd_mmc_protocol.h.

◆ CARD_STATUS_OVERRUN

#define CARD_STATUS_OVERRUN   (1lu << 17)

Definition at line 851 of file sd_mmc_protocol.h.

◆ CARD_STATUS_READY_FOR_DATA

#define CARD_STATUS_READY_FOR_DATA   (1lu << 8)

Definition at line 837 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE

#define CARD_STATUS_STATE   (0xFlu << 9)

Definition at line 847 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE_DATA

#define CARD_STATUS_STATE_DATA   (5lu << 9)

Definition at line 843 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE_DIS

#define CARD_STATUS_STATE_DIS   (8lu << 9)

Definition at line 846 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE_IDENT

#define CARD_STATUS_STATE_IDENT   (2lu << 9)

Definition at line 840 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE_IDLE

#define CARD_STATUS_STATE_IDLE   (0lu << 9)

Definition at line 838 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE_PRG

#define CARD_STATUS_STATE_PRG   (7lu << 9)

Definition at line 845 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE_RCV

#define CARD_STATUS_STATE_RCV   (6lu << 9)

Definition at line 844 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE_READY

#define CARD_STATUS_STATE_READY   (1lu << 9)

Definition at line 839 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE_STBY

#define CARD_STATUS_STATE_STBY   (3lu << 9)

Definition at line 841 of file sd_mmc_protocol.h.

◆ CARD_STATUS_STATE_TRAN

#define CARD_STATUS_STATE_TRAN   (4lu << 9)

Definition at line 842 of file sd_mmc_protocol.h.

◆ CARD_STATUS_SWITCH_ERROR

#define CARD_STATUS_SWITCH_ERROR   (1lu << 7)

Definition at line 836 of file sd_mmc_protocol.h.

◆ CARD_STATUS_UNERRUN

#define CARD_STATUS_UNERRUN   (1lu << 18)

Definition at line 852 of file sd_mmc_protocol.h.

◆ CARD_STATUS_UNLOCK_FAILED

#define CARD_STATUS_UNLOCK_FAILED   (1lu << 24)

Definition at line 858 of file sd_mmc_protocol.h.

◆ CARD_STATUS_WP_ERASE_SKIP

#define CARD_STATUS_WP_ERASE_SKIP   (1lu << 15)

Definition at line 849 of file sd_mmc_protocol.h.

◆ CARD_STATUS_WP_VIOLATION

#define CARD_STATUS_WP_VIOLATION   (1lu << 26)

Definition at line 860 of file sd_mmc_protocol.h.

◆ CSD_REG_BIT_SIZE

#define CSD_REG_BIT_SIZE   128

128 bits

Definition at line 705 of file sd_mmc_protocol.h.

◆ CSD_REG_BSIZE

#define CSD_REG_BSIZE   (CSD_REG_BIT_SIZE / 8)

16 bytes

Definition at line 706 of file sd_mmc_protocol.h.

◆ CSD_STRUCTURE

#define CSD_STRUCTURE (   csd,
  pos,
  size 
)    SDMMC_UNSTUFF_BITS(csd, CSD_REG_BIT_SIZE, pos, size)

Definition at line 707 of file sd_mmc_protocol.h.

◆ CSD_STRUCTURE_VERSION

#define CSD_STRUCTURE_VERSION (   csd)    CSD_STRUCTURE(csd, 126, 2)

Definition at line 709 of file sd_mmc_protocol.h.

◆ CSD_TRAN_SPEED

#define CSD_TRAN_SPEED (   csd)    CSD_STRUCTURE(csd, 96, 8)

Definition at line 715 of file sd_mmc_protocol.h.

◆ EXT_CSD_ACC_SIZE_INDEX

#define EXT_CSD_ACC_SIZE_INDEX   225lu

Definition at line 888 of file sd_mmc_protocol.h.

◆ EXT_CSD_BOOT_BUS_WIDTH_INDEX

#define EXT_CSD_BOOT_BUS_WIDTH_INDEX   177lu

Definition at line 922 of file sd_mmc_protocol.h.

◆ EXT_CSD_BOOT_CONFIG_INDEX

#define EXT_CSD_BOOT_CONFIG_INDEX   179lu

Definition at line 921 of file sd_mmc_protocol.h.

◆ EXT_CSD_BOOT_INFO_INDEX

#define EXT_CSD_BOOT_INFO_INDEX   228lu

Definition at line 886 of file sd_mmc_protocol.h.

◆ EXT_CSD_BOOT_SIZE_MULTI_INDEX

#define EXT_CSD_BOOT_SIZE_MULTI_INDEX   226lu

Definition at line 887 of file sd_mmc_protocol.h.

◆ EXT_CSD_BSIZE

#define EXT_CSD_BSIZE   512

512 bytes.

Definition at line 883 of file sd_mmc_protocol.h.

◆ EXT_CSD_BUS_WIDTH_INDEX

#define EXT_CSD_BUS_WIDTH_INDEX   183lu

Definition at line 919 of file sd_mmc_protocol.h.

◆ EXT_CSD_CARD_TYPE_INDEX

#define EXT_CSD_CARD_TYPE_INDEX   196lu

Definition at line 907 of file sd_mmc_protocol.h.

◆ EXT_CSD_CMD_SET_INDEX

#define EXT_CSD_CMD_SET_INDEX   191lu

Definition at line 915 of file sd_mmc_protocol.h.

◆ EXT_CSD_CMD_SET_REV_INDEX

#define EXT_CSD_CMD_SET_REV_INDEX   189lu

Definition at line 916 of file sd_mmc_protocol.h.

◆ EXT_CSD_CSD_STRUCTURE_INDEX

#define EXT_CSD_CSD_STRUCTURE_INDEX   194lu

Definition at line 911 of file sd_mmc_protocol.h.

◆ EXT_CSD_ERASE_GROUP_DEF_INDEX

#define EXT_CSD_ERASE_GROUP_DEF_INDEX   175lu

Definition at line 923 of file sd_mmc_protocol.h.

◆ EXT_CSD_ERASE_TIMEOUT_MULT_INDEX

#define EXT_CSD_ERASE_TIMEOUT_MULT_INDEX   223lu

Definition at line 890 of file sd_mmc_protocol.h.

◆ EXT_CSD_ERASED_MEM_CONT_INDEX

#define EXT_CSD_ERASED_MEM_CONT_INDEX   181lu

Definition at line 920 of file sd_mmc_protocol.h.

◆ EXT_CSD_EXT_CSD_REV_INDEX

#define EXT_CSD_EXT_CSD_REV_INDEX   192lu

Definition at line 912 of file sd_mmc_protocol.h.

◆ EXT_CSD_HC_ERASE_GRP_SIZE_INDEX

#define EXT_CSD_HC_ERASE_GRP_SIZE_INDEX   224lu

Definition at line 889 of file sd_mmc_protocol.h.

◆ EXT_CSD_HC_WP_GRP_SIZE_INDEX

#define EXT_CSD_HC_WP_GRP_SIZE_INDEX   221lu

Definition at line 892 of file sd_mmc_protocol.h.

◆ EXT_CSD_HS_TIMING_INDEX

#define EXT_CSD_HS_TIMING_INDEX   185lu

Definition at line 918 of file sd_mmc_protocol.h.

◆ EXT_CSD_MIN_PERF_R_4_26_INDEX

#define EXT_CSD_MIN_PERF_R_4_26_INDEX   205lu

Definition at line 902 of file sd_mmc_protocol.h.

◆ EXT_CSD_MIN_PERF_R_8_26_4_52_INDEX

#define EXT_CSD_MIN_PERF_R_8_26_4_52_INDEX   207lu

Definition at line 900 of file sd_mmc_protocol.h.

◆ EXT_CSD_MIN_PERF_R_8_52_INDEX

#define EXT_CSD_MIN_PERF_R_8_52_INDEX   209lu

Definition at line 898 of file sd_mmc_protocol.h.

◆ EXT_CSD_MIN_PERF_W_4_26_INDEX

#define EXT_CSD_MIN_PERF_W_4_26_INDEX   206lu

Definition at line 901 of file sd_mmc_protocol.h.

◆ EXT_CSD_MIN_PERF_W_8_26_4_52_INDEX

#define EXT_CSD_MIN_PERF_W_8_26_4_52_INDEX   208lu

Definition at line 899 of file sd_mmc_protocol.h.

◆ EXT_CSD_MIN_PERF_W_8_52_INDEX

#define EXT_CSD_MIN_PERF_W_8_52_INDEX   210lu

Definition at line 897 of file sd_mmc_protocol.h.

◆ EXT_CSD_POWER_CLASS_INDEX

#define EXT_CSD_POWER_CLASS_INDEX   187lu

Definition at line 917 of file sd_mmc_protocol.h.

◆ EXT_CSD_PWR_CL_26_195_INDEX

#define EXT_CSD_PWR_CL_26_195_INDEX   201lu

Definition at line 905 of file sd_mmc_protocol.h.

◆ EXT_CSD_PWR_CL_26_360_INDEX

#define EXT_CSD_PWR_CL_26_360_INDEX   203lu

Definition at line 903 of file sd_mmc_protocol.h.

◆ EXT_CSD_PWR_CL_52_195_INDEX

#define EXT_CSD_PWR_CL_52_195_INDEX   200lu

Definition at line 906 of file sd_mmc_protocol.h.

◆ EXT_CSD_PWR_CL_52_360_INDEX

#define EXT_CSD_PWR_CL_52_360_INDEX   202lu

Definition at line 904 of file sd_mmc_protocol.h.

◆ EXT_CSD_REL_WR_SEC_C_INDEX

#define EXT_CSD_REL_WR_SEC_C_INDEX   222lu

Definition at line 891 of file sd_mmc_protocol.h.

◆ EXT_CSD_S_A_TIMEOUT_INDEX

#define EXT_CSD_S_A_TIMEOUT_INDEX   217lu

Definition at line 895 of file sd_mmc_protocol.h.

◆ EXT_CSD_S_C_VCC_INDEX

#define EXT_CSD_S_C_VCC_INDEX   220lu

Definition at line 893 of file sd_mmc_protocol.h.

◆ EXT_CSD_S_C_VCCQ_INDEX

#define EXT_CSD_S_C_VCCQ_INDEX   219lu

Definition at line 894 of file sd_mmc_protocol.h.

◆ EXT_CSD_S_CMD_SET_INDEX

#define EXT_CSD_S_CMD_SET_INDEX   504lu

Definition at line 885 of file sd_mmc_protocol.h.

◆ EXT_CSD_SEC_COUNT_INDEX

#define EXT_CSD_SEC_COUNT_INDEX   212lu

Definition at line 896 of file sd_mmc_protocol.h.

◆ MMC_CMD6_ACCESS_CLEAR_BITS

#define MMC_CMD6_ACCESS_CLEAR_BITS   (2lu << 24)

Definition at line 368 of file sd_mmc_protocol.h.

◆ MMC_CMD6_ACCESS_COMMAND_SET

#define MMC_CMD6_ACCESS_COMMAND_SET   (0lu << 24)

[31:26] Set to 0 [25:24] Access

Definition at line 366 of file sd_mmc_protocol.h.

◆ MMC_CMD6_ACCESS_SET_BITS

#define MMC_CMD6_ACCESS_SET_BITS   (1lu << 24)

Definition at line 367 of file sd_mmc_protocol.h.

◆ MMC_CMD6_ACCESS_WRITE_BYTE

#define MMC_CMD6_ACCESS_WRITE_BYTE   (3lu << 24)

Definition at line 369 of file sd_mmc_protocol.h.

◆ MMC_CMD6_INDEX_BOOT_BUS_WIDTH

#define MMC_CMD6_INDEX_BOOT_BUS_WIDTH   (EXT_CSD_BOOT_BUS_WIDTH_INDEX << 16)

Definition at line 378 of file sd_mmc_protocol.h.

◆ MMC_CMD6_INDEX_BOOT_CONFIG

#define MMC_CMD6_INDEX_BOOT_CONFIG   (EXT_CSD_BOOT_CONFIG_INDEX << 16)

Definition at line 377 of file sd_mmc_protocol.h.

◆ MMC_CMD6_INDEX_BUS_WIDTH

#define MMC_CMD6_INDEX_BUS_WIDTH   (EXT_CSD_BUS_WIDTH_INDEX << 16)

Definition at line 375 of file sd_mmc_protocol.h.

◆ MMC_CMD6_INDEX_CMD_SET

#define MMC_CMD6_INDEX_CMD_SET   (EXT_CSD_CMD_SET_INDEX << 16)

[23:16] Index for Mode Segment

Definition at line 371 of file sd_mmc_protocol.h.

◆ MMC_CMD6_INDEX_CMD_SET_REV

#define MMC_CMD6_INDEX_CMD_SET_REV   (EXT_CSD_CMD_SET_REV_INDEX << 16)

Definition at line 372 of file sd_mmc_protocol.h.

◆ MMC_CMD6_INDEX_ERASE_GROUP_DEF

#define MMC_CMD6_INDEX_ERASE_GROUP_DEF   (EXT_CSD_ERASE_GROUP_DEF_INDEX << 16)

Definition at line 379 of file sd_mmc_protocol.h.

◆ MMC_CMD6_INDEX_ERASED_MEM_CONT

#define MMC_CMD6_INDEX_ERASED_MEM_CONT   (EXT_CSD_ERASED_MEM_CONT_INDEX << 16)

Definition at line 376 of file sd_mmc_protocol.h.

◆ MMC_CMD6_INDEX_HS_TIMING

#define MMC_CMD6_INDEX_HS_TIMING   (EXT_CSD_HS_TIMING_INDEX << 16)

Definition at line 374 of file sd_mmc_protocol.h.

◆ MMC_CMD6_INDEX_POWER_CLASS

#define MMC_CMD6_INDEX_POWER_CLASS   (EXT_CSD_POWER_CLASS_INDEX << 16)

Definition at line 373 of file sd_mmc_protocol.h.

◆ MMC_CMD6_VALUE_BUS_WIDTH_1BIT

#define MMC_CMD6_VALUE_BUS_WIDTH_1BIT   (0x0lu << 8)

[15:8] Value

Definition at line 381 of file sd_mmc_protocol.h.

◆ MMC_CMD6_VALUE_BUS_WIDTH_4BIT

#define MMC_CMD6_VALUE_BUS_WIDTH_4BIT   (0x1lu << 8)

Definition at line 382 of file sd_mmc_protocol.h.

◆ MMC_CMD6_VALUE_BUS_WIDTH_8BIT

#define MMC_CMD6_VALUE_BUS_WIDTH_8BIT   (0x2lu << 8)

Definition at line 383 of file sd_mmc_protocol.h.

◆ MMC_CMD6_VALUE_HS_TIMING_DISABLE

#define MMC_CMD6_VALUE_HS_TIMING_DISABLE   (0x0lu << 8)

Definition at line 385 of file sd_mmc_protocol.h.

◆ MMC_CMD6_VALUE_HS_TIMING_ENABLE

#define MMC_CMD6_VALUE_HS_TIMING_ENABLE   (0x1lu << 8)

Definition at line 384 of file sd_mmc_protocol.h.

◆ MMC_CSD_C_SIZE

#define MMC_CSD_C_SIZE (   csd)    CSD_STRUCTURE(csd, 62, 12)

Definition at line 720 of file sd_mmc_protocol.h.

◆ MMC_CSD_C_SIZE_MULT

#define MMC_CSD_C_SIZE_MULT (   csd)    CSD_STRUCTURE(csd, 47, 3)

Definition at line 721 of file sd_mmc_protocol.h.

◆ MMC_CSD_READ_BL_LEN

#define MMC_CSD_READ_BL_LEN (   csd)    CSD_STRUCTURE(csd, 80, 4)

Definition at line 722 of file sd_mmc_protocol.h.

◆ MMC_CSD_SPEC_VERS

#define MMC_CSD_SPEC_VERS (   csd)    CSD_STRUCTURE(csd, 122, 4)

Definition at line 723 of file sd_mmc_protocol.h.

◆ MMC_CSD_VER_1_0

#define MMC_CSD_VER_1_0   0

Definition at line 712 of file sd_mmc_protocol.h.

◆ MMC_CSD_VER_1_1

#define MMC_CSD_VER_1_1   1

Definition at line 713 of file sd_mmc_protocol.h.

◆ MMC_CSD_VER_1_2

#define MMC_CSD_VER_1_2   2

Definition at line 714 of file sd_mmc_protocol.h.

◆ MMC_CTYPE_26MHZ

#define MMC_CTYPE_26MHZ   0x1

Definition at line 909 of file sd_mmc_protocol.h.

◆ MMC_CTYPE_52MHZ

#define MMC_CTYPE_52MHZ   0x2

Definition at line 910 of file sd_mmc_protocol.h.

◆ OCR_ACCESS_MODE_BYTE

#define OCR_ACCESS_MODE_BYTE   (0lu << 29)

(MMC) Byte access mode

Definition at line 750 of file sd_mmc_protocol.h.

◆ OCR_ACCESS_MODE_MASK

#define OCR_ACCESS_MODE_MASK   (3lu << 29)

(MMC) Access mode mask

Definition at line 749 of file sd_mmc_protocol.h.

◆ OCR_ACCESS_MODE_SECTOR

#define OCR_ACCESS_MODE_SECTOR   (2lu << 29)

(MMC) Sector access mode

Definition at line 751 of file sd_mmc_protocol.h.

◆ OCR_CCS

#define OCR_CCS   (1lu << 30)

(SD) Card Capacity Status

Definition at line 752 of file sd_mmc_protocol.h.

◆ OCR_POWER_UP_BUSY

#define OCR_POWER_UP_BUSY   (1lu << 31)

Card power up status bit

Definition at line 753 of file sd_mmc_protocol.h.

◆ OCR_REG_BSIZE

#define OCR_REG_BSIZE   (32 / 8)

32 bits, 4 bytes

Definition at line 728 of file sd_mmc_protocol.h.

◆ OCR_SDIO_MP

#define OCR_SDIO_MP   (1lu << 27)

Memory Present

Definition at line 747 of file sd_mmc_protocol.h.

◆ OCR_SDIO_NF

#define OCR_SDIO_NF   (7lu << 28)

Number of I/O Functions

Definition at line 748 of file sd_mmc_protocol.h.

◆ OCR_SDIO_S18R

#define OCR_SDIO_S18R   (1lu << 24)

Switching to 1.8V Accepted

Definition at line 746 of file sd_mmc_protocol.h.

◆ OCR_VDD_170_195

#define OCR_VDD_170_195   (1lu << 7)

Definition at line 729 of file sd_mmc_protocol.h.

◆ OCR_VDD_20_21

#define OCR_VDD_20_21   (1lu << 8)

Definition at line 730 of file sd_mmc_protocol.h.

◆ OCR_VDD_21_22

#define OCR_VDD_21_22   (1lu << 9)

Definition at line 731 of file sd_mmc_protocol.h.

◆ OCR_VDD_22_23

#define OCR_VDD_22_23   (1lu << 10)

Definition at line 732 of file sd_mmc_protocol.h.

◆ OCR_VDD_23_24

#define OCR_VDD_23_24   (1lu << 11)

Definition at line 733 of file sd_mmc_protocol.h.

◆ OCR_VDD_24_25

#define OCR_VDD_24_25   (1lu << 12)

Definition at line 734 of file sd_mmc_protocol.h.

◆ OCR_VDD_25_26

#define OCR_VDD_25_26   (1lu << 13)

Definition at line 735 of file sd_mmc_protocol.h.

◆ OCR_VDD_26_27

#define OCR_VDD_26_27   (1lu << 14)

Definition at line 736 of file sd_mmc_protocol.h.

◆ OCR_VDD_27_28

#define OCR_VDD_27_28   (1lu << 15)

Definition at line 737 of file sd_mmc_protocol.h.

◆ OCR_VDD_28_29

#define OCR_VDD_28_29   (1lu << 16)

Definition at line 738 of file sd_mmc_protocol.h.

◆ OCR_VDD_29_30

#define OCR_VDD_29_30   (1lu << 17)

Definition at line 739 of file sd_mmc_protocol.h.

◆ OCR_VDD_30_31

#define OCR_VDD_30_31   (1lu << 18)

Definition at line 740 of file sd_mmc_protocol.h.

◆ OCR_VDD_31_32

#define OCR_VDD_31_32   (1lu << 19)

Definition at line 741 of file sd_mmc_protocol.h.

◆ OCR_VDD_32_33

#define OCR_VDD_32_33   (1lu << 20)

Definition at line 742 of file sd_mmc_protocol.h.

◆ OCR_VDD_33_34

#define OCR_VDD_33_34   (1lu << 21)

Definition at line 743 of file sd_mmc_protocol.h.

◆ OCR_VDD_34_35

#define OCR_VDD_34_35   (1lu << 22)

Definition at line 744 of file sd_mmc_protocol.h.

◆ OCR_VDD_35_36

#define OCR_VDD_35_36   (1lu << 23)

Definition at line 745 of file sd_mmc_protocol.h.

◆ R1_SPI_ADDRESS

#define R1_SPI_ADDRESS   (1lu << 5)

Definition at line 942 of file sd_mmc_protocol.h.

◆ R1_SPI_COM_CRC

#define R1_SPI_COM_CRC   (1lu << 3)

Definition at line 940 of file sd_mmc_protocol.h.

◆ R1_SPI_ERASE_RESET

#define R1_SPI_ERASE_RESET   (1lu << 1)

Definition at line 938 of file sd_mmc_protocol.h.

◆ R1_SPI_ERASE_SEQ

#define R1_SPI_ERASE_SEQ   (1lu << 4)

Definition at line 941 of file sd_mmc_protocol.h.

◆ R1_SPI_ERROR

#define R1_SPI_ERROR   (1lu << 7)

Definition at line 945 of file sd_mmc_protocol.h.

◆ R1_SPI_IDLE

#define R1_SPI_IDLE   (1lu << 0)

Definition at line 937 of file sd_mmc_protocol.h.

◆ R1_SPI_ILLEGAL_COMMAND

#define R1_SPI_ILLEGAL_COMMAND   (1lu << 2)

Definition at line 939 of file sd_mmc_protocol.h.

◆ R1_SPI_PARAMETER

#define R1_SPI_PARAMETER   (1lu << 6)

Definition at line 943 of file sd_mmc_protocol.h.

◆ R2_SPI_CARD_ECC_ERROR

#define R2_SPI_CARD_ECC_ERROR   (1lu << 4)

Definition at line 956 of file sd_mmc_protocol.h.

◆ R2_SPI_CARD_LOCKED

#define R2_SPI_CARD_LOCKED   (1lu << 0)

Definition at line 951 of file sd_mmc_protocol.h.

◆ R2_SPI_CC_ERROR

#define R2_SPI_CC_ERROR   (1lu << 3)

Definition at line 955 of file sd_mmc_protocol.h.

◆ R2_SPI_CSD_OVERWRITE

#define R2_SPI_CSD_OVERWRITE   R2_SPI_OUT_OF_RANGE

Definition at line 960 of file sd_mmc_protocol.h.

◆ R2_SPI_ERASE_PARAM

#define R2_SPI_ERASE_PARAM   (1lu << 6)

Definition at line 958 of file sd_mmc_protocol.h.

◆ R2_SPI_ERROR

#define R2_SPI_ERROR   (1lu << 2)

Definition at line 954 of file sd_mmc_protocol.h.

◆ R2_SPI_LOCK_UNLOCK_FAIL

#define R2_SPI_LOCK_UNLOCK_FAIL   R2_SPI_WP_ERASE_SKIP

Definition at line 953 of file sd_mmc_protocol.h.

◆ R2_SPI_OUT_OF_RANGE

#define R2_SPI_OUT_OF_RANGE   (1lu << 7)

Definition at line 959 of file sd_mmc_protocol.h.

◆ R2_SPI_WP_ERASE_SKIP

#define R2_SPI_WP_ERASE_SKIP   (1lu << 1)

Definition at line 952 of file sd_mmc_protocol.h.

◆ R2_SPI_WP_VIOLATION

#define R2_SPI_WP_VIOLATION   (1lu << 5)

Definition at line 957 of file sd_mmc_protocol.h.

◆ SD_ACMD41_HCS

#define SD_ACMD41_HCS   (1lu << 30)

(SD) Host Capacity Support

Definition at line 426 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP1_DEFAULT

#define SD_CMD6_GRP1_DEFAULT   (0x0lu << 0)

Definition at line 394 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP1_HIGH_SPEED

#define SD_CMD6_GRP1_HIGH_SPEED   (0x1lu << 0)

CMD6 arg[ 3: 0] function group 1, access mode.

Definition at line 393 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP2_DEFAULT

#define SD_CMD6_GRP2_DEFAULT   (0x0lu << 4)

Definition at line 397 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP2_NO_INFLUENCE

#define SD_CMD6_GRP2_NO_INFLUENCE   (0xFlu << 4)

CMD6 arg[ 7: 4] function group 2, command system.

Definition at line 396 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP3_DEFAULT

#define SD_CMD6_GRP3_DEFAULT   (0x0lu << 8)

Definition at line 400 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP3_NO_INFLUENCE

#define SD_CMD6_GRP3_NO_INFLUENCE   (0xFlu << 8)

CMD6 arg[11: 8] function group 3, 0xF or 0x0.

Definition at line 399 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP4_DEFAULT

#define SD_CMD6_GRP4_DEFAULT   (0x0lu << 12)

Definition at line 403 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP4_NO_INFLUENCE

#define SD_CMD6_GRP4_NO_INFLUENCE   (0xFlu << 12)

CMD6 arg[15:12] function group 4, 0xF or 0x0.

Definition at line 402 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP5_DEFAULT

#define SD_CMD6_GRP5_DEFAULT   (0x0lu << 16)

Definition at line 406 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP5_NO_INFLUENCE

#define SD_CMD6_GRP5_NO_INFLUENCE   (0xFlu << 16)

CMD6 arg[19:16] function group 5, 0xF or 0x0.

Definition at line 405 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP6_DEFAULT

#define SD_CMD6_GRP6_DEFAULT   (0x0lu << 20)

Definition at line 409 of file sd_mmc_protocol.h.

◆ SD_CMD6_GRP6_NO_INFLUENCE

#define SD_CMD6_GRP6_NO_INFLUENCE   (0xFlu << 20)

CMD6 arg[23:20] function group 6, 0xF or 0x0.

Definition at line 408 of file sd_mmc_protocol.h.

◆ SD_CMD6_MODE_CHECK

#define SD_CMD6_MODE_CHECK   (0lu << 31)

CMD6 arg[30:24] reserved 0 CMD6 arg[31 ] Mode, 0: Check, 1: Switch

Definition at line 412 of file sd_mmc_protocol.h.

◆ SD_CMD6_MODE_SWITCH

#define SD_CMD6_MODE_SWITCH   (1lu << 31)

Definition at line 413 of file sd_mmc_protocol.h.

◆ SD_CMD8_HIGH_VOLTAGE

#define SD_CMD8_HIGH_VOLTAGE   0x100

Definition at line 420 of file sd_mmc_protocol.h.

◆ SD_CMD8_MASK_PATTERN

#define SD_CMD8_MASK_PATTERN   0xFF

Definition at line 419 of file sd_mmc_protocol.h.

◆ SD_CMD8_MASK_VOLTAGE

#define SD_CMD8_MASK_VOLTAGE   0xF00

Definition at line 421 of file sd_mmc_protocol.h.

◆ SD_CMD8_PATTERN

#define SD_CMD8_PATTERN   0xAA

Definition at line 418 of file sd_mmc_protocol.h.

◆ SD_CSD_1_0_C_SIZE

#define SD_CSD_1_0_C_SIZE (   csd)    CSD_STRUCTURE(csd, 62, 12)

Definition at line 716 of file sd_mmc_protocol.h.

◆ SD_CSD_1_0_C_SIZE_MULT

#define SD_CSD_1_0_C_SIZE_MULT (   csd)    CSD_STRUCTURE(csd, 47, 3)

Definition at line 717 of file sd_mmc_protocol.h.

◆ SD_CSD_1_0_READ_BL_LEN

#define SD_CSD_1_0_READ_BL_LEN (   csd)    CSD_STRUCTURE(csd, 80, 4)

Definition at line 718 of file sd_mmc_protocol.h.

◆ SD_CSD_2_0_C_SIZE

#define SD_CSD_2_0_C_SIZE (   csd)    CSD_STRUCTURE(csd, 48, 22)

Definition at line 719 of file sd_mmc_protocol.h.

◆ SD_CSD_VER_1_0

#define SD_CSD_VER_1_0   0

Definition at line 710 of file sd_mmc_protocol.h.

◆ SD_CSD_VER_2_0

#define SD_CSD_VER_2_0   1

Definition at line 711 of file sd_mmc_protocol.h.

◆ SD_SCR_DATA_STATUS_AFTER_ERASE

#define SD_SCR_DATA_STATUS_AFTER_ERASE (   scr)    SD_SCR_STRUCTURE(scr, 55, 1)

Definition at line 768 of file sd_mmc_protocol.h.

◆ SD_SCR_REG_BIT_SIZE

#define SD_SCR_REG_BIT_SIZE   64

64 bits

Definition at line 758 of file sd_mmc_protocol.h.

◆ SD_SCR_REG_BSIZE

#define SD_SCR_REG_BSIZE   (SD_SCR_REG_BIT_SIZE / 8)

8 bytes

Definition at line 759 of file sd_mmc_protocol.h.

◆ SD_SCR_SCR_STRUCTURE

#define SD_SCR_SCR_STRUCTURE (   scr)    SD_SCR_STRUCTURE(scr, 60, 4)

Definition at line 762 of file sd_mmc_protocol.h.

◆ SD_SCR_SCR_STRUCTURE_1_0

#define SD_SCR_SCR_STRUCTURE_1_0   0

Definition at line 763 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_BUS_WIDTH_1BITS

#define SD_SCR_SD_BUS_WIDTH_1BITS   (1lu << 0)

Definition at line 776 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_BUS_WIDTH_4BITS

#define SD_SCR_SD_BUS_WIDTH_4BITS   (1lu << 2)

Definition at line 777 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_BUS_WIDTHS

#define SD_SCR_SD_BUS_WIDTHS (   scr)    SD_SCR_STRUCTURE(scr, 48, 4)

Definition at line 775 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_CMD_SUPPORT

#define SD_SCR_SD_CMD_SUPPORT (   scr)    SD_SCR_STRUCTURE(scr, 32, 2)

Definition at line 781 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_EX_SECURITY

#define SD_SCR_SD_EX_SECURITY (   scr)    SD_SCR_STRUCTURE(scr, 43, 4)

Definition at line 780 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SECURITY

#define SD_SCR_SD_SECURITY (   scr)    SD_SCR_STRUCTURE(scr, 52, 3)

Definition at line 769 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SECURITY_1_01

#define SD_SCR_SD_SECURITY_1_01   2

Definition at line 772 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SECURITY_2_00

#define SD_SCR_SD_SECURITY_2_00   3

Definition at line 773 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SECURITY_3_00

#define SD_SCR_SD_SECURITY_3_00   4

Definition at line 774 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SECURITY_NO

#define SD_SCR_SD_SECURITY_NO   0

Definition at line 770 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SECURITY_NOTUSED

#define SD_SCR_SD_SECURITY_NOTUSED   1

Definition at line 771 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SPEC

#define SD_SCR_SD_SPEC (   scr)    SD_SCR_STRUCTURE(scr, 56, 4)

Definition at line 764 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SPEC3

#define SD_SCR_SD_SPEC3 (   scr)    SD_SCR_STRUCTURE(scr, 47, 1)

Definition at line 778 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SPEC_1_0_01

#define SD_SCR_SD_SPEC_1_0_01   0

Definition at line 765 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SPEC_1_10

#define SD_SCR_SD_SPEC_1_10   1

Definition at line 766 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SPEC_2_00

#define SD_SCR_SD_SPEC_2_00   2

Definition at line 767 of file sd_mmc_protocol.h.

◆ SD_SCR_SD_SPEC_3_00

#define SD_SCR_SD_SPEC_3_00   1

Definition at line 779 of file sd_mmc_protocol.h.

◆ SD_SCR_STRUCTURE

#define SD_SCR_STRUCTURE (   scr,
  pos,
  size 
)    SDMMC_UNSTUFF_BITS(scr, SD_SCR_REG_BIT_SIZE, pos, size)

Definition at line 760 of file sd_mmc_protocol.h.

◆ SD_STATUS_BSIZE

#define SD_STATUS_BSIZE   (512 / 8)

512 bits, 64bytes

Definition at line 878 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_BIT_SIZE

#define SD_SW_STATUS_BIT_SIZE   512

512 bits

Definition at line 786 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_BSIZE

#define SD_SW_STATUS_BSIZE   (SD_SW_STATUS_BIT_SIZE / 8)

64 bytes

Definition at line 787 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_DATA_STRUCT_VER

#define SD_SW_STATUS_DATA_STRUCT_VER (   status)    SD_SW_STATUS_STRUCTURE(status, 368, 8)

Definition at line 817 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP1_BUSY

#define SD_SW_STATUS_FUN_GRP1_BUSY (   status)    SD_SW_STATUS_STRUCTURE(status, 272, 16)

Definition at line 829 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP1_INFO

#define SD_SW_STATUS_FUN_GRP1_INFO (   status)    SD_SW_STATUS_STRUCTURE(status, 400, 16)

Definition at line 802 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP1_RC

#define SD_SW_STATUS_FUN_GRP1_RC (   status)    SD_SW_STATUS_STRUCTURE(status, 376, 4)

Definition at line 814 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP2_BUSY

#define SD_SW_STATUS_FUN_GRP2_BUSY (   status)    SD_SW_STATUS_STRUCTURE(status, 288, 16)

Definition at line 827 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP2_INFO

#define SD_SW_STATUS_FUN_GRP2_INFO (   status)    SD_SW_STATUS_STRUCTURE(status, 416, 16)

Definition at line 800 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP2_RC

#define SD_SW_STATUS_FUN_GRP2_RC (   status)    SD_SW_STATUS_STRUCTURE(status, 380, 4)

Definition at line 812 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP3_BUSY

#define SD_SW_STATUS_FUN_GRP3_BUSY (   status)    SD_SW_STATUS_STRUCTURE(status, 304, 16)

Definition at line 825 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP3_INFO

#define SD_SW_STATUS_FUN_GRP3_INFO (   status)    SD_SW_STATUS_STRUCTURE(status, 432, 16)

Definition at line 798 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP3_RC

#define SD_SW_STATUS_FUN_GRP3_RC (   status)    SD_SW_STATUS_STRUCTURE(status, 384, 4)

Definition at line 810 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP4_BUSY

#define SD_SW_STATUS_FUN_GRP4_BUSY (   status)    SD_SW_STATUS_STRUCTURE(status, 320, 16)

Definition at line 823 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP4_INFO

#define SD_SW_STATUS_FUN_GRP4_INFO (   status)    SD_SW_STATUS_STRUCTURE(status, 448, 16)

Definition at line 796 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP4_RC

#define SD_SW_STATUS_FUN_GRP4_RC (   status)    SD_SW_STATUS_STRUCTURE(status, 388, 4)

Definition at line 808 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP5_BUSY

#define SD_SW_STATUS_FUN_GRP5_BUSY (   status)    SD_SW_STATUS_STRUCTURE(status, 336, 16)

Definition at line 821 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP5_INFO

#define SD_SW_STATUS_FUN_GRP5_INFO (   status)    SD_SW_STATUS_STRUCTURE(status, 464, 16)

Definition at line 794 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP5_RC

#define SD_SW_STATUS_FUN_GRP5_RC (   status)    SD_SW_STATUS_STRUCTURE(status, 392, 4)

Definition at line 806 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP6_BUSY

#define SD_SW_STATUS_FUN_GRP6_BUSY (   status)    SD_SW_STATUS_STRUCTURE(status, 352, 16)

Definition at line 819 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP6_INFO

#define SD_SW_STATUS_FUN_GRP6_INFO (   status)    SD_SW_STATUS_STRUCTURE(status, 480, 16)

Definition at line 792 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP6_RC

#define SD_SW_STATUS_FUN_GRP6_RC (   status)    SD_SW_STATUS_STRUCTURE(status, 396, 4)

Definition at line 804 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_FUN_GRP_RC_ERROR

#define SD_SW_STATUS_FUN_GRP_RC_ERROR   0xFU

Definition at line 816 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_MAX_CURRENT_CONSUMPTION

#define SD_SW_STATUS_MAX_CURRENT_CONSUMPTION (   status)    SD_SW_STATUS_STRUCTURE(status, 496, 16)

Definition at line 790 of file sd_mmc_protocol.h.

◆ SD_SW_STATUS_STRUCTURE

#define SD_SW_STATUS_STRUCTURE (   sd_sw_status,
  pos,
  size 
)    SDMMC_UNSTUFF_BITS(sd_sw_status, SD_SW_STATUS_BIT_SIZE, pos, size)

Definition at line 788 of file sd_mmc_protocol.h.

◆ SDIO_AS_FN1

#define SDIO_AS_FN1   (0x1lu << 0)

Abort function 1 IO

Definition at line 570 of file sd_mmc_protocol.h.

◆ SDIO_AS_FN2

#define SDIO_AS_FN2   (0x2lu << 0)

Abort function 2 IO

Definition at line 571 of file sd_mmc_protocol.h.

◆ SDIO_AS_FN3

#define SDIO_AS_FN3   (0x3lu << 0)

Abort function 3 IO

Definition at line 572 of file sd_mmc_protocol.h.

◆ SDIO_AS_FN4

#define SDIO_AS_FN4   (0x4lu << 0)

Abort function 4 IO

Definition at line 573 of file sd_mmc_protocol.h.

◆ SDIO_AS_FN5

#define SDIO_AS_FN5   (0x5lu << 0)

Abort function 5 IO

Definition at line 574 of file sd_mmc_protocol.h.

◆ SDIO_AS_FN6

#define SDIO_AS_FN6   (0x6lu << 0)

Abort function 6 IO

Definition at line 575 of file sd_mmc_protocol.h.

◆ SDIO_AS_FN7

#define SDIO_AS_FN7   (0x7lu << 0)

Abort function 7 IO

Definition at line 576 of file sd_mmc_protocol.h.

◆ SDIO_BR

#define SDIO_BR   (0x1lu << 1)

Bus Release Request/Status (R/W)

Definition at line 611 of file sd_mmc_protocol.h.

◆ SDIO_BS

#define SDIO_BS   (0x1lu << 0)

Bus Status (transfer on DAT[x] lines) (RO)

Definition at line 609 of file sd_mmc_protocol.h.

◆ SDIO_BUS_CD_DISABLE

#define SDIO_BUS_CD_DISABLE   (0x1lu << 7)

Connect(0)/Disconnect(1) pull-up on CD/DAT3

Definition at line 586 of file sd_mmc_protocol.h.

◆ SDIO_BUS_ECSI

#define SDIO_BUS_ECSI   (0x1lu << 5)

Enable Continuous SPI interrupt (R/W)

Definition at line 582 of file sd_mmc_protocol.h.

◆ SDIO_BUS_SCSI

#define SDIO_BUS_SCSI   (0x1lu << 6)

Support Continuous SPI interrupt (RO)

Definition at line 584 of file sd_mmc_protocol.h.

◆ SDIO_BUSWIDTH_1B

#define SDIO_BUSWIDTH_1B   (0x0lu << 0)

1-bit data bus

Definition at line 579 of file sd_mmc_protocol.h.

◆ SDIO_BUSWIDTH_4B

#define SDIO_BUSWIDTH_4B   (0x2lu << 0)

4-bit data bus

Definition at line 580 of file sd_mmc_protocol.h.

◆ SDIO_CAP_4BLS

#define SDIO_CAP_4BLS   (0x1lu << 7)

4-bit support for Low-Speed Card (RO)

Definition at line 603 of file sd_mmc_protocol.h.

◆ SDIO_CAP_E4MI

#define SDIO_CAP_E4MI   (0x1lu << 5)

Enable interrupt between blocks of data in 4-bit SD mode (R/W)

Definition at line 599 of file sd_mmc_protocol.h.

◆ SDIO_CAP_LSC

#define SDIO_CAP_LSC   (0x1lu << 6)

Low-Speed Card (RO)

Definition at line 601 of file sd_mmc_protocol.h.

◆ SDIO_CAP_S4MI

#define SDIO_CAP_S4MI   (0x1lu << 4)

Support interrupt between blocks of data in 4-bit SD mode (RO)

Definition at line 597 of file sd_mmc_protocol.h.

◆ SDIO_CAP_SBS

#define SDIO_CAP_SBS   (0x1lu << 3)

Support Suspend/Resume (RO)

Definition at line 595 of file sd_mmc_protocol.h.

◆ SDIO_CAP_SDC

#define SDIO_CAP_SDC   (0x1lu << 0)

Support Direct Commands during data transfer (RO)

Definition at line 589 of file sd_mmc_protocol.h.

◆ SDIO_CAP_SMB

#define SDIO_CAP_SMB   (0x1lu << 1)

Support Multi-Block (RO)

Definition at line 591 of file sd_mmc_protocol.h.

◆ SDIO_CAP_SRW

#define SDIO_CAP_SRW   (0x1lu << 2)

Support Read Wait (RO)

Definition at line 593 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_BUS_CTRL

#define SDIO_CCCR_BUS_CTRL   0x07

Bus Interface Control

Definition at line 578 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_BUS_SUSPEND

#define SDIO_CCCR_BUS_SUSPEND   0x0C

Bus Suspend

Definition at line 607 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_CAP

#define SDIO_CCCR_CAP   0x08

Card Capability

Definition at line 587 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_CIS_PTR

#define SDIO_CCCR_CIS_PTR   0x09

Pointer to CIS (3B, LSB first)

Definition at line 605 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_EXEC

#define SDIO_CCCR_EXEC   0x0E

Exec Flags (RO)

Definition at line 623 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_FN0_BLKSIZ

#define SDIO_CCCR_FN0_BLKSIZ   0x10

FN0 Block Size (2B, LSB first) (R/W)

Definition at line 641 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_FUN_SEL

#define SDIO_CCCR_FUN_SEL   0x0D

Function select

Definition at line 612 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_HS

#define SDIO_CCCR_HS   0x13

High-Speed

Definition at line 645 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_IEN

#define SDIO_CCCR_IEN   0x04

Int Enable

Definition at line 552 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_INT

#define SDIO_CCCR_INT   0x05

Int Pending

Definition at line 561 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_IOA

#define SDIO_CCCR_IOA   0x06

I/O Abort

Definition at line 569 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_IOE

#define SDIO_CCCR_IOE   0x02

I/O Enable (R/W)

Definition at line 536 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_IOR

#define SDIO_CCCR_IOR   0x03

I/O Ready (RO)

Definition at line 544 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_POWER

#define SDIO_CCCR_POWER   0x12

Power Control

Definition at line 642 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_READY

#define SDIO_CCCR_READY   0x0F

Ready Flags (RO)

Definition at line 632 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_REV_1_00

#define SDIO_CCCR_REV_1_00   (0x0lu << 0)

CCCR/FBR Version 1.00

Definition at line 522 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_REV_1_10

#define SDIO_CCCR_REV_1_10   (0x1lu << 0)

CCCR/FBR Version 1.10

Definition at line 523 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_REV_2_00

#define SDIO_CCCR_REV_2_00   (0x2lu << 0)

CCCR/FBR Version 2.00

Definition at line 524 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_REV_3_00

#define SDIO_CCCR_REV_3_00   (0x3lu << 0)

CCCR/FBR Version 3.00

Definition at line 525 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_SD_REV

#define SDIO_CCCR_SD_REV   0x01

SD Spec Revision (RO)

Definition at line 531 of file sd_mmc_protocol.h.

◆ SDIO_CCCR_SDIO_REV

#define SDIO_CCCR_SDIO_REV   0x00

CCCR/SDIO revision (RO)

Definition at line 521 of file sd_mmc_protocol.h.

◆ SDIO_CIA

#define SDIO_CIA   0

SDIO Function 0 (CIA)

Definition at line 508 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_ALTSTR

#define SDIO_CISTPL_ALTSTR   0x16

Alternate Language String (PCMCIA 3.2.1)

Definition at line 661 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_CHECKSUM

#define SDIO_CISTPL_CHECKSUM   0x10

Checksum control (PCMCIA 3.1.1)

Definition at line 657 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_DEVICE

#define SDIO_CISTPL_DEVICE   0x01

Device tuple (PCMCIA 3.2.2)

Definition at line 655 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_END

#define SDIO_CISTPL_END   0xFF

The End-of-chain Tuple (PCMCIA 3.1.2)

Definition at line 673 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_FUNCE

#define SDIO_CISTPL_FUNCE   0x22

Function Extensions (PCMCIA 3.2.6)

Definition at line 667 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_FUNCID

#define SDIO_CISTPL_FUNCID   0x21

Function Identification (PCMCIA 3.2.7)

Definition at line 665 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_MANFID

#define SDIO_CISTPL_MANFID   0x20

Manufacturer Identification String (PCMCIA 3.2.9)

Definition at line 663 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_NULL

#define SDIO_CISTPL_NULL   0x00

Null tuple (PCMCIA 3.1.9)

Definition at line 653 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_SDIO_EXT

#define SDIO_CISTPL_SDIO_EXT   0x92

Reserved for future SDIO (PCMCIA 6.1.3)

Definition at line 671 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_SDIO_STD

#define SDIO_CISTPL_SDIO_STD   0x91

Additional information for SDIO (PCMCIA 6.1.2)

Definition at line 669 of file sd_mmc_protocol.h.

◆ SDIO_CISTPL_VERS_1

#define SDIO_CISTPL_VERS_1   0x15

Level 1 version (PCMCIA 3.2.10)

Definition at line 659 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_FUNCTION_NUM

#define SDIO_CMD52_FUNCTION_NUM   28

CMD52 arg[30:28] Number of the function.

Definition at line 476 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_RAW_FLAG

#define SDIO_CMD52_RAW_FLAG   27

CMD52 arg[ 27] Read after Write flag.

Definition at line 474 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_READ_FLAG

#define SDIO_CMD52_READ_FLAG   0

Definition at line 479 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_REG_ADRR

#define SDIO_CMD52_REG_ADRR   9

CMD52 arg[25: 9] Register address.

Definition at line 470 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_RW_FLAG

#define SDIO_CMD52_RW_FLAG   31

CMD52 arg[ 31] Direction, 1:write, 0:read.

Definition at line 478 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_STUFF0

#define SDIO_CMD52_STUFF0   8

CMD52 arg[ 8] Reserved.

Definition at line 468 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_STUFF1

#define SDIO_CMD52_STUFF1   26

CMD52 arg[ 26] Reserved.

Definition at line 472 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_WR_DATA

#define SDIO_CMD52_WR_DATA   0

CMD52 arg[ 7: 0] Write data or stuff bits.

Definition at line 466 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_WRITE_FLAG

#define SDIO_CMD52_WRITE_FLAG   1

Definition at line 480 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_BLOCK_MODE

#define SDIO_CMD53_BLOCK_MODE   27

CMD53 arg[ 27] (Optional) 1:block mode.

Definition at line 497 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_COUNT

#define SDIO_CMD53_COUNT   0

[ 8: 0] Byte mode: number of bytes to transfer, 0 cause 512 bytes transfer. Block mode: number of blocks to transfer, 0 set count to infinite.

Definition at line 491 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_FUNCTION_NUM

#define SDIO_CMD53_FUNCTION_NUM   28

CMD53 arg[30:28] Number of the function.

Definition at line 499 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_OP_CODE

#define SDIO_CMD53_OP_CODE   26

CMD53 arg[ 26] 1:Incrementing address, 0: fixed.

Definition at line 495 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_READ_FLAG

#define SDIO_CMD53_READ_FLAG   0

Definition at line 502 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_REG_ADDR

#define SDIO_CMD53_REG_ADDR   9

CMD53 arg[25: 9] Start Address I/O register.

Definition at line 493 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_RW_FLAG

#define SDIO_CMD53_RW_FLAG   31

CMD53 arg[ 31] Direction, 1:WR, 0:RD.

Definition at line 501 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_WRITE_FLAG

#define SDIO_CMD53_WRITE_FLAG   1

Definition at line 503 of file sd_mmc_protocol.h.

◆ SDIO_DF

#define SDIO_DF   (0x1lu << 7)

Resume Data Flag (RO)

Definition at line 613 of file sd_mmc_protocol.h.

◆ SDIO_EHS

#define SDIO_EHS   (0x1lu << 1)

Enable High-Speed (R/W)

Definition at line 647 of file sd_mmc_protocol.h.

◆ SDIO_EX_FN1

#define SDIO_EX_FN1   (0x1lu << 1)

Executing status of func 1

Definition at line 625 of file sd_mmc_protocol.h.

◆ SDIO_EX_FN2

#define SDIO_EX_FN2   (0x1lu << 2)

Executing status of func 2

Definition at line 626 of file sd_mmc_protocol.h.

◆ SDIO_EX_FN3

#define SDIO_EX_FN3   (0x1lu << 3)

Executing status of func 3

Definition at line 627 of file sd_mmc_protocol.h.

◆ SDIO_EX_FN4

#define SDIO_EX_FN4   (0x1lu << 4)

Executing status of func 4

Definition at line 628 of file sd_mmc_protocol.h.

◆ SDIO_EX_FN5

#define SDIO_EX_FN5   (0x1lu << 5)

Executing status of func 5

Definition at line 629 of file sd_mmc_protocol.h.

◆ SDIO_EX_FN6

#define SDIO_EX_FN6   (0x1lu << 6)

Executing status of func 6

Definition at line 630 of file sd_mmc_protocol.h.

◆ SDIO_EX_FN7

#define SDIO_EX_FN7   (0x1lu << 7)

Executing status of func 7

Definition at line 631 of file sd_mmc_protocol.h.

◆ SDIO_EXM

#define SDIO_EXM   (0x1lu << 0)

Executing status of memory

Definition at line 624 of file sd_mmc_protocol.h.

◆ SDIO_FN0

#define SDIO_FN0   0

SDIO Function 0

Definition at line 509 of file sd_mmc_protocol.h.

◆ SDIO_FN1

#define SDIO_FN1   1

SDIO Function 1

Definition at line 510 of file sd_mmc_protocol.h.

◆ SDIO_FN2

#define SDIO_FN2   2

SDIO Function 2

Definition at line 511 of file sd_mmc_protocol.h.

◆ SDIO_FN3

#define SDIO_FN3   3

SDIO Function 3

Definition at line 512 of file sd_mmc_protocol.h.

◆ SDIO_FN4

#define SDIO_FN4   4

SDIO Function 4

Definition at line 513 of file sd_mmc_protocol.h.

◆ SDIO_FN5

#define SDIO_FN5   5

SDIO Function 5

Definition at line 514 of file sd_mmc_protocol.h.

◆ SDIO_FN6

#define SDIO_FN6   6

SDIO Function 6

Definition at line 515 of file sd_mmc_protocol.h.

◆ SDIO_FN7

#define SDIO_FN7   7

SDIO Function 7

Definition at line 516 of file sd_mmc_protocol.h.

◆ SDIO_FS_CIA

#define SDIO_FS_CIA   (0x0lu << 0)

Select CIA (function 0)

Definition at line 614 of file sd_mmc_protocol.h.

◆ SDIO_FS_FN1

#define SDIO_FS_FN1   (0x1lu << 0)

Select Function 1

Definition at line 615 of file sd_mmc_protocol.h.

◆ SDIO_FS_FN2

#define SDIO_FS_FN2   (0x2lu << 0)

Select Function 2

Definition at line 616 of file sd_mmc_protocol.h.

◆ SDIO_FS_FN3

#define SDIO_FS_FN3   (0x3lu << 0)

Select Function 3

Definition at line 617 of file sd_mmc_protocol.h.

◆ SDIO_FS_FN4

#define SDIO_FS_FN4   (0x4lu << 0)

Select Function 4

Definition at line 618 of file sd_mmc_protocol.h.

◆ SDIO_FS_FN5

#define SDIO_FS_FN5   (0x5lu << 0)

Select Function 5

Definition at line 619 of file sd_mmc_protocol.h.

◆ SDIO_FS_FN6

#define SDIO_FS_FN6   (0x6lu << 0)

Select Function 6

Definition at line 620 of file sd_mmc_protocol.h.

◆ SDIO_FS_FN7

#define SDIO_FS_FN7   (0x7lu << 0)

Select Function 7

Definition at line 621 of file sd_mmc_protocol.h.

◆ SDIO_FS_MEM

#define SDIO_FS_MEM   (0x8lu << 0)

Select memory in combo card

Definition at line 622 of file sd_mmc_protocol.h.

◆ SDIO_IEN_FN1

#define SDIO_IEN_FN1   (0x1lu << 1)

Function 1 Int Enable

Definition at line 554 of file sd_mmc_protocol.h.

◆ SDIO_IEN_FN2

#define SDIO_IEN_FN2   (0x1lu << 2)

Function 2 Int Enable

Definition at line 555 of file sd_mmc_protocol.h.

◆ SDIO_IEN_FN3

#define SDIO_IEN_FN3   (0x1lu << 3)

Function 3 Int Enable

Definition at line 556 of file sd_mmc_protocol.h.

◆ SDIO_IEN_FN4

#define SDIO_IEN_FN4   (0x1lu << 4)

Function 4 Int Enable

Definition at line 557 of file sd_mmc_protocol.h.

◆ SDIO_IEN_FN5

#define SDIO_IEN_FN5   (0x1lu << 5)

Function 5 Int Enable

Definition at line 558 of file sd_mmc_protocol.h.

◆ SDIO_IEN_FN6

#define SDIO_IEN_FN6   (0x1lu << 6)

Function 6 Int Enable

Definition at line 559 of file sd_mmc_protocol.h.

◆ SDIO_IEN_FN7

#define SDIO_IEN_FN7   (0x1lu << 7)

Function 7 Int Enable

Definition at line 560 of file sd_mmc_protocol.h.

◆ SDIO_IENM

#define SDIO_IENM   (0x1lu << 0)

Int Enable Master (R/W)

Definition at line 553 of file sd_mmc_protocol.h.

◆ SDIO_INT_FN1

#define SDIO_INT_FN1   (0x1lu << 1)

Function 1 Int pending

Definition at line 562 of file sd_mmc_protocol.h.

◆ SDIO_INT_FN2

#define SDIO_INT_FN2   (0x1lu << 2)

Function 2 Int pending

Definition at line 563 of file sd_mmc_protocol.h.

◆ SDIO_INT_FN3

#define SDIO_INT_FN3   (0x1lu << 3)

Function 3 Int pending

Definition at line 564 of file sd_mmc_protocol.h.

◆ SDIO_INT_FN4

#define SDIO_INT_FN4   (0x1lu << 4)

Function 4 Int pending

Definition at line 565 of file sd_mmc_protocol.h.

◆ SDIO_INT_FN5

#define SDIO_INT_FN5   (0x1lu << 5)

Function 5 Int pending

Definition at line 566 of file sd_mmc_protocol.h.

◆ SDIO_INT_FN6

#define SDIO_INT_FN6   (0x1lu << 6)

Function 6 Int pending

Definition at line 567 of file sd_mmc_protocol.h.

◆ SDIO_INT_FN7

#define SDIO_INT_FN7   (0x1lu << 7)

Function 7 Int pending

Definition at line 568 of file sd_mmc_protocol.h.

◆ SDIO_IOE_FN1

#define SDIO_IOE_FN1   (0x1lu << 1)

Function 1 Enable/Disable

Definition at line 537 of file sd_mmc_protocol.h.

◆ SDIO_IOE_FN2

#define SDIO_IOE_FN2   (0x1lu << 2)

Function 2 Enable/Disable

Definition at line 538 of file sd_mmc_protocol.h.

◆ SDIO_IOE_FN3

#define SDIO_IOE_FN3   (0x1lu << 3)

Function 3 Enable/Disable

Definition at line 539 of file sd_mmc_protocol.h.

◆ SDIO_IOE_FN4

#define SDIO_IOE_FN4   (0x1lu << 4)

Function 4 Enable/Disable

Definition at line 540 of file sd_mmc_protocol.h.

◆ SDIO_IOE_FN5

#define SDIO_IOE_FN5   (0x1lu << 5)

Function 5 Enable/Disable

Definition at line 541 of file sd_mmc_protocol.h.

◆ SDIO_IOE_FN6

#define SDIO_IOE_FN6   (0x1lu << 6)

Function 6 Enable/Disable

Definition at line 542 of file sd_mmc_protocol.h.

◆ SDIO_IOE_FN7

#define SDIO_IOE_FN7   (0x1lu << 7)

Function 7 Enable/Disable

Definition at line 543 of file sd_mmc_protocol.h.

◆ SDIO_IOR_FN1

#define SDIO_IOR_FN1   (0x1lu << 1)

Function 1 ready

Definition at line 545 of file sd_mmc_protocol.h.

◆ SDIO_IOR_FN2

#define SDIO_IOR_FN2   (0x1lu << 2)

Function 2 ready

Definition at line 546 of file sd_mmc_protocol.h.

◆ SDIO_IOR_FN3

#define SDIO_IOR_FN3   (0x1lu << 3)

Function 3 ready

Definition at line 547 of file sd_mmc_protocol.h.

◆ SDIO_IOR_FN4

#define SDIO_IOR_FN4   (0x1lu << 4)

Function 4 ready

Definition at line 548 of file sd_mmc_protocol.h.

◆ SDIO_IOR_FN5

#define SDIO_IOR_FN5   (0x1lu << 5)

Function 5 ready

Definition at line 549 of file sd_mmc_protocol.h.

◆ SDIO_IOR_FN6

#define SDIO_IOR_FN6   (0x1lu << 6)

Function 6 ready

Definition at line 550 of file sd_mmc_protocol.h.

◆ SDIO_IOR_FN7

#define SDIO_IOR_FN7   (0x1lu << 7)

Function 7 ready

Definition at line 551 of file sd_mmc_protocol.h.

◆ SDIO_POWER_EMPC

#define SDIO_POWER_EMPC   (0x1lu << 1)

Enable Master Power Control

Definition at line 644 of file sd_mmc_protocol.h.

◆ SDIO_POWER_SMPC

#define SDIO_POWER_SMPC   (0x1lu << 0)

Support Master Power Control

Definition at line 643 of file sd_mmc_protocol.h.

◆ SDIO_R5_COM_CRC_ERROR

#define SDIO_R5_COM_CRC_ERROR   (1lu << 15)

CRC check error

Definition at line 436 of file sd_mmc_protocol.h.

◆ SDIO_R5_ERROR

#define SDIO_R5_ERROR   (1lu << 11)

General error

Definition at line 443 of file sd_mmc_protocol.h.

◆ SDIO_R5_FUNC_NUM

#define SDIO_R5_FUNC_NUM   (1lu << 9)

Invalid function number

Definition at line 444 of file sd_mmc_protocol.h.

◆ SDIO_R5_ILLEGAL_COMMAND

#define SDIO_R5_ILLEGAL_COMMAND   (1lu << 14)

Illegal command

Definition at line 437 of file sd_mmc_protocol.h.

◆ SDIO_R5_OUT_OF_RANGE

#define SDIO_R5_OUT_OF_RANGE   (1lu << 8)

Argument out of range

Definition at line 445 of file sd_mmc_protocol.h.

◆ SDIO_R5_STATE

#define SDIO_R5_STATE   (3lu << 12)

SDIO R5 state mask

Definition at line 438 of file sd_mmc_protocol.h.

◆ SDIO_R5_STATE_CMD

#define SDIO_R5_STATE_CMD   (1lu << 12)

DAT lines free

Definition at line 440 of file sd_mmc_protocol.h.

◆ SDIO_R5_STATE_DIS

#define SDIO_R5_STATE_DIS   (0lu << 12)

Disabled

Definition at line 439 of file sd_mmc_protocol.h.

◆ SDIO_R5_STATE_RFU

#define SDIO_R5_STATE_RFU   (3lu << 12)

Reserved

Definition at line 442 of file sd_mmc_protocol.h.

◆ SDIO_R5_STATE_TRN

#define SDIO_R5_STATE_TRN   (2lu << 12)

Transfer

Definition at line 441 of file sd_mmc_protocol.h.

◆ SDIO_R5_STATUS_ERR

#define SDIO_R5_STATUS_ERR
Value:
#define SDIO_R5_OUT_OF_RANGE
#define SDIO_R5_FUNC_NUM
#define SDIO_R5_ERROR

Errro status bits mask

Definition at line 446 of file sd_mmc_protocol.h.

◆ SDIO_R6_COM_CRC_ERROR

#define SDIO_R6_COM_CRC_ERROR   (1lu << 15)

The CRC check of the previous command failed.

Definition at line 453 of file sd_mmc_protocol.h.

◆ SDIO_R6_ERROR

#define SDIO_R6_ERROR   (1lu << 13)

A general or an unknown error occurred during the operation.

Definition at line 457 of file sd_mmc_protocol.h.

◆ SDIO_R6_ILLEGAL_COMMAND

#define SDIO_R6_ILLEGAL_COMMAND   (1lu << 14)

Command not legal for the card state.

Definition at line 455 of file sd_mmc_protocol.h.

◆ SDIO_RES

#define SDIO_RES   (0x1lu << 3)

IO CARD RESET (WO)

Definition at line 577 of file sd_mmc_protocol.h.

◆ SDIO_RF_FN1

#define SDIO_RF_FN1   (0x1lu << 1)

Ready Flag for function 1

Definition at line 634 of file sd_mmc_protocol.h.

◆ SDIO_RF_FN2

#define SDIO_RF_FN2   (0x1lu << 2)

Ready Flag for function 2

Definition at line 635 of file sd_mmc_protocol.h.

◆ SDIO_RF_FN3

#define SDIO_RF_FN3   (0x1lu << 3)

Ready Flag for function 3

Definition at line 636 of file sd_mmc_protocol.h.

◆ SDIO_RF_FN4

#define SDIO_RF_FN4   (0x1lu << 4)

Ready Flag for function 4

Definition at line 637 of file sd_mmc_protocol.h.

◆ SDIO_RF_FN5

#define SDIO_RF_FN5   (0x1lu << 5)

Ready Flag for function 5

Definition at line 638 of file sd_mmc_protocol.h.

◆ SDIO_RF_FN6

#define SDIO_RF_FN6   (0x1lu << 6)

Ready Flag for function 6

Definition at line 639 of file sd_mmc_protocol.h.

◆ SDIO_RF_FN7

#define SDIO_RF_FN7   (0x1lu << 7)

Ready Flag for function 7

Definition at line 640 of file sd_mmc_protocol.h.

◆ SDIO_RFM

#define SDIO_RFM   (0x1lu << 0)

Ready Flag for memory

Definition at line 633 of file sd_mmc_protocol.h.

◆ SDIO_SD_REV_1_01

#define SDIO_SD_REV_1_01   (0x0lu << 0)

SD 1.01 (Mar 2000)

Definition at line 532 of file sd_mmc_protocol.h.

◆ SDIO_SD_REV_1_10

#define SDIO_SD_REV_1_10   (0x1lu << 0)

SD 1.10 (Oct 2004)

Definition at line 533 of file sd_mmc_protocol.h.

◆ SDIO_SD_REV_2_00

#define SDIO_SD_REV_2_00   (0x2lu << 0)

SD 2.00 (May 2006)

Definition at line 534 of file sd_mmc_protocol.h.

◆ SDIO_SD_REV_3_00

#define SDIO_SD_REV_3_00   (0x3lu << 0)

SD 3.00

Definition at line 535 of file sd_mmc_protocol.h.

◆ SDIO_SDIO_REV_1_00

#define SDIO_SDIO_REV_1_00   (0x0lu << 4)

SDIO Spec 1.00

Definition at line 526 of file sd_mmc_protocol.h.

◆ SDIO_SDIO_REV_1_10

#define SDIO_SDIO_REV_1_10   (0x1lu << 4)

SDIO Spec 1.10

Definition at line 527 of file sd_mmc_protocol.h.

◆ SDIO_SDIO_REV_1_20

#define SDIO_SDIO_REV_1_20   (0x2lu << 4)

SDIO Spec 1.20(unreleased)

Definition at line 528 of file sd_mmc_protocol.h.

◆ SDIO_SDIO_REV_2_00

#define SDIO_SDIO_REV_2_00   (0x3lu << 4)

SDIO Spec Version 2.00

Definition at line 529 of file sd_mmc_protocol.h.

◆ SDIO_SDIO_REV_3_00

#define SDIO_SDIO_REV_3_00   (0x4lu << 4)

SDIO Spec Version 3.00

Definition at line 530 of file sd_mmc_protocol.h.

◆ SDIO_SHS

#define SDIO_SHS   (0x1lu << 0)

Support High-Speed (RO)

Definition at line 646 of file sd_mmc_protocol.h.

◆ SDIO_STATUS_R6

#define SDIO_STATUS_R6
Value:
#define SDIO_R6_ERROR
#define SDIO_R6_COM_CRC_ERROR
#define SDIO_R6_ILLEGAL_COMMAND

Status bits mask for SDIO R6

Definition at line 459 of file sd_mmc_protocol.h.

◆ SPI_CMD_ENCODE

#define SPI_CMD_ENCODE (   x)    (0x40 | (x & 0x3F))

SPI commands start with a start bit "0" and a transmit bit "1".

Definition at line 932 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_ERROR_CC_ERROR

#define SPI_TOKEN_DATA_ERROR_CC_ERROR   (1lu << 1)

Definition at line 971 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_ERROR_ECC_ERROR

#define SPI_TOKEN_DATA_ERROR_ECC_ERROR   (1lu << 2)

Definition at line 972 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_ERROR_ERROR

#define SPI_TOKEN_DATA_ERROR_ERROR   (1lu << 0)

Definition at line 970 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_ERROR_ERRORS

#define SPI_TOKEN_DATA_ERROR_ERRORS   (0x0F)

Definition at line 969 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_ERROR_OUT_RANGE

#define SPI_TOKEN_DATA_ERROR_OUT_RANGE   (1lu << 3)

Definition at line 973 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_ERROR_VALID

#define SPI_TOKEN_DATA_ERROR_VALID (   token)    (((token) & 0xF0) == 0)

Definition at line 968 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_RESP_ACCEPTED

#define SPI_TOKEN_DATA_RESP_ACCEPTED   (2lu << 1)

Definition at line 983 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_RESP_CODE

#define SPI_TOKEN_DATA_RESP_CODE (   token)    ((token) & 0x1E)

Definition at line 982 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_RESP_CRC_ERR

#define SPI_TOKEN_DATA_RESP_CRC_ERR   (5lu << 1)

Definition at line 984 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_RESP_VALID

#define SPI_TOKEN_DATA_RESP_VALID (   token)    ((((token) & (1 << 4)) == 0) && (((token) & (1 << 0)) == 1))

Definition at line 980 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_DATA_RESP_WRITE_ERR

#define SPI_TOKEN_DATA_RESP_WRITE_ERR   (6lu << 1)

Definition at line 985 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_MULTI_WRITE

#define SPI_TOKEN_MULTI_WRITE   0xFC

Definition at line 978 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_SINGLE_MULTI_READ

#define SPI_TOKEN_SINGLE_MULTI_READ   0xFE

Definition at line 967 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_SINGLE_WRITE

#define SPI_TOKEN_SINGLE_WRITE   0xFE

Definition at line 977 of file sd_mmc_protocol.h.

◆ SPI_TOKEN_STOP_TRAN

#define SPI_TOKEN_STOP_TRAN   0xFD

Definition at line 979 of file sd_mmc_protocol.h.

Function Documentation

◆ SDMMC_UNSTUFF_BITS()

static uint32_t SDMMC_UNSTUFF_BITS ( uint8_t *  reg,
uint16_t  reg_size,
uint16_t  pos,
uint8_t  size 
)
inlinestatic

Macro function to extract a bits field from a large SD MMC register Used by : CSD, SCR, Switch status.

Definition at line 685 of file sd_mmc_protocol.h.



inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:07