T5-4.7-S3 Epaper Pro support (#6625)

* preliminary io pin definitions

* Update product link

* Move to new variant structure and refactor inkHUD - Display does not work and SX1262 init fails on HT752-02

* update variant definitions

* add EPD driver

* fix lora, add v1/v2 variant targets

* adapt pins for v1/v2

* alt button

* add compile guards

* use lilygo epd47 lib

* workaround for INT ERR_NOT_FOUND

* USE_EPD (e-ink parallel display)

* use FastEPD driver

* create screen

* EInkParallelDisplay definition

* setup screen

* dispaly() implementation

* enable touchscreen

* rotate touch screen

* refactor display buffer processing

* provide local copy of TwoWire instance as the touch driver calls end()

* use larger fonts

* replace touch driver; enable debugging

* replace touch driver; enable debugging

* consider bitsremain == 0

* tryfix crash

* fix button

* update touch driver

* set lora_cs pin

* update touch driver and lib reference

* add locks

* limit Ghosting similar to EInkDynamicDisplay

* workaround for FastEPD partial update bug (artifacts)

* display() code cleanup

* fix a few platformio definitions

* more EPD display cleanup

* set rotation

* use FastEPD arduino I2C by default

* touch rotation

* update screen for EPD

* increase swipe distance for larger screen

* EPD UIRenderer

* trunk fmt

* further #ifdef USE_EPD

* disable rotation which messes up w/h; more cleanup

* switch off ghosting algo

* releease build; V1 buttons

* swap V1 buttons

* rearrange USE_EINK/EPD macros, use large font

* cleanup (revert modified files)

* more cleanup

* revert

* revert file

* revert file

Removed redundant line continuation in preprocessor directives.

* Temporary gate off PSRam calculations until we can fix them

* move variant.cpp and update commit references

* revert wrong merge

* add earlyInitVariant()

* initialize all port 0 pins (0-7) as outputs / HIGH

---------

Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Jason P <applewiz@mac.com>
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Manuel
2026-03-25 16:52:18 +01:00
committed by GitHub
parent d693fd4232
commit 3b079c91bf
14 changed files with 927 additions and 11 deletions

View File

@@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "configuration.h"
#include "meshUtils.h"
#if HAS_SCREEN
#include "EInkParallelDisplay.h"
#include <OLEDDisplay.h>
#include "DisplayFormatters.h"
@@ -364,12 +365,14 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O
defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS) || defined(HACKADAY_COMMUNICATOR)
dispdev = new TFTDisplay(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
#elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY)
#elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY) && !defined(USE_EINK_PARALLELDISPLAY)
dispdev = new EInkDisplay(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
#elif defined(USE_EINK) && defined(USE_EINK_DYNAMICDISPLAY)
dispdev = new EInkDynamicDisplay(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
#elif defined(USE_EINK_PARALLELDISPLAY)
dispdev = new EInkParallelDisplay(EPD_WIDTH, EPD_HEIGHT, EInkParallelDisplay::EPD_ROT_PORTRAIT);
#elif defined(USE_ST7567)
dispdev = new ST7567Wire(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
@@ -759,7 +762,11 @@ void Screen::forceDisplay(bool forceUiUpdate)
}
// Tell EInk class to update the display
#if defined(USE_EINK_PARALLELDISPLAY)
static_cast<EInkParallelDisplay *>(dispdev)->forceDisplay();
#elif defined(USE_EINK)
static_cast<EInkDisplay *>(dispdev)->forceDisplay();
#endif
#else
// No delay between UI frame rendering
if (forceUiUpdate) {
@@ -998,8 +1005,10 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver)
ui->update();
} while (ui->getUiState()->lastUpdate < startUpdate);
#if defined(USE_EINK_PARALLELDISPLAY)
static_cast<EInkParallelDisplay *>(dispdev)->forceDisplay(0);
#elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY)
// Old EInkDisplay class
#if !defined(USE_EINK_DYNAMICDISPLAY)
static_cast<EInkDisplay *>(dispdev)->forceDisplay(0); // Screen::forceDisplay(), but override rate-limit
#endif
@@ -1011,7 +1020,7 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver)
#ifdef EINK_HASQUIRK_GHOSTING
EINK_ADD_FRAMEFLAG(dispdev, COSMETIC); // Really ugly to see ghosting from "screen paused"
#else
EINK_ADD_FRAMEFLAG(dispdev, RESPONSIVE); // Really nice to wake screen with a fast-refresh
EINK_ADD_FRAMEFLAG(dispdev, RESPONSIVE); // Really nice to wake screen with a fast-refresh
#endif
}
#endif