distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
distortos::devices::SdMmcCardLowLevel::Transfer Class Reference

transfer associated with transaction More...

#include "distortos/devices/memory/SdMmcCardLowLevel.hpp"

Inheritance diagram for distortos::devices::SdMmcCardLowLevel::Transfer:
[legend]

Public Member Functions

constexpr Transfer ()
 Transfer's constructor. More...
 
constexpr Transfer (void *const readBuffer, const size_t size, const size_t blockSize, const uint16_t timeoutMs)
 Transfer's constructor. More...
 
constexpr Transfer (const void *const writeBuffer, const size_t size, const size_t blockSize, const uint16_t timeoutMs)
 Transfer's constructor. More...
 
size_t getBlockSize () const
 
void * getReadBuffer () const
 
size_t getSize () const
 
uint16_t getTimeoutMs () const
 
const void * getWriteBuffer () const
 
bool isWriteTransfer () const
 

Private Attributes

union {
   void *   readBuffer_
 buffer into which the data will be read, valid only if writeTransfer_ is false More...
 
   const void *   writeBuffer_
 buffer with data that will be written, valid only if writeTransfer_ is true More...
 
}; 
 
size_t size_
 size of readBuffer_ or writeBuffer_, bytes More...
 
size_t blockSize_
 block size, bytes More...
 
uint16_t timeoutMs_
 timeout of transfer, milliseconds More...
 
bool writeTransfer_
 selects whether this is a read (false) or write (true) transfer More...
 

Detailed Description

transfer associated with transaction

Constructor & Destructor Documentation

◆ Transfer() [1/3]

constexpr distortos::devices::SdMmcCardLowLevel::Transfer::Transfer ( )
inline

Transfer's constructor.

Used when no transfer is associated with transaction.

◆ Transfer() [2/3]

constexpr distortos::devices::SdMmcCardLowLevel::Transfer::Transfer ( void *const  readBuffer,
const size_t  size,
const size_t  blockSize,
const uint16_t  timeoutMs 
)
inline

Transfer's constructor.

Used when read transfer is associated with transaction.

Parameters
[out]readBufferis the buffer into which the data will be read
[in]sizeis the size of readBuffer, bytes, must be a multiple of block size
[in]blockSizeis the block size, bytes
[in]timeoutMsis the timeout of read transfer, milliseconds

◆ Transfer() [3/3]

constexpr distortos::devices::SdMmcCardLowLevel::Transfer::Transfer ( const void *const  writeBuffer,
const size_t  size,
const size_t  blockSize,
const uint16_t  timeoutMs 
)
inline

Transfer's constructor.

Used when write transfer is associated with transaction.

Parameters
[in]writeBufferis the buffer with data that will be written
[in]sizeis the size of writeBuffer, bytes, must be a multiple of block size
[in]blockSizeis the block size, bytes
[in]timeoutMsis the timeout of write transfer, milliseconds

Member Function Documentation

◆ getBlockSize()

size_t distortos::devices::SdMmcCardLowLevel::Transfer::getBlockSize ( ) const
inline
Returns
block size, bytes

◆ getReadBuffer()

void* distortos::devices::SdMmcCardLowLevel::Transfer::getReadBuffer ( ) const
inline
Returns
buffer into which the data will be read, valid only if isWriteTransfer() returns false

◆ getSize()

size_t distortos::devices::SdMmcCardLowLevel::Transfer::getSize ( ) const
inline
Returns
size of read buffer or write buffer, bytes

◆ getTimeoutMs()

uint16_t distortos::devices::SdMmcCardLowLevel::Transfer::getTimeoutMs ( ) const
inline
Returns
timeout of transfer, milliseconds

◆ getWriteBuffer()

const void* distortos::devices::SdMmcCardLowLevel::Transfer::getWriteBuffer ( ) const
inline
Returns
buffer with data that will be written, valid only if isWriteTransfer() returns true

◆ isWriteTransfer()

bool distortos::devices::SdMmcCardLowLevel::Transfer::isWriteTransfer ( ) const
inline
Returns
false if this is a read transfer, true if this is a write transfer

Member Data Documentation

◆ blockSize_

size_t distortos::devices::SdMmcCardLowLevel::Transfer::blockSize_
private

block size, bytes

◆ readBuffer_

void* distortos::devices::SdMmcCardLowLevel::Transfer::readBuffer_

buffer into which the data will be read, valid only if writeTransfer_ is false

◆ size_

size_t distortos::devices::SdMmcCardLowLevel::Transfer::size_
private

size of readBuffer_ or writeBuffer_, bytes

◆ timeoutMs_

uint16_t distortos::devices::SdMmcCardLowLevel::Transfer::timeoutMs_
private

timeout of transfer, milliseconds

◆ writeBuffer_

const void* distortos::devices::SdMmcCardLowLevel::Transfer::writeBuffer_

buffer with data that will be written, valid only if writeTransfer_ is true

◆ writeTransfer_

bool distortos::devices::SdMmcCardLowLevel::Transfer::writeTransfer_
private

selects whether this is a read (false) or write (true) transfer


The documentation for this class was generated from the following file: