1.22.24.12 SDHCx_CommandSend Function

C

/* x = SDHC instance number (x is applicable only on devices with more than one instances of SDHC) */

void SDHCx_CommandSend (
	uint8_t opCode,
	uint32_t argument,
	uint8_t respType,
	SDHC_DataTransferFlags transferFlags
)

Summary

This function allows the applicaton to send a SD command on the SDHC interface.

Description

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

Precondition

SDHCx_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 SDHC_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

SDHC_DataTransferFlags transferFlags;
transferFlags.isDataPresent = false;

// Send command 8 with 0x1AAA argument. The expected response is of R7 type.
SDHC1_CommandSend(8, 0x1AA, SDHC_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.