Files
xiaozhi-esp32/main/Display.h

37 lines
749 B
C
Raw Normal View History

2024-10-01 14:16:12 +08:00
#ifndef DISPLAY_H
#define DISPLAY_H
2024-10-03 06:39:22 +08:00
#include <driver/i2c_master.h>
#include <esp_lcd_panel_io.h>
#include <esp_lcd_panel_ops.h>
#include <lvgl.h>
2024-10-15 03:56:35 +08:00
#include <esp_timer.h>
2024-10-01 14:16:12 +08:00
#include <string>
class Display {
public:
Display(int sda_pin, int scl_pin);
~Display();
void SetText(const std::string &text);
2024-10-15 03:56:35 +08:00
void ShowNotification(const std::string &text);
2024-10-01 14:16:12 +08:00
private:
int sda_pin_;
int scl_pin_;
i2c_master_bus_handle_t i2c_bus_ = nullptr;
esp_lcd_panel_io_handle_t panel_io_ = nullptr;
esp_lcd_panel_handle_t panel_ = nullptr;
lv_disp_t *disp_ = nullptr;
lv_obj_t *label_ = nullptr;
2024-10-15 03:56:35 +08:00
lv_obj_t *notification_ = nullptr;
esp_timer_handle_t notification_timer_ = nullptr;
2024-10-01 14:16:12 +08:00
std::string text_;
};
#endif