Macros
SD/MMC Protocol Definition
Collaboration diagram for SD/MMC Protocol Definition:

Macros

#define SDMMC_CLOCK_INIT   400000
 

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...
 

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)
 

Detailed Description

Macro Definition Documentation

◆ MMC_CMD11_READ_DAT_UNTIL_STOP

#define MMC_CMD11_READ_DAT_UNTIL_STOP   (11 | SDMMC_CMD_R1)

MMC Cmd11(adtc, R1): Read data stream from the card, starting at the given address, until a STOP_TRANSMISSION follows.

Definition at line 197 of file sd_mmc_protocol.h.

◆ MMC_CMD14_BUSTEST_R

#define MMC_CMD14_BUSTEST_R   (14 | SDMMC_CMD_R1)

MMC Cmd14(adtc, R1): Read the reversed bus testing data pattern from a card.

Definition at line 207 of file sd_mmc_protocol.h.

◆ MMC_CMD19_BUSTEST_W

#define MMC_CMD19_BUSTEST_W   (19 | SDMMC_CMD_R1)

MMC Cmd19(adtc, R1): Send the bus test data pattern

Definition at line 212 of file sd_mmc_protocol.h.

◆ MMC_CMD20_WRITE_DAT_UNTIL_STOP

#define MMC_CMD20_WRITE_DAT_UNTIL_STOP   (20 | SDMMC_CMD_R1)

MMC Cmd20(adtc, R1): Write a data stream from the host, starting at the given address, until a STOP_TRANSMISSION follows.

Definition at line 236 of file sd_mmc_protocol.h.

◆ MMC_CMD23_SET_BLOCK_COUNT

#define MMC_CMD23_SET_BLOCK_COUNT   (23 | SDMMC_CMD_R1)

MMC Cmd23(ac, R1): Set block count

Definition at line 242 of file sd_mmc_protocol.h.

◆ MMC_CMD26_PROGRAM_CID

#define MMC_CMD26_PROGRAM_CID   (26 | SDMMC_CMD_R1)

MMC Cmd26(adtc, R1): Programming of the card identification register.

Definition at line 248 of file sd_mmc_protocol.h.

◆ MMC_CMD35_ERASE_GROUP_START

#define MMC_CMD35_ERASE_GROUP_START   (35 | SDMMC_CMD_R1)

MMC Cmd35(ac, R1):

Definition at line 260 of file sd_mmc_protocol.h.

◆ MMC_CMD36_ERASE_GROUP_END

#define MMC_CMD36_ERASE_GROUP_END   (36 | SDMMC_CMD_R1)

MMC Cmd36(ac, R1):

Definition at line 262 of file sd_mmc_protocol.h.

◆ MMC_CMD39_FAST_IO

#define MMC_CMD39_FAST_IO   (39 | SDMMC_CMD_R4)

MMC Cmd39(ac, R4): Used to write and read 8 bit (register) data fields.

Definition at line 343 of file sd_mmc_protocol.h.

◆ MMC_CMD3_SET_RELATIVE_ADDR

#define MMC_CMD3_SET_RELATIVE_ADDR   (3 | SDMMC_CMD_R1)

MMC Cmd3(ac, R1): Assigns relative address to the card

Definition at line 171 of file sd_mmc_protocol.h.

◆ MMC_CMD40_GO_IRQ_STATE

#define MMC_CMD40_GO_IRQ_STATE   (40 | SDMMC_CMD_R5 | SDMMC_CMD_OPENDRAIN)

MMC Cmd40(bcr, R5): Set the system into interrupt mode

Definition at line 345 of file sd_mmc_protocol.h.

◆ MMC_CMD5_SLEEP_AWAKE

#define MMC_CMD5_SLEEP_AWAKE   (5 | SDMMC_CMD_R1B)

MMC Cmd5(ac, R1b): Toggle the card between Sleep state and Standby state.

Definition at line 175 of file sd_mmc_protocol.h.

◆ MMC_CMD6_SWITCH

