-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgfx_system.cpp
More file actions
26 lines (20 loc) · 764 Bytes
/
gfx_system.cpp
File metadata and controls
26 lines (20 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <Arduino.h>
#include <ESP_Panel_Library.h>
#include <lvgl.h>
#include "lvgl_port_v8.h"
void gfx_system_init()
{
Serial.println("GFX system init");
Serial.println("Initialize panel device");
ESP_Panel *panel = new ESP_Panel();
panel->init();
#if LVGL_PORT_AVOID_TEAR
// When avoid tearing function is enabled, configure the RGB bus according to the LVGL configuration
ESP_PanelBus_RGB *rgb_bus = static_cast<ESP_PanelBus_RGB *>(panel->getLcd()->getBus());
rgb_bus->configRgbFrameBufferNumber(LVGL_PORT_DISP_BUFFER_NUM);
rgb_bus->configRgbBounceBufferSize(LVGL_PORT_RGB_BOUNCE_BUFFER_SIZE);
#endif
panel->begin();
Serial.println("Initialize LVGL");
lvgl_port_init(panel->getLcd(), panel->getTouch());
}