### Install SDL2 Runtime (Debian/Ubuntu) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs the SDL2 runtime library package on Debian-based Linux distributions using apt-get. The specific version `libsdl2-2.0-0` is used as an example, which should be replaced with the version found using `apt-cache search`. ```Shell sudo apt-get install libsdl2-2.0-0 ``` -------------------------------- ### Install SDL2 Library on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/pc-simulator.md Installs the main SDL2 runtime library on Debian-based Linux distributions. The version 'libsdl2-2.0-0' is an example and should be replaced with the version found using 'apt-cache search'. ```Shell sudo apt-get install libsdl2-2.0-0 ``` -------------------------------- ### Creating Basic LVGL Objects in Micropython Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/get-started/quick-overview.md Provides a simple Micropython example demonstrating the creation of a screen, a button on the screen, a label on the button, setting label text, aligning the button, and loading the screen. ```Python # Create a Button and a Label scr = lv.obj() btn = lv.btn(scr) btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0) label = lv.label(btn) label.set_text("Button") # Load the screen lv.scr_load(scr) ``` -------------------------------- ### Install Build Essentials on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/get-started/platforms/pc-simulator.md Installs essential packages required for compiling software on Debian-based Linux distributions, including GCC, G++, and make. ```shell sudo apt-get install build-essential ``` -------------------------------- ### Install Build Essentials on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs essential packages required for compiling software from source, including GCC, G++, and make. ```Shell sudo apt-get install build-essential ``` -------------------------------- ### Install Build Essentials (Debian/Ubuntu) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs essential packages required for compiling software from source on Debian-based Linux distributions, including compilers and build tools, using apt-get. ```Shell sudo apt-get install build-essential ``` -------------------------------- ### Install Build Essentials on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/pc-simulator.md Installs essential packages required for building software from source, including compilers and build tools, on Debian-based Linux distributions. ```Shell sudo apt-get install build-essential ``` -------------------------------- ### Install SDL2 Development Headers on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/get-started/platforms/pc-simulator.md Installs the development headers and static libraries for SDL2, necessary for compiling applications that use SDL2. ```shell sudo apt-get install libsdl2-dev ``` -------------------------------- ### Install SDL2 Development Files on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs the development headers and libraries for SDL2, necessary for compiling applications that use SDL2. ```Shell sudo apt-get install libsdl2-dev ``` -------------------------------- ### Install SDL2 on macOS using Homebrew Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/get-started/platforms/pc-simulator.md Installs the SDL2 library on macOS using the Homebrew package manager. ```shell brew install sdl2 ``` -------------------------------- ### Install Build Essentials on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/pc-simulator.md Installs the build-essential package using apt-get on Debian or Ubuntu Linux. This package includes necessary tools like GCC, G++, and Make, required for compiling C/C++ projects. ```Bash sudo apt-get install build-essential ``` -------------------------------- ### Creating LVGL Button and Label (Micropython) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/quick-overview.md Provides a basic example in Micropython for creating an LVGL screen, a button object, and a label object, aligning the button, setting the label text, and loading the screen. ```python # Create a Button and a Label scr = lv.obj() btn = lv.btn(scr) btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0) label = lv.label(btn) label.set_text("Button") # Load the screen lv.scr_load(scr) ``` -------------------------------- ### Creating Basic LVGL Objects (Micropython) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/quick-overview.md Provides a simple Micropython example demonstrating how to create a screen object, a button on the screen, align the button, create a label on the button, set the label text, and load the screen. ```python # Create a Button and a Label scr = lv.obj() btn = lv.btn(scr) btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0) label = lv.label(btn) label.set_text("Button") # Load the screen lv.scr_load(scr) ``` -------------------------------- ### Install SDL2 Development Headers (Debian/Ubuntu) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs the development headers and libraries for SDL2 on Debian-based Linux distributions using apt-get, which are necessary for compiling applications that use SDL2. ```Shell sudo apt-get install libsdl2-dev ``` -------------------------------- ### Install SDL2 on macOS using Homebrew Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs the SDL2 library on macOS using the Homebrew package manager. ```Shell brew install sdl2 ``` -------------------------------- ### Installing Git Hook Scripts with pre-commit Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/CODING_STYLE.md Provides the console command required to set up the git hook scripts after installing the `pre-commit` package, enabling automatic checks on commit. ```console pre-commit install ``` -------------------------------- ### Install SDL2 on macOS using Homebrew Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/pc-simulator.md Installs the SDL2 library on macOS using the Homebrew package manager, providing the necessary components for the PC simulator. ```Shell brew install sdl2 ``` -------------------------------- ### Installing Build Essentials on Debian/Ubuntu (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/platforms/pc-simulator.md Command to install essential build tools and libraries, such as GCC, G++, and make, on Debian-based Linux distributions using apt-get. This package is often required for compiling software from source. ```Shell sudo apt-get install build-essential ``` -------------------------------- ### Install SDL2 Runtime (Debian/Ubuntu) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/pc-simulator.md Installs the SDL2 runtime library on Debian-based Linux distributions. Replace 'libsdl2-2.0-0' with the version found using 'apt-cache search'. ```Shell sudo apt-get install libsdl2-2.0-0 ``` -------------------------------- ### Install SDL2 Runtime on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/get-started/platforms/pc-simulator.md Installs the SDL2 runtime library on Debian-based Linux distributions. Replace 'libsdl2-2.0-0' with the version found using 'apt-cache search'. ```shell sudo apt-get install libsdl2-2.0-0 ``` -------------------------------- ### Install SDL2 Development Headers on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/pc-simulator.md Installs the development files (headers, static libraries) for SDL2 using apt-get on Debian or Ubuntu Linux. Necessary for compiling applications that link against SDL2. ```Bash sudo apt-get install libsdl2-dev ``` -------------------------------- ### Install SDL2 Library on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/pc-simulator.md Installs the core SDL2 library package using apt-get on Debian or Ubuntu Linux. The package name might vary depending on the distribution version. ```Bash sudo apt-get install libsdl2-2.0-0 ``` -------------------------------- ### Install SDL2 (macOS) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/pc-simulator.md Installs the SDL2 library on macOS using the Homebrew package manager. ```Shell brew install sdl2 ``` -------------------------------- ### Install SDL2 Runtime on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs the SDL2 runtime library on Debian-based Linux distributions. Replace 'libsdl2-2.0-0' with the version found using 'apt-cache search'. ```Shell sudo apt-get install libsdl2-2.0-0 ``` -------------------------------- ### Install SDL2 (OSX/Homebrew) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs the SDL2 library on macOS using the Homebrew package manager, providing the necessary components for the LVGL simulator. ```Shell brew install sdl2 ``` -------------------------------- ### Install Build Essentials (Debian/Ubuntu) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/pc-simulator.md Installs essential build tools like GCC, G++, and make on Debian-based Linux distributions, required for compiling C/C++ projects. ```Shell sudo apt-get install build-essential ``` -------------------------------- ### Complete Blink Example (C/C++) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/arduino-esp32-master/docs/source/tutorials/blink.rst Provides the complete, runnable code for the interactive blink tutorial. It includes the pin definition, setup function, and the main loop for blinking. ```C++ #define LED 2 void setup() { pinMode(LED, OUTPUT); } void loop() { digitalWrite(LED, HIGH); delay(100); digitalWrite(LED, LOW); delay(100); } ``` -------------------------------- ### Install pre-commit Git Hooks Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/CODING_STYLE.md Command to install the pre-commit git hook scripts into the local repository, enabling automated checks before commits. ```console pre-commit install ``` -------------------------------- ### Install Java Runtime Environment (Debian/Ubuntu) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs the default Java Runtime Environment package on Debian-based Linux distributions using apt-get, which is required for running Eclipse. ```Shell sudo apt-get install default-jre ``` -------------------------------- ### Install SDL2 Development Headers (Debian/Ubuntu) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/pc-simulator.md Installs the development headers and libraries for SDL2 on Debian-based Linux distributions, necessary for compiling applications that use SDL2. ```Shell sudo apt-get install libsdl2-dev ``` -------------------------------- ### Install Java Runtime Environment (Debian/Ubuntu) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/pc-simulator.md Installs the default Java Runtime Environment on Debian-based Linux distributions, which is required for running Eclipse. ```Shell sudo apt-get install default-jre ``` -------------------------------- ### Installing pre-commit Git Hooks Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/CODING_STYLE.md Command to install the git hook scripts managed by pre-commit into the local repository, enabling automatic checks before commits. ```Shell pre-commit install ``` -------------------------------- ### Installing SDL2 Runtime on Debian/Ubuntu (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/platforms/pc-simulator.md Command to install the SDL2 runtime library package on Debian-based Linux distributions using apt-get. Replace `libsdl2-2.0-0` with the version found using `apt-cache search`. This library is required by the LVGL PC simulator. ```Shell sudo apt-get install libsdl2-2.0-0 ``` -------------------------------- ### Install SDL2 Development Package on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/pc-simulator.md Installs the development files for SDL2, which are necessary for compiling applications that use the SDL2 library on Debian-based Linux distributions. ```Shell sudo apt-get install libsdl2-dev ``` -------------------------------- ### Installing SDL2 Development Headers on Debian/Ubuntu (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/platforms/pc-simulator.md Command to install the SDL2 development package, including headers and static libraries, on Debian-based Linux distributions using apt-get. This package is necessary for compiling applications that use SDL2. ```Shell sudo apt-get install libsdl2-dev ``` -------------------------------- ### Install Java JRE on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/get-started/platforms/pc-simulator.md Installs the default Java Runtime Environment on Debian-based Linux distributions like Ubuntu, which is required for running Eclipse. ```shell sudo apt-get install default-jre ``` -------------------------------- ### Install SDL2 on macOS using Homebrew Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/pc-simulator.md Installs the SDL2 library on macOS using the Homebrew package manager. This is the recommended way to get SDL2 on OSX. ```Bash brew install sdl2 ``` -------------------------------- ### Build and Run WebAssembly Port (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/LovyanGFX/LovyanGFX/examples_for_PC/CMake_WASM/README.md These commands create a build directory, navigate into it, configure the project using emcmake (Emscripten's CMake wrapper), build the project using emmake (Emscripten's Make wrapper), and instruct the user to open the generated index.html file. ```Shell mkdir build cd build emcmake cmake .. emmake make ``` -------------------------------- ### Set Label Text Selection Start (LVGL C) - Second Call Example Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/widgets/core/label.md Shows a second example call to lv_label_get_text_selection_start with a different parameter name (end_char_index). While the function name implies getting the start, the context suggests this might be intended to show setting the end index, but the provided code uses the same function name. ```C lv_label_get_text_selection_start(label, end_char_index) ``` -------------------------------- ### Initialize and Run LVGL Music Demo (C/C++) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/src/demos/music/README.md After initializing the LVGL library with `lv_init()` and setting up your display and input drivers, call the `lv_demo_music()` function to start the music player demo interface. ```C/C++ lv_init(); // Initialize your display and input drivers here lv_demo_music(); ``` -------------------------------- ### Search for SDL2 Package on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/pc-simulator.md Uses apt-cache to search for available SDL2 packages on Debian-based Linux distributions to find the correct package name and version for installation. ```Shell apt-cache search libsdl2 ``` -------------------------------- ### Initialize Digital Pin as Output (Arduino C++) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/arduino-esp32-master/docs/EXAMPLE_README_TEMPLATE.md This C++ snippet shows the standard Arduino `setup()` function used to initialize a digital pin (specifically pin 4 in this example) as an output using the `pinMode()` function. This function runs once when the board starts or resets. ```cpp // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 4 as an output. pinMode(4, OUTPUT); } ``` -------------------------------- ### Sphinx toctree Directive Configuration Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/index.md This reStructuredText snippet uses the Sphinx 'toctree' directive to generate a table of contents. It specifies a maximum depth for the tree and lists the documents to include in the table of contents. ```reStructuredText .. toctree:: :maxdepth: 2 quick-overview platforms/index os/index bindings/index ``` -------------------------------- ### Search for SDL2 Package on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/platforms/pc-simulator.md Searches the apt package cache for available SDL2 packages to identify the correct version name for installation. ```Shell apt-cache search libsdl2 ``` -------------------------------- ### Search for SDL2 Package on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/pc-simulator.md Uses apt-cache to search for available packages related to libsdl2 on Debian or Ubuntu Linux. Helps identify the correct package name for installation. ```Bash apt-cache search libsdl2 ``` -------------------------------- ### Basic LVGL Menu Creation C Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/examples/widgets/menu/index.rst This example demonstrates the fundamental steps required to create a simple menu using the LVGL library. It covers the basic structure and initialization of a menu object. ```c Code for widgets/menu/lv_example_menu_1.c would be loaded here. ``` -------------------------------- ### Install Java JRE on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/pc-simulator.md Installs the default Java Runtime Environment package using apt-get on Debian or Ubuntu Linux distributions. Required for running Eclipse CDT. ```Bash sudo apt-get install default-jre ``` -------------------------------- ### Find SDL2 Package Version (Debian/Ubuntu) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/platforms/pc-simulator.md Searches the apt package cache for packages related to 'libsdl2' to find the exact package name and version on Debian-based Linux distributions before installation. ```Shell apt-cache search libsdl2 ``` -------------------------------- ### Alternative Install Path for Arduino ESP32 on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/arduino-esp32-master/docs/source/installing.rst An alternative bash script for Debian/Ubuntu, starting from the user's Arduino hardware directory, to create the espressif directory, clone the Arduino ESP32 repository, and run the get.py script. Useful if Arduino is installed in the home directory. ```bash cd ~/Arduino/hardware mkdir -p espressif && \ cd espressif && \ git clone https://github.com/espressif/arduino-esp32.git esp32 && \ cd esp32/tools && \ python3 get.py ``` -------------------------------- ### Creating Basic LVGL Objects in Micropython (Python) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/quick-overview.md Provides a basic example of creating LVGL objects (a screen, a button, and a label) using the Micropython binding. It shows how to create objects, set their parent, align them, set text, and load the screen. ```Python # Create a Button and a Label scr = lv.obj() btn = lv.btn(scr) btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0) label = lv.label(btn) label.set_text("Button") # Load the screen lv.scr_load(scr) ``` -------------------------------- ### Creating LVGL Button and Label in C Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/README.md Demonstrates how to create a button and a label on the current screen using the LVGL library in C. It sets the position and size of the button, adds a label to it, centers the label, and assigns an event callback function to handle button clicks. ```C lv_obj_t * btn = lv_btn_create(lv_scr_act()); /*Add a button to the current screen*/ lv_obj_set_pos(btn, 10, 10); /*Set its position*/ lv_obj_set_size(btn, 100, 50); /*Set its size*/ lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/ lv_obj_t * label = lv_label_create(btn); /*Add a label to the button*/ lv_label_set_text(label, "Button"); /*Set the labels text*/ lv_obj_center(label); /*Align the label to the center*/ ... void btn_event_cb(lv_event_t * e) { printf("Clicked\\n"); } ``` -------------------------------- ### Build and Install Freetype Library (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/Adafruit_GFX_Library/fontconvert/fontconvert_win.md Executes the standard configure, make, and make install commands to build and install the Freetype library using MinGW/MSYS, installing it under the /mingw prefix. ```Shell ./configure --prefix=/mingw make make install ``` -------------------------------- ### Install SDL2 Runtime Library (Linux) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/pc-simulator.md Command to install the SDL2 runtime library on Debian-based Linux distributions using apt-get. Replace the package name with the specific version found using `apt-cache search`. ```Shell sudo apt-get install libsdl2-2.0-0 ``` -------------------------------- ### Create LVGL Button and Label - Micropython Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/README.md This snippet illustrates how to create an LVGL button and a label using the Micropython binding. It covers setting the button's position and size, adding a label with text, centering the label, and defining and assigning a callback function for the click event. ```Micropython def btn_event_cb(e): print("Clicked") # Create a Button and a Label btn = lv.btn(lv.scr_act()) btn.set_pos(10, 10) btn.set_size(100, 50) btn.add_event_cb(btn_event_cb, lv.EVENT.CLICKED, None) label = lv.label(btn) label.set_text("Button") label.center() ``` -------------------------------- ### Installing Documentation Dependencies (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/arduino-esp32-master/docs/source/guides/docs_contributing.rst Install the required Python packages for building the documentation, including Sphinx and other dependencies listed in the requirements.txt file located in the 'docs' folder. ```shell pip install -U Sphinx pip install -r requirements.txt ``` -------------------------------- ### Documenting C Functions with Doxygen-style Comments Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/CODING_STYLE.md Example of the required Doxygen-style comment block that should precede every function definition, explaining its purpose, parameters, and return value. ```C /** * Return with the screen of an object * @param obj pointer to an object * @return pointer to a screen */ lv_obj_t * lv_obj_get_scr(lv_obj_t * obj); ``` -------------------------------- ### Find SDL2 Package Version on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/get-started/platforms/pc-simulator.md Searches the apt package cache for available SDL2 packages to identify the correct version name for installation. ```shell apt-cache search libsdl2 ``` -------------------------------- ### Creating an LVGL Button with Label in C Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/README.md This C code snippet demonstrates how to create a basic button and a label using the LVGL library. It sets the button's position and size, adds a label with text, centers the label, and assigns a callback function to handle click events. ```C lv_obj_t * btn = lv_btn_create(lv_scr_act()); /*Add a button to the current screen*/ lv_obj_set_pos(btn, 10, 10); /*Set its position*/ lv_obj_set_size(btn, 100, 50); /*Set its size*/ lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/ lv_obj_t * label = lv_label_create(btn); /*Add a label to the button*/ lv_label_set_text(label, "Button"); /*Set the labels text*/ lv_obj_center(label); /*Align the label to the center*/ ... void btn_event_cb(lv_event_t * e) { printf("Clicked\n"); } ``` -------------------------------- ### C Function Comment Style Example Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/CODING_STYLE.md Illustrates the required format for function comments, including a brief description, parameter documentation (@param), and return value documentation (@return). ```c /** * Return with the screen of an object * @param obj pointer to an object * @return pointer to a screen */ lv_obj_t * lv_obj_get_scr(lv_obj_t * obj); ``` -------------------------------- ### Creating LVGL Button and Label in Micropython Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/README.md Shows how to create a button and a label using the LVGL library binding for Micropython. It sets the button's position and size, adds a label with text, centers the label, and attaches an event callback function to print 'Clicked' when the button is clicked. ```Micropython def btn_event_cb(e): print("Clicked") # Create a Button and a Label btn = lv.btn(lv.scr_act()) btn.set_pos(10, 10) btn.set_size(100, 50) btn.add_event_cb(btn_event_cb, lv.EVENT.CLICKED, None) label = lv.label(btn) label.set_text("Button") label.center() ``` -------------------------------- ### Create LVGL Button and Label - C Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/README.md This snippet demonstrates how to create a basic button and a label on the active screen using the LVGL library in C. It shows how to set the button's position and size, add a label with text, center the label, and assign a click event callback function. ```C lv_obj_t * btn = lv_btn_create(lv_scr_act()); /*Add a button to the current screen*/ lv_obj_set_pos(btn, 10, 10); /*Set its position*/ lv_obj_set_size(btn, 100, 50); /*Set its size*/ lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/ lv_obj_t * label = lv_label_create(btn); /*Add a label to the button*/ lv_label_set_text(label, "Button"); /*Set the labels text*/ lv_obj_center(label); /*Align the label to the center*/ ... void btn_event_cb(lv_event_t * e) { printf("Clicked\n"); } ``` -------------------------------- ### Sphinx toctree Directive (reStructuredText) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/index.md This reStructuredText snippet uses the Sphinx `.. toctree::` directive to generate a table of contents. The `:maxdepth: 2` option limits the depth of the generated table of contents to two levels. The listed items (`quick-overview`, `platforms/index`, etc.) are the documents to include in the table of contents. ```reStructuredText .. toctree:: :maxdepth: 2 quick-overview platforms/index os/index bindings/index ``` -------------------------------- ### Start LVGL Demo in NSH Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/os/nuttx.md After flashing and resetting the board, this command is entered into the NuttX Shell (NSH) terminal to launch the LVGL demo application. This command executes the pre-configured LVGL example. ```Shell lvgldemo ``` -------------------------------- ### Create Build Directory (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/LovyanGFX-master/examples_for_PC/CMake_WASM/README.md Creates a new directory named 'build' to store build artifacts. ```Shell mkdir build ``` -------------------------------- ### Install Prerequisites for NuttX/LVGL on WSL Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/os/nuttx.md Installs the necessary build tools and libraries required to compile NuttX and its applications on a system using Windows Subsystem for Linux (WSL). This command uses `apt-get` to fetch packages. ```Shell sudo apt-get install automake bison build-essential flex gcc-arm-none-eabi gperf git libncurses5-dev libtool libusb-dev libusb-1.0.0-dev pkg-config kconfig-frontends openocd ``` -------------------------------- ### Creating an LVGL Button with Label in Micropython Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/README.md This Micropython code snippet demonstrates how to create a button and a label using the LVGL binding. It defines an event callback function, creates the button and label, sets their properties like position, size, and text, and assigns the callback to the button's click event. ```Micropython def btn_event_cb(e): print("Clicked") # Create a Button and a Label btn = lv.btn(lv.scr_act()) btn.set_pos(10, 10) btn.set_size(100, 50) btn.add_event_cb(btn_event_cb, lv.EVENT.CLICKED, None) label = lv.label(btn) label.set_text("Button") label.center() ``` -------------------------------- ### Nested Scrolling LVGL C Example Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/src/examples/scroll/index.rst Demonstrates how to implement nested scrolling behavior in LVGL using the C language. This example shows a basic setup for scrollable containers within other scrollable containers. ```c scroll/lv_example_scroll_1 ``` -------------------------------- ### Initialize LVGL and Run Music Demo in C Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/demos/music/README.md After initializing the LVGL library and display/input drivers using `lv_init()`, call the `lv_demo_music()` function to start the music player demo interface. ```C lv_init(); lv_demo_music(); ``` -------------------------------- ### Installing Pre-Commit Git Hooks Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/CODING_STYLE.md Command to install the git hook scripts configured in the .pre-commit-config.yaml file. This sets up pre-commit to run automatically on 'git commit'. Requires the pre-commit Python package to be installed. ```console pre-commit install ``` -------------------------------- ### Build Project with Emscripten Make (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/LovyanGFX-master/examples_for_PC/CMake_WASM/README.md Executes the build process using 'make' wrapped by 'emmake', which ensures the Emscripten environment is used for compilation and linking. ```Shell emmake make ``` -------------------------------- ### Install Build Prerequisites (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/get-started/os/nuttx.md Installs the required packages and tools for building NuttX on a Debian/Ubuntu-based system using `apt-get`. This includes compilers, build utilities, and flashing tools like OpenOCD. ```Shell $ sudo apt-get install automake bison build-essential flex gcc-arm-none-eabi gperf git libncurses5-dev libtool libusb-dev libusb-1.0.0-dev pkg-config kconfig-frontends openocd ``` -------------------------------- ### Initialize LVGL and Run Keypad/Encoder Demo Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/src/demos/keypad_encoder/README.md After successfully initializing the LVGL graphics library and its drivers, call these functions in sequence to start the keypad and encoder demo application. ```C lv_init(); lv_demo_keypad_encoder(); ``` -------------------------------- ### Install FFmpeg using configure, make, and install (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/libs/ffmpeg.md These commands configure, build, and install the FFmpeg library from source with specific features enabled for integration. The configure script prepares the build system, make compiles the source code, and sudo make install installs the compiled binaries and libraries to the system. ```Shell ./configure --disable-all --disable-autodetect --disable-podpages --disable-asm --enable-avcodec --enable-avformat --enable-decoders --enable-encoders --enable-demuxers --enable-parsers --enable-protocol='file' --enable-swscale --enable-zlib make sudo make install ``` -------------------------------- ### Create Build Directory (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/LovyanGFX/examples_for_PC/CMake_WASM/README.md Creates a new directory named 'build' in the current location to store build artifacts. ```Shell mkdir build ``` -------------------------------- ### Installing Git Hooks with pre-commit Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/CODING_STYLE.md Shows the console command required to install the git hook scripts managed by the pre-commit tool into the local `.git` directory, enabling automatic hook execution on subsequent commits. ```console pre-commit install ``` -------------------------------- ### Install NuttX Prerequisites (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/os/nuttx.md Installs necessary build tools and libraries for NuttX development on a Linux system (specifically targeting WSL). Uses `apt-get` to install packages like `automake`, `bison`, `build-essential`, `gcc-arm-none-eabi`, `git`, `libncurses5-dev`, `libtool`, `libusb-dev`, `pkg-config`, `kconfig-frontends`, and `openocd`. ```shell sudo apt-get install automake bison build-essential flex gcc-arm-none-eabi gperf git libncurses5-dev libtool libusb-dev libusb-1.0.0-dev pkg-config kconfig-frontends openocd ``` -------------------------------- ### Link LVGL Examples with CMake Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/cmake.md Demonstrates how to add the LVGL examples target (lvgl::examples) as a dependency to a project's executable target, allowing the project to build and use the provided LVGL examples. ```CMake # The target "MyFirmware" depends on LVGL and examples target_link_libraries(MyFirmware PRIVATE lvgl::lvgl lvgl::examples) ``` -------------------------------- ### Build Script Usage Example Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/arduino-esp32-master/docs/source/lib_builder.rst Shows the general usage syntax for the build.sh script, listing available command-line options for customizing the build process. ```bash build.sh [-s] [-A arduino_branch] [-I idf_branch] [-i idf_commit] [-c path] [-t ] [-b ] [config ...] ``` -------------------------------- ### Build and Run WebAssembly Port - Shell Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/LovyanGFX/examples_for_PC/CMake_WASM/README.md These commands guide the user through creating a build directory, navigating into it, configuring the build with `emcmake` (Emscripten's CMake wrapper), and compiling the project using `emmake` (Emscripten's make wrapper). ```Shell mkdir build cd build emcmake cmake .. emmake make ``` -------------------------------- ### Install Java JRE on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/platforms/pc-simulator.md Installs the default Java Runtime Environment on Debian-based Linux distributions like Ubuntu, which is required for running Eclipse CDT. ```Shell sudo apt-get install default-jre ``` -------------------------------- ### Get Chart X Start Point - LVGL C Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/CHANGELOG.md Retrieves the current index in the data array that corresponds to the starting point on the chart's x-axis. ```c lv_chart_get_x_start_point() ``` -------------------------------- ### Include and Link LVGL Drivers and Examples with CMake Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/cmake.md Shows how to use FetchContent to include the LVGL drivers and demos repositories from GitHub. It then demonstrates linking the project's executable target against the lvgl::drivers and lvgl::examples targets, and mentions setting LV_DEMO_CONF_PATH for the demo configuration header. ```CMake # Specify path to own LVGL demos config header set(LV_DEMO_CONF_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/lv_demo_conf.h CACHE STRING "" FORCE) FetchContent_Declare(lv_drivers GIT_REPOSITORY https://github.com/lvgl/lv_drivers) FetchContent_MakeAvailable(lv_drivers) FetchContent_Declare(lv_demos GIT_REPOSITORY https://github.com/lvgl/lv_demos.git) FetchContent_MakeAvailable(lv_demos) # The target "MyFirmware" depends on LVGL, drivers and demos target_link_libraries(MyFirmware PRIVATE lvgl::lvgl lvgl::drivers lvgl::examples) ``` -------------------------------- ### Get Chart X-Axis Start Point LVGL C Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/CHANGELOG.md Retrieves the current index of the x-axis start point within the data array for a chart object. ```C lv_chart_get_x_start_point() ``` -------------------------------- ### Get Chart X-Axis Start Point in LVGL C Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/CHANGELOG.md Retrieves the current index within the data array that is used as the starting point for the x-axis on a chart. ```C lv_chart_get_x_start_point() ``` -------------------------------- ### Creating LVGL Objects and Loading Screen (Micropython) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/quick-overview.md A basic Micropython example showing how to create a screen, a button on that screen, a label on the button, set the label text, align the button, and finally load the screen to make it visible. ```Python # Create a Button and a Label scr = lv.obj() btn = lv.btn(scr) btn.align(lv.scr_act(), lv.ALIGN.CENTER, 0, 0) label = lv.label(btn) label.set_text("Button") # Load the screen lv.scr_load(scr) ``` -------------------------------- ### Creating NuttX Workspace (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/nuttx.md Creates a directory for NuttX source files and navigates into it. ```Shell mkdir ~/nuttxspace cd ~/nuttxspace ``` -------------------------------- ### Integrating LVGL Drivers and Examples with CMake Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/platforms/cmake.md This CMake configuration demonstrates how to integrate both LVGL drivers and examples into a project using FetchContent. It fetches the `lv_drivers` repository and then links the `lvgl::drivers` and `lvgl::examples` targets to the project's executable target. ```cmake FetchContent_Declare(lv_drivers GIT_REPOSITORY https://github.com/lvgl/lv_drivers) FetchContent_MakeAvailable(lv_drivers) # The target "MyFirmware" depends on LVGL, drivers and demos target_link_libraries(MyFirmware PRIVATE lvgl::lvgl lvgl::drivers lvgl::examples) ``` -------------------------------- ### Retrieving LVGL Event Target Object (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/get-started/quick-overview.md This snippet, used within an LVGL event callback, shows how to get a pointer to the object that originally triggered the event. It calls `lv_event_get_target`, passing the event object `e`, and stores the returned `lv_obj_t *` pointer in the `obj` variable. This is useful when a single callback function handles events from multiple objects. ```C lv_obj_t * obj = lv_event_get_target(e); ``` -------------------------------- ### Configuring LGFX_LINUX_FB Project with CMake Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/LovyanGFX/examples_for_PC/CMake_FrameBuffer/CMakeLists.txt This snippet defines the CMake project setup. It sets the minimum required CMake version, names the project, adds a preprocessor definition, finds source files using GLOB, creates an executable from these files, specifies public include directories for LovyanGFX, sets the C++ standard to 17, and links the executable with the pthreads library. ```CMake cmake_minimum_required (VERSION 3.8) project(LGFX_LINUX_FB) add_definitions(-DLGFX_LINUX_FB) file(GLOB Target_Files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS *.cpp LovyanGFX/src/lgfx/Fonts/efont/*.c LovyanGFX/src/lgfx/Fonts/IPA/*.c LovyanGFX/src/lgfx/utility/*.c LovyanGFX/src/lgfx/v1/*.cpp LovyanGFX/src/lgfx/v1/misc/*.cpp LovyanGFX/src/lgfx/v1/panel/Panel_Device.cpp LovyanGFX/src/lgfx/v1/platforms/framebuffer/*.cpp ) add_executable (LGFX_LINUX_FB ${Target_Files}) target_include_directories(LGFX_LINUX_FB PUBLIC "LovyanGFX/src/") target_compile_features(LGFX_LINUX_FB PUBLIC cxx_std_17) target_link_libraries(LGFX_LINUX_FB -lpthread) ``` -------------------------------- ### Linking LVGL Drivers and Examples with CMake Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/cmake.md Demonstrates fetching the LVGL drivers and demos repositories using FetchContent, setting the LV_DEMO_CONF_PATH, and linking the `lvgl::drivers` and `lvgl::examples` targets to the project executable. ```cmake # Specify path to own LVGL demos config header set(LV_DEMO_CONF_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/lv_demo_conf.h CACHE STRING "" FORCE) FetchContent_Declare(lv_drivers GIT_REPOSITORY https://github.com/lvgl/lv_drivers) FetchContent_MakeAvailable(lv_drivers) FetchContent_Declare(lv_demos GIT_REPOSITORY https://github.com/lvgl/lv_demos.git) FetchContent_MakeAvailable(lv_demos) # The target "MyFirmware" depends on LVGL, drivers and demos target_link_libraries(MyFirmware PRIVATE lvgl::lvgl lvgl::drivers lvgl::examples) ``` -------------------------------- ### Install librosa Python Library Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/demos/music/README.md Install the required `librosa` library using pip to run the `spectrum.py` script, which is used to generate spectrum data from audio files for the demo. ```Shell pip3 install librosa ``` -------------------------------- ### Install Build Essentials (Linux) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/pc-simulator.md Command to install the `build-essential` package on Debian-based Linux distributions. This package includes essential tools like GCC, G++, and make, necessary for compiling software. ```Shell sudo apt-get install build-essential ``` -------------------------------- ### Getting LVGL Event Code in Callback (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/quick-overview.md Shows how to extract the specific event code that triggered the callback from the `lv_event_t` structure (`e`) using the `lv_event_get_code` function. ```c lv_event_code_t code = lv_event_get_code(e); ``` -------------------------------- ### Implementing and Registering LVGL Display Driver (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/quick-overview.md This code demonstrates how to initialize and configure an `lv_disp_drv_t` structure, assign the draw buffer, set resolution, and register the driver. It includes an example `my_disp_flush` function showing how to copy rendered pixels to the display using a placeholder `set_pixel` function and calling `lv_disp_flush_ready` when the flushing is complete. Requires a `set_pixel` function implementation. ```C static lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/ lv_disp_drv_init(&disp_drv); /*Basic initialization*/ disp_drv.flush_cb = my_disp_flush; /*Set your driver function*/ disp_drv.draw_buf = &draw_buf; /*Assign the buffer to the display*/ disp_drv.hor_res = MY_DISP_HOR_RES; /*Set the horizontal resolution of the display*/ disp_drv.ver_res = MY_DISP_VER_RES; /*Set the vertical resolution of the display*/ lv_disp_drv_register(&disp_drv); /*Finally register the driver*/ void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) { int32_t x, y; /*It's a very slow but simple implementation. *`set_pixel` needs to be written by you to a set pixel on the screen*/ for(y = area->y1; y <= area->y2; y++) { for(x = area->x1; x <= area->x2; x++) { set_pixel(x, y, *color_p); color_p++; } } lv_disp_flush_ready(disp); /* Indicate you are ready with the flushing*/ } ``` -------------------------------- ### Creating an LVGL Button with Label and Event Callback (Micropython) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/README.md This Micropython code snippet shows how to create an LVGL button and a label. It defines an event callback function `btn_event_cb` that prints "Clicked". The code then creates a button, sets its position and size, adds the callback for click events, and finally creates a label on the button, sets its text, and centers it. ```Micropython def btn_event_cb(e): print("Clicked") # Create a Button and a Label btn = lv.btn(lv.scr_act()) btn.set_pos(10, 10) btn.set_size(100, 50) btn.add_event_cb(btn_event_cb, lv.EVENT.CLICKED, None) label = lv.label(btn) label.set_text("Button") label.center() ``` -------------------------------- ### Styling Buttons Example (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/src/examples/widgets/btn/index.rst Shows how to apply custom styles to LVGL buttons by referencing the standard styling example. ```c .. lv_example:: widgets/btn/lv_example_btn_2 :language: c ``` -------------------------------- ### Install SDL2 Library on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/platforms/pc-simulator.md Installs the main SDL2 library package on Debian-based Linux distributions. The specific package name (e.g., libsdl2-2.0-0) should be determined using `apt-cache search libsdl2`. ```bash sudo apt-get install libsdl2-2.0-0 ``` -------------------------------- ### Clone NuttX and Apps Repositories Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/os/nuttx.md Clones the main Apache NuttX RTOS repository and the associated applications repository from GitHub into the current workspace directory. These repositories contain the core OS and example applications, including the LVGL demo. ```Shell git clone https://github.com/apache/incubator-nuttx nuttx git clone https://github.com/apache/incubator-nuttx-apps apps ``` -------------------------------- ### Retrieving LVGL Event Code in C Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/quick-overview.md Shows how to get the specific event code that triggered an event callback from the `lv_event_t *` parameter `e` using the `lv_event_get_code` function. ```C lv_event_code_t code = lv_event_get_code(e); ``` -------------------------------- ### Getting LVGL Event Target Object in Callback (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/quick-overview.md Demonstrates how to obtain a pointer to the LVGL object that generated the event from the `lv_event_t` structure (`e`) using the `lv_event_get_target` function. ```c lv_obj_t * obj = lv_event_get_target(e); ``` -------------------------------- ### Getting LVGL Label Text Selection Start (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/docs/widgets/core/label.md Retrieves the character index where the text selection starts on an LVGL label. This is part of the manual text selection API. ```C lv_label_get_text_selection_start(label, start_char_index); ``` -------------------------------- ### Install SDL2 Library on macOS using Homebrew Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/platforms/pc-simulator.md Installs the SDL2 library on macOS using the Homebrew package manager, providing the necessary components for the LVGL simulator. ```bash brew install sdl2 ``` -------------------------------- ### Install Build Essentials on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/platforms/pc-simulator.md Installs essential build tools and libraries (like GCC, G++) on Debian-based Linux distributions, which are often required for compiling software from source or building projects. ```bash sudo apt-get install build-essential ``` -------------------------------- ### Install Java Runtime Environment (Linux) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/pc-simulator.md Command to install the default Java Runtime Environment (JRE) on Debian-based Linux distributions using the apt-get package manager. JRE is required to run Eclipse. ```Shell sudo apt-get install default-jre ``` -------------------------------- ### Install Java Runtime Environment (JRE) on Debian/Ubuntu Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/docs/get-started/pc-simulator.md Installs the default Java Runtime Environment required for running Eclipse, which is a Java-based IDE. This command is for Debian-based Linux distributions like Ubuntu. ```Shell sudo apt-get install default-jre ``` -------------------------------- ### Installing SDL2 on macOS using Homebrew (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/platforms/pc-simulator.md Command to install the SDL2 library on macOS using the Homebrew package manager. This provides the necessary SDL2 libraries for the PC simulator environment on OSX. ```Shell brew install sdl2 ``` -------------------------------- ### Install Spectrum Script Dependency (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/src/demos/music/README.md The `spectrum.py` script requires the `librosa` Python library to analyze music files. Install it using pip with the following command. ```Shell pip3 install librosa ``` -------------------------------- ### Example: Getting String Preference with Default (Arduino) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/arduino-esp32-master/docs/source/tutorials/preferences.rst Provides a concrete example of using the getString method with a specified default value ('gravel'). This value will be assigned to the 'dessert' variable if the 'favourites' key cannot be retrieved. ```arduino dessert = mySketchPrefs.getString("favourites", "gravel"); ``` -------------------------------- ### Creating an LVGL Button with Label and Event Callback (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/README.md This C code snippet demonstrates how to create a basic button object on the current screen using LVGL. It sets the button's position and size, adds a label with text centered on the button, and assigns an event callback function (`btn_event_cb`) to handle click events. The callback function simply prints "Clicked" to the console. ```C lv_obj_t * btn = lv_btn_create(lv_scr_act()); /*Add a button to the current screen*/ lv_obj_set_pos(btn, 10, 10); /*Set its position*/ lv_obj_set_size(btn, 100, 50); /*Set its size*/ lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/ lv_obj_t * label = lv_label_create(btn); /*Add a label to the button*/ lv_label_set_text(label, "Button"); /*Set the labels text*/ lv_obj_center(label); /*Align the label to the center*/ ... void btn_event_cb(lv_event_t * e) { printf("Clicked\n"); } ``` -------------------------------- ### Install Test Prerequisites (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/tests/README.md Installs necessary dependencies for running the LVGL tests on a Linux system using a provided script. ```sh scripts/install-prerequisites.sh ``` -------------------------------- ### Load Lottie Animation from File (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/HomeAssistant_7.0/lib/lvgl/examples/libs/rlottie/index.rst This example demonstrates how to load a Lottie animation from a file path on a filesystem accessible to the device, using the LVGL rlottie integration. ```c .. lv_example:: libs/rlottie/lv_example_rlottie_2 :language: c ``` -------------------------------- ### Installing Java Runtime Environment (JRE) on Debian/Ubuntu (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/libraries_of_1.0&2.0/lvgl-3/docs/get-started/platforms/pc-simulator.md Command to install the default Java Runtime Environment package on Debian-based Linux distributions like Ubuntu using apt-get. This is a prerequisite for running Eclipse, which is Java-based. ```Shell sudo apt-get install default-jre ``` -------------------------------- ### Empty Arduino Loop Function (C++) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/arduino-esp32-master/docs/source/tutorials/preferences.rst This is the standard Arduino `loop` function, which is typically called repeatedly after `setup` completes. In this specific example, the function is empty, indicating that the main program logic is executed only once within the `setup` function. ```C++ void loop() { ; } ``` -------------------------------- ### Getting Event Code in LVGL (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/quick-overview.md Shows how to retrieve the specific event code that triggered a callback from the `lv_event_t` structure (`e`) passed to the callback function. The `lv_event_get_code` function returns an `lv_event_code_t` value representing the event type. ```C lv_event_code_t code = lv_event_get_code(e); ``` -------------------------------- ### Getting Event Target Object in LVGL (C) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/7.0libraries/lvgl/docs/get-started/quick-overview.md Demonstrates how to obtain a pointer to the LVGL object that triggered the event from the `lv_event_t` structure (`e`) within an event callback function. The `lv_event_get_target` function returns an `lv_obj_t *` pointer to the target object. ```C lv_obj_t * obj = lv_event_get_target(e); ``` -------------------------------- ### Building Documentation (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/arduino-esp32-master/docs/source/guides/docs_contributing.rst Execute this command within the 'docs' folder to build the documentation and generate the HTML output files in the 'build/html' directory. This step is crucial for checking syntax and viewing the final result. ```shell make html ``` -------------------------------- ### Create NuttX Workspace (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/ESP_IDF/CrowPanel_ESP32_7.0/components/lvgl-3/docs/get-started/os/nuttx.md Creates a directory for NuttX source files and navigates into it. ```Shell mkdir ~/nuttxspace cd ~/nuttxspace ``` -------------------------------- ### Install LVGL Test Prerequisites (Shell) Source: https://github.com/elecrow-rd/crowpanel-7.0-hmi-esp32-display-800x480/blob/master/example/Arduino/arduino_code/Arduino_7inch/V3.0/libraries/lvgl/tests/README.md Installs the necessary dependencies required to run the LVGL tests on a Linux environment using a provided shell script. ```sh scripts/install-prerequisites.sh ```