#define MMC_CMD6_SWITCH   (6 | SDMMC_CMD_R1B)

MMC Cmd6(ac, R1b) : Switche the mode of operation of the selected card or modifies the EXT_CSD registers.

Definition at line 300 of file sd_mmc_protocol.h.

◆ MMC_CMD8_SEND_EXT_CSD

#define MMC_CMD8_SEND_EXT_CSD   (8 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)

MMC Cmd8(adtc, R1): Send EXT_CSD register as a block of data

Definition at line 184 of file sd_mmc_protocol.h.

◆ MMC_MCI_CMD1_SEND_OP_COND

#define MMC_MCI_CMD1_SEND_OP_COND   (1 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN)

Definition at line 165 of file sd_mmc_protocol.h.

◆ MMC_SPI_CMD1_SEND_OP_COND

#define MMC_SPI_CMD1_SEND_OP_COND   (1 | SDMMC_CMD_R1)

MMC Cmd1(bcr, R3): Ask the card to send its Operating Conditions

Definition at line 164 of file sd_mmc_protocol.h.

◆ SD_ACMD13_SD_STATUS

#define SD_ACMD13_SD_STATUS   (13 | SDMMC_CMD_R1)

ACMD13(adtc, R1): Send the SD Status.

Definition at line 309 of file sd_mmc_protocol.h.

◆ SD_ACMD22_SEND_NUM_WR_BLOCKS

#define SD_ACMD22_SEND_NUM_WR_BLOCKS   (22 | SDMMC_CMD_R1)

ACMD22(adtc, R1): Send the number of the written (with-out errors) write blocks.

Definition at line 314 of file sd_mmc_protocol.h.

◆ SD_ACMD23_SET_WR_BLK_ERASE_COUNT

#define SD_ACMD23_SET_WR_BLK_ERASE_COUNT   (23 | SDMMC_CMD_R1)

ACMD23(ac, R1): Set the number of write blocks to be pre-erased before writing

Definition at line 319 of file sd_mmc_protocol.h.

◆ SD_ACMD42_SET_CLR_CARD_DETECT

#define SD_ACMD42_SET_CLR_CARD_DETECT   (42 | SDMMC_CMD_R1)

ACMD42(ac, R1): Connect[1]/Disconnect[0] the 50 KOhm pull-up resistor on CD/DAT3 (pin 1) of the card.

Definition at line 335 of file sd_mmc_protocol.h.

◆ SD_ACMD51_SEND_SCR

#define SD_ACMD51_SEND_SCR   (51 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)

ACMD51(adtc, R1): Read the SD Configuration Register (SCR).

Definition at line 337 of file sd_mmc_protocol.h.

◆ SD_ACMD6_SET_BUS_WIDTH

#define SD_ACMD6_SET_BUS_WIDTH   (6 | SDMMC_CMD_R1)

ACMD6(ac, R1): Define the data bus width

Definition at line 307 of file sd_mmc_protocol.h.

◆ SD_CMD11_READ_DAT_UNTIL_STOP

#define SD_CMD11_READ_DAT_UNTIL_STOP   (11 | SDMMC_CMD_R1)

Definition at line 199 of file sd_mmc_protocol.h.

◆ SD_CMD32_ERASE_WR_BLK_START

#define SD_CMD32_ERASE_WR_BLK_START   (32 | SDMMC_CMD_R1)

SD Cmd32(ac, R1):

Definition at line 256 of file sd_mmc_protocol.h.

◆ SD_CMD33_ERASE_WR_BLK_END

#define SD_CMD33_ERASE_WR_BLK_END   (33 | SDMMC_CMD_R1)

SD Cmd33(ac, R1):

Definition at line 258 of file sd_mmc_protocol.h.

◆ SD_CMD3_SEND_RELATIVE_ADDR

#define SD_CMD3_SEND_RELATIVE_ADDR   (3 | SDMMC_CMD_R6 | SDMMC_CMD_OPENDRAIN)

SD Cmd3(bcr, R6): Ask the card to publish a new relative address (RCA)

