From 526be77574d298d7b0cc3fc25f5c725d6a82439c Mon Sep 17 00:00:00 2001 From: C47D Date: Mon, 4 Jan 2021 22:52:33 -0600 Subject: [PATCH 1/3] Update readme --- CONTRIBUTE_CONTROLLER_SUPPORT.md | 52 ++++++++++++++++++++++++++++++ README.md | 54 ++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 CONTRIBUTE_CONTROLLER_SUPPORT.md diff --git a/CONTRIBUTE_CONTROLLER_SUPPORT.md b/CONTRIBUTE_CONTROLLER_SUPPORT.md new file mode 100644 index 0000000..db4c647 --- /dev/null +++ b/CONTRIBUTE_CONTROLLER_SUPPORT.md @@ -0,0 +1,52 @@ +# Is your driver not listed on the supported drivers list? + +Consider contributing to this demo project by adding support to your driver. + +## Display driver. + +To enable LVGL to work with your display you would need to implement from one up to three callback functions (one function for RGB TFT displays, three functions for monochrome display controllers), you can add more functions to enable backlight control, etc. + +All display controller code is stored on the `components/lvgl_esp32_drivers/lvgl_tft` directory, see `disp_driver` and `CMakeLists.txt` to add your code into the idf project. + +Create a header and source file named after the display controller (in lowercase). On the header file declare the necessary functions, such as: + +```c +/* Configure your display */ +void x_init(void); + +/* LVGL callbacks */ +void x_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_map); +/* Only for monochrome displays */ +void x_rounder(lv_disp_drv_t *disp_drv, lv_area_t *area); +void x_set_px(lv_disp_drv_t *disp_drv, uint8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa); +``` + +Where x is the controller name. + +For more information on the function callbacks check LVGL documentation: (Display driver)[https://docs.lvgl.io/v7/en/html/porting/display.html#display-driver]. + +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. + +## 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. + +All touch controller code is stored on the `components/lvgl_esp32_drivers/lvgl_touch` directory. + +Create a header and source file named after the display controller (in lowercase). On the header file declare the necessary functions, such as: + +```c +/* Configure your display */ +void x_init(void); + +/* LVGL callbacks */ +bool x_read(lv_disp_drv_t *drv, lv_indev_data_t *data); +``` + +Where x is the controller name. + +For more information on the function callbacks check LVGL documentation: (Display driver)[https://docs.lvgl.io/v7/en/html/porting/indev.html]. + +## Kconfig and Project Configuration + +The ESP32 SDK (ESP-IDF) uses [kconfiglib](https://github.com/ulfalizer/Kconfiglib) which is a Python-based extension to the [Kconfig](https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt) system which provides a compile-time project configuration mechanism. Using `idf.py menuconfig` will update the file sdkconfig and, during build, provide the file sdkconfig.h. diff --git a/README.md b/README.md index 0c61046..60f9980 100644 --- a/README.md +++ b/README.md @@ -1 +1,55 @@ # lvgl esp32 drivers + +# Supported display controllers + +**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). +You can use the rotate member of the `lv_disp_drv_t` type to rotate the screen. + +| Display Controller | Type | Interface | Color depth (LV_COLOR_DEPTH) | Swap the 2 bytes of RGB565 color (LV_COLOR_16_SWAP) | +|---------------------------------------------|------------|------------------------|------------------------------|-----------------------------------------------------| +| ILI9341 | TFT | SPI | 16: RGB565 | Yes | +| ILI9486 | TFT | SPI | 16: RGB565 | Yes | +| ILI9488 | TFT | SPI | 16: RGB565 | No | +| HX8357B/HX8357D | TFT | SPI | 16: RGB565 | Yes | +| ST7789 | TFT | SPI | 16: RGB565 | Yes | +| ST7735S | TFT | SPI | 16: RGB565 | Yes | +| FT81x | TFT | Single, Dual, Quad SPI | 16: RGB565 | No | +| GC9A01 | TFT | SPI | 16: RGB565 | Yes | +| RA8875 | TFT | SPI | 16: RGB565 | Yes | +| SH1107 | Monochrome | SPI | 1: 1byte per pixel | No | +| SSD1306 | Monochrome | I2C | 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 +- other FT6X36 or the FT6206 controllers should work as well (not tested) +- STMPE610 +- FT81x (Single, Dual, and Quad SPI) + +If your display or input device (touch) controller is not supported consider contributing to this repo by +adding support to it! [Contribute controller support](CONTRIBUTE_CONTROLLER_SUPPORT.md) + +# Support for predefined development kits + +You can also use the predefined kits, which selects the correct display and input device controllers on the kit, +it also sets the pin numbers for the interfaces. + +| Kit name | Display controller | Hor. Res. | Ver. Res. | Indev controller | +|---------------------------|-----------------------|-----------|-----------|-------------------| +| ESP Wrover Kit v4.1 | +| M5Stack | +| M5Stick | +| M5StickC | +| Adafruit 3.5 Featherwing | +| RPi MPI3501 | +| Wemos Lolin OLED | +| ER-TFT035-6 | +| AIRcable ATAGv3 | + +**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. From 75e26f8c8601d469247cb59e53a0770d4e45b250 Mon Sep 17 00:00:00 2001 From: C47D Date: Wed, 6 Jan 2021 11:14:00 -0600 Subject: [PATCH 2/3] Update predefined kits --- README.md | 66 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 60f9980..d18f2dd 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ # lvgl esp32 drivers -# Supported display controllers - **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). -You can use the rotate member of the `lv_disp_drv_t` type to rotate the screen. -| Display Controller | Type | Interface | Color depth (LV_COLOR_DEPTH) | Swap the 2 bytes of RGB565 color (LV_COLOR_16_SWAP) | -|---------------------------------------------|------------|------------------------|------------------------------|-----------------------------------------------------| -| ILI9341 | TFT | SPI | 16: RGB565 | Yes | -| ILI9486 | TFT | SPI | 16: RGB565 | Yes | -| ILI9488 | TFT | SPI | 16: RGB565 | No | -| HX8357B/HX8357D | TFT | SPI | 16: RGB565 | Yes | -| ST7789 | TFT | SPI | 16: RGB565 | Yes | -| ST7735S | TFT | SPI | 16: RGB565 | Yes | -| FT81x | TFT | Single, Dual, Quad SPI | 16: RGB565 | No | -| GC9A01 | TFT | SPI | 16: RGB565 | Yes | -| RA8875 | TFT | SPI | 16: RGB565 | Yes | -| SH1107 | Monochrome | SPI | 1: 1byte per pixel | No | -| SSD1306 | Monochrome | I2C | 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 display controllers + + +| Display Controller | Type | Interface | Color depth (LV_COLOR_DEPTH) | Swap RGB565 color (LV_COLOR_16_SWAP) | +|---------------------------------------------|------------|------------------------|------------------------------|----------------------------------------| +| ILI9341 | TFT | SPI | 16: RGB565 | Yes | +| ILI9486 | TFT | SPI | 16: RGB565 | Yes | +| ILI9488 | TFT | SPI | 16: RGB565 | No | +| HX8357B/HX8357D | TFT | SPI | 16: RGB565 | Yes | +| ST7789 | TFT | SPI | 16: RGB565 | Yes | +| ST7735S | TFT | SPI | 16: RGB565 | Yes | +| FT81x | TFT | Single, Dual, Quad SPI | 16: RGB565 | No | +| GC9A01 | TFT | SPI | 16: RGB565 | Yes | +| RA8875 | TFT | SPI | 16: RGB565 | Yes | +| SH1107 | Monochrome | SPI | 1: 1byte per pixel | No | +| SSD1306 | Monochrome | I2C | 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 @@ -36,20 +36,22 @@ adding support to it! [Contribute controller support](CONTRIBUTE_CONTROLLER_SUPP # Support for predefined development kits -You can also use the predefined kits, which selects the correct display and input device controllers on the kit, -it also sets the pin numbers for the interfaces. +You can also use the predefined kits, which selects the correct display controllers on the kit, +and sets the gpio numbers for the interface. -| Kit name | Display controller | Hor. Res. | Ver. Res. | Indev controller | -|---------------------------|-----------------------|-----------|-----------|-------------------| -| ESP Wrover Kit v4.1 | -| M5Stack | -| M5Stick | -| M5StickC | -| Adafruit 3.5 Featherwing | -| RPi MPI3501 | -| Wemos Lolin OLED | -| ER-TFT035-6 | -| AIRcable ATAGv3 | +| Kit name | Display controller | Interface | Hor. Res. | Ver. Res. | +|---------------------------|-----------------------|-----------|-----------|-----------| +| ESP Wrover Kit v4.1 | ILI9341 | SPI | 240 | 320 | +| M5Stack | ILI9341 | SPI | 240 | 320 | +| M5Stick | SH1107 | SPI | - | - | +| M5StickC | ST7735S | SPI | 80 | 160 | +| Adafruit 3.5 Featherwing | HX8357 | SPI | 480 | 320 | +| RPi MPI3501 | ILI9486 | SPI | - | - | +| Wemos Lolin OLED | SSD1306 | SPI | 64 | 128 | +| ER-TFT035-6 | ILI9488 | SPI | 480 | 320 | +| AIRcable ATAGv3 | IL3820 | SPI | 128 | 296 | +| TTGO T-Display | ST7789 | SPI | 135 | 240 | +| TTGO Camera Plus | ST7789 | SPI | 240 | 240 | **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. From cf279f765e0e92e9c3ea41cfcf0a767d3e3afd9e Mon Sep 17 00:00:00 2001 From: C47D Date: Wed, 6 Jan 2021 11:17:06 -0600 Subject: [PATCH 3/3] Add sections to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index d18f2dd..e70f78d 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,12 @@ **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). +[Supported display controllers](#Supported-display-controllers) + +[Supported indev controllers](#Supported-indev-controllers) + +[Support for predefined development kits](#Support-fot-predefined-development-kits) + # Supported display controllers