12 #ifndef INCLUDE_DISTORTOS_DEVICES_MEMORY_SDMMCCARDLOWLEVEL_HPP_ 13 #define INCLUDE_DISTORTOS_DEVICES_MEMORY_SDMMCCARDLOWLEVEL_HPP_ 74 constexpr
explicit Response(uint32_t& shortResponse) :
88 constexpr
explicit Response(uint32_t (& shortResponse)[1]) :
102 constexpr
explicit Response(std::array<uint32_t, 1>& shortResponse) :
116 constexpr
explicit Response(uint32_t (& longResponse)[4]) :
130 constexpr
explicit Response(std::array<uint32_t, 4>& longResponse) :
169 constexpr
Transfer(
void*
const readBuffer,
const size_t size,
const size_t blockSize,
170 const uint16_t timeoutMs) :
191 constexpr
Transfer(
const void*
const writeBuffer,
const size_t size,
const size_t blockSize,
192 const uint16_t timeoutMs) :
292 constexpr
ReadTransfer(
void*
const readBuffer,
const size_t size,
const size_t blockSize,
293 const uint16_t timeoutMs) :
294 Transfer{readBuffer, size, blockSize, timeoutMs}
313 constexpr
WriteTransfer(
const void*
const writeBuffer,
const size_t size,
const size_t blockSize,
314 const uint16_t timeoutMs) :
315 Transfer{writeBuffer, size, blockSize, timeoutMs}
353 virtual int start() = 0;
385 Transfer transfer) = 0;
396 virtual void stop() = 0;
403 #endif // INCLUDE_DISTORTOS_DEVICES_MEMORY_SDMMCCARDLOWLEVEL_HPP_ bool writeTransfer_
selects whether this is a read (false) or write (true) transfer
Definition: SdMmcCardLowLevel.hpp:277
constexpr Transfer(const void *const writeBuffer, const size_t size, const size_t blockSize, const uint16_t timeoutMs)
Transfer's constructor.
Definition: SdMmcCardLowLevel.hpp:191
void * readBuffer_
buffer into which the data will be read, valid only if writeTransfer_ is false
Definition: SdMmcCardLowLevel.hpp:261
constexpr Response(uint32_t &shortResponse)
Response's constructor.
Definition: SdMmcCardLowLevel.hpp:74
command response
Definition: SdMmcCardLowLevel.hpp:47
transfer associated with transaction
Definition: SdMmcCardLowLevel.hpp:138
constexpr Response(uint32_t(&longResponse)[4])
Response's constructor.
Definition: SdMmcCardLowLevel.hpp:116
read transfer associated with transaction
Definition: SdMmcCardLowLevel.hpp:281
virtual int start()=0
Starts low-level SD/MMC card driver.
size_t size_
size of readBuffer_ or writeBuffer_, bytes
Definition: SdMmcCardLowLevel.hpp:268
void * getReadBuffer() const
Definition: SdMmcCardLowLevel.hpp:215
constexpr Transfer()
Transfer's constructor.
Definition: SdMmcCardLowLevel.hpp:148
uint16_t timeoutMs_
timeout of transfer, milliseconds
Definition: SdMmcCardLowLevel.hpp:274
ContiguousRange template class is a pair of iterators to contiguous sequence of elements in memory.
Definition: ContiguousRange.hpp:27
constexpr Transfer(void *const readBuffer, const size_t size, const size_t blockSize, const uint16_t timeoutMs)
Transfer's constructor.
Definition: SdMmcCardLowLevel.hpp:169
constexpr Response(std::array< uint32_t, 1 > &shortResponse)
Response's constructor.
Definition: SdMmcCardLowLevel.hpp:102
constexpr ReadTransfer(void *const readBuffer, const size_t size, const size_t blockSize, const uint16_t timeoutMs)
ReadTransfer's constructor.
Definition: SdMmcCardLowLevel.hpp:292
size_t getSize() const
Definition: SdMmcCardLowLevel.hpp:224
constexpr Response(std::array< uint32_t, 4 > &longResponse)
Response's constructor.
Definition: SdMmcCardLowLevel.hpp:130
const void * writeBuffer_
buffer with data that will be written, valid only if writeTransfer_ is true
Definition: SdMmcCardLowLevel.hpp:264
write transfer associated with transaction
Definition: SdMmcCardLowLevel.hpp:301
size_t getBlockSize() const
Definition: SdMmcCardLowLevel.hpp:206
Definition: SdMmcCardLowLevel.hpp:31
constexpr Response(uint32_t(&shortResponse)[1])
Response's constructor.
Definition: SdMmcCardLowLevel.hpp:88
ContiguousRange template class header.
virtual void stop()=0
Stops low-level SD/MMC card driver.
Top-level namespace of distortos project.
Definition: buttons.hpp:33
size_t blockSize_
block size, bytes
Definition: SdMmcCardLowLevel.hpp:271
uint16_t getTimeoutMs() const
Definition: SdMmcCardLowLevel.hpp:233
Definition: SdMmcCardBase.hpp:30
BusMode
bus mode
Definition: SdMmcCardLowLevel.hpp:36
bool isWriteTransfer() const
Definition: SdMmcCardLowLevel.hpp:251
constexpr WriteTransfer(const void *const writeBuffer, const size_t size, const size_t blockSize, const uint16_t timeoutMs)
WriteTransfer's constructor.
Definition: SdMmcCardLowLevel.hpp:313
const void * getWriteBuffer() const
Definition: SdMmcCardLowLevel.hpp:242
constexpr Response()
Response's constructor.
Definition: SdMmcCardLowLevel.hpp:60
virtual ~SdMmcCardLowLevel()=default
SdMmcCardLowLevel's destructor.
static constexpr uint8_t maxCommand
maximum allowed command
Definition: SdMmcCardLowLevel.hpp:322
virtual void configure(BusMode busMode, uint32_t clockFrequency)=0
Configures parameters of low-level SD/MMC card driver.
virtual void startTransaction(SdMmcCardBase &sdMmcCardBase, uint8_t command, uint32_t argument, Response response, Transfer transfer)=0
Starts asynchronous transaction.