From fc81c6da5a553ac8ba7f6f3bd482cd1f46e6f736 Mon Sep 17 00:00:00 2001 From: C47D Date: Wed, 2 Feb 2022 21:28:34 -0600 Subject: [PATCH] README: Update peripherals and display gpios helpers --- README.md | 5 +++++ examples/wemos_lolin_oled/hello_world/main/hello_world.c | 3 ++- lvgl_helpers.c | 2 +- lvgl_helpers.h | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 522c0e1..e41ab85 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,11 @@ For a ready to use ESP32 project take look at the [lv_port_esp32](https://github **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). +## MCU Configuration + +Example of SPI/I2C configuration peripherals is done with `lvgl_interface_init`. +Example of display gpios configuration, such as the DC, RST, Backlight is done with `lvgl_display_gpios_init` + ## Supported display controllers diff --git a/examples/wemos_lolin_oled/hello_world/main/hello_world.c b/examples/wemos_lolin_oled/hello_world/main/hello_world.c index 6ef1146..9e573b9 100644 --- a/examples/wemos_lolin_oled/hello_world/main/hello_world.c +++ b/examples/wemos_lolin_oled/hello_world/main/hello_world.c @@ -54,7 +54,8 @@ static void guiTask(void *pvParameter) /* Initialize the needed peripherals */ lvgl_interface_init(); /* Initialize needed GPIOs, e.g. backlight, reset GPIOs */ - display_bsp_init_io(); + lvgl_display_gpios_init(); + /* ToDo Initialize used display driver passing registered lv_disp_drv_t as parameter */ size_t display_buffer_size = lvgl_get_display_buffer_size(); diff --git a/lvgl_helpers.c b/lvgl_helpers.c index f6a539f..b5d23e2 100644 --- a/lvgl_helpers.c +++ b/lvgl_helpers.c @@ -153,7 +153,7 @@ void lvgl_interface_init(void) #endif } -void display_bsp_init_io(void) +void lvgl_display_gpios_init(void) { esp_err_t err = ESP_OK; gpio_config_t io_conf = { diff --git a/lvgl_helpers.h b/lvgl_helpers.h index 6031036..c166a23 100644 --- a/lvgl_helpers.h +++ b/lvgl_helpers.h @@ -41,7 +41,7 @@ bool lvgl_spi_driver_init(int host, int miso_pin, int mosi_pin, int sclk_pin, int max_transfer_sz, int dma_channel, int quadwp_pin, int quadhd_pin); /* Initialize display GPIOs, e.g. DC and RST pins */ -void display_bsp_init_io(void); +void lvgl_display_gpios_init(void); /* Get display buffer size */ size_t lvgl_get_display_buffer_size(void);