Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Epdiy Features #33

Open
vroland opened this issue Mar 24, 2021 · 7 comments
Open

New Epdiy Features #33

vroland opened this issue Mar 24, 2021 · 7 comments
Labels

Comments

@vroland
Copy link

vroland commented Mar 24, 2021

Hi,
as mentioned in a previous issue, epdiy, the driver this library is based on, has made some progress since this repository was created. Notable changes are:

  • A high-level API that makes allows to simply write to a framebuffer and let the driver update the display, no need to know about different update modes / calculating partial updates. (see https://github.com/vroland/epdiy/blob/master/examples/demo/main/main.c)
  • Removed namespace clashes with Adafruit GFX
  • Support for vendor waveforms, allowing arbitrary grayscale-to-grayscale transitions
  • Support the the arduino IDE. Currently, this requires to install a board definition file because of limitations of arduino-esp32, but since this library only supports one board this process could be simplified.
  • The driver can be configured to use significantly less memory at the expense of performance, which is necessary when using wifi and bluetooth together.
  • The documentation has been updated to make things like image and font generation clearer.

Thus, I thought it would make sense to discuss how these changes could be best integrated here, to take advantage of the development effort happening in both places. Maybe this library could wrap epdiy and add device-specific examples and extensions?

@martinberlin
Copy link

Thanks for the great update @vroland
As I commented in #9 I would like to add software rotation here too but I'm not going to do it with the existing old copy of EPDiy.
I would like to do it correctly and link EPDiy as a base library in the platformio.ini or at least if that is not the preferred way by Lilygo to have an epd_driver copy of the latest version.
But I would favour to use EPDiy as an arduino-esp32 dependency and to set the Epaper / Board defines directly using build_flags in platformio.ini (Or any other constant that needs to be defined in order for this to work correctly)

@Lorysmus
Copy link

Hi there I play with the Lilygo EPD47 with the Epdiy library because of the rotation feature which works very well now! Great work Martin... Unfortunately I did not find out the way how to reduce the power consumption to minimum in deep sleep mode with this library - Do you have any experience? I tried to use epd_deinit() but without any effect.

@martinberlin
Copy link

martinberlin commented May 13, 2021

Thanks @Lorysmus much appreciated. I actually didn’t check consumption with fine detail yet.

@vroland do the parallel epapers also have a deepsleep mode?
By the way, did you try: epd_poweroff();

So far for many demos like weather all the ESP32 is going to sleep till next refresh but I do not have much experience with parallel yet, just understand parts of the code since I added the rotation.
By the way do you have measurements in consumption, running same program, with and without epaper connected? So far I didn’t try that.

@vroland
Copy link
Author

vroland commented May 14, 2021

With the v5 board, I managed to get 13uA deep sleep current. But I did not test with the LilyGo board, yet. I guess a dedicated deepsleep demo would be useful, but I did not get arround to that, yet.

@DavidM42
Copy link

DavidM42 commented May 14, 2021

The example I added to the main epdiy repo should demo low power usage of the lilygo epd 4.7 inch fairly well.
The code I use which formed the base for my example is sitting in deepsleep for days or weeks on battery now.
I use both epd.poweroff() and then the typical esp deepsleep start

@AndreKR
Copy link

AndreKR commented Nov 17, 2021

A note about power consumption, just for reference because I didn't immediately understand it.

Both the LilyGo and the Epdiy board use a shift register to make various hardware settings. The library function epd_poweroff_all() just sets all outputs to LOW to disable the power supply for minimum power consumption:

LilyGo-EPD47/src/ed097oc4.c

Lines 147 to 151 in 37e8691

void epd_poweroff_all()
{
memset(&config_reg, 0, sizeof(config_reg));
push_cfg(&config_reg);
}

From the schematic I think the crucial bit is PWR_EN, which in the code is still (taken from the epdiy source) called ep_scan_direction:
static void IRAM_ATTR push_cfg(epd_config_register_t *cfg) {
fast_gpio_set_lo(CFG_STR);
// push config bits in reverse order
push_cfg_bit(cfg->ep_output_enable);
push_cfg_bit(cfg->ep_mode);
push_cfg_bit(cfg->ep_scan_direction);
push_cfg_bit(cfg->ep_stv);
push_cfg_bit(cfg->neg_power_enable);
push_cfg_bit(cfg->pos_power_enable);
push_cfg_bit(cfg->power_disable);
push_cfg_bit(cfg->ep_latch_enable);
fast_gpio_set_hi(CFG_STR);
}

This is now also taken into account by the original Epdiy project:
https://github.com/vroland/epdiy/blob/84898485658af384a9b71148c9294daf56c96abd/src/epd_driver/config_reg_v2.h#L69-L84

static void cfg_poweroff(epd_config_register_t *cfg) {
#if defined(CONFIG_EPD_BOARD_REVISION_LILYGO_T5_47)
  // This was re-purposed as power enable.
  cfg->ep_scan_direction = false;
#endif
  // POWEROFF
  cfg->pos_power_enable = false;
  push_cfg(cfg);
  busy_delay(10 * 240);
  cfg->neg_power_enable = false;
  push_cfg(cfg);
  busy_delay(100 * 240);
  cfg->power_disable = true;
  push_cfg(cfg);
  // END POWEROFF
}

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants