{"id":14963350,"url":"https://github.com/etdds/esp-idf-lvgl-displays","last_synced_at":"2025-10-25T01:30:34.423Z","repository":{"id":95118303,"uuid":"599039955","full_name":"etdds/esp-idf-lvgl-displays","owner":"etdds","description":"An ESP IDF component for various development boards, running LVGL.","archived":false,"fork":false,"pushed_at":"2023-05-04T11:09:53.000Z","size":33,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T04:51:24.968Z","etag":null,"topics":["esp-idf","esp-idf-component","esp32","esp32s3","tdisplay-s3","ttgo-t-display"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/etdds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-08T10:25:57.000Z","updated_at":"2024-08-15T02:37:53.000Z","dependencies_parsed_at":"2024-09-13T19:11:56.014Z","dependency_job_id":null,"html_url":"https://github.com/etdds/esp-idf-lvgl-displays","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"762225a9f7d0643dee68b22ea36e602b07e863bf"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etdds%2Fesp-idf-lvgl-displays","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etdds%2Fesp-idf-lvgl-displays/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etdds%2Fesp-idf-lvgl-displays/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etdds%2Fesp-idf-lvgl-displays/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etdds","download_url":"https://codeload.github.com/etdds/esp-idf-lvgl-displays/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238053514,"owners_count":19408699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp-idf","esp-idf-component","esp32","esp32s3","tdisplay-s3","ttgo-t-display"],"created_at":"2024-09-24T13:31:23.408Z","updated_at":"2025-10-25T01:30:29.130Z","avatar_url":"https://github.com/etdds.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LVGL Display Drivers for ESP IDF\n\nAn component for creation and management of displays using the LVGL graphics library on ESP-IDF platforms. The component provides defined configurations for preconfigured boards. It handles display controller initialization, LVGL task and timer management, and provides a scoped mutex to manage access to LVGL components.\n\nLVGL Display Drivers for ESP IDF is available as an ESP IDF component, and can be easily integrated into existing ESP-IDF projects using the component manager or cloned directly from the project repository. The component is built on top of the popular LVGL library and is an amalgamation of espressif/esp_lvgl_port and esp-idf native display drivers.\n\n# Example Usage\n\n```c++\n#include \u003cfreertos/FreeRTOS.h\u003e\n#include \u003cfreertos/task.h\u003e\n#include \u003clvgl.h\u003e\n#include \u003cstdio.h\u003e\n\n#include \u003ccontroller.hpp\u003e\n\n#include \"esp_system.h\"\n\n// Get an instance of the LVGL Display Controller\nconstexpr auto Display = LVGLDisplay::Controller::instance;\n\n// The screen label to change.\nlv_obj_t* label;\n\n// Function to create a \"Hello World\" label on the display\nvoid create_hello_world() {\n  // LVGL operations are not thread safe. To avoid conflicts, we acquire the\n  // mutex for the controller before accessing LVGL APIs. The mutex is released\n  // once the lock goes out of scope.\n  auto lock = LVGLDisplay::Lock();\n\n  // Set the background color of the screen to a black.\n  lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x000000), LV_PART_MAIN);\n\n  // Add a red border around the edge of the screen to help set offsets.\n  lv_obj_set_style_border_color(lv_scr_act(), lv_color_hex(0xFF00000), LV_PART_MAIN);\n  lv_obj_set_style_border_width(lv_scr_act(), 1, LV_PART_MAIN);\n  \n\n\n  // Create a label object with the text \"Hello world\"\n  label = lv_label_create(lv_scr_act());\n  lv_label_set_text(label, \"\");\n\n  // Set the text color to white\n  lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN);\n\n  // Align the label object to the center of the screen\n  lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);\n}\n\n// Main function\nextern \"C\" void app_main(void) {\n  // Initialise the display controller, allocate required resources, and start\n  // the LVGL main task and timer.\n  Display().initialise();\n\n  // Turn the backlight on\n  Display().backlight(true);\n\n  // Create a \"Hello World\" label on the display\n  create_hello_world();\n\n  size_t seconds = 0;\n  char text[32] = \"\";\n\n  // Loop forever\n  while(1) {\n    snprintf(text, 32, \"Hello world %u\", seconds++);\n\n    // Update the display with the current elapsed seconds.\n    // Use a static lock, which does not rely on scope.\n    LVGLDisplay::Lock::acquire();\n    lv_label_set_text(label, text);\n    LVGLDisplay::Lock::release();\n\n    // Delay the task for 1000ms (1 second)\n    vTaskDelay(pdMS_TO_TICKS(1000));\n  }\n}\n```\n\n# Supported Displays\n\n| Board | Display Interface | Display Controller | Link |\n|----------|----------|----------|----------|\n| LilyGO T-Display-S3 | Intel 8080 | ST7789 | https://www.lilygo.cc/products/t-display-s3 |\n| LilyGO TTGO-TDisplay| SPI | ST7789 |https://www.lilygo.cc/products/lilygo%C2%AE-ttgo-t-display-1-14-inch-lcd-esp32-control-board  |\n\n# Configuration\n\nThe display used by LVGL is chosen and configured by Kconfig. When using the ESP-IDF component manager, use idf.py menuconfig and browse to Component config -\u003e LVGL Display Configuration.\n\n| Option                      | Default value | Range   | Description                                                                                                                          |\n|-----------------------------|---------------|---------|--------------------------------------------------------------------------------------------------------------------------------------|\n| `LVGL_DISPLAY_TDISPLAY_S3`  | `y`           |         | Select LilyGO T-Display-S3 display module                                                                                            |\n| `LVGL_DISPLAY_TTGO_TDISPLAY`  | `n`           |         | Select LilyGO TTGO-tdisplay display module                                                                                            |\n| `LVGL_DISPLAY_PIXEL_CLOCK`  | `10`          | `1-80`  | Set the pixel clock frequency for the 8080 parallel bus.                                                                              |\n| `LVGL_DISPLAY_TQUEUE_DEPTH`  | `10`          | `1-100`  | Set the length of the LCD transaction queue.                                                                              |\n| `LVGL_DISPLAY_DRAW_BUFF_LEN`| `20`          | `1-170` | Set the number of horizontal lines used as a draw buffer. Higher values use more memory. Usually this value should not be less than 20.|\n| `LVGL_DISPLAY_SPI_CLOCK`  | `20`          | `1-40`  | Set the SPI clock frequency for SPI based controllers bus.                                                                              |\n| `LVGL_DISPLAY_MIRROR_X`     | `n`           |         | Mirror X orientation on display                                                                                                      |\n| `LVGL_DISPLAY_MIRROR_Y`     | `y`           |         | Mirror Y orientation on display                                                                                                      |\n| `LVGL_DISPLAY_TASK_PRIORITY`| `4`           |         | Set the FreeRTOS task priority for the LVGL main task.                                                                               |\n| `LVGL_DISPLAY_TASK_STACK`   | `4096`        |         | Set the FreeRTOS task stack for the LVGL main task.                                                                                  |\n| `LVGL_DISPLAY_TASK_AFFINITY`| `-1`          | `-1-1`  | Set the task affinity for the LVGL main task. Determines which core the task is tied to. -1 sets either core.                        |\n| `LVGL_DISPLAY_TASK_MAX_SLEEP` | `500`       | `0-5000` | Set the maximum sleep time for the main LVGL task, in milliseconds.                                                                   |\n| `LVGL_DISPLAY_TIMER_PERIOD` | `5`          | `0-5000` | Set the period for the LVGL timer in milliseconds.                                                                                   |\n\n# Installation\n\n## ESP IDF component manager\n\nAdd to your main `idf_component.yml` file, under dependencies.\n\n```yaml\ndependencies:\n  esp-idf-lvgl-displays:\n    git: https://github.com/etdds/esp-idf-lvgl-displays.git\n```\n\n# Direct component\nAdd the repository as a standard IDF component.\n```\ngit clone https://github.com/etdds/esp-idf-lvgl-displays.git components/esp-idf-lvgl-displays\n```\n\n# Submodule component\nAdd the repository as a standard IDF component.\n```\ngit submodule add https://github.com/etdds/esp-idf-lvgl-displays.git components/esp-idf-lvgl-displays\n```\n\n# Adding additional baords:\n\n1. Add the display driver which implements `include/display.hpp : Display`\n2. Add a static instance to `display_factory.cpp`\n3. Add a guarded entry to `CMakelists.txt`\n4. Add Kconfig options\n5. Add display information and any additional configuration to `README.md`\n6. Add default configuration to each example.\n7. Add build configuration to `.vscode/tasks.json`\n8. Add github action target.\n\n\n# Examples\n\nThe repository contains examples for all suported boards. \n\nTo build an example:\n```\n# Clone the repository:\ngit clone https://github.com/etdds/esp-idf-lvgl-displays.git\n\n# Configure for tdiplay-s3, using the 'hello world' example\ncd examples/hello_world \u0026\u0026 rm -f sdkconfig* \u0026\u0026 cp tdisplay-s3.defaults sdkconfig.defaults \u0026\u0026 idf.py set-target esp32s3\n# OR\n\n# Configure for ttgo-tdiplay, using the 'hello world' example\ncd examples/hello_world \u0026\u0026 rm -f sdkconfig* \u0026\u0026 cp ttgo-tdisplay.defaults sdkconfig.defaults \u0026\u0026 idf.py set-target esp32\n\n# Build the example (from the examples/hello_world directory)\nidf.py build\n\n# Flash\nidf.py -p (PORT) \n\n# Clean\nidf.py fullclean\n```\n\n# Credits\n\nThis component is an amalgamation of [espressif/esp_lvgl_port](https://components.espressif.com/components/espressif/esp_lvgl_port) and [LVGL](https://docs.lvgl.io/8.3/index.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetdds%2Fesp-idf-lvgl-displays","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetdds%2Fesp-idf-lvgl-displays","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetdds%2Fesp-idf-lvgl-displays/lists"}