From 9e71db53410bd5cf8698c25c4bc12d3f5e5559b7 Mon Sep 17 00:00:00 2001 From: ZinggJM Date: Wed, 30 Oct 2024 11:17:52 +0100 Subject: [PATCH] Version 1.6.0 - updated support for GDEY029T94: fixed a partial refresh issue - updated support for GDEY042T81: fixed fast full refresh for 2024 panel version - updated support for GDEP073E01: fixed color mapping for its native color values - updated GxEPD2_display_selection_new_style.h: added Arduino Nano Every, Arduino Nano ESP32, Arduino Nano IoT. --- README.md | 7 +- examples/GxEPD2_Example/GxEPD2_Example.ino | 30 +++--- .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ .../GxEPD2_display_selection_new_style.h | 93 +++++++++++++------ library.properties | 2 +- src/GxEPD2_EPD.h | 1 + src/epd7c/GxEPD2_730c_GDEP073E01.cpp | 57 ++++++++++-- src/epd7c/GxEPD2_730c_GDEP073E01.h | 2 + src/gdey/GxEPD2_290_GDEY029T94.cpp | 1 + src/gdey/GxEPD2_290_GDEY029T94.h | 6 +- src/gdey/GxEPD2_420_GDEY042T81.cpp | 11 ++- src/gdey/GxEPD2_420_GDEY042T81.h | 3 + 21 files changed, 805 insertions(+), 338 deletions(-) diff --git a/README.md b/README.md index ec35a73..ee9edad 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,12 @@ - But only few panels at any time, and only panels from known sources. - Adding support will take as much time as needed. -### Version 1.5.9 +### Version 1.6.0 +- updated support for GDEY029T94: fixed a partial refresh issue +- updated support for GDEY042T81: fixed fast full refresh for 2024 panel version +- updated support for GDEP073E01: fixed color mapping for its native color values +- updated GxEPD2_display_selection_new_style.h: added Arduino Nano Every, Arduino Nano ESP32, Arduino Nano IoT. +#### Version 1.5.9 - added Power Save command (PWS) to GDEY075T7 init (issue with dithered bitmaps) - added support for GDEY0579T93 5.79" b/w 792x272, SSD1683 - added support for GDEY0579Z93 5.79" b/w/r 792x272, SSD1683 diff --git a/examples/GxEPD2_Example/GxEPD2_Example.ino b/examples/GxEPD2_Example/GxEPD2_Example.ino index 7586f3f..b8ad819 100644 --- a/examples/GxEPD2_Example/GxEPD2_Example.ino +++ b/examples/GxEPD2_Example/GxEPD2_Example.ino @@ -224,12 +224,14 @@ void setup() drawGraphics(); //display.powerOff(); return; #if !defined(__AVR) // takes too long! - if ((display.epd2.panel == GxEPD2::ACeP565) || (display.epd2.panel == GxEPD2::GDEY073D46) || (display.epd2.panel == GxEPD2::ACeP730) || (display.epd2.panel == GxEPD2::GDEP0565D90)) + if ((display.epd2.panel == GxEPD2::ACeP565) || (display.epd2.panel == GxEPD2::GDEY073D46) || (display.epd2.panel == GxEPD2::ACeP730) || + (display.epd2.panel == GxEPD2::GDEP0565D90) || (display.epd2.panel == GxEPD2::GDEP073E01)) { //draw7colorlines(); //delay(2000); draw7colors(); delay(4000); + display.epd2.drawNativeColors(); delay(2000); //return; } #endif @@ -811,6 +813,9 @@ void drawBitmaps() #ifdef _GxBitmaps104x212_H_ drawBitmaps104x212(); #endif +#ifdef _GxBitmaps200x200_H_ + drawBitmaps200x200(); +#endif #ifdef _GxBitmaps128x250_H_ drawBitmaps128x250(); #endif @@ -863,6 +868,9 @@ void drawBitmaps() #ifdef _GxBitmaps3c104x212_H_ drawBitmaps3c104x212(); #endif +#ifdef _GxBitmaps3c200x200_H_ + drawBitmaps3c200x200(); +#endif #ifdef _GxBitmaps3c128x250_H_ drawBitmaps3c128x250(); #endif @@ -892,24 +900,14 @@ void drawBitmaps() #endif #if defined(ESP32) && defined(_GxBitmaps3c960x680_H_) drawBitmaps3c960x680(); -#endif - if ((display.epd2.WIDTH >= 200) && (display.epd2.HEIGHT >= 200)) - { - // show these after the specific bitmaps -#ifdef _GxBitmaps200x200_H_ - drawBitmaps200x200(); #endif #if defined(ESP32) && defined(_GxBitmaps1360x480_H_) - drawBitmaps1360x480(); -#endif - // 3-color -#ifdef _GxBitmaps3c200x200_H_ - drawBitmaps3c200x200(); + drawBitmaps1360x480(); #endif + // 3-color #if defined(ESP32) && defined(_GxBitmaps3c800x276_H_) - drawBitmaps3c800x276(); + drawBitmaps3c800x276(); #endif - } // 4-color #if defined(_GxBitmaps4c128x250_H_) drawBitmaps4c128x250(); @@ -1859,9 +1857,9 @@ void drawBitmaps3c400x300() { {Bitmap3c400x300_1_black, Bitmap3c400x300_1_red}, {Bitmap3c400x300_2_black, Bitmap3c400x300_2_red}, + {WS_Bitmap3c400x300_black, WS_Bitmap3c400x300_red}, {Bitmap3c400x300_3_black, Bitmap3c400x300_3_red}, {Bitmap3c400x300_4_black, Bitmap3c400x300_4_red}, - {WS_Bitmap3c400x300_black, WS_Bitmap3c400x300_red} }; #else bitmap_pair bitmap_pairs[] = {}; // not enough code space @@ -1936,7 +1934,7 @@ void drawBitmaps3c800x276() display.writeImagePart(Bitmap3c800x276_black_1, Bitmap3c800x276_red_1, i * wp, j * hp, 800, 272, i * wp, j * hp, wp, hp, true, false, true); } } - } + } display.refresh(false); delay(2000); } diff --git a/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_RotaryUsingBusyCallback/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_RotaryUsingBusyCallback/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_RotaryUsingBusyCallback/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_RotaryUsingBusyCallback/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/examples/GxEPD2_WiFi_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_WiFi_Example/GxEPD2_display_selection_new_style.h index 6e31deb..ec02d61 100644 --- a/examples/GxEPD2_WiFi_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_WiFi_Example/GxEPD2_display_selection_new_style.h @@ -147,8 +147,26 @@ #include "GxEPD2_selection_check.h" -#if defined (ESP8266) -#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use +// for my test use only +//#if defined(_AVR) +//#warning "defined(_AVR)" +//#endif +//#if defined(ESP32) +//#warning "defined(ESP32)" +//#endif +//#if defined(ARDUINO_ARCH_ESP32) +//#warning "defined(ARDUINO_ARCH_ESP32)" +//#endif + +#if defined(ARDUINO_ARCH_AVR) +#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#elif defined(ARDUINO_AVR_NANO_EVERY) +#define EPD_CS 10 +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 // +#endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -157,16 +175,27 @@ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, new version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); -// mapping of Waveshare e-Paper ESP8266 Driver Board, old version -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); -#undef MAX_DISPLAY_BUFFER_SIZE -#undef MAX_HEIGHT +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif + +#if defined(ARDUINO_ARCH_MEGAAVR) +#if defined(ARDUINO_AVR_NANO_EVERY) +#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) +#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) +#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) +#endif +// adapt the constructor parameters to your wiring +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#endif #endif -#if defined(ESP32) +#if defined(ARDUINO_ARCH_ESP32) #define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g. #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) @@ -177,7 +206,9 @@ GxEPD2_DISPLAY_CLASS displ #endif // adapt the constructor parameters to your wiring #if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_1248c(GxEPD2_DRIVER_CLASS) -#if defined(ARDUINO_LOLIN_D32_PRO) +#if defined(ARDUINO_NANO_ESP32) // uses Dx pin names +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ D10, /*DC=*/ D8, /*RST=*/ D9, /*BUSY=*/ D7)); +#elif defined(ARDUINO_LOLIN_D32_PRO) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // my LOLIN_D32_PRO proto board #elif defined(ARDUINO_LOLIN_S2_MINI) GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS*/ 33, /*DC=*/ 35, /*RST=*/ 37, /*BUSY=*/ 39)); // my LOLIN ESP32 S2 mini connection @@ -202,9 +233,8 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #undef MAX_HEIGHT #endif -// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) -#if defined(ARDUINO_ARCH_STM32) -#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise +#if defined (ARDUINO_ARCH_ESP8266) +#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -213,21 +243,18 @@ GxEPD2_DISPLAY_CLASS < GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS) > di #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -// for Good Display STM32 Development Kit DESPI-L. -// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, new version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); +// mapping of Waveshare e-Paper ESP8266 Driver Board, old version +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif -#if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA -#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200 -#else // Note: SS is on 10 on UNO, NANO -#define MAX_DISPLAY_BUFFER_SIZE 800 // -#endif +// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics) +#if defined(ARDUINO_ARCH_STM32) +#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) || IS_GxEPD2_4C(GxEPD2_DISPLAY_CLASS) @@ -236,11 +263,16 @@ GxEPD2_DISPLAY_CLASS displ #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif // adapt the constructor parameters to your wiring -GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); -// for Arduino Micro or Arduino Leonardo with CS on 10 on my proto boards (SS would be 17) uncomment instead: -//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +// for Good Display STM32 Development Kit DESPI-L. +// needs jumpers from PA5 (PIN_SPI_SCK) to SCK for EPD and PA7 (PIN_SPI_MOSI) to SDI for EPD. PD9 and PD10 are not HW SPI capable. +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13)); +//GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ PD8, /*DC=*/ PE15, /*RST=*/ PE14, /*BUSY=*/ PE13, /*CS2=*/ PD12)); // for GDEM1085T51 +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=PA4*/ EPD_CS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // my proto board +#undef MAX_DISPLAY_BUFFER_SIZE +#undef MAX_HEIGHT #endif +#if defined(ARDUINO_ARCH_RENESAS) #if defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) #define MAX_DISPLAY_BUFFER_SIZE 16384ul // e.g. half of available RAM #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -253,6 +285,7 @@ GxEPD2_DISPLAY_CLASS displ // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif +#endif #if defined(ARDUINO_ARCH_SAM) #define MAX_DISPLAY_BUFFER_SIZE 32768ul // e.g., up to 96k @@ -278,10 +311,14 @@ GxEPD2_DISPLAY_CLASS displ #elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) #endif +#if defined(ARDUINO_SAMD_NANO_33_IOT) +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +#else // adapt the constructor parameters to your wiring GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 4, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // my Seed XIOA0 //GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=4*/ 3, /*DC=*/ 2, /*RST=*/ 1, /*BUSY=*/ 0)); // my other Seed XIOA0 +#endif #undef MAX_DISPLAY_BUFFER_SIZE #undef MAX_HEIGHT #endif diff --git a/library.properties b/library.properties index 59bc05c..6567df4 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=GxEPD2 -version=1.5.9 +version=1.6.0 author=Jean-Marc Zingg maintainer=Jean-Marc Zingg sentence=Arduino Display Library for SPI E-Paper displays from Dalian Good Display and Waveshare. diff --git a/src/GxEPD2_EPD.h b/src/GxEPD2_EPD.h index 0c222ba..e7a08c5 100644 --- a/src/GxEPD2_EPD.h +++ b/src/GxEPD2_EPD.h @@ -88,6 +88,7 @@ class GxEPD2_EPD virtual void hibernate() = 0; // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) virtual void setPaged() {}; // for GxEPD2_154c paged workaround virtual void selectFastFullUpdate(bool) {}; // for some panels that support this + virtual void drawNativeColors() {}; // for test (7-color native mapping) // register a callback function to be called during _waitWhileBusy continuously. void setBusyCallback(void (*busyCallback)(const void*), const void* busy_callback_parameter = 0); static inline uint16_t gx_uint16_min(uint16_t a, uint16_t b) diff --git a/src/epd7c/GxEPD2_730c_GDEP073E01.cpp b/src/epd7c/GxEPD2_730c_GDEP073E01.cpp index 4bfdc0b..fdd00a2 100644 --- a/src/epd7c/GxEPD2_730c_GDEP073E01.cpp +++ b/src/epd7c/GxEPD2_730c_GDEP073E01.cpp @@ -369,6 +369,7 @@ void GxEPD2_730c_GDEP073E01::writeNative(const uint8_t* data1, const uint8_t* da for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(h) / 2; i++) { uint8_t data = data1[i]; + if (!invert) data = _convert_to_native(data); _transfer(data); } _endTransfer(); @@ -409,7 +410,7 @@ void GxEPD2_730c_GDEP073E01::writeNative(const uint8_t* data1, const uint8_t* da { data = data1[idx]; } - if (invert) data = ~data; + if (!invert) data = _convert_to_native(data); } } _transfer(data); @@ -472,7 +473,7 @@ void GxEPD2_730c_GDEP073E01::writeNativePart(const uint8_t* data1, const uint8_t { data = data1[idx]; } - if (invert) data = ~data; + if (!invert) data = _convert_to_native(data); } _transfer(data); } @@ -672,11 +673,11 @@ uint8_t GxEPD2_730c_GDEP073E01::_colorOfDemoBitmap(uint8_t from, int16_t mode) switch (from) { case 0xFF: return (0x01); // white; - case 0xFC: return (0x05); // yellow; - case 0xF1: return (0x06); // orange; - case 0xE5: return (0x04); // red; - case 0x4B: return (0x03); // blue; - case 0x39: return (0x02); // green; + case 0xFC: return (0x02); // yellow; + case 0xF1: return (0x04); // orange; + case 0xE5: return (0x03); // red; + case 0x4B: return (0x05); // blue; + case 0x39: return (0x06); // green; case 0x00: return (0x00); // black; default: return (0x01); // white; } @@ -761,3 +762,45 @@ void GxEPD2_730c_GDEP073E01::drawDemoBitmap(const uint8_t* data1, const uint8_t* writeDemoBitmap(data1, data2, x, y, w, h, mode, mirror_y, pgm); refresh(x, y, w, h); } + +void GxEPD2_730c_GDEP073E01::drawNativeColors() +{ + const uint16_t colors = 7; + //const uint16_t colors = 8; // 7 is white + //const uint16_t colors = 16; // repeated for 8..15 + const uint16_t h1 = HEIGHT / colors; + _writeCommand(0x10); + _startTransfer(); + for (uint16_t cn = 0; cn < colors; cn++) + { + for (uint16_t hnb = 0; hnb < h1 * WIDTH / 2; hnb++) + { + _transfer((cn << 4) | cn); + } + } + _endTransfer(); + refresh(); +} + +uint8_t GxEPD2_730c_GDEP073E01::_convert_to_native(uint8_t data) +{ + uint8_t result = 0x00; + for (int i = 0; i < 2; i++) + { + switch (data & 0x07) + { + case 0x00 : result |= 0x00 << 4; break; // black + case 0x01 : result |= 0x01 << 4; break; // white + case 0x02 : result |= 0x06 << 4; break; // green + case 0x03 : result |= 0x05 << 4; break; // blue + case 0x04 : result |= 0x03 << 4; break; // red + case 0x05 : result |= 0x02 << 4; break; // yellow + case 0x06 : result |= 0x04 << 4; break; // orange + case 0x07 : result |= 0x07 << 4; break; // white + } + if (i == 1) break; + data >>= 4; + result >>= 4; + } + return result; +} diff --git a/src/epd7c/GxEPD2_730c_GDEP073E01.h b/src/epd7c/GxEPD2_730c_GDEP073E01.h index a887072..40569ec 100644 --- a/src/epd7c/GxEPD2_730c_GDEP073E01.h +++ b/src/epd7c/GxEPD2_730c_GDEP073E01.h @@ -66,11 +66,13 @@ class GxEPD2_730c_GDEP073E01 : public GxEPD2_EPD void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) void setPaged(); // for GxEPD2_154c and GxEPD2_565c and GxEPD2_730c_GDEP073E01 paged workaround + void drawNativeColors(); private: uint8_t _colorOfDemoBitmap(uint8_t from, int16_t mode = 0); void _PowerOn(); void _PowerOff(); void _InitDisplay(); + uint8_t _convert_to_native(uint8_t data); // uses different native colors private: bool _paged; }; diff --git a/src/gdey/GxEPD2_290_GDEY029T94.cpp b/src/gdey/GxEPD2_290_GDEY029T94.cpp index 522f1ae..6b9b576 100644 --- a/src/gdey/GxEPD2_290_GDEY029T94.cpp +++ b/src/gdey/GxEPD2_290_GDEY029T94.cpp @@ -66,6 +66,7 @@ void GxEPD2_290_GDEY029T94::writeImageForFullRefresh(const uint8_t bitmap[], int void GxEPD2_290_GDEY029T94::writeImageAgain(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) { + _writeImage(0x26, bitmap, x, y, w, h, invert, mirror_y, pgm); // set previous _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm); // set current } diff --git a/src/gdey/GxEPD2_290_GDEY029T94.h b/src/gdey/GxEPD2_290_GDEY029T94.h index 601aed7..8df0ae0 100644 --- a/src/gdey/GxEPD2_290_GDEY029T94.h +++ b/src/gdey/GxEPD2_290_GDEY029T94.h @@ -29,9 +29,9 @@ class GxEPD2_290_GDEY029T94 : public GxEPD2_EPD static const bool hasFastPartialUpdate = true; static const bool useFastFullUpdate = true; // set false for extended (low) temperature range static const uint16_t power_on_time = 100; // ms, e.g. 95868us - static const uint16_t power_off_time = 150; // ms, e.g. 140350us - static const uint16_t full_refresh_time = 1700; // ms, e.g. 1616000us - static const uint16_t partial_refresh_time = 500; // ms, e.g. 403000us + static const uint16_t power_off_time = 150; // ms, e.g. 140001us + static const uint16_t full_refresh_time = 1750; // ms, e.g. 1715001us + static const uint16_t partial_refresh_time = 400; // ms, e.g. 362000us // constructor GxEPD2_290_GDEY029T94(int16_t cs, int16_t dc, int16_t rst, int16_t busy); // methods (virtual) diff --git a/src/gdey/GxEPD2_420_GDEY042T81.cpp b/src/gdey/GxEPD2_420_GDEY042T81.cpp index ea509e3..9bd7b38 100644 --- a/src/gdey/GxEPD2_420_GDEY042T81.cpp +++ b/src/gdey/GxEPD2_420_GDEY042T81.cpp @@ -16,6 +16,12 @@ GxEPD2_420_GDEY042T81::GxEPD2_420_GDEY042T81(int16_t cs, int16_t dc, int16_t rst, int16_t busy) : GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate) { + _use_fast_update = useFastFullUpdate; +} + +void GxEPD2_420_GDEY042T81::selectFastFullUpdate(bool ff) +{ + _use_fast_update = ff; } void GxEPD2_420_GDEY042T81::clearScreen(uint8_t value) @@ -362,10 +368,11 @@ void GxEPD2_420_GDEY042T81::_Update_Full() _writeCommand(0x21); // Display Update Controll _writeData(0x40); // bypass RED as 0 _writeData(0x00); // single chip application - if (useFastFullUpdate) + if (_use_fast_update) { _writeCommand(0x1A); // Write to temperature register - _writeData(0x64); + //_writeData(0x64); // 2023 version + _writeData(0x6E); // 2024 version, ok for 2023 version _writeCommand(0x22); _writeData(0xd7); } diff --git a/src/gdey/GxEPD2_420_GDEY042T81.h b/src/gdey/GxEPD2_420_GDEY042T81.h index 0df9828..d2bab8f 100644 --- a/src/gdey/GxEPD2_420_GDEY042T81.h +++ b/src/gdey/GxEPD2_420_GDEY042T81.h @@ -66,6 +66,7 @@ class GxEPD2_420_GDEY042T81 : public GxEPD2_EPD void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) + void selectFastFullUpdate(bool); private: void _writeScreenBuffer(uint8_t command, uint8_t value); void _writeImage(uint8_t command, const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); @@ -77,6 +78,8 @@ class GxEPD2_420_GDEY042T81 : public GxEPD2_EPD void _InitDisplay(); void _Update_Full(); void _Update_Part(); + private: + bool _use_fast_update; }; #endif