oled_display.h 977 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef OLED_DISPLAY_H
  2. #define OLED_DISPLAY_H
  3. #include "display.h"
  4. #include <esp_lcd_panel_io.h>
  5. #include <esp_lcd_panel_ops.h>
  6. class OledDisplay : public Display {
  7. private:
  8. esp_lcd_panel_io_handle_t panel_io_ = nullptr;
  9. esp_lcd_panel_handle_t panel_ = nullptr;
  10. lv_obj_t* status_bar_ = nullptr;
  11. lv_obj_t* content_ = nullptr;
  12. lv_obj_t* content_left_ = nullptr;
  13. lv_obj_t* content_right_ = nullptr;
  14. lv_obj_t* container_ = nullptr;
  15. lv_obj_t* side_bar_ = nullptr;
  16. DisplayFonts fonts_;
  17. virtual bool Lock(int timeout_ms = 0) override;
  18. virtual void Unlock() override;
  19. void SetupUI_128x64();
  20. void SetupUI_128x32();
  21. public:
  22. OledDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel, int width, int height, bool mirror_x, bool mirror_y,
  23. DisplayFonts fonts);
  24. ~OledDisplay();
  25. virtual void SetChatMessage(const char* role, const char* content) override;
  26. };
  27. #endif // OLED_DISPLAY_H