Definition at line 169 of file sd_mmc_protocol.h.

◆ SD_CMD6_SWITCH_FUNC

#define SD_CMD6_SWITCH_FUNC   (6 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)

SD Cmd6(adtc, R1) : Check switchable function (mode 0) and switch card function (mode 1).

Definition at line 305 of file sd_mmc_protocol.h.

◆ SD_CMD8_SEND_IF_COND

#define SD_CMD8_SEND_IF_COND   (8 | SDMMC_CMD_R7 | SDMMC_CMD_OPENDRAIN)

SD Cmd8(bcr, R7) : Send SD Memory Card interface condition

Definition at line 186 of file sd_mmc_protocol.h.

◆ SD_MCI_ACMD41_SD_SEND_OP_COND

#define SD_MCI_ACMD41_SD_SEND_OP_COND   (41 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN)

ACMD41(bcr, R3): Send host capacity support information (HCS) and asks the accessed card to send its operating condition register (OCR) content in the response

Definition at line 325 of file sd_mmc_protocol.h.

◆ SD_SPI_ACMD41_SD_SEND_OP_COND

#define SD_SPI_ACMD41_SD_SEND_OP_COND   (41 | SDMMC_CMD_R1)

ACMD41(R1): Send host capacity support information (HCS) and activates the card's initilization process

Definition at line 330 of file sd_mmc_protocol.h.

◆ SDIO_CMD52_IO_RW_DIRECT

#define SDIO_CMD52_IO_RW_DIRECT   (52 | SDMMC_CMD_R5)

SDIO CMD52(R5): Direct IO read/write

Definition at line 349 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_IO_R_BLOCK_EXTENDED

#define SDIO_CMD53_IO_R_BLOCK_EXTENDED   (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BLOCK)

Definition at line 353 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_IO_R_BYTE_EXTENDED

#define SDIO_CMD53_IO_R_BYTE_EXTENDED   (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BYTE)

SDIO CMD53(R5): Extended IO read/write

Definition at line 351 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_IO_W_BLOCK_EXTENDED

#define SDIO_CMD53_IO_W_BLOCK_EXTENDED   (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BLOCK | SDMMC_CMD_WRITE)

Definition at line 354 of file sd_mmc_protocol.h.

◆ SDIO_CMD53_IO_W_BYTE_EXTENDED

#define SDIO_CMD53_IO_W_BYTE_EXTENDED   (53 | SDMMC_CMD_R5 | SDMMC_CMD_SDIO_BYTE | SDMMC_CMD_WRITE)

Definition at line 352 of file sd_mmc_protocol.h.

◆ SDIO_CMD5_SEND_OP_COND

#define SDIO_CMD5_SEND_OP_COND   (5 | SDMMC_CMD_R4 | SDMMC_CMD_OPENDRAIN)

SDIO Cmd5(R4): Send operation condition

Definition at line 347 of file sd_mmc_protocol.h.

◆ SDMMC_CLOCK_INIT

#define SDMMC_CLOCK_INIT   400000

Definition at line 53 of file sd_mmc_protocol.h.

◆ SDMMC_CMD10_SEND_CID

#define SDMMC_CMD10_SEND_CID   (10 | SDMMC_CMD_R2)

Cmd10(ac, R2): Addressed card sends its card identification (CID)

Definition at line 192 of file sd_mmc_protocol.h.

◆ SDMMC_CMD12_STOP_TRANSMISSION

#define SDMMC_CMD12_STOP_TRANSMISSION   (12 | SDMMC_CMD_R1B)

Cmd12(ac, R1b): Force the card to stop transmission

Definition at line 201 of file sd_mmc_protocol.h.

◆ SDMMC_CMD15_GO_INACTIVE_STATE

#define SDMMC_CMD15_GO_INACTIVE_STATE   (15 | SDMMC_CMD_NO_RESP | SDMMC_CMD_OPENDRAIN)

Cmd15(ac): Send an addressed card into the Inactive State.

