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

#include "distortos/devices/communication/SpiMasterTransfer.hpp"

Public Member Functions

constexpr SpiMasterTransfer (const void *const writeBuffer, void *const readBuffer, const size_t size)
 SpiMasterTransfer's constructor. More...
 
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, bytes More...
 

Detailed Description

SpiMasterTransfer class is a single transfer operation that can be executed by SPI master as part of a transaction.

Constructor & Destructor Documentation

◆ SpiMasterTransfer()

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

SpiMasterTransfer'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, 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

◆ getReadBuffer()

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

◆ getSize()

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

◆ getWriteBuffer()

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

Member Data Documentation

◆ readBuffer_

void* distortos::devices::SpiMasterTransfer::readBuffer_
private

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

◆ size_

size_t distortos::devices::SpiMasterTransfer::size_
private

size of transfer, bytes

◆ writeBuffer_

const void* distortos::devices::SpiMasterTransfer::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: