Files
xiaozhi-esp32/main/display/st7789_display.h

40 lines
1.1 KiB
C
Raw Normal View History

2024-11-06 10:06:05 +08:00
#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;
2024-11-16 03:25:55 +08:00
gpio_num_t backlight_pin_ = GPIO_NUM_NC;
bool backlight_output_invert_ = false;
2024-11-06 10:06:05 +08:00
bool mirror_x_ = false;
bool mirror_y_ = false;
2024-11-16 03:25:55 +08:00
bool swap_xy_ = false;
2024-11-18 06:17:39 +08:00
lv_obj_t* status_bar_ = nullptr;
lv_obj_t* content_ = nullptr;
lv_obj_t* container_ = nullptr;
lv_obj_t* side_bar_ = nullptr;
2024-11-06 10:06:05 +08:00
void InitializeBacklight(gpio_num_t backlight_pin);
void SetBacklight(uint8_t brightness);
2024-11-18 06:17:39 +08:00
void SetupUI();
2024-11-06 10:06:05 +08:00
virtual void Lock() override;
virtual void Unlock() override;
public:
2024-11-16 03:25:55 +08:00
St7789Display(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
gpio_num_t backlight_pin, bool backlight_output_invert,
2024-11-30 19:00:05 +08:00
int width, int height, int offset_x, int offset_y, bool mirror_x, bool mirror_y, bool swap_xy);
2024-11-06 10:06:05 +08:00
~St7789Display();
};
#endif // ST7789_DISPLAY_H