add st7789

This commit is contained in:
Terrence
2024-11-06 10:06:05 +08:00
parent 3575448373
commit 20deb2b777
13 changed files with 250 additions and 28 deletions

View File

@@ -0,0 +1,29 @@
#ifndef ST7789_DISPLAY_H
#define ST7789_DISPLAY_H
#include "display.h"
#include <driver/gpio.h>
#include <esp_lcd_panel_io.h>
#include <esp_lcd_panel_ops.h>
class St7789Display : public Display {
private:
esp_lcd_panel_io_handle_t panel_io_ = nullptr;
esp_lcd_panel_handle_t panel_ = nullptr;
bool mirror_x_ = false;
bool mirror_y_ = false;
void InitializeBacklight(gpio_num_t backlight_pin);
void SetBacklight(uint8_t brightness);
virtual void Lock() override;
virtual void Unlock() override;
public:
St7789Display(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel, gpio_num_t backlight_pin,
int width, int height, bool mirror_x, bool mirror_y);
~St7789Display();
};
#endif // ST7789_DISPLAY_H