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

Transfer class is a single transfer operation. More...

#include <SpiMasterOperation.hpp>

Collaboration diagram for distortos::devices::SpiMasterOperation::Transfer:
[legend]

Public Member Functions

constexpr Transfer (const void *const writeBuffer, void *const readBuffer, const size_t size)
 Transfer's constructor. More...
 
void finalize (const SpiMasterErrorSet errorSet, const size_t bytesTransfered)
 Finalizes transfer operation. More...
 
size_t getBytesTransfered () const
 
SpiMasterErrorSet getErrorSet () const
 
void * getReadBuffer () const
 
size_t getSize () const
 
const void * getWriteBuffer () const
 

Private Attributes

void * readBuffer_
 buffer with data that will be read, nullptr to ignore received data More...
 
const void * writeBuffer_
 buffer with data that will be written, nullptr to send dummy data More...
 
size_t size_
 size of transfer (size of readBuffer_ and/or writeBuffer_), bytes More...
 
size_t bytesTransfered_
 
SpiMasterErrorSet errorSet_
 set of error bits detected during the transfer More...
 

Detailed Description

Transfer class is a single transfer operation.

Constructor & Destructor Documentation

◆ Transfer()

constexpr distortos::devices::SpiMasterOperation::Transfer::Transfer ( const void *const  writeBuffer,
void *const  readBuffer,
const size_t  size 
)
inline

Transfer's constructor.

Parameters
[in]writeBufferis the buffer with data that will be written, nullptr to send dummy data
[out]readBufferis the buffer with data that will be read, nullptr to ignore received data
[in]sizeis the size of transfer (size of writeBuffer and/or readBuffer), bytes, must be even if number of data bits is in range (8; 16], divisible by 3 if number of data bits is in range (16; 24] or divisible by 4 if number of data bits is in range (24; 32]

Member Function Documentation

◆ finalize()

void distortos::devices::SpiMasterOperation::Transfer::finalize ( const SpiMasterErrorSet  errorSet,
const size_t  bytesTransfered 
)
inline

Finalizes transfer operation.

Parameters
[in]errorSetis the set of error bits
[in]bytesTransferedis the number of bytes transfered by low-level SPI master driver (read from write buffer and/or written to read buffer), may be unreliable if errorSet is not empty (i.e. transfer error was detected)

◆ getBytesTransfered()

size_t distortos::devices::SpiMasterOperation::Transfer::getBytesTransfered ( ) const
inline
Returns
number of bytes transfered by low-level SPI master driver (read from write buffer and/or written to read buffer), may be unreliable if error set is not empty (i.e. transfer error was detected)

◆ getErrorSet()

SpiMasterErrorSet distortos::devices::SpiMasterOperation::Transfer::getErrorSet ( ) const
inline
Returns
set of error bits detected during the transfer

◆ getReadBuffer()

void* distortos::devices::SpiMasterOperation::Transfer::getReadBuffer ( ) const
inline
Returns
buffer with data that will be read, nullptr to ignore received data

◆ getSize()

size_t distortos::devices::SpiMasterOperation::Transfer::getSize ( ) const
inline
Returns
size of transfer (size of read and/or write buffers), bytes

◆ getWriteBuffer()

const void* distortos::devices::SpiMasterOperation::Transfer::getWriteBuffer ( ) const
inline
Returns
buffer with data that will be written, nullptr to send dummy data

Member Data Documentation

◆ bytesTransfered_

size_t distortos::devices::SpiMasterOperation::Transfer::bytesTransfered_
private

number of bytes transfered by low-level SPI master driver (read from writeBuffer_ and/or written to readBuffer_), may be unreliable if errorSet_ is not empty (i.e. transfer error was detected)

◆ errorSet_

SpiMasterErrorSet distortos::devices::SpiMasterOperation::Transfer::errorSet_
private

set of error bits detected during the transfer

◆ readBuffer_

void* distortos::devices::SpiMasterOperation::Transfer::readBuffer_
private

buffer with data that will be read, nullptr to ignore received data

◆ size_

size_t distortos::devices::SpiMasterOperation::Transfer::size_
private

size of transfer (size of readBuffer_ and/or writeBuffer_), bytes

◆ writeBuffer_

const void* distortos::devices::SpiMasterOperation::Transfer::writeBuffer_
private

buffer with data that will be written, nullptr to send dummy data


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