diff --git a/README.md b/README.md index 10ab08e..932049c 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ - GDEM029T94 2.9" b/w - GDEW029M06 2.9" b/w DES - GDEW029Z10 2.9" b/w/r +- GDEM029C90 2.9" b/w/y - GDEW026T0 2.6" b/w - GDEW026M01 2.6" b/w DES - GDEW027C44 2.7" b/w/r @@ -95,7 +96,12 @@ - promotion panels from suppliers are welcome, to add support to GxEPD2 - donation panels from users are welcome, to add support to GxEPD2 -### Version 1.3.0 +### Version 1.3.1 +- added support for GDEM029C90 128x296 b/w/y e-paper panel +- GDEM029C90 has a very long refresh time of about 27 seconds +- GDEM029C90 has partial update (window addressing) of controller memory +- GDEM029C90 supports only full refresh of screen +#### Version 1.3.0 - added support for GDEM029T94 128x296 b/w e-paper panel - added support for GDEW026M01 152x296 b/w new DES e-paper panel - the new GDEW026M01 DES b/w e-paper panel has higher contrast and wide temperature range diff --git a/examples/GxEPD2_Example/GxEPD2_Example.ino b/examples/GxEPD2_Example/GxEPD2_Example.ino index ec5c904..a0bd890 100644 --- a/examples/GxEPD2_Example/GxEPD2_Example.ino +++ b/examples/GxEPD2_Example/GxEPD2_Example.ino @@ -1294,7 +1294,7 @@ void drawBitmaps3c128x296() {WS_Bitmap3c128x296_black, WS_Bitmap3c128x296_red} }; #endif - if (display.epd2.panel == GxEPD2::GDEW029Z10) + if ((display.epd2.WIDTH == 128) && (display.epd2.HEIGHT == 296) && display.epd2.hasColor) { for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++) { @@ -1302,12 +1302,12 @@ void drawBitmaps3c128x296() do { display.fillScreen(GxEPD_WHITE); - display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK); + display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, 128, 296, GxEPD_BLACK); if (bitmap_pairs[i].red == WS_Bitmap3c128x296_red) { - display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED); + display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, 128, 296, GxEPD_RED); } - else display.drawBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED); + else display.drawBitmap(0, 0, bitmap_pairs[i].red, 128, 296, GxEPD_RED); } while (display.nextPage()); delay(2000); diff --git a/examples/GxEPD2_Example/GxEPD2_display_selection.h b/examples/GxEPD2_Example/GxEPD2_display_selection.h index 079a089..19c3a75 100644 --- a/examples/GxEPD2_Example/GxEPD2_display_selection.h +++ b/examples/GxEPD2_Example/GxEPD2_display_selection.h @@ -45,6 +45,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW027C44 // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW042Z15 @@ -94,6 +95,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW027C44 // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW042Z15 @@ -137,6 +139,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW042Z15 //GxEPD2_3C display(GxEPD2_583c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0583Z21 @@ -195,6 +198,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW042Z15 //GxEPD2_3C display(GxEPD2_583c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0583Z21 @@ -207,52 +211,53 @@ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 -#define MAX_DISPLAY_BUFFER_SIZE 800 // +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 #endif #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) // select one and adapt to your mapping -//GxEPD2_BW display(GxEPD2_154(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEP015OC1 no longer available -//GxEPD2_BW display(GxEPD2_154_D67(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154D67 -//GxEPD2_BW display(GxEPD2_154_T8(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154T8 152x152 -//GxEPD2_BW display(GxEPD2_154_M09(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M09 200x200 -//GxEPD2_BW display(GxEPD2_154_M10(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M10 152x152 -//GxEPD2_BW display(GxEPD2_213(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDE0213B1, phased out -//GxEPD2_BW display(GxEPD2_213_B72(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B72 -//GxEPD2_BW display(GxEPD2_213_B73(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 -//GxEPD2_BW display(GxEPD2_213_flex(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F -//GxEPD2_BW display(GxEPD2_213_M21(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 -//GxEPD2_BW display(GxEPD2_290(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029A1 -//GxEPD2_BW display(GxEPD2_290_T5(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 -//GxEPD2_BW display(GxEPD2_290_T94(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029T94 -//GxEPD2_BW display(GxEPD2_290_M06(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 -//GxEPD2_BW display(GxEPD2_260(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026T0 -//GxEPD2_BW display(GxEPD2_260_M01(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026M01 -//GxEPD2_BW display(GxEPD2_270(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027W3 -//GxEPD2_BW display(GxEPD2_371(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0371W7 -//GxEPD2_BW display(GxEPD2_420(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042T2 -//GxEPD2_BW display(GxEPD2_420_M01(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042M01 -//GxEPD2_BW display(GxEPD2_583(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T7 -//GxEPD2_BW display(GxEPD2_583_T8(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T8 648x480 -//GxEPD2_BW display(GxEPD2_750(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T8 640x384 -//GxEPD2_BW display(GxEPD2_750_T7(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T7 800x480 +//GxEPD2_BW display(GxEPD2_154(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEP015OC1 no longer available +//GxEPD2_BW display(GxEPD2_154_D67(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154D67 +//GxEPD2_BW display(GxEPD2_154_T8(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154T8 152x152 +//GxEPD2_BW display(GxEPD2_154_M09(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M09 200x200 +//GxEPD2_BW display(GxEPD2_154_M10(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M10 152x152 +//GxEPD2_BW display(GxEPD2_213(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDE0213B1, phased out +//GxEPD2_BW display(GxEPD2_213_B72(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B72 +//GxEPD2_BW display(GxEPD2_213_B73(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 +//GxEPD2_BW display(GxEPD2_213_flex(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F +//GxEPD2_BW display(GxEPD2_213_M21(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_290(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029A1 +//GxEPD2_BW display(GxEPD2_290_T5(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T94(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029T94 +//GxEPD2_BW display(GxEPD2_290_M06(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 +//GxEPD2_BW display(GxEPD2_260(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026T0 +//GxEPD2_BW display(GxEPD2_260_M01(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026M01 +//GxEPD2_BW display(GxEPD2_270(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027W3 +//GxEPD2_BW display(GxEPD2_371(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0371W7 +//GxEPD2_BW display(GxEPD2_420(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042T2 +//GxEPD2_BW display(GxEPD2_420_M01(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042M01 +//GxEPD2_BW display(GxEPD2_583(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T7 +//GxEPD2_BW display(GxEPD2_583_T8(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T8 648x480 +//GxEPD2_BW display(GxEPD2_750(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T8 640x384 +//GxEPD2_BW display(GxEPD2_750_T7(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T7 800x480 // 3-color e-papers #define MAX_HEIGHT_3C(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) -//GxEPD2_3C display(GxEPD2_154c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available -//GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 -//GxEPD2_3C display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16 -//GxEPD2_3C display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029Z10 -//GxEPD2_3C display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027C44 -//GxEPD2_3C display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042Z15 -//GxEPD2_3C display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583Z21 -//GxEPD2_3C display(GxEPD2_750c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z09 -//GxEPD2_3C display(GxEPD2_750c_Z08(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z08 800x480 -//GxEPD2_3C display(GxEPD2_750c_Z90(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH075Z90 880x528 +//GxEPD2_3C display(GxEPD2_154c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available +//GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 +//GxEPD2_3C display(GxEPD2_213c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_290c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 +//GxEPD2_3C display(GxEPD2_270c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027C44 +//GxEPD2_3C display(GxEPD2_420c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042Z15 +//GxEPD2_3C display(GxEPD2_583c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583Z21 +//GxEPD2_3C display(GxEPD2_750c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z09 +//GxEPD2_3C display(GxEPD2_750c_Z08(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z08 800x480 +//GxEPD2_3C display(GxEPD2_750c_Z90(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH075Z90 880x528 // 7-color e-paper #define MAX_HEIGHT_7C(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) // 2 pixel per byte -//GxEPD2_7C display(GxEPD2_565c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // Waveshare 5.65" 7-color +//GxEPD2_7C display(GxEPD2_565c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // Waveshare 5.65" 7-color // ***** for mapping of Waveshare Universal e-Paper Raw Panel Driver Shield for Arduino / NUCLEO ***** // the RST line is not connected through level converter, but has a pull up resistor and a pull down diode to the Arduino pin; this is safe for 5V Arduino @@ -290,6 +295,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW042Z15 //GxEPD2_3C display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0583Z21 diff --git a/examples/GxEPD2_Example/GxEPD2_display_selection_added.h b/examples/GxEPD2_Example/GxEPD2_display_selection_added.h index 0b023fb..b4fb1d1 100644 --- a/examples/GxEPD2_Example/GxEPD2_display_selection_added.h +++ b/examples/GxEPD2_Example/GxEPD2_display_selection_added.h @@ -50,6 +50,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_290c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_420c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_583c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); @@ -104,6 +105,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_583c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); @@ -153,6 +155,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_583c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); @@ -201,6 +204,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_583c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); @@ -251,6 +255,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); diff --git a/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h index 0794a17..ad9a171 100644 --- a/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) diff --git a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection.h b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection.h index 079a089..19c3a75 100644 --- a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection.h +++ b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection.h @@ -45,6 +45,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW027C44 // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW042Z15 @@ -94,6 +95,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW027C44 // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW042Z15 @@ -137,6 +139,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW042Z15 //GxEPD2_3C display(GxEPD2_583c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0583Z21 @@ -195,6 +198,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW042Z15 //GxEPD2_3C display(GxEPD2_583c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0583Z21 @@ -207,52 +211,53 @@ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 -#define MAX_DISPLAY_BUFFER_SIZE 800 // +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 #endif #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) // select one and adapt to your mapping -//GxEPD2_BW display(GxEPD2_154(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEP015OC1 no longer available -//GxEPD2_BW display(GxEPD2_154_D67(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154D67 -//GxEPD2_BW display(GxEPD2_154_T8(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154T8 152x152 -//GxEPD2_BW display(GxEPD2_154_M09(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M09 200x200 -//GxEPD2_BW display(GxEPD2_154_M10(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M10 152x152 -//GxEPD2_BW display(GxEPD2_213(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDE0213B1, phased out -//GxEPD2_BW display(GxEPD2_213_B72(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B72 -//GxEPD2_BW display(GxEPD2_213_B73(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 -//GxEPD2_BW display(GxEPD2_213_flex(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F -//GxEPD2_BW display(GxEPD2_213_M21(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 -//GxEPD2_BW display(GxEPD2_290(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029A1 -//GxEPD2_BW display(GxEPD2_290_T5(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 -//GxEPD2_BW display(GxEPD2_290_T94(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029T94 -//GxEPD2_BW display(GxEPD2_290_M06(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 -//GxEPD2_BW display(GxEPD2_260(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026T0 -//GxEPD2_BW display(GxEPD2_260_M01(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026M01 -//GxEPD2_BW display(GxEPD2_270(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027W3 -//GxEPD2_BW display(GxEPD2_371(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0371W7 -//GxEPD2_BW display(GxEPD2_420(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042T2 -//GxEPD2_BW display(GxEPD2_420_M01(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042M01 -//GxEPD2_BW display(GxEPD2_583(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T7 -//GxEPD2_BW display(GxEPD2_583_T8(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T8 648x480 -//GxEPD2_BW display(GxEPD2_750(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T8 640x384 -//GxEPD2_BW display(GxEPD2_750_T7(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T7 800x480 +//GxEPD2_BW display(GxEPD2_154(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEP015OC1 no longer available +//GxEPD2_BW display(GxEPD2_154_D67(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154D67 +//GxEPD2_BW display(GxEPD2_154_T8(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154T8 152x152 +//GxEPD2_BW display(GxEPD2_154_M09(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M09 200x200 +//GxEPD2_BW display(GxEPD2_154_M10(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M10 152x152 +//GxEPD2_BW display(GxEPD2_213(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDE0213B1, phased out +//GxEPD2_BW display(GxEPD2_213_B72(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B72 +//GxEPD2_BW display(GxEPD2_213_B73(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 +//GxEPD2_BW display(GxEPD2_213_flex(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F +//GxEPD2_BW display(GxEPD2_213_M21(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_290(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029A1 +//GxEPD2_BW display(GxEPD2_290_T5(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T94(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029T94 +//GxEPD2_BW display(GxEPD2_290_M06(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 +//GxEPD2_BW display(GxEPD2_260(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026T0 +//GxEPD2_BW display(GxEPD2_260_M01(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026M01 +//GxEPD2_BW display(GxEPD2_270(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027W3 +//GxEPD2_BW display(GxEPD2_371(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0371W7 +//GxEPD2_BW display(GxEPD2_420(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042T2 +//GxEPD2_BW display(GxEPD2_420_M01(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042M01 +//GxEPD2_BW display(GxEPD2_583(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T7 +//GxEPD2_BW display(GxEPD2_583_T8(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T8 648x480 +//GxEPD2_BW display(GxEPD2_750(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T8 640x384 +//GxEPD2_BW display(GxEPD2_750_T7(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T7 800x480 // 3-color e-papers #define MAX_HEIGHT_3C(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) -//GxEPD2_3C display(GxEPD2_154c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available -//GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 -//GxEPD2_3C display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16 -//GxEPD2_3C display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029Z10 -//GxEPD2_3C display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027C44 -//GxEPD2_3C display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042Z15 -//GxEPD2_3C display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583Z21 -//GxEPD2_3C display(GxEPD2_750c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z09 -//GxEPD2_3C display(GxEPD2_750c_Z08(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z08 800x480 -//GxEPD2_3C display(GxEPD2_750c_Z90(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH075Z90 880x528 +//GxEPD2_3C display(GxEPD2_154c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available +//GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 +//GxEPD2_3C display(GxEPD2_213c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_290c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 +//GxEPD2_3C display(GxEPD2_270c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027C44 +//GxEPD2_3C display(GxEPD2_420c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042Z15 +//GxEPD2_3C display(GxEPD2_583c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583Z21 +//GxEPD2_3C display(GxEPD2_750c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z09 +//GxEPD2_3C display(GxEPD2_750c_Z08(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z08 800x480 +//GxEPD2_3C display(GxEPD2_750c_Z90(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH075Z90 880x528 // 7-color e-paper #define MAX_HEIGHT_7C(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) // 2 pixel per byte -//GxEPD2_7C display(GxEPD2_565c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // Waveshare 5.65" 7-color +//GxEPD2_7C display(GxEPD2_565c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // Waveshare 5.65" 7-color // ***** for mapping of Waveshare Universal e-Paper Raw Panel Driver Shield for Arduino / NUCLEO ***** // the RST line is not connected through level converter, but has a pull up resistor and a pull down diode to the Arduino pin; this is safe for 5V Arduino @@ -290,6 +295,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW042Z15 //GxEPD2_3C display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0583Z21 diff --git a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_added.h b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_added.h index 0b023fb..b4fb1d1 100644 --- a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_added.h +++ b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_added.h @@ -50,6 +50,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_290c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_420c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_583c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); @@ -104,6 +105,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_583c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); @@ -153,6 +155,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_583c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); @@ -201,6 +204,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_583c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); @@ -251,6 +255,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); 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 0794a17..ad9a171 100644 --- a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) diff --git a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection.h b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection.h index 079a089..19c3a75 100644 --- a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection.h +++ b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection.h @@ -45,6 +45,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW027C44 // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW042Z15 @@ -94,6 +95,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW027C44 // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW042Z15 @@ -137,6 +139,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW042Z15 //GxEPD2_3C display(GxEPD2_583c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0583Z21 @@ -195,6 +198,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW042Z15 //GxEPD2_3C display(GxEPD2_583c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0583Z21 @@ -207,52 +211,53 @@ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 -#define MAX_DISPLAY_BUFFER_SIZE 800 // +#else // Note: SS is on 10 on UNO, NANO +#define MAX_DISPLAY_BUFFER_SIZE 800 #endif #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) // select one and adapt to your mapping -//GxEPD2_BW display(GxEPD2_154(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEP015OC1 no longer available -//GxEPD2_BW display(GxEPD2_154_D67(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154D67 -//GxEPD2_BW display(GxEPD2_154_T8(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154T8 152x152 -//GxEPD2_BW display(GxEPD2_154_M09(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M09 200x200 -//GxEPD2_BW display(GxEPD2_154_M10(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M10 152x152 -//GxEPD2_BW display(GxEPD2_213(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDE0213B1, phased out -//GxEPD2_BW display(GxEPD2_213_B72(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B72 -//GxEPD2_BW display(GxEPD2_213_B73(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 -//GxEPD2_BW display(GxEPD2_213_flex(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F -//GxEPD2_BW display(GxEPD2_213_M21(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 -//GxEPD2_BW display(GxEPD2_290(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029A1 -//GxEPD2_BW display(GxEPD2_290_T5(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 -//GxEPD2_BW display(GxEPD2_290_T94(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029T94 -//GxEPD2_BW display(GxEPD2_290_M06(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 -//GxEPD2_BW display(GxEPD2_260(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026T0 -//GxEPD2_BW display(GxEPD2_260_M01(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026M01 -//GxEPD2_BW display(GxEPD2_270(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027W3 -//GxEPD2_BW display(GxEPD2_371(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0371W7 -//GxEPD2_BW display(GxEPD2_420(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042T2 -//GxEPD2_BW display(GxEPD2_420_M01(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042M01 -//GxEPD2_BW display(GxEPD2_583(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T7 -//GxEPD2_BW display(GxEPD2_583_T8(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T8 648x480 -//GxEPD2_BW display(GxEPD2_750(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T8 640x384 -//GxEPD2_BW display(GxEPD2_750_T7(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T7 800x480 +//GxEPD2_BW display(GxEPD2_154(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEP015OC1 no longer available +//GxEPD2_BW display(GxEPD2_154_D67(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154D67 +//GxEPD2_BW display(GxEPD2_154_T8(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154T8 152x152 +//GxEPD2_BW display(GxEPD2_154_M09(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M09 200x200 +//GxEPD2_BW display(GxEPD2_154_M10(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154M10 152x152 +//GxEPD2_BW display(GxEPD2_213(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDE0213B1, phased out +//GxEPD2_BW display(GxEPD2_213_B72(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B72 +//GxEPD2_BW display(GxEPD2_213_B73(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 +//GxEPD2_BW display(GxEPD2_213_flex(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F +//GxEPD2_BW display(GxEPD2_213_M21(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_290(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029A1 +//GxEPD2_BW display(GxEPD2_290_T5(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T94(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029T94 +//GxEPD2_BW display(GxEPD2_290_M06(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 +//GxEPD2_BW display(GxEPD2_260(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026T0 +//GxEPD2_BW display(GxEPD2_260_M01(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026M01 +//GxEPD2_BW display(GxEPD2_270(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027W3 +//GxEPD2_BW display(GxEPD2_371(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0371W7 +//GxEPD2_BW display(GxEPD2_420(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042T2 +//GxEPD2_BW display(GxEPD2_420_M01(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042M01 +//GxEPD2_BW display(GxEPD2_583(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T7 +//GxEPD2_BW display(GxEPD2_583_T8(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583T8 648x480 +//GxEPD2_BW display(GxEPD2_750(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T8 640x384 +//GxEPD2_BW display(GxEPD2_750_T7(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075T7 800x480 // 3-color e-papers #define MAX_HEIGHT_3C(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8)) -//GxEPD2_3C display(GxEPD2_154c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available -//GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 -//GxEPD2_3C display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16 -//GxEPD2_3C display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029Z10 -//GxEPD2_3C display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027C44 -//GxEPD2_3C display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042Z15 -//GxEPD2_3C display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583Z21 -//GxEPD2_3C display(GxEPD2_750c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z09 -//GxEPD2_3C display(GxEPD2_750c_Z08(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z08 800x480 -//GxEPD2_3C display(GxEPD2_750c_Z90(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH075Z90 880x528 +//GxEPD2_3C display(GxEPD2_154c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available +//GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 +//GxEPD2_3C display(GxEPD2_213c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_290c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 +//GxEPD2_3C display(GxEPD2_270c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027C44 +//GxEPD2_3C display(GxEPD2_420c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042Z15 +//GxEPD2_3C display(GxEPD2_583c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0583Z21 +//GxEPD2_3C display(GxEPD2_750c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z09 +//GxEPD2_3C display(GxEPD2_750c_Z08(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z08 800x480 +//GxEPD2_3C display(GxEPD2_750c_Z90(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH075Z90 880x528 // 7-color e-paper #define MAX_HEIGHT_7C(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) // 2 pixel per byte -//GxEPD2_7C display(GxEPD2_565c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // Waveshare 5.65" 7-color +//GxEPD2_7C display(GxEPD2_565c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // Waveshare 5.65" 7-color // ***** for mapping of Waveshare Universal e-Paper Raw Panel Driver Shield for Arduino / NUCLEO ***** // the RST line is not connected through level converter, but has a pull up resistor and a pull down diode to the Arduino pin; this is safe for 5V Arduino @@ -290,6 +295,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213Z16 //GxEPD2_3C display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW042Z15 //GxEPD2_3C display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0583Z21 diff --git a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_added.h b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_added.h index 0b023fb..b4fb1d1 100644 --- a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_added.h +++ b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_added.h @@ -50,6 +50,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_290c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_420c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_583c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); @@ -104,6 +105,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_583c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); @@ -153,6 +155,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_583c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); @@ -201,6 +204,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_583c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); @@ -251,6 +255,7 @@ //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); diff --git a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h index 0794a17..ad9a171 100644 --- a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) diff --git a/examples/GxEPD2_MinimumExample/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_MinimumExample/GxEPD2_display_selection_new_style.h index 0794a17..ad9a171 100644 --- a/examples/GxEPD2_MinimumExample/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_MinimumExample/GxEPD2_display_selection_new_style.h @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) diff --git a/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h index 0794a17..ad9a171 100644 --- a/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) diff --git a/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h index 0794a17..ad9a171 100644 --- a/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) 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 0794a17..ad9a171 100644 --- a/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) 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 0794a17..ad9a171 100644 --- a/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) 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 0794a17..ad9a171 100644 --- a/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) diff --git a/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_U8G2_Fonts_Example.ino b/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_U8G2_Fonts_Example.ino index 9dada7d..112dcf1 100644 --- a/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_U8G2_Fonts_Example.ino +++ b/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_U8G2_Fonts_Example.ino @@ -62,6 +62,10 @@ void loop() { } +const char HelloWorld[] = "Hello World!"; +const char HelloArduino[] = "Hello Arduino!"; +const char HelloEpaper[] = "Hello E-Paper!"; + void helloWorld() { //Serial.println("helloWorld"); @@ -72,14 +76,22 @@ void helloWorld() u8g2Fonts.setForegroundColor(fg); // apply Adafruit GFX color u8g2Fonts.setBackgroundColor(bg); // apply Adafruit GFX color u8g2Fonts.setFont(u8g2_font_helvR14_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall - uint16_t x = (display.width() - 160) / 2; - uint16_t y = display.height() / 2; + int16_t tw = u8g2Fonts.getUTF8Width(HelloWorld); // text box width + int16_t ta = u8g2Fonts.getFontAscent(); // positive + int16_t td = u8g2Fonts.getFontDescent(); // negative; in mathematicians view + int16_t th = ta - td; // text box height + //Serial.print("ascent, descent ("); Serial.print(u8g2Fonts.getFontAscent()); Serial.print(", "); Serial.print(u8g2Fonts.getFontDescent()); Serial.println(")"); + // center bounding box by transposition of origin: + // y is base line for u8g2Fonts, like for Adafruit_GFX True Type fonts + uint16_t x = (display.width() - tw) / 2; + uint16_t y = (display.height() - th) / 2 + ta; + //Serial.print("bounding box ("); Serial.print(x); Serial.print(", "); Serial.print(y); Serial.print(", "); Serial.print(tw); Serial.print(", "); Serial.print(th); Serial.println(")"); display.firstPage(); do { display.fillScreen(bg); u8g2Fonts.setCursor(x, y); // start writing at this position - u8g2Fonts.print("Hello World!"); + u8g2Fonts.print(HelloWorld); } while (display.nextPage()); //Serial.println("helloWorld done"); @@ -95,15 +107,19 @@ void helloArduino() u8g2Fonts.setForegroundColor(fg); // apply Adafruit GFX color u8g2Fonts.setBackgroundColor(bg); // apply Adafruit GFX color u8g2Fonts.setFont(u8g2_font_helvR14_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall - uint16_t x = (display.width() - 160) / 2; - uint16_t y = display.height() / 4; + int16_t tw = u8g2Fonts.getUTF8Width(HelloArduino); // text box width + int16_t ta = u8g2Fonts.getFontAscent(); // positive + int16_t td = u8g2Fonts.getFontDescent(); // negative; in mathematicians view + int16_t th = ta - td; // text box height + uint16_t x = (display.width() - tw) / 2; + uint16_t y = display.height() / 4 - th / 2 + ta; display.setPartialWindow(0, y - 14, display.width(), 20); display.firstPage(); do { display.fillScreen(bg); u8g2Fonts.setCursor(x, y); - u8g2Fonts.println("Hello Arduino!"); + u8g2Fonts.print(HelloArduino); } while (display.nextPage()); //Serial.println("helloArduino done"); @@ -119,15 +135,19 @@ void helloEpaper() u8g2Fonts.setForegroundColor(fg); // apply Adafruit GFX color u8g2Fonts.setBackgroundColor(bg); // apply Adafruit GFX color u8g2Fonts.setFont(u8g2_font_helvR14_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall - uint16_t x = (display.width() - 160) / 2; - uint16_t y = display.height() * 3 / 4; + int16_t tw = u8g2Fonts.getUTF8Width(HelloArduino); // text box width + int16_t ta = u8g2Fonts.getFontAscent(); // positive + int16_t td = u8g2Fonts.getFontDescent(); // negative; in mathematicians view + int16_t th = ta - td; // text box height + uint16_t x = (display.width() - tw) / 2; + uint16_t y = display.height() * 3 / 4 - th / 2 + ta; display.setPartialWindow(0, y - 14, display.width(), 20); display.firstPage(); do { display.fillScreen(bg); u8g2Fonts.setCursor(x, y); - u8g2Fonts.println("Hello E-Paper!"); + u8g2Fonts.print(HelloEpaper); } while (display.nextPage()); //Serial.println("helloEpaper done"); 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 0794a17..ad9a171 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 @@ -48,10 +48,11 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 -//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 600x384 +//#define GxEPD2_DRIVER_CLASS GxEPD2_750c // GDEW075Z09 640x384 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z08 // GDEW075Z08 800x480 //#define GxEPD2_DRIVER_CLASS GxEPD2_750c_Z90 // GDEH075Z90 880x528 //#define GxEPD2_DRIVER_CLASS GxEPD2_1248 // GDEW1248T3 1303x984 @@ -139,9 +140,9 @@ GxEPD2_DISPLAY_CLASS displ #endif #if defined(__AVR) -#if defined (ARDUINO_AVR_MEGA2560) +#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 +#else // Note: SS is on 10 on UNO, NANO #define MAX_DISPLAY_BUFFER_SIZE 800 // #endif #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) @@ -152,7 +153,7 @@ 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=10*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +GxEPD2_DISPLAY_CLASS display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); #endif #if defined(ARDUINO_ARCH_SAM) diff --git a/examples/GxEPD2_WS_ESP32_Driver/GxEPD2_WS_ESP32_Driver.ino b/examples/GxEPD2_WS_ESP32_Driver/GxEPD2_WS_ESP32_Driver.ino index 81921c6..bac1bd2 100644 --- a/examples/GxEPD2_WS_ESP32_Driver/GxEPD2_WS_ESP32_Driver.ino +++ b/examples/GxEPD2_WS_ESP32_Driver/GxEPD2_WS_ESP32_Driver.ino @@ -70,6 +70,7 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 diff --git a/examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino b/examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino index 9064588..f3471fe 100644 --- a/examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino +++ b/examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino @@ -67,6 +67,7 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 diff --git a/library.properties b/library.properties index 88105a6..2c7638e 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=GxEPD2 -version=1.3.0 +version=1.3.1 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.h b/src/GxEPD2.h index e6589fb..427c414 100644 --- a/src/GxEPD2.h +++ b/src/GxEPD2.h @@ -67,6 +67,7 @@ class GxEPD2 GDEH0154Z90, Waveshare_1_54_bwr_Z90 = GDEH0154Z90, GDEW0213Z16, Waveshare_2_13_bwr = GDEW0213Z16, GDEW029Z10, Waveshare_2_9_bwr = GDEW029Z10, + GDEM029C90, GDEW027C44, Waveshare_2_7_bwr = GDEW027C44, GDEW042Z15, Waveshare_4_2_bwr = GDEW042Z15, GDEW0583Z21, Waveshare_5_83_bwr = GDEW0583Z21, diff --git a/src/GxEPD2_3C.h b/src/GxEPD2_3C.h index 0ac1cd4..d29d9b7 100644 --- a/src/GxEPD2_3C.h +++ b/src/GxEPD2_3C.h @@ -34,6 +34,7 @@ #include "epd3c/GxEPD2_154_Z90c.h" #include "epd3c/GxEPD2_213c.h" #include "epd3c/GxEPD2_290c.h" +#include "epd3c/GxEPD2_290_C90c.h" #include "epd3c/GxEPD2_270c.h" #include "epd3c/GxEPD2_420c.h" #include "epd3c/GxEPD2_583c.h" diff --git a/src/epd3c/GxEPD2_213c.cpp b/src/epd3c/GxEPD2_213c.cpp index 5134ed9..299ae0f 100644 --- a/src/epd3c/GxEPD2_213c.cpp +++ b/src/epd3c/GxEPD2_213c.cpp @@ -250,7 +250,7 @@ void GxEPD2_213c::drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_ } void GxEPD2_213c::drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, - int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) { writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); refresh(x, y, w, h); @@ -263,7 +263,7 @@ void GxEPD2_213c::drawImage(const uint8_t* black, const uint8_t* color, int16_t } void GxEPD2_213c::drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, - int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) { writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); refresh(x, y, w, h); @@ -360,8 +360,8 @@ void GxEPD2_213c::_InitDisplay() //_waitWhileBusy("_wakeUp Power On"); _writeCommand(0X00); _writeData(0x8f); - _writeCommand(0X50); - _writeData(0x37); //VCOM AND DATA INTERVAL SETTING + _writeCommand(0x50); //VCOM AND DATA INTERVAL SETTING + _writeData(0x77); //WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 _writeCommand(0x61); //resolution setting _writeData (0x68); //source 104 _writeData (0x00); @@ -377,8 +377,9 @@ void GxEPD2_213c::_Init_Full() void GxEPD2_213c::_Init_Part() { _InitDisplay(); - _writeCommand(0X50); - _writeData(0xF7); //WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 + _writeCommand(0x50); //VCOM AND DATA INTERVAL SETTING + _writeData(0x77); //WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 + //_writeData(0xF7); //WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 _PowerOn(); } diff --git a/src/epd3c/GxEPD2_290_C90c.cpp b/src/epd3c/GxEPD2_290_C90c.cpp new file mode 100644 index 0000000..14e73e9 --- /dev/null +++ b/src/epd3c/GxEPD2_290_C90c.cpp @@ -0,0 +1,396 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: SSD1680 : https://v4.cecdn.yun300.cn/100001_1909185148/SSD1680.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#include "GxEPD2_290_C90c.h" + +GxEPD2_290_C90c::GxEPD2_290_C90c(int8_t cs, int8_t dc, int8_t rst, int8_t busy) : + GxEPD2_EPD(cs, dc, rst, busy, HIGH, 30000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate) +{ +} + +void GxEPD2_290_C90c::clearScreen(uint8_t value) +{ + clearScreen(value, 0xFF); +} + +void GxEPD2_290_C90c::clearScreen(uint8_t black_value, uint8_t color_value) +{ + _initial_write = false; // initial full screen buffer clean done + _Init_Part(); + _setPartialRamArea(0, 0, WIDTH, HEIGHT); + _writeCommand(0x24); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(black_value); + } + _writeCommand(0x26); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(~color_value); + } + _Update_Part(); +} + +void GxEPD2_290_C90c::writeScreenBuffer(uint8_t value) +{ + writeScreenBuffer(value, 0xFF); +} + +void GxEPD2_290_C90c::writeScreenBuffer(uint8_t black_value, uint8_t color_value) +{ + _initial_write = false; // initial full screen buffer clean done + _Init_Part(); + _setPartialRamArea(0, 0, WIDTH, HEIGHT); + _writeCommand(0x24); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(black_value); + } + _writeCommand(0x26); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(~color_value); + } +} + +void GxEPD2_290_C90c::writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(bitmap, NULL, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_C90c::writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + int16_t wb = (w + 7) / 8; // width bytes, bitmaps are padded + x -= x % 8; // byte boundary + w = wb * 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + _Init_Part(); + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(0x24); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data = 0xFF; + if (black) + { + // use wb, h of bitmap for index! + int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&black[idx]); +#else + data = black[idx]; +#endif + } + else + { + data = black[idx]; + } + if (invert) data = ~data; + } + _writeData(data); + } + } + _writeCommand(0x26); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data = 0xFF; + if (color) + { + // use wb, h of bitmap for index! + int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&color[idx]); +#else + data = color[idx]; +#endif + } + else + { + data = color[idx]; + } + if (invert) data = ~data; + } + _writeData(~data); + } + } + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_290_C90c::writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(bitmap, NULL, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_C90c::writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0)) return; + if ((x_part < 0) || (x_part >= w_bitmap)) return; + if ((y_part < 0) || (y_part >= h_bitmap)) return; + int16_t wb_bitmap = (w_bitmap + 7) / 8; // width bytes, bitmaps are padded + x_part -= x_part % 8; // byte boundary + w = w_bitmap - x_part < w ? w_bitmap - x_part : w; // limit + h = h_bitmap - y_part < h ? h_bitmap - y_part : h; // limit + x -= x % 8; // byte boundary + w = 8 * ((w + 7) / 8); // byte boundary, bitmaps are padded + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + if (!_using_partial_mode) _Init_Part(); + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(0x24); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data; + // use wb_bitmap, h_bitmap of bitmap for index! + int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&black[idx]); +#else + data = black[idx]; +#endif + } + else + { + data = black[idx]; + } + if (invert) data = ~data; + _writeData(data); + } + } + _writeCommand(0x26); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data = 0xFF; + if (color) + { + // use wb_bitmap, h_bitmap of bitmap for index! + int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&color[idx]); +#else + data = color[idx]; +#endif + } + else + { + data = color[idx]; + } + if (invert) data = ~data; + } + _writeData(~data); + } + } + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_290_C90c::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (data1) + { + writeImage(data1, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_290_C90c::drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_C90c::drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_C90c::drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(black, color, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_C90c::drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_C90c::drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_C90c::refresh(bool partial_update_mode) +{ + if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT); + else _Update_Full(); +} + +void GxEPD2_290_C90c::refresh(int16_t x, int16_t y, int16_t w, int16_t h) +{ + x -= x % 8; // byte boundary + w -= x % 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + w1 -= x1 - x; + h1 -= y1 - y; + _Init_Part(); + _setPartialRamArea(x1, y1, w1, h1); + _Update_Part(); +} + +void GxEPD2_290_C90c::powerOff() +{ + _PowerOff(); +} + +void GxEPD2_290_C90c::hibernate() +{ + _PowerOff(); + if (_rst >= 0) + { + _writeCommand(0x10); // deep sleep mode + _writeData(0x1); // enter deep sleep + _hibernating = true; + } +} + +void GxEPD2_290_C90c::_setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h) +{ + _writeCommand(0x44); + _writeData(x / 8); + _writeData((x + w - 1) / 8); + _writeCommand(0x45); + _writeData(y % 256); + _writeData(y / 256); + _writeData((y + h - 1) % 256); + _writeData((y + h - 1) / 256); + _writeCommand(0x4e); + _writeData(x / 8); + _writeCommand(0x4f); + _writeData(y % 256); + _writeData(y / 256); +} + +void GxEPD2_290_C90c::_PowerOn() +{ + if (!_power_is_on) + { + _writeCommand(0x22); + _writeData(0xf8); + _writeCommand(0x20); + _waitWhileBusy("_PowerOn", power_on_time); + } + _power_is_on = true; +} + +void GxEPD2_290_C90c::_PowerOff() +{ + if (_power_is_on) + { + _writeCommand(0x22); + _writeData(0x83); + _writeCommand(0x20); + _waitWhileBusy("_PowerOff", power_off_time); + } + _power_is_on = false; +} + +void GxEPD2_290_C90c::_InitDisplay() +{ + if (_hibernating) _reset(); + delay(10); // 10ms according to specs + _writeCommand(0x12); //SWRESET + delay(10); // 10ms according to specs + _writeCommand(0x01); //Driver output control + _writeData(0x27); + _writeData(0x01); + _writeData(0x00); + _writeCommand(0x11); //data entry mode + _writeData(0x03); + _writeCommand(0x3C); //BorderWavefrom + _writeData(0x05); + _writeCommand(0x18); //Read built-in temperature sensor + _writeData(0x80); + _writeCommand(0x21); // Display update control + _writeData(0x00); + _writeData(0x80); + _setPartialRamArea(0, 0, WIDTH, HEIGHT); +} + +void GxEPD2_290_C90c::_Init_Full() +{ + _InitDisplay(); + _PowerOn(); +} + +void GxEPD2_290_C90c::_Init_Part() +{ + _InitDisplay(); + _PowerOn(); +} + +void GxEPD2_290_C90c::_Update_Full() +{ + _writeCommand(0x22); + _writeData(0xf7); + _writeCommand(0x20); + _waitWhileBusy("_Update_Full", full_refresh_time); +} + +void GxEPD2_290_C90c::_Update_Part() +{ + _writeCommand(0x22); + _writeData(0xf7); + _writeCommand(0x20); + _waitWhileBusy("_Update_Part", partial_refresh_time); +} diff --git a/src/epd3c/GxEPD2_290_C90c.h b/src/epd3c/GxEPD2_290_C90c.h new file mode 100644 index 0000000..a1dc33c --- /dev/null +++ b/src/epd3c/GxEPD2_290_C90c.h @@ -0,0 +1,74 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: SSD1680 : https://v4.cecdn.yun300.cn/100001_1909185148/SSD1680.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#ifndef _GxEPD2_290_C90c_H_ +#define _GxEPD2_290_C90c_H_ + +#include "../GxEPD2_EPD.h" + +class GxEPD2_290_C90c : public GxEPD2_EPD +{ + public: + // attributes + static const uint16_t WIDTH = 128; + static const uint16_t HEIGHT = 296; + static const GxEPD2::Panel panel = GxEPD2::GDEM029C90; + static const bool hasColor = true; + static const bool hasPartialUpdate = true; // but refresh is full screen + static const bool hasFastPartialUpdate = false; + static const uint16_t power_on_time = 100; // ms, e.g. 94628us + static const uint16_t power_off_time = 150; // ms, e.g. 139874us + static const uint16_t full_refresh_time = 27000; // ms, e.g. 26130024us + static const uint16_t partial_refresh_time = 27000; // ms, e.g. 26130024us + // constructor + GxEPD2_290_C90c(int8_t cs, int8_t dc, int8_t rst, int8_t busy); + // methods (virtual) + // Support for Bitmaps (Sprites) to Controller Buffer and to Screen + void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) + void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen + void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) + void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory + // write to controller memory, without screen refresh; x and w should be multiple of 8 + void writeImage(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); + void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 + void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write to controller memory, with screen refresh; x and w should be multiple of 8 + void drawImage(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); + void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 + void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen + 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) + private: + void _writeScreenBuffer(uint8_t value); + void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); + void _PowerOn(); + void _PowerOff(); + void _InitDisplay(); + void _Init_Full(); + void _Init_Part(); + void _Update_Full(); + void _Update_Part(); +}; + +#endif