1.25.19.12 SDMMCx_CommandSend Function

C

/* x = SDMMC instance number */

void SDMMCx_CommandSend (
uint8_t opCode,
uint32_t argument,
uint8_t respType,
SDMMC_DataTransferFlags transferFlags
)

Summary

This function allows the client to send a SD command on the SDMMC interface.

Description

This function is used to send a command on the SDMMC interface and start a transfer.

Precondition

SDMMCx_Initialize() must have been called first for the associated instance.

Parameters

Param Description
opCode The SD command opcode.
argument The argument to the SD command.
respType The expected response type for the given SD command. Refer to the SDMMC_CMD_RESP_TYPE enum for the possible values of the response type
transferFlags Transfer flags associated with data transfer Indicates if the transfer contains data stage or not. If the data stage is present, the transferFlags indicate transfer type - single block or multiple block and the transfer direction - read or write

Returns

None.

Example

SDMMC_DataTransferFlags transferFlags;
transferFlags.isDataPresent = false;

// Send command 8 with 0x1AAA argument. The expected response is of R7 type.
SDMMC1_CommandSend(8, 0x1AA, SDMMC_CMD_RESP_R7, transferFlags);

Remarks

The function only supports commonly used SD commands and does not support all the commands specified in the SD protocol.