Skip to content

Update EPDiy version for parallel epapers and to support ESP-IDF v 4.4

Compare
Choose a tag to compare
@martinberlin martinberlin released this 27 Mar 18:30
· 290 commits to master since this release

This update took quite long to come out since it required a major bump of the EPDiy component.

Now supporting also epapers for the 6 inches range like ED060SC4 and ED060SCA (All range of 6" displays should work)
Please notice that our intent is to implement EPDiy in a simple way so the settings for this release are the following:

epd_init(EPD_OPTIONS_DEFAULT);
framebuffer = epd_init_hl(EPD_BUILTIN_WAVEFORM);

If you want to change that please do it in the cpp class itself. If there is interest in doing this different we can also pass it as a parameter on the init method.
There are major changes on the API and the high level HL implementation. Now we don't declare the framebuffer directly like before but is returning from this function epd_init_hl that we added in epd_driver.
I had an issue compiling this since even though that the highlevel.c was added into the build I could not access to the functions from my C++ classes. So I build bridge functions on the epd_driver.c:

uint8_t* epd_init_hl(const EpdWaveform* waveform) {
 hl = epd_hl_init(waveform);
 return epd_hl_get_framebuffer(&hl);
}


void epd_update_screen(uint8_t *framebuffer, enum EpdDrawMode mode) {
 printf("epd_update_screen called\n\n");
 epd_hl_update_screen(&hl, mode, 25);
}

void epd_update_area(enum EpdDrawMode mode, EpdRect area) {
 enum EpdDrawError err = epd_hl_update_area(&hl, mode, 25, area);
 assert(err == EPD_DRAW_SUCCESS);
}

It's very nice how it works and I'm proud to work with this awesome library and make a C++ bridge to it. This makes using it a real pleasure since the complexity is abstracted and you also have rotation as an advantage already included on the mix.

dragon

Examples

To download a bitmap from the web and render it on the epaper please try uncommenting the source file cale-grayscale.cpp on the /main/CMakeLists.txt file
This example is now updated to support 24 bits full color bitmaps and only the gray level is sent to the display.drawPixel(x, y, color) method.
The way that this is calculated once the 3 R, G, B color bytes are available is this:

                   color = 0.33 * in_red + 0.34 * in_green + 0.33 * in_blue;
                   display.drawPixel(drawX, drawY, color);

So feel free to play around with the R, G, B percentages to get different grays. It's possible also to use (in_red & in_green & in_blue) but this will make noise on certain photos and I think the percentage grays works much smoother if you want to render Black & White photos.
They loook really nice in this 16 grayscale displays.

All credits for EPDiy are for his original author Valentin Roland (@vroland)
Thanks go to my father Carlos Fasani for all the testing, wisdom and color conversion formulas.