Embedded Artistry Framework
Embedded Systems C++ Framework
Classes | Typedefs | Enumerations | Variables

Definitions, functions, and classes related to SPI communication bus devices. More...

Classes

class  activeMaster
 
class  master
 This class provides the SPI master interface definition. More...
 
struct  op_t
 SPI operation definition. More...
 

Typedefs

using ao_storage = std::pair< embvm::spi::op_t, const embvm::spi::master::cb_t >
 
using baud_t = uint32_t
 SPI baudrate is specified as an integral value with units Hz. More...
 
using status = embvm::comm::status
 
using commBus = commBus< spi::op_t, spi::baud_t, spi::SPI_MASTER_REQD_STATIC_FUNCTION_SIZE >
 Convenience alias for the declaration of the SPI commBus. More...
 

Enumerations

enum  mode : uint8_t { mode::mode0 = 0, mode::mode1 = 1, mode::mode2 = 2, mode::mode3 = 3 }
 SPI bus operational modes. More...
 
enum  order : uint8_t { order::msbFirst = 0, order::lsbFirst }
 SPI bus transmission order options. More...
 

Variables

static constexpr size_t SPI_MASTER_REQD_STATIC_FUNCTION_SIZE = 80
 Maximum size of the SPI master callback functor object. More...
 
static constexpr spi::baud_t DEFAULT_SPI_BAUD = UINT32_C(125000)
 Default baudrate, which is used in the default constructor. More...
 

Detailed Description

Definitions, functions, and classes related to SPI communication bus devices.


Class Documentation

◆ embvm::spi::op_t

struct embvm::spi::op_t

SPI operation definition.

The SPI bus is full-duplex and always transmits and receives simultaneously.

A TX operation involves a valid tx_buffer pointer with rx_buffer set to nullptr.

An RX operation involves a valid rx_buffer pointer with tx_buffer set to nullptr. When tx_buffer is set to nullptr, the driver should clock out empty bytes.

An equal number of bytes are transmitted and received during a SPI transaction. The transfer size is controlled by the length argument.

Class Members
size_t length Number of bytes to transfer over the bus.
uint8_t * rx_buffer Pointer to buffer holding receive bytes.

Can be set to nullptr to ignore reception.

uint8_t * tx_buffer Pointer to buffer holding transmit bytes.

Can be set to nullptr to transmit empty bytes.

Typedef Documentation

◆ ao_storage

using embvm::spi::ao_storage = typedef std::pair<embvm::spi::op_t, const embvm::spi::master::cb_t>

◆ baud_t

using embvm::spi::baud_t = typedef uint32_t

SPI baudrate is specified as an integral value with units Hz.

◆ commBus

Convenience alias for the declaration of the SPI commBus.

◆ status

Enumeration Type Documentation

◆ mode

enum embvm::spi::mode : uint8_t
strong

SPI bus operational modes.

Enumerator
mode0 

Clock polarity normal, samples on rising edge.

mode1 

Clock polarity normal, samples on falling edge.

mode2 

Clock polarity inverted, samples on rising edge.

mode3 

Clock polarity inverted, samples on falling edge.

◆ order

enum embvm::spi::order : uint8_t
strong

SPI bus transmission order options.

This setting determines whether the bus transmit MSB or LSB first.

msbFirst is the most common setting.

Enumerator
msbFirst 
lsbFirst 

Variable Documentation

◆ DEFAULT_SPI_BAUD

constexpr spi::baud_t embvm::spi::DEFAULT_SPI_BAUD = UINT32_C(125000)
static

Default baudrate, which is used in the default constructor.

◆ SPI_MASTER_REQD_STATIC_FUNCTION_SIZE

constexpr size_t embvm::spi::SPI_MASTER_REQD_STATIC_FUNCTION_SIZE = 80
static

Maximum size of the SPI master callback functor object.