Adafruit Library
ws_display_driver.h
Go to the documentation of this file.
1 
15 #ifndef WIPPERSNAPPER_DISPLAY_H
16 #define WIPPERSNAPPER_DISPLAY_H
17 
18 #include "Wippersnapper.h"
19 #include "provisioning/Config.h"
20 #include <Adafruit_LvGL_Glue.h> // Always include this BEFORE lvgl.h!
21 #include <Adafruit_ST7789.h>
22 #include <lvgl.h>
23 
24 LV_FONT_DECLARE(errorTriangle);
25 
26 class Wippersnapper; // fwd decl
27 
28 /***************************************************************************/
32 /***************************************************************************/
34 public:
36  ws_display_driver(displayConfig config);
38 
39  bool begin();
40  void setResolution(uint16_t displayWidth, uint16_t displayHeight);
41  void setRotation(uint8_t rotationMode);
42  void enableLogging();
43  Adafruit_LvGL_Glue *_glue;
44  void esp32_lvgl_acquire();
45  void esp32_lvgl_release();
46 
47 private:
48  Adafruit_ST7789 *_tft_st7789 = nullptr;
49  uint16_t _displayWidth;
50  uint16_t _displayHeight;
51  uint8_t
52  _displayRotationMode;
53 };
54 extern Wippersnapper WS;
55 
56 #endif // WIPPERSNAPPER_DISPLAY_H
void esp32_lvgl_acquire()
Acquires the LVGL_Glue lock.
Definition: ws_display_driver.cpp:134
bool begin()
Initializes the display and the lvgl_glue driver.
Definition: ws_display_driver.cpp:94
Class that provides storage and functions for the Adafruit IO Wippersnapper interface.
Definition: Wippersnapper.h:283
Display driver for LVGL and LVGL_Glue in WipperSnapper.
Definition: ws_display_driver.h:33
Adafruit_LvGL_Glue * _glue
LVGL glue object.
Definition: ws_display_driver.h:43
void setResolution(uint16_t displayWidth, uint16_t displayHeight)
Sets the display resolution, must be called BEFORE begin()!
Definition: ws_display_driver.cpp:82
void esp32_lvgl_release()
Releases the LVGL_Glue lock.
Definition: ws_display_driver.cpp:141
~ws_display_driver()
Deletes a new WipperSnapper display driver object.
Definition: ws_display_driver.cpp:48
LV_FONT_DECLARE(errorTriangle)
Error triangle symbol/font.
Wippersnapper WS
Definition: Wippersnapper.cpp:36
void setRotation(uint8_t rotationMode)
Sets the display&#39;s rotation mode.
Definition: ws_display_driver.cpp:69
void enableLogging()
Enables LVGL logging using the usb serial. Must be called AFTER calling Serial.begin().
Definition: ws_display_driver.cpp:60