-
Notifications
You must be signed in to change notification settings - Fork 12
Description
FIX: To use epd_highlevel without hooks in epd_driver.c (Should be updated in CalEPD too)
ED047TC1.txt
UPDATE: New suggestions coming from LVGL Forum. CalEPD has been deprecated (Still exists in develop branch) in favor of the fast parallel driver EPDiy. Honestly, only parallel can be used for UX, others I find super slow and unusable.
This will be the initial task. First epaper target is the 5.83 in Goodisplay gdew0583t7
Basically the first idea is to add CalEPD as a component. And initialization plus drawing hooks.
Initially to refresh hole screen with the UX, partial refresh comes later.
Next candidate is 2.7 in with touch: gdew027w3T
LOG
Adding required components as submodules:
git submodule add https://github.com/martinberlin/CalEPD.git components/CalEPD
git submodule add https://github.com/martinberlin/Adafruit-GFX-Library-ESP-IDF components/Adafruit-GFX
Adding this modules is successful. A few notes:
components/lvgl (LVGL base library) needs to REQUIRE "CalEPD" in CMakeLists.txt
This additionally calls to add modifications in the REQUIRE's of CalEPD since at the moment they include:
idf_component_register(SRCS ${srcs}
REQUIRES "Adafruit-GFX"
REQUIRES "FT6X36-IDF" -> Touch comment out
REQUIRES "Epdiy-IDF" -> Parallel comment out
INCLUDE_DIRS "include"
)
Additionally all models that use touch or parallel dependencies (like gdew027w3T) should be excluded from CaleEPD CMakeLists.txt too.
At the moment trying only to make an example about how to interface with CalEPD just for the display without touch and just as a proof-of-concept example.
Errors or conflicts
../components/CalEPD/include/gdew0583t7.h:11:10: fatal error: string: No such file or directory
Why I used :
../components/CalEPD/include/epd.h:115:22: note: 'std::string' is defined in header ''; did you forget to '#include '?
And this is because main is not CPP. The issue is that adding extern "C" a lot of compile errors appear. It seems mainly since this library is pure C and uses templates. Example error:
/home/martin/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.2.0/bits/stl_iterator_base_types.h:143:3: error: template with C linkage
template<typename _Iterator, typename = __void_t<>>
^~~~~~~~
In file included from ../components/lvgl_esp32_drivers/lvgl_helpers.h:18,
from ../main/main.cpp:30:
../components/lvgl_esp32_drivers/lvgl_tft/disp_driver.h:9:1: note: 'extern "C"' linkage started here
extern "C" {
This seems to be the issue:
extern C disables name mangling, which templates use
https://stackoverflow.com/questions/4877705/why-cant-templates-be-within-extern-c-blocks
Solved including gdew0583t7.h in refactored driver il3820.cpp (Attached in this issue as .txt)
Additional notes:
Also CalEPD will try to instantiate SPI when is already done by LGVL. So we should find a way to signalize this, so it does not generate a never ending restart loop.
Solution: Use VSPI or different SPI in menuconfig.