diff --git a/Boards/LilygoTLoraPager/Source/hal/TpagerDisplay.cpp b/Boards/LilygoTLoraPager/Source/hal/TpagerDisplay.cpp index 4736f022..d4ac7a06 100644 --- a/Boards/LilygoTLoraPager/Source/hal/TpagerDisplay.cpp +++ b/Boards/LilygoTLoraPager/Source/hal/TpagerDisplay.cpp @@ -19,7 +19,9 @@ std::shared_ptr createDisplay() { true, //swapXY true, //mirrorX true, //mirrorY - true //invertColor + true, //invertColor + 0, //gapX + 49 //gapY ); configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty; diff --git a/Drivers/ST7796/README.md b/Drivers/ST7796/README.md index 2f6c6fb7..eae8f783 100644 --- a/Drivers/ST7796/README.md +++ b/Drivers/ST7796/README.md @@ -1,3 +1,3 @@ -# ST7789 +# ST7796 -A basic ESP32 LVGL driver for ST7789 displays. +A basic ESP32 LVGL driver for ST7796 displays. diff --git a/Drivers/ST7796/Source/St7796Display.cpp b/Drivers/ST7796/Source/St7796Display.cpp index 58aad133..22ae268f 100644 --- a/Drivers/ST7796/Source/St7796Display.cpp +++ b/Drivers/ST7796/Source/St7796Display.cpp @@ -123,7 +123,7 @@ bool St7796Display::start() { return false; } - if (esp_lcd_panel_set_gap(panelHandle, 0, 49) != ESP_OK) { + if (esp_lcd_panel_set_gap(panelHandle, configuration->gapX, configuration->gapY) != ESP_OK) { TT_LOG_E(TAG, "Failed to set panel gap"); return false; } diff --git a/Drivers/ST7796/Source/St7796Display.h b/Drivers/ST7796/Source/St7796Display.h index edbea517..3b7bf0a8 100644 --- a/Drivers/ST7796/Source/St7796Display.h +++ b/Drivers/ST7796/Source/St7796Display.h @@ -28,6 +28,8 @@ public: bool mirrorX = false, bool mirrorY = false, bool invertColor = false, + unsigned int gapX = 0, + unsigned int gapY = 0, uint32_t bufferSize = 0 // Size in pixel count. 0 means default, which is 1/10 of the screen size ) : spiBusHandle(spi_bus_handle), csPin(csPin), @@ -38,6 +40,8 @@ public: mirrorX(mirrorX), mirrorY(mirrorY), invertColor(invertColor), + gapX(gapX), + gapY(gapY), bufferSize(bufferSize), touch(std::move(touch)) {} @@ -53,6 +57,8 @@ public: bool mirrorX = false; bool mirrorY = false; bool invertColor = false; + unsigned int gapX = 0; + unsigned int gapY = 0; uint32_t bufferSize = 0; // Size in pixel count. 0 means default, which is 1/10 of the screen size std::shared_ptr touch; std::function _Nullable backlightDutyFunction = nullptr;