3D Graphics Engine for ESP32
 
Loading...
Searching...
No Matches
Ragot::Driver_ST7789 Class Reference

Driver for the ST7789 LCD panel. More...

#include <Driver_ST7789.hpp>

Inheritance diagram for Ragot::Driver_ST7789:
Inheritance graph
Collaboration diagram for Ragot::Driver_ST7789:
Collaboration graph

Public Member Functions

 Driver_ST7789 ()
 Default constructor for the Driver_ST7789 class.
 
virtual ~Driver_ST7789 ()=default
 Default virtual destructor for the Driver_ST7789 class.
 
esp_err_t init (gpio_num_t reset_pin, gpio_num_t bk_pin) override
 Initializes the ST7789 LCD panel driver.
 
esp_err_t deinit () override
 Deinitializes the ST7789 LCD panel driver.
 
esp_err_t set_pixel (uint32_t x, uint32_t y, uint32_t color) override
 Sets a pixel at the specified coordinates to the given color.
 
esp_err_t send_frame_buffer (const void *frame_buffer) override
 Sends a frame buffer to the ST7789 LCD panel.
 
IRAM_ATTR bool refresh_frame_buffer (void *user_ctx)
 Refreshes the frame buffer for the ST7789 LCD panel.
 
- Public Member Functions inherited from Ragot::DriverLCD
 DriverLCD ()=default
 Default constructor for the DriverLCD class.
 
virtual ~DriverLCD ()=default
 Default virtual destructor for the DriverLCD class.
 
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.
 

Public Attributes

SemaphoreHandle_t refresh_semaphore
 Refresh semaphore for synchronizing frame buffer updates.
 

Private Member Functions

void bsp_init_lcd_backlight (gpio_num_t bk_pin)
 Initializes the LCD backlight GPIO pin.
 

Static Private Attributes

static constexpr const char * TAG = "[Driver_ST7789]..."
 Tag for logging messages related to the ST7789 driver.
 

Additional Inherited Members

- Protected Attributes inherited from Ragot::DriverLCD
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

Driver for the ST7789 LCD panel.

This class provides methods to initialize, deinitialize, and send frame buffers to the ST7789 LCD panel. It inherits from the DriverLCD class and implements the necessary methods for LCD operations.

Constructor & Destructor Documentation

◆ Driver_ST7789()

Ragot::Driver_ST7789::Driver_ST7789 ( )

Default constructor for the Driver_ST7789 class.

Initializes the LCD driver with default values.

Here is the call graph for this function:

◆ ~Driver_ST7789()

virtual Ragot::Driver_ST7789::~Driver_ST7789 ( )
virtualdefault

Default virtual destructor for the Driver_ST7789 class.

Cleans up resources used by the LCD driver.

Member Function Documentation

◆ bsp_init_lcd_backlight()

void Ragot::Driver_ST7789::bsp_init_lcd_backlight ( gpio_num_t bk_pin)
private

Initializes the LCD backlight GPIO pin.

This method sets up the specified GPIO pin for controlling the LCD backlight.

Parameters
bk_pinGPIO pin for backlight control.

◆ deinit()

esp_err_t Ragot::Driver_ST7789::deinit ( )
overridevirtual

Deinitializes the ST7789 LCD panel driver.

This method cleans up resources used by the driver, including deleting the panel handler and freeing the refresh semaphore.

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

Implements Ragot::DriverLCD.

◆ init()

esp_err_t Ragot::Driver_ST7789::init ( gpio_num_t reset_pin,
gpio_num_t bk_pin )
overridevirtual

Initializes the ST7789 LCD panel driver.

This method sets up the LCD panel with the specified reset and backlight GPIO pins. It configures the panel's pixel format, width, height, and other parameters.

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.

Implements Ragot::DriverLCD.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refresh_frame_buffer()

IRAM_ATTR bool Ragot::Driver_ST7789::refresh_frame_buffer ( void * user_ctx)

Refreshes the frame buffer for the ST7789 LCD panel.

Note
This method is called from the ISR context and should be used to signal that the frame buffer has been updated.
Parameters
user_ctx
Returns
bool True if the frame buffer was refreshed successfully, false otherwise.
Here is the caller graph for this function:

◆ send_frame_buffer()

esp_err_t Ragot::Driver_ST7789::send_frame_buffer ( const void * frame_buffer)
overridevirtual

Sends a frame buffer to the ST7789 LCD panel.

This method sends the provided frame buffer to the panel for display. It waits for the refresh semaphore to be available before sending the frame buffer.

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

Implements Ragot::DriverLCD.

◆ set_pixel()

esp_err_t Ragot::Driver_ST7789::set_pixel ( uint32_t x,
uint32_t y,
uint32_t color )
inlineoverridevirtual

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

This method is not implemented for the ST7789 driver and will return ESP_FAIL.

Parameters
xX coordinate of the pixel.
yY coordinate of the pixel.
colorColor value for the pixel.
Returns
esp_err_t ESP_FAIL as this method is not implemented.

Implements Ragot::DriverLCD.

Member Data Documentation

◆ refresh_semaphore

SemaphoreHandle_t Ragot::Driver_ST7789::refresh_semaphore

Refresh semaphore for synchronizing frame buffer updates.

◆ TAG

const char* Ragot::Driver_ST7789::TAG = "[Driver_ST7789]..."
staticconstexprprivate

Tag for logging messages related to the ST7789 driver.


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