| 799 | */ |
| 800 | |
| 801 | std::tuple<int, uint8_t, std::array<uint8_t, 16>> executeCmd9(const SpiMasterHandle& spiMasterHandle) |
| 802 | { |
| 803 | { |
| 804 | const auto ret = writeCmdReadR1(spiMasterHandle, 9); |
| 805 | if (ret.first != 0 || ret.second != 0) |
| 806 | return decltype(executeCmd9(spiMasterHandle)){ret.first, ret.second, {}}; |
| 807 | } |
| 808 | std::array<uint8_t, 16> csdBuffer; |
| 809 | // "7.2.6 Read CID/CSD Registers" of Physical Layer Simplified Specification Version 6.00 - use fixed read timeout |
| 810 | const auto ret = |
| 811 | readDataBlock(spiMasterHandle, csdBuffer.begin(), csdBuffer.size(), std::chrono::milliseconds{100}); |
| 812 | return decltype(executeCmd9(spiMasterHandle)){ret, {}, csdBuffer}; |
| 813 | } |
| 814 | |
| 815 | /** |
| 816 | * \brief Executes CMD12 command on SD card connected via SPI. |
no test coverage detected