Definition at line 210 of file sd_mmc_protocol.h.

◆ SDMMC_CMD16_SET_BLOCKLEN

#define SDMMC_CMD16_SET_BLOCKLEN   (16 | SDMMC_CMD_R1)

Cmd16(ac, R1): Set the block length (in bytes)

Definition at line 222 of file sd_mmc_protocol.h.

◆ SDMMC_CMD17_READ_SINGLE_BLOCK

#define SDMMC_CMD17_READ_SINGLE_BLOCK   (17 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)

Cmd17(adtc, R1): Read single block

Definition at line 224 of file sd_mmc_protocol.h.

◆ SDMMC_CMD18_READ_MULTIPLE_BLOCK

#define SDMMC_CMD18_READ_MULTIPLE_BLOCK   (18 | SDMMC_CMD_R1 | SDMMC_CMD_MULTI_BLOCK)

Cmd18(adtc, R1): Read multiple block

Definition at line 226 of file sd_mmc_protocol.h.

◆ SDMMC_CMD24_WRITE_BLOCK

#define SDMMC_CMD24_WRITE_BLOCK   (24 | SDMMC_CMD_R1 | SDMMC_CMD_WRITE | SDMMC_CMD_SINGLE_BLOCK)

Cmd24(adtc, R1): Write block

Definition at line 244 of file sd_mmc_protocol.h.

◆ SDMMC_CMD25_WRITE_MULTIPLE_BLOCK

#define SDMMC_CMD25_WRITE_MULTIPLE_BLOCK   (25 | SDMMC_CMD_R1 | SDMMC_CMD_WRITE | SDMMC_CMD_MULTI_BLOCK)

Cmd25(adtc, R1): Write multiple block

Definition at line 246 of file sd_mmc_protocol.h.

◆ SDMMC_CMD27_PROGRAM_CSD

#define SDMMC_CMD27_PROGRAM_CSD   (27 | SDMMC_CMD_R1)

Cmd27(adtc, R1): Programming of the programmable bits of the CSD.

Definition at line 250 of file sd_mmc_protocol.h.

◆ SDMMC_CMD28_SET_WRITE_PROT

#define SDMMC_CMD28_SET_WRITE_PROT   (28 | SDMMC_CMD_R1B)

Cmd28(ac, R1b): Set write protection

Definition at line 270 of file sd_mmc_protocol.h.

◆ SDMMC_CMD29_CLR_WRITE_PROT

#define SDMMC_CMD29_CLR_WRITE_PROT   (29 | SDMMC_CMD_R1B)

Cmd29(ac, R1b): Clr write protection

Definition at line 272 of file sd_mmc_protocol.h.

◆ SDMMC_CMD2_ALL_SEND_CID

#define SDMMC_CMD2_ALL_SEND_CID   (2 | SDMMC_CMD_R2 | SDMMC_CMD_OPENDRAIN)

Cmd2(bcr, R2): Ask the card to send its CID number (stuff but arg 0 used)

Definition at line 167 of file sd_mmc_protocol.h.

◆ SDMMC_CMD30_SEND_WRITE_PROT

#define SDMMC_CMD30_SEND_WRITE_PROT   (30 | SDMMC_CMD_R1)

Cmd30(adtc, R1b): Send write protection

Definition at line 274 of file sd_mmc_protocol.h.

◆ SDMMC_CMD38_ERASE

#define SDMMC_CMD38_ERASE   (38 | SDMMC_CMD_R1B)

Cmd38(ac, R1B):

Definition at line 264 of file sd_mmc_protocol.h.

◆ SDMMC_CMD42_LOCK_UNLOCK

#define SDMMC_CMD42_LOCK_UNLOCK   (42 | SDMMC_CMD_R1)

Cmd42(adtc, R1): Used to set/reset the password or lock/unlock the card.

Definition at line 280 of file sd_mmc_protocol.h.

◆ SDMMC_CMD4_SET_DSR

#define SDMMC_CMD4_SET_DSR   (4 | SDMMC_CMD_NO_RESP)

Cmd4(bc): Program the DSR of all cards (MCI only)

Definition at line 173 of file sd_mmc_protocol.h.

◆ SDMMC_CMD55_APP_CMD

#define SDMMC_CMD55_APP_CMD   (55 | SDMMC_CMD_R1)

Cmd55(ac, R1): Indicate to the card that the next command is an application specific command rather than a standard command.

Definition at line 289 of file sd_mmc_protocol.h.

◆ SDMMC_CMD56_GEN_CMD

#define SDMMC_CMD56_GEN_CMD   (56 | SDMMC_CMD_R1)

Cmd 56(adtc, R1): Used either to transfer a data block to the card or to get a data block from the card for general purpose/application specific commands.

Definition at line 294 of file sd_mmc_protocol.h.

◆ SDMMC_CMD7_DESELECT_CARD_CMD

#define SDMMC_CMD7_DESELECT_CARD_CMD   (7 | SDMMC_CMD_R1)

Definition at line 182 of file sd_mmc_protocol.h.

◆ SDMMC_CMD7_SELECT_CARD_CMD

#define SDMMC_CMD7_SELECT_CARD_CMD   (7 | SDMMC_CMD_R1B)

Cmd7(ac, R1/R1b): Select/Deselect card For SD: R1b only from the selected card. For MMC: R1 while selecting from Stand-By State to Transfer State; R1b while selecting from Disconnected State to Programming State.

Definition at line 181 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_GET_INDEX

#define SDMMC_CMD_GET_INDEX (   cmd)    (cmd & 0x3F)

Definition at line 106 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_MULTI_BLOCK

#define SDMMC_CMD_MULTI_BLOCK   (1lu << 20)

To signal a data transfer in multi block mode.

Definition at line 133 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_NO_RESP

#define SDMMC_CMD_NO_RESP   (0)

Definition at line 138 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_OPENDRAIN

#define SDMMC_CMD_OPENDRAIN   (1lu << 14)

Definition at line 121 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_R1

#define SDMMC_CMD_R1   (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC)

Definition at line 139 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_R1B

#define SDMMC_CMD_R1B   (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC | SDMMC_RESP_BUSY)

Definition at line 140 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_R2

#define SDMMC_CMD_R2   (SDMMC_RESP_PRESENT | SDMMC_RESP_8 | SDMMC_RESP_136 | SDMMC_RESP_CRC)

Definition at line 141 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_R3

#define SDMMC_CMD_R3   (SDMMC_RESP_PRESENT | SDMMC_RESP_32)

Definition at line 142 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_R4

#define SDMMC_CMD_R4   (SDMMC_RESP_PRESENT | SDMMC_RESP_32)

Definition at line 143 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_R5

#define SDMMC_CMD_R5   (SDMMC_RESP_PRESENT | SDMMC_RESP_8 | SDMMC_RESP_CRC)

Definition at line 144 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_R6

#define SDMMC_CMD_R6   (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC)

Definition at line 145 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_R7

#define SDMMC_CMD_R7   (SDMMC_RESP_PRESENT | SDMMC_RESP_32 | SDMMC_RESP_CRC)

Definition at line 146 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_SDIO_BLOCK

#define SDMMC_CMD_SDIO_BLOCK   (1lu << 17)

To signal a SDIO tranfer in block mode.

Definition at line 127 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_SDIO_BYTE

#define SDMMC_CMD_SDIO_BYTE   (1lu << 16)

To signal a SDIO tranfer in multi byte mode.

Definition at line 125 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_SINGLE_BLOCK

#define SDMMC_CMD_SINGLE_BLOCK   (1lu << 19)

To signal a data transfer in single block mode.

Definition at line 131 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_STREAM

#define SDMMC_CMD_STREAM   (1lu << 18)

To signal a data transfer in stream mode.

Definition at line 129 of file sd_mmc_protocol.h.

◆ SDMMC_CMD_WRITE

#define SDMMC_CMD_WRITE   (1lu << 15)

