From 7014e64fed7de0050cb098a052fa9fe914700f60 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sun, 3 Jan 2021 08:08:03 +0100 Subject: [PATCH] st7789 support for LANBON_L8 --- .../Arduino_ST7789-gemu-1.0/Arduino_ST7789.cpp | 7 +++++-- tasmota/xdsp_12_ST7789.ino | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/lib_display/Arduino_ST7789-gemu-1.0/Arduino_ST7789.cpp b/lib/lib_display/Arduino_ST7789-gemu-1.0/Arduino_ST7789.cpp index 74837242b..47312c50a 100644 --- a/lib/lib_display/Arduino_ST7789-gemu-1.0/Arduino_ST7789.cpp +++ b/lib/lib_display/Arduino_ST7789-gemu-1.0/Arduino_ST7789.cpp @@ -96,8 +96,11 @@ Arduino_ST7789::Arduino_ST7789(int8_t dc, int8_t rst, int8_t cs, int8_t bp) void Arduino_ST7789::DisplayInit(int8_t p,int8_t size,int8_t rot,int8_t font) { setRotation(rot); - //invertDisplay(false); - invertDisplay(true); + if (_width==320 || _height==320) { + invertDisplay(false); + } else { + invertDisplay(true); + } //setTextWrap(false); // Allow text to run off edges //cp437(true); setTextFont(font&3); diff --git a/tasmota/xdsp_12_ST7789.ino b/tasmota/xdsp_12_ST7789.ino index cdb9ad167..80cf4d6e5 100644 --- a/tasmota/xdsp_12_ST7789.ino +++ b/tasmota/xdsp_12_ST7789.ino @@ -45,6 +45,10 @@ // currently fixed #define BACKPLANE_PIN 2 + #ifdef USE_LANBON_L8 + #undef BACKPLANE_PIN + #define BACKPLANE_PIN 5 + #endif // USE_LANBON_L8 extern uint8_t *buffer; extern uint8_t color_type; @@ -126,6 +130,12 @@ void ST7789_InitDriver(void) { // start digitizer with fixed adress and pins for esp32 #define SDA_2 23 #define SCL_2 32 + #ifdef USE_LANBON_L8 + #undef SDA_2 + #undef SCL_2 + #define SDA_2 4 + #define SCL_2 0 + #endif // USE_LANBON_L8 Wire1.begin(SDA_2, SCL_2, 400000); Touch_Init(Wire1); #endif // USE_FT5206