MCPcopy Create free account
hub / github.com/DISTORTEC/distortos / writeAcmd

Function writeAcmd

source/devices/memory/SdCardSpiBased.cpp:1029–1039  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1027 */
1028
1029int writeAcmd(const SpiMasterHandle& spiMasterHandle, const uint8_t command, const uint32_t argument = {},
1030 const uint8_t crc7 = {}, const bool stuffByte = {})
1031{
1032 const auto ret = executeCmd55(spiMasterHandle);
1033 if (ret.first != 0)
1034 return ret.first;
1035 if (ret.second != 0 && ret.second != r1InIdleStateMask)
1036 return EIO;
1037
1038 return writeCmd(spiMasterHandle, command, argument, crc7, stuffByte);
1039}
1040
1041/**
1042 * \brief Writes application (ACMD) command and reads R1 response to/from SD card connected via SPI.

Callers 2

writeAcmdReadR1Function · 0.85
writeAcmdReadR2Function · 0.85

Calls 2

writeCmdFunction · 0.85
executeCmd55Function · 0.70

Tested by

no test coverage detected