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

Function executeCmd8

source/devices/memory/SdCardSpiBased.cpp:779–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777 */
778
779std::tuple<int, uint8_t, bool> executeCmd8(const SpiMasterHandle& spiMasterHandle)
780{
781 constexpr uint8_t supplyVoltage {1}; // 2.7 - 3.6 V
782 constexpr uint8_t checkPattern {0xaa};
783 const auto ret = writeCmdReadR7(spiMasterHandle, 8, supplyVoltage << 8 | checkPattern, 0x43);
784 const auto match = ret.second.checkPattern == checkPattern && ret.second.voltageAccepted == supplyVoltage;
785 return std::make_tuple(ret.first, ret.second.r1, match);
786}
787
788/**
789 * \brief Executes CMD9 command on SD card connected via SPI.

Callers 1

initializeMethod · 0.70

Calls 1

writeCmdReadR7Function · 0.85

Tested by

no test coverage detected