Driver for the ST7789 LCD panel.
More...
#include <Driver_ST7789.hpp>
|
| 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.
|
|
| 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.
|
|
|
SemaphoreHandle_t | refresh_semaphore |
| Refresh semaphore for synchronizing frame buffer updates.
|
|
|
static constexpr const char * | TAG = "[Driver_ST7789]..." |
| Tag for logging messages related to the ST7789 driver.
|
|
|
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.
|
|
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.
◆ Driver_ST7789()
Ragot::Driver_ST7789::Driver_ST7789 |
( |
| ) |
|
Default constructor for the Driver_ST7789 class.
Initializes the LCD driver with default values.
◆ ~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.
◆ 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_pin | GPIO 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_pin | GPIO pin for panel reset. |
bk_pin | GPIO pin for backlight control. |
- Returns
- esp_err_t ESP_OK on success, or an error code on failure.
Implements Ragot::DriverLCD.
◆ 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
-
- Returns
- bool True if the frame buffer was refreshed successfully, false otherwise.
◆ 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_buffer | Pointer 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
-
x | X coordinate of the pixel. |
y | Y coordinate of the pixel. |
color | Color value for the pixel. |
- Returns
- esp_err_t ESP_FAIL as this method is not implemented.
Implements Ragot::DriverLCD.
◆ 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: