Update readme

This commit is contained in:
C47D 2021-01-04 22:52:33 -06:00
parent e85761665e
commit 526be77574
2 changed files with 106 additions and 0 deletions

View file

@ -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.

View file

@ -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.