3D Graphics Engine for ESP32
 
Loading...
Searching...
No Matches
Ragot::DriverLCD Class Referenceabstract

Base class for LCD drivers. More...

#include <driver_lcd.hpp>

Inheritance diagram for Ragot::DriverLCD:
Inheritance graph
Collaboration diagram for Ragot::DriverLCD:
Collaboration graph

Public Member Functions

 DriverLCD ()=default
 Default constructor for the DriverLCD class.
 
virtual ~DriverLCD ()=default
 Default virtual destructor for the DriverLCD class.
 
virtual esp_err_t init (gpio_num_t reset_pin, gpio_num_t bk_pin)=0
 Initializes the LCD driver with the specified reset and backlight GPIO pins.
 
virtual esp_err_t deinit ()=0
 Deinitializes the LCD driver.
 
virtual esp_err_t set_pixel (uint32_t x, uint32_t y, uint32_t color)=0
 Sets a pixel at the specified coordinates to the given color.
 
virtual esp_err_t send_frame_buffer (const void *frame_buffer)=0
 Sends a frame buffer to the LCD panel.
 
const size_t get_width () const
 Gets the width of the LCD panel.
 
size_t get_width ()
 Gets the height of the LCD panel.
 
const size_t get_height () const
 Gets the height of the LCD panel.
 
size_t get_height ()
 Gets the height of the LCD panel.
 
const lcd_color_rgb_pixel_format_t get_pixel_format () const
 Get the pixel format object.
 
lcd_color_rgb_pixel_format_t get_pixel_format ()
 Get the pixel format object.
 
const esp_lcd_panel_handle_t get_handler () const
 Get the handler object.
 
esp_lcd_panel_handle_t get_handler ()
 Get the handler object.
 
const bool is_initialized () const
 Checks if the LCD driver is initialized.
 
bool is_initialized ()
 Checks if the LCD driver is initialized.
 

Protected Attributes

bool initialized = false
 Flag indicating if the LCD driver is initialized.
 
size_t width
 Width of the LCD panel in pixels.
 
size_t height
 Height of the LCD panel in pixels.
 
lcd_color_rgb_pixel_format_t pixel_format
 Pixel format of the LCD panel.
 
esp_lcd_panel_handle_t handler
 Handle to the LCD panel.
 

Detailed Description

Base class for LCD drivers.

This class provides an interface for LCD drivers, including methods for initialization, deinitialization, setting pixels, and sending frame buffers. It also provides access to the LCD panel's width, height, pixel format, and handler.

Constructor & Destructor Documentation

◆ DriverLCD()

Ragot::DriverLCD::DriverLCD ( )
default

Default constructor for the DriverLCD class.

Initializes the LCD driver with default values.

◆ ~DriverLCD()

virtual Ragot::DriverLCD::~DriverLCD ( )
virtualdefault

Default virtual destructor for the DriverLCD class.

Cleans up resources used by the LCD driver.

Member Function Documentation

◆ deinit()

virtual esp_err_t Ragot::DriverLCD::deinit ( )
pure virtual

Deinitializes the LCD driver.

This method should be implemented by derived classes to clean up resources used by the LCD panel.

Returns
esp_err_t ESP_OK on success, or an error code on failure.

Implemented in Ragot::Driver_ST7789, and Ragot::DriverEK79007.

◆ get_handler() [1/2]

esp_lcd_panel_handle_t Ragot::DriverLCD::get_handler ( )
inline

Get the handler object.

Returns
esp_lcd_panel_handle_t

◆ get_handler() [2/2]

const esp_lcd_panel_handle_t Ragot::DriverLCD::get_handler ( ) const
inline

Get the handler object.

Returns
const esp_lcd_panel_handle_t

◆ get_height() [1/2]

size_t Ragot::DriverLCD::get_height ( )
inline

Gets the height of the LCD panel.

Returns
size_t Height of the LCD panel in pixels.

◆ get_height() [2/2]

const size_t Ragot::DriverLCD::get_height ( ) const
inline

Gets the height of the LCD panel.

Returns
size_t Height of the LCD panel in pixels.

◆ get_pixel_format() [1/2]

lcd_color_rgb_pixel_format_t Ragot::DriverLCD::get_pixel_format ( )
inline

Get the pixel format object.

Returns
lcd_color_rgb_pixel_format_t

◆ get_pixel_format() [2/2]

const lcd_color_rgb_pixel_format_t Ragot::DriverLCD::get_pixel_format ( ) const
inline

Get the pixel format object.

Returns
const lcd_color_rgb_pixel_format_t

◆ get_width() [1/2]

size_t Ragot::DriverLCD::get_width ( )
inline

Gets the height of the LCD panel.

Returns
size_t Height of the LCD panel in pixels.

◆ get_width() [2/2]

const size_t Ragot::DriverLCD::get_width ( ) const
inline

Gets the width of the LCD panel.

Returns
size_t Width of the LCD panel in pixels.

◆ init()

virtual esp_err_t Ragot::DriverLCD::init ( gpio_num_t reset_pin,
gpio_num_t bk_pin )
pure virtual

Initializes the LCD driver with the specified reset and backlight GPIO pins.

This method should be implemented by derived classes to set up the LCD panel.

Parameters
reset_pinGPIO pin for panel reset.
bk_pinGPIO pin for backlight control.
Returns
esp_err_t ESP_OK on success, or an error code on failure.

Implemented in Ragot::Driver_ST7789, and Ragot::DriverEK79007.

◆ is_initialized() [1/2]

bool Ragot::DriverLCD::is_initialized ( )
inline

Checks if the LCD driver is initialized.

Returns
true
false

◆ is_initialized() [2/2]

const bool Ragot::DriverLCD::is_initialized ( ) const
inline

Checks if the LCD driver is initialized.

Returns
true
false

◆ send_frame_buffer()

virtual esp_err_t Ragot::DriverLCD::send_frame_buffer ( const void * frame_buffer)
pure virtual

Sends a frame buffer to the LCD panel.

This method should be implemented by derived classes to send the provided frame buffer to the panel for display.

Parameters
frame_bufferPointer to the frame buffer data.
Returns
esp_err_t ESP_OK on success, or an error code on failure.

Implemented in Ragot::Driver_ST7789, and Ragot::DriverEK79007.

◆ set_pixel()

virtual esp_err_t Ragot::DriverLCD::set_pixel ( uint32_t x,
uint32_t y,
uint32_t color )
pure virtual

Sets a pixel at the specified coordinates to the given color.

This method should be implemented by derived classes to set a pixel on the LCD panel.

Parameters
xX coordinate of the pixel.
yY coordinate of the pixel.
colorColor value for the pixel.
Returns
esp_err_t ESP_OK on success, or an error code on failure.

Implemented in Ragot::Driver_ST7789, and Ragot::DriverEK79007.

Member Data Documentation

◆ handler

esp_lcd_panel_handle_t Ragot::DriverLCD::handler
protected

Handle to the LCD panel.

◆ height

size_t Ragot::DriverLCD::height
protected

Height of the LCD panel in pixels.

◆ initialized

bool Ragot::DriverLCD::initialized = false
protected

Flag indicating if the LCD driver is initialized.

◆ pixel_format

lcd_color_rgb_pixel_format_t Ragot::DriverLCD::pixel_format
protected

Pixel format of the LCD panel.

◆ width

size_t Ragot::DriverLCD::width
protected

Width of the LCD panel in pixels.


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