1.34.6.9 HSMCI_CommandSend Function

C

void HSMCI_CommandSend (
	uint8_t opCode,
	uint32_t argument,
	uint8_t respType,
	HSMCI_DataTransferFlags transferFlags
)

Summary

This function allows the application to send a SD command on the HSMCI interface

Description

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

Precondition

HSMCI_Initialize() must have been called first.

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

HSMCI_DataTransferFlags transferFlags;
transferFlags.isDataPresent = false;

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