From b9f25eb85cee2712da5ff20ab17a92677e079e32 Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Wed, 1 Jun 2022 11:21:09 +0200 Subject: [PATCH] Update EInkDisplay2.cpp --- src/graphics/EInkDisplay2.cpp | 44 +++++++++++++---------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 073b313c..71606d44 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -31,6 +31,11 @@ //4.2 inch 300x400 - GxEPD2_420_M01 #define TECHO_DISPLAY_MODEL GxEPD2_420_M01 +#elif defined(PRIVATE_HW) +//M5Stack CoreInk +//1.54 inch 200x200 - GxEPD2_154_M09 +#define TECHO_DISPLAY_MODEL GxEPD2_154_M09 + #endif GxEPD2_BW *adafruitDisplay; @@ -58,6 +63,12 @@ EInkDisplay::EInkDisplay(uint8_t address, int sda, int scl) //GxEPD2_420_M01 setGeometry(GEOMETRY_RAWMODE, 300, 400); + #elif defined(PRIVATE_HW) + + //M5Stack_CoreInk 200x200 + //1.54 inch 200x200 - GxEPD2_154_M09 + setGeometry(GEOMETRY_RAWMODE, 200, 200); + #endif // setGeometry(GEOMETRY_RAWMODE, 128, 64); // old resolution // setGeometry(GEOMETRY_128_64); // We originally used this because I wasn't sure if rawmode worked - it does @@ -108,7 +119,7 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit) // 4.2 inch 300x400 - GxEPD2_420_M01 //adafruitDisplay->nextPage(); - #elif defined(PCA10059) + #elif defined(PCA10059) || defined(PRIVATE_HW) adafruitDisplay->nextPage(); #endif @@ -180,40 +191,15 @@ bool EInkDisplay::connect() adafruitDisplay->init(115200, true, 10, false, SPI1, SPISettings(4000000, MSBFIRST, SPI_MODE0)); //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates - //RAK14000 2.13 inch b/w 250x122 does not support partial updates adafruitDisplay->setRotation(3); //For 1.54, 2.9 and 4.2 //adafruitDisplay->setRotation(1); - - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); - adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); + //adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); } else { (void)adafruitDisplay; } } -#elif defined(PCA10059) +#elif defined(PCA10059) || defined(PRIVATE_HW) { auto lowLevel = new TECHO_DISPLAY_MODEL(PIN_EINK_CS, PIN_EINK_DC, PIN_EINK_RES, PIN_EINK_BUSY); adafruitDisplay = new GxEPD2_BW(*lowLevel); @@ -221,6 +207,8 @@ bool EInkDisplay::connect() adafruitDisplay->setRotation(3); adafruitDisplay->setPartialWindow(0, 0, displayWidth, displayHeight); } +#elif defined(PRIVATE_HW) + adafruitDisplay->setRotation(0); #endif