
4.2 inch E-paper display GDEW042T2 worked on CALE-IDF using ESP32S2 and DESPI-C02 HAT
- Categories:News
- Author:
- Origin:
- Time of issue:2022-10-23 15:16
- Views:
(Summary description)
4.2 inch E-paper display GDEW042T2 worked on CALE-IDF using ESP32S2 and DESPI-C02 HAT
(Summary description)
- Categories:News
- Author:
- Origin:
- Time of issue:2022-10-23 15:16
- Views:
4.2 inch E-paper display GDEW042T2 worked on CALE-IDF using ESP32S2 and DESPI-C02 HAT
- Size: 400 * 300 4.2"
- Controller: IL0398
- Status: Working correctly
- New class: gdew042t2Grays.h supports 4 Gray mode at the cost of 30Kb more DRAM.
- Tested on ESP32 / ESP32S2
Stats
This time in milliseconds was tested in a S2, and it's v1.0 without optimization, sending a byte at time with SPI and toggling the Chip Select (SS) state. v1 original version GxEPD style
3210 _wakeUp settings+send Buffer
2006 _powerOn
5217 total time in millis
gdew042t2 v2 using SPI optimization
2569 _wakeUp settings+send Buffer
2007 _powerOn
4577 total time in ms (640 milliseconds optimized)
gdew042t2Grays.h class
90 ms _wakeUp settings+send Buffer
About the gdew042t2Grays class you need to be aware that it keeps 3 buffers:
_buffer (monochrome) _buffer1 is SPI1 buffer (0x10 command) _buffer2 is SPI2 buffer (0x13 command)
Each of them 15 K that is the result of doing 400/8*300 (1-bit per pixel) summing 45Kb of DRAM in total (about 30Kb more than the monochrome version).
Be aware that you cannot use updateWindow partial update method if you are in 4 Grays mode. Or you can, but it will show the contents of _buffer (monochrome) since the controller does not support partial upgrade in 4 gray mode. In order to achieve both modes in the same class it has a new method called: setMonoMode(bool mode) on true it use monochrome mode and _buffer. In setMonoMode(false) you can draw using the 3 levels of gray plus white. There are 4 constants defined for that:
// The only 4 grays supported by Good display/Waveshare
#define EPD_BLACK 0
#define EPD_DARKGREY 64
#define EPD_LIGHTGREY 128
#define EPD_WHITE 255
Implementation demo
#include <gdew042t2Grays.h>
EpdSpi io;
Gdew042t2Grays display(io);
void app_main() {
// Test Epd class. true to enable debug
display.init(false);
// Note that is in 4 Gray mode as default this is just to make it more explicit:
display.setMonoMode(false); // 4 gray mode.
// Draw something
display.setTextColor(EPD_DARKGREY);
display.setCursor(20,40);
display.print("Hello world");
display.fillCircle(60 , 200, 40, EPD_LIGHTGREY);
display.fillCircle(160, 200, 40, EPD_DARKGREY);
display.fillCircle(260, 200, 40, EPD_BLACK);
display.drawCircle(360, 200, 40, EPD_BLACK);
display.update();
// Wait some seconds with some delay()
display.setMonoMode(true); // Now it's in MONO mode
// Draw something in the _buffer
display.update();
}
For the record this is the first iteration of the monochrome mode Class
Requirements
- esp32 or esp32S2 / C3 in branch develop
- Espressif IDF framework >= 4.2 (4.3 -> 4.4 ideally to support latest S3)
- An epaper display (see Wiki for supported models)
ESP32C3 /S3 also works as a target. Please check also config-examples/C3-riscv-spi where is a PIN configuration that is prove to be working.
Then just select one of the SPI examples, and do a: idf.py set-target esp32c3
idf.py --preview set-target esp32s3 (Only v4.4 since tried this only with beta3)
Cale-idf is the official ESP-IDF firmware of our Web-Service CALE.es and
also the repository where the development of CalEPD epaper component takes place.
The main class extends Adafruit GFX so this library has full geometric functions and also fonts including German/Spanish/French special characters support.
Scan the QR code to read on your phone


Address:No.18, Zhonghua West Road, Dalian, China,116033
E-mail: sales@eink-display.com
©2007-2021 Dalian Diamo Electronic Technology Co., Ltd. All Rights Reserved. 辽ICP备08000578号-1 Website construction:www.300.cn dalian.300.cn
Dalian Diamo Electronic Technology Co., Ltd.
辽ICP备08000578号
Website construction:www.300.cn jinzhou.300.cn