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

Panel I/O interface for SPI- and I2C-connected displays. More...

Classes

struct  i2c_config
 I2C-based panel I/O configuration. More...
 
struct  spi_config
 SPI-based panel I/O configuration. More...
 

Public Types

typedef std::move_only_function< bool(esp_lcd_panel_io_event_data_t *edata)> color_transfer_done_callback
 Callback type invoked when color data transfer has finished.
 

Public Member Functions

 panel_io (idfxx::spi::master_bus &spi_bus, spi_config config)
 Creates a new panel I/O interface.
 
 panel_io (idfxx::i2c::master_bus &i2c_bus, i2c_config config)
 Creates a new panel I/O interface.
 
 ~panel_io ()
 
 panel_io (const panel_io &)=delete
 
panel_iooperator= (const panel_io &)=delete
 
 panel_io (panel_io &&other) noexcept
 
panel_iooperator= (panel_io &&other) noexcept
 
esp_lcd_panel_io_handle_t idf_handle () const
 Returns the underlying ESP-IDF handle.
 

Static Public Member Functions

static result< panel_iomake (idfxx::spi::master_bus &spi_bus, spi_config config)
 Creates a new panel I/O interface.
 
static result< panel_iomake (idfxx::i2c::master_bus &i2c_bus, i2c_config config)
 Creates a new panel I/O interface.
 

Detailed Description

Panel I/O interface for SPI- and I2C-connected displays.

Provides the communication layer for display panels (LCD, OLED, ePaper) and touch controllers that use SPI or I2C. This type is non-copyable and move-only. A moved-from object must not be used: any operation other than destruction or assignment is undefined behavior.

Definition at line 42 of file panel_io.hpp.

Member Typedef Documentation

◆ color_transfer_done_callback

typedef std::move_only_function<bool(esp_lcd_panel_io_event_data_t* edata)> idfxx::panel_io::color_transfer_done_callback

Callback type invoked when color data transfer has finished.

Parameters
edataPanel IO event data.
Returns
Whether a high priority task has been woken up by this function.

Definition at line 50 of file panel_io.hpp.

Constructor & Destructor Documentation

◆ panel_io() [1/4]

idfxx::panel_io::panel_io ( idfxx::spi::master_bus spi_bus,
spi_config  config 
)
explicit

Creates a new panel I/O interface.

Does not take ownership of spi_bus. It is the caller's responsibility to ensure that this panel_io does not outlive the bus.

Parameters
spi_busThe SPI bus.
configPanel I/O configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled in menuconfig.
Exceptions
std::system_erroron failure.

◆ panel_io() [2/4]

idfxx::panel_io::panel_io ( idfxx::i2c::master_bus i2c_bus,
i2c_config  config 
)
explicit

Creates a new panel I/O interface.

Does not take ownership of i2c_bus. It is the caller's responsibility to ensure that this panel_io does not outlive the bus.

Parameters
i2c_busThe I2C bus.
configPanel I/O configuration.
Note
Only available when CONFIG_COMPILER_CXX_EXCEPTIONS is enabled in menuconfig.
Exceptions
std::system_erroron failure.

◆ ~panel_io()

idfxx::panel_io::~panel_io ( )

◆ panel_io() [3/4]

idfxx::panel_io::panel_io ( const panel_io )
delete

◆ panel_io() [4/4]

idfxx::panel_io::panel_io ( panel_io &&  other)
noexcept

Member Function Documentation

◆ idf_handle()

esp_lcd_panel_io_handle_t idfxx::panel_io::idf_handle ( ) const
inline

Returns the underlying ESP-IDF handle.

Definition at line 177 of file panel_io.hpp.

◆ make() [1/2]

static result< panel_io > idfxx::panel_io::make ( idfxx::i2c::master_bus i2c_bus,
i2c_config  config 
)
static

Creates a new panel I/O interface.

Does not take ownership of i2c_bus. It is the caller's responsibility to ensure that this panel_io does not outlive the bus.

Parameters
i2c_busThe I2C bus.
configPanel I/O configuration.
Returns
The new panel_io, or an error.

◆ make() [2/2]

static result< panel_io > idfxx::panel_io::make ( idfxx::spi::master_bus spi_bus,
spi_config  config 
)
static

Creates a new panel I/O interface.

Does not take ownership of spi_bus. It is the caller's responsibility to ensure that this panel_io does not outlive the bus.

Parameters
spi_busThe SPI bus.
configPanel I/O configuration.
Returns
The new panel_io, or an error.

◆ operator=() [1/2]

panel_io & idfxx::panel_io::operator= ( const panel_io )
delete

◆ operator=() [2/2]

panel_io & idfxx::panel_io::operator= ( panel_io &&  other)
noexcept

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