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

Adding drivers for EPDiy supported parallel epapers #75

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a0113e0
Setup epdiy_epaper generic driver REF: https://github.com/martinberli…
martinberlin May 28, 2021
2d3a1fa
Make grays darker
martinberlin May 28, 2021
f4a760d
Enlarge DISP_BUF_SIZE. Remove epdiy_rounder callback since is not used
martinberlin May 28, 2021
7d339be
Attempt to add partial update when flush area is not full screen
martinberlin May 29, 2021
c9660bd
#3 Start adding L58: Find a way to instantiate existing class or refa…
martinberlin May 30, 2021
debae0b
#3 Add touch hook for Lilygo L58
martinberlin May 30, 2021
19b1ecd
Update epdiy driver using it standalone, without CalEPD. Previous is …
martinberlin Jun 1, 2021
18350e6
Add old calepd version
martinberlin Jun 1, 2021
42ae32f
Update epdiy_epaper to make void epdiy_set_px_cb callback write direc…
martinberlin Jun 1, 2021
160035c
Add generic CalEPD SPI epaper driver
martinberlin Jun 3, 2021
c539322
Using epdiy_set_px_cb *buf and returning *color_map in flush method t…
martinberlin Jun 11, 2021
cd28318
Clean up example with buffer copy
martinberlin Jun 11, 2021
6dfa2a1
Fill *buf initially with white in first set_px call. Remove additiona…
martinberlin Jun 12, 2021
d71793f
Now first version is renamed to epdiy_epaper_v1.cpp
martinberlin Jun 12, 2021
97a330c
Now v2 is the official EPDiy driver of this fork
martinberlin Jun 12, 2021
255a1a7
Update callbacks to support also fast update MODE_DU configurable wit…
martinberlin Jun 13, 2021
9a16924
Related to commit in https://github.com/martinberlin/lv_port_esp32-ep…
martinberlin Jun 13, 2021
588b14f
Leave buf_copy_to_framebuffer as the default method and Gabor method …
martinberlin Jun 13, 2021
4650001
Rendering correctly in full screen and small updates
martinberlin Jun 15, 2021
4004726
Merge branch 'lvgl:master' into master
martinberlin Jun 21, 2021
c55e32a
Update Readme
martinberlin Jun 21, 2021
a66706d
#1 Cleanup and add L58 as driver in this component
martinberlin Jun 22, 2021
bcd2b80
Merge branch 'master' into master
martinberlin Jun 23, 2021
22893f0
Add a reference to L58 include directory
martinberlin Jun 23, 2021
2868e21
#75 Start resolving conflicts (updating component)
martinberlin Jan 2, 2022
63bc5f4
#75 Update lvgl_tft
martinberlin Jan 2, 2022
0636e26
Merge branch 'master' into master
martinberlin Jan 2, 2022
d738aaa
#75 update I2C references since lvgl_i2c_conf.h is not used
martinberlin Jan 2, 2022
87bf29d
Update with epdiy last version support
martinberlin Aug 24, 2023
9445dab
epdiy V7 made a bit faster
martinberlin Aug 26, 2023
5ffb67f
Add GT911 using esp_lcd_touch_gt911
martinberlin Sep 2, 2023
03cf7ec
Exclude CalEPD and other tests from main CMakeLists.txt
martinberlin Mar 10, 2024
58d5feb
Updated for color output on Kaleido e-paper
Mar 11, 2024
a1acc7e
Keep also a copy of epdiy driver for grayscale without color filter e…
martinberlin Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -3,12 +3,20 @@ if(ESP_PLATFORM)
file(GLOB SOURCES *.c)
set(LVGL_INCLUDE_DIRS . lvgl_tft)
list(APPEND SOURCES "lvgl_tft/disp_driver.c")
list(APPEND SOURCES "lvgl_tft/esp_lcd_backlight.c")

#@todo add SimleInclude macro here

# Include only the source file of the selected
# display controller.
if(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9341)
list(APPEND SOURCES "lvgl_tft/ili9341.c")
elseif(CONFIG_LV_EPAPER_EPDIY_DISPLAY_CONTROLLER)
list(APPEND SOURCES "lvgl_tft/epdiy_epaper.cpp")
elseif(CONFIG_LV_EPAPER_CALEPD_DISPLAY_CONTROLLER)
list(APPEND SOURCES "lvgl_tft/calepd_epaper.cpp")
elseif(CONFIG_LV_SHARP_DISPLAY_CONTROLLER)
list(APPEND SOURCES "lvgl_tft/sharp_mip.cpp")

elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9481)
list(APPEND SOURCES "lvgl_tft/ili9481.c")
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9486)
@@ -40,10 +48,6 @@ elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_RA8875)
list(APPEND SOURCES "lvgl_tft/ra8875.c")
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_GC9A01)
list(APPEND SOURCES "lvgl_tft/GC9A01.c")
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9163C)
list(APPEND SOURCES "lvgl_tft/ili9163c.c")
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_PCD8544)
list(APPEND SOURCES "lvgl_tft/pcd8544.c")
else()
message(WARNING "LVGL ESP32 drivers: Display controller not defined.")
endif()
@@ -63,6 +67,10 @@ if(CONFIG_LV_TOUCH_CONTROLLER)
list(APPEND SOURCES "lvgl_touch/xpt2046.c")
elseif(CONFIG_LV_TOUCH_CONTROLLER_FT6X06)
list(APPEND SOURCES "lvgl_touch/ft6x36.c")
elseif(CONFIG_LV_TOUCH_CONTROLLER_L58)
list(APPEND SOURCES "lvgl_touch/l58.cpp")
elseif(CONFIG_LV_TOUCH_CONTROLLER_GT911)
list(APPEND SOURCES "lvgl_touch/gt911.c")
elseif(CONFIG_LV_TOUCH_CONTROLLER_STMPE610)
list(APPEND SOURCES "lvgl_touch/stmpe610.c")
elseif(CONFIG_LV_TOUCH_CONTROLLER_ADCRAW)
@@ -71,23 +79,24 @@ if(CONFIG_LV_TOUCH_CONTROLLER)
list(APPEND SOURCES "lvgl_touch/FT81x.c")
elseif(CONFIG_LV_TOUCH_CONTROLLER_RA8875)
list(APPEND SOURCES "lvgl_touch/ra8875_touch.c")
elseif(CONFIG_LV_TOUCH_CONTROLLER_GT911)
list(APPEND SOURCES "lvgl_touch/gt911.c")
endif()

if(CONFIG_LV_TOUCH_DRIVER_PROTOCOL_SPI)
list(APPEND SOURCES "lvgl_touch/tp_spi.c")
elseif(CONFIG_LV_TOUCH_DRIVER_PROTOCOL_I2C)
list(APPEND SOURCES "lvgl_touch/tp_i2c.c")
endif()
endif()

if(CONFIG_LV_I2C)
list(APPEND SOURCES "lvgl_i2c/i2c_manager.c")
endif()

idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
REQUIRES lvgl)

REQUIRES epdiy
lvgl
#CalEPD
#sharp-lcd
#espressif__esp_lcd_touch_gt911
)

target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_LVGL_H_INCLUDE_SIMPLE")

