22#include <idfxx/spi/master>
24#include <esp_lcd_panel_io.h>
25#include <frequency/frequency>
88#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
130 struct callback_state {
140 std::unique_ptr<callback_state> _callbacks;
Type-safe set of flags from a scoped enum.
static constexpr gpio nc()
Returns a GPIO representing "not connected".
SPI-based panel I/O interface.
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.
panel_io(idfxx::spi::master_bus &spi_bus, spi_config config)
Creates a new panel I/O interface.
panel_io(panel_io &&other) noexcept
esp_lcd_panel_io_handle_t idf_handle() const
Returns the underlying ESP-IDF handle.
static result< panel_io > make(idfxx::spi::master_bus &spi_bus, spi_config config)
Creates a new panel I/O interface.
panel_io & operator=(panel_io &&other) noexcept
panel_io(const panel_io &)=delete
panel_io & operator=(const panel_io &)=delete
std::expected< T, std::error_code > result
result type wrapping a value or error code.
SPI-based panel I/O configuration.
unsigned int octal_mode
transmit with octal mode (8 data lines), this mode is used to simulate Intel 8080 timing
size_t trans_queue_depth
Size of internal transaction queue.
uint8_t cs_enable_pretrans
Amount of SPI bit-cycles the cs should be activated before the transmission (0-16)
unsigned int dc_low_on_data
If enabled, DC level = 0 indicates color data transfer.
int spi_mode
Traditional SPI mode (0~3)
int lcd_param_bits
Bit-width of LCD parameter.
int lcd_cmd_bits
Bit-width of LCD command.
unsigned int cs_high_active
CS line is high active.
gpio cs_gpio
GPIO used for CS line.
freq::hertz pclk_freq
Frequency of pixel clock.
unsigned int dc_low_on_param
If enabled, DC level = 0 indicates parameter transfer.
unsigned int dc_high_on_cmd
If enabled, DC level = 1 indicates command transfer.
color_transfer_done_callback on_color_transfer_done
Callback invoked when color data transfer has finished.
gpio dc_gpio
GPIO used to select the D/C line, set to gpio::nc() if not used.
uint8_t cs_enable_posttrans
Amount of SPI bit-cycles the cs should stay active after the transmission (0-16)
unsigned int quad_mode
transmit with quad mode (4 data lines), this mode is useful when transmitting LCD parameters (Only us...
unsigned int sio_mode
Read and write through a single data line (MOSI)
unsigned int lsb_first
transmit LSB bit first