To signal a data write operation.

Definition at line 123 of file sd_mmc_protocol.h.

◆ SDMMC_MCI_CMD0_GO_IDLE_STATE

#define SDMMC_MCI_CMD0_GO_IDLE_STATE   (0 | SDMMC_CMD_NO_RESP | SDMMC_CMD_OPENDRAIN)

Definition at line 162 of file sd_mmc_protocol.h.

◆ SDMMC_MCI_CMD13_SEND_STATUS

#define SDMMC_MCI_CMD13_SEND_STATUS   (13 | SDMMC_CMD_R1)

Cmd13(ac, R1): Addressed card sends its status register.

Definition at line 205 of file sd_mmc_protocol.h.

◆ SDMMC_MCI_CMD9_SEND_CSD

#define SDMMC_MCI_CMD9_SEND_CSD   (9 | SDMMC_CMD_R2)

Cmd9 MCI (ac, R2): Addressed card sends its card-specific data (CSD)

Definition at line 190 of file sd_mmc_protocol.h.

◆ SDMMC_RESP_136

#define SDMMC_RESP_136   (1lu << 11)

136 bit response (MCI only)

Definition at line 114 of file sd_mmc_protocol.h.

◆ SDMMC_RESP_32

#define SDMMC_RESP_32   (1lu << 10)

32 bit response (SPI only)

Definition at line 112 of file sd_mmc_protocol.h.

◆ SDMMC_RESP_8

#define SDMMC_RESP_8   (1lu << 9)

8 bit response (SPI only)

Definition at line 110 of file sd_mmc_protocol.h.

◆ SDMMC_RESP_BUSY

#define SDMMC_RESP_BUSY   (1lu << 13)

Card may send busy.

Definition at line 118 of file sd_mmc_protocol.h.

◆ SDMMC_RESP_CRC

#define SDMMC_RESP_CRC   (1lu << 12)

Expect valid crc (MCI only)

Definition at line 116 of file sd_mmc_protocol.h.

◆ SDMMC_RESP_PRESENT

#define SDMMC_RESP_PRESENT   (1lu << 8)

Have response (MCI only)

Definition at line 108 of file sd_mmc_protocol.h.

◆ SDMMC_SPI_CMD0_GO_IDLE_STATE

#define SDMMC_SPI_CMD0_GO_IDLE_STATE   (0 | SDMMC_CMD_R1)

Cmd0(bc): Reset all cards to idle state

Definition at line 161 of file sd_mmc_protocol.h.

◆ SDMMC_SPI_CMD13_SEND_STATUS

#define SDMMC_SPI_CMD13_SEND_STATUS   (13 | SDMMC_CMD_R2)

Cmd13(R2): Addressed card sends its status register.

Definition at line 203 of file sd_mmc_protocol.h.

◆ SDMMC_SPI_CMD58_READ_OCR

#define SDMMC_SPI_CMD58_READ_OCR   (58 | SDMMC_CMD_R3)

Cmd58(R3): Reads the OCR register of a card

Definition at line 214 of file sd_mmc_protocol.h.

◆ SDMMC_SPI_CMD59_CRC_ON_OFF

#define SDMMC_SPI_CMD59_CRC_ON_OFF   (59 | SDMMC_CMD_R1)

Cmd59(R1): Turns the CRC option on or off

Definition at line 216 of file sd_mmc_protocol.h.

◆ SDMMC_SPI_CMD9_SEND_CSD

#define SDMMC_SPI_CMD9_SEND_CSD   (9 | SDMMC_CMD_R1 | SDMMC_CMD_SINGLE_BLOCK)

Cmd9 SPI (R1): Addressed card sends its card-specific data (CSD)

Definition at line 188 of file sd_mmc_protocol.h.

Typedef Documentation

◆ sdmmc_cmd_def_t

typedef uint32_t sdmmc_cmd_def_t

Value to define a SD/MMC/SDIO command.

Definition at line 102 of file sd_mmc_protocol.h.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:01