idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::spi::master_bus Class Reference

A SPI master bus. More...

Public Member Functions

 master_bus (enum host_device host, enum dma_chan dma_chan, struct bus_config config)
 Constructs a new SPI master bus.
 
 ~master_bus ()
 
 master_bus (const master_bus &)=delete
 
master_busoperator= (const master_bus &)=delete
 
 master_bus (master_bus &&other) noexcept
 Move constructor.
 
master_busoperator= (master_bus &&other) noexcept
 Move assignment.
 
enum host_device host () const
 Returns the host device ID the bus is using.
 

Static Public Member Functions

static result< master_busmake (enum host_device host, enum dma_chan dma_chan, struct bus_config config)
 Creates a new SPI master bus.
 

Detailed Description

A SPI master bus.

Represents a SPI bus operating in master mode. This type is non-copyable and move-only. The destructor is a no-op on a moved-from object.

Definition at line 158 of file master.hpp.

Constructor & Destructor Documentation

◆ master_bus() [1/3]

idfxx::spi::master_bus::master_bus ( enum host_device  host,
enum dma_chan  dma_chan,
struct bus_config  config 
)
explicit

Constructs a new SPI master bus.

Parameters
hostSPI host device (e.g., SPI2_HOST).
dma_chanDMA channel, or idfxx::spi::dma_chan::disabled.
configBus configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled in menuconfig.
Exceptions
std::system_erroron failure.

◆ ~master_bus()

idfxx::spi::master_bus::~master_bus ( )

◆ master_bus() [2/3]

idfxx::spi::master_bus::master_bus ( const master_bus )
delete

◆ master_bus() [3/3]

idfxx::spi::master_bus::master_bus ( master_bus &&  other)
noexcept

Move constructor.

Transfers bus ownership.

Member Function Documentation

◆ host()

enum host_device idfxx::spi::master_bus::host ( ) const
inline

Returns the host device ID the bus is using.

Definition at line 198 of file master.hpp.

◆ make()

static result< master_bus > idfxx::spi::master_bus::make ( enum host_device  host,
enum dma_chan  dma_chan,
struct bus_config  config 
)
static

Creates a new SPI master bus.

Parameters
hostSPI host device (e.g., SPI2_HOST).
dma_chanDMA channel, or idfxx::spi::dma_chan::disabled.
configBus configuration.
Returns
The new bus, or an error.

◆ operator=() [1/2]

master_bus & idfxx::spi::master_bus::operator= ( const master_bus )
delete

◆ operator=() [2/2]

master_bus & idfxx::spi::master_bus::operator= ( master_bus &&  other)
noexcept

Move assignment.

Transfers bus ownership.


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