else()
6 changes: 6 additions & 0 deletions CONTRIBUTE_CONTROLLER_SUPPORT.md
Original file line number Diff line number Diff line change
@@ -27,6 +27,12 @@ For more information on the function callbacks check LVGL documentation: (Displa
Add your display functions on `disp_driver_init`, `disp_driver_flush`, `disp_driver_rounder` and `disp_driver_set_px` on the `disp_driver.c` file.
**Additional notes**
New drivers should be also have some defines added in:
lvgl_helpers.h
(follow existing ones to add yours)
## Input device driver.
To enable LVGL to work with your touch controller you would need to implement an initialization function and one function to get the data out from your touch controller.
16 changes: 2 additions & 14 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
menu "LVGL ESP Drivers"

rsource "lvgl_tft/Kconfig"

rsource "lvgl_touch/Kconfig"

endmenu

menu "I2C Port Settings"
depends on LV_I2C && !HAVE_I2C_MANAGER

rsource "lvgl_i2c/Kconfig"

endmenu
rsource "lvgl_tft/Kconfig"
rsource "lvgl_touch/Kconfig"
33 changes: 2 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,8 +6,6 @@ For a ready to use ESP32 project take look at the [lv_port_esp32](https://github
- [Supported display controllers](#supported-display-controllers)
- [Supported indev controllers](#supported-indev-controllers)
- [Support for predefined development kits](#support-for-predefined-development-kits)
- [Thread-safe I2C with I2C Manager](#thread-safe-i2c-with-i2c-manager)
- [Backlight control](#backlight-control)

**NOTE:** You need to set the display horizontal and vertical size, color depth and
swap of RGB565 color on the LVGL configuration menuconfig (it's not handled automatically).
@@ -19,7 +17,6 @@ swap of RGB565 color on the LVGL configuration menuconfig (it's not handled auto
| Display Controller | Type | Interface | Color depth (LV_COLOR_DEPTH) | Swap RGB565 color (LV_COLOR_16_SWAP) |
|---------------------------------------------|------------|------------------------|------------------------------|----------------------------------------|
| ILI9341 | TFT | SPI | 16: RGB565 | Yes |
| ILI9163C | TFT | SPI | 16: RGB565 | Yes |
| ILI9486 | TFT | SPI | 16: RGB565 | Yes |
| ILI9488 | TFT | SPI | 16: RGB565 | No |
| HX8357B/HX8357D | TFT | SPI | 16: RGB565 | Yes |
@@ -30,16 +27,15 @@ swap of RGB565 color on the LVGL configuration menuconfig (it's not handled auto
| RA8875 | TFT | SPI | 16: RGB565 | Yes |
| SH1107 | Monochrome | SPI | 1: 1byte per pixel | No |
| SSD1306 | Monochrome | I2C | 1: 1byte per pixel | No |
| PCD8544 | Monochrome | SPI | 1: 1byte per pixel | No |
| IL3820 | e-Paper | SPI | 1: 1byte per pixel | No |
| UC8151D/ GoodDisplay GDEW0154M10 DES | e-Paper | SPI | 1: 1byte per pixel | No |
| FitiPower JD79653A/ GoodDisplay GDEW0154M09 | e-Paper | SPI | 1: 1byte per pixel | No |

## Supported indev controllers

- XPT2046
- FT3236, FT6X36
- FT6206 controllers should work as well (not tested)
- FT3236
- other FT6X36 or the FT6206 controllers should work as well (not tested)
- STMPE610
- FT81x (Single, Dual, and Quad SPI)

@@ -55,7 +51,6 @@ and sets the gpio numbers for the interface.
|---------------------------|-----------------------|-----------|-----------|-----------|
| ESP Wrover Kit v4.1 | ILI9341 | SPI | 240 | 320 |
| M5Stack | ILI9341 | SPI | 240 | 320 |
| M5Stack Core2 | ILI9341 | SPI | 240 | 320 |
| M5Stick | SH1107 | SPI | - | - |
| M5StickC | ST7735S | SPI | 80 | 160 |
| Adafruit 3.5 Featherwing | HX8357 | SPI | 480 | 320 |
@@ -68,27 +63,3 @@ and sets the gpio numbers for the interface.

**NOTE:** See [Supported display controllers](#supported-display-controllers) for more information on display configuration.
**NOTE:** See [Supported indev controllers](#supported-indev-controllers) for more information about indev configuration.


## Thread-safe I2C with I2C Manager

LVGL can use I2C to read from a touch sensor or write to a display, possibly
many times a second. Meanwhile, other tasks may also want to read from i2c
devices on the same bus. I2C using the ESP-IDF is not thread-safe.

I2C Manager (`i2c_manager`) is a component that will let code in multiple threads
talk to devices on the I2C ports without getting in each other's way. These drivers
use a built-in copy of I2C Manager to talk to the I2C port, but you can also use
the I2C Manager component itself and have others play nice with LVGL and vice-versa.
[Click here](i2c_manager/README.md) for details.


## Backlight control

Control of LCD's backlight is provided by separate module that is independent from the display driver.
Configuration of the backlight controller can be found in menuconfig `LVGL ESP Drivers -> LVGL TFT Display controller`.

There are three modes of operation:
1. Off - No backlight control
2. Switch - Allows ON/OFF control
3. PWM - Allows brightness control (by Pulse-Width-Modulated signal)
6 changes: 2 additions & 4 deletions component.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# LVGL ESP32 drivers

# Define sources and include dirs
COMPONENT_SRCDIRS := . lvgl_tft lvgl_touch lvgl_i2c
COMPONENT_SRCDIRS := . lvgl_tft lvgl_touch
COMPONENT_ADD_INCLUDEDIRS := .

# LVGL is supposed to be used as a ESP-IDF component
@@ -44,6 +44,4 @@ $(call compile_only_if,$(and $(CONFIG_LV_TOUCH_CONTROLLER),$(CONFIG_LV_TOUCH_CON
$(call compile_only_if,$(and $(CONFIG_LV_TOUCH_CONTROLLER),$(CONFIG_LV_TOUCH_CONTROLLER_RA8875)), lvgl_touch/ra8875_touch.o)

$(call compile_only_if,$(and $(CONFIG_LV_TOUCH_CONTROLLER),$(CONFIG_LV_TOUCH_DRIVER_PROTOCOL_SPI)), lvgl_touch/tp_spi.o)

# I2C Manager
$(call compile_only_if,$(CONFIG_LV_I2C), lvgl_i2c/i2c_manager.o)
$(call compile_only_if,$(and $(CONFIG_LV_TOUCH_CONTROLLER),$(CONFIG_LV_TOUCH_DRIVER_PROTOCOL_I2C)), lvgl_touch/tp_i2c.o)
Loading