From 3ffb83c33cf424494c07fcd2715ba9123ffc64d3 Mon Sep 17 00:00:00 2001 From: Greg Dickson Date: Tue, 10 May 2022 21:04:16 +0800 Subject: [PATCH] Add epd_powerdown for lilygo (#179) * added epd_powerdown On lilygo disable display power but not touch screen. The epd power flag was re-purposed as power enable however it also disables the touch. this workaround may still leave power on to epd and as such may cause other problems such as grey screen. please also use poweroff when you sleep the system wake on touch will still work just not the I2C interface. * lilygo epd_powerdown note in readme Sorry it's not the prettiest thing. * Documentation change Deoxygenised the comments on the function so it will be explained in the readthedocs.io * Clarify readme * Finish readme for lily go * Clean up * Oops --- README.md | 21 +++++++++++++++++++-- src/epd_driver/config_reg_v2.h | 22 ++++++++++++++++++++++ src/epd_driver/display_ops.c | 7 +++++++ src/epd_driver/include/epd_driver.h | 24 ++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index de3381c1..68bfada9 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,25 @@ The following list is compiled from past experiences and GitHub issues: * **The existing image fades / darkens when updating a partial screen region.** Make sure the VCOM voltage is [calibrated](https://epdiy.readthedocs.io/en/latest/getting_started.html#calibrate-vcom) for your specific display. * **The second third of the image is replaced with the last third.** This seems to be a timing issue we could not yet quite figure out the reason for. For a workarround or suggestions please [join the discussion](https://github.com/vroland/epdiy/issues/15). * **The ESP does not boot correctly when external periperals are connected.** Make sure not to pull GPIO12 high during boot, as it is a strapping pin internal voltage selection (https://github.com/vroland/epdiy/issues/17). - + +LilyGo Boards +--------------- +There are several differences with these boards. +One particular one is the way the LilyGo handles power to the display the official lilygo code has two states. +This is now handled in epdiy in a different way to the lilygo code. +**epd_poweroff()** completely turns the power off to the display and the other peripherals of the lilygo. +The new function **epd_powerdown()** keeps the peripherals on (this allows the touch functions to continue to work). +**epd_poweroff() should allways be called before sleeping the system** +You can still use touch to wake the screen with the following. +In Arduino it works like this. +`epd_poweroff();` + + `epd_deinit();` + + `esp_sleep_enable_ext1_wakeup(GPIO_SEL_13, ESP_EXT1_WAKEUP_ANY_HIGH);` + + `esp_deep_sleep_start();` + More on E-Paper Displays ------------------------ @@ -115,4 +133,3 @@ The board and schematic are licensed under a