diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css index d507d0765..18507d026 100644 --- a/docs/_static/css/custom.css +++ b/docs/_static/css/custom.css @@ -142,4 +142,11 @@ dl.cpp.unexpanded dd { div.body { min-width: 360px; max-width: 1920px; -} \ No newline at end of file +} + +.cpp-expr { + font-family: monospace; + background-color: #dff0ff; + padding: 1px; + border-radius: 4px; +} diff --git a/docs/get-started/index.rst b/docs/get-started/index.rst index 960764098..2606f929e 100644 --- a/docs/get-started/index.rst +++ b/docs/get-started/index.rst @@ -23,6 +23,3 @@ are learning to use LVGL: :maxdepth: 2 quick-overview - platforms/index - os/index - bindings/index diff --git a/docs/get-started/platforms/arduino.md b/docs/get-started/platforms/arduino.md deleted file mode 100644 index 2571caca4..000000000 --- a/docs/get-started/platforms/arduino.md +++ /dev/null @@ -1,84 +0,0 @@ - -# Arduino - -The [LVGL library](https://github.com/lvgl/lvgl) is directly available as Arduino libraries. - -Note that you need to choose a board powerful enough to run LVGL and your GUI. See the [requirements of LVGL](https://docs.lvgl.io/master/intro/index.html#requirements). - -For example ESP32 is a good candidate to create UI's with LVGL. - -## Get the LVGL Arduino library - -LVGL can be installed via the Arduino IDE Library Manager or as a .ZIP library. - -You can [Download](https://github.com/lvgl/lvgl/archive/refs/heads/master.zip) the latest version of LVGL from GitHub and simply copy it to Arduino's library folder. - -## Set up drivers - -To get started it's recommended to use [TFT_eSPI](https://github.com/Bodmer/TFT_eSPI) library as a TFT driver to simplify testing. -To make it work, setup `TFT_eSPI` according to your TFT display type via editing either -- `User_Setup.h` -- or by selecting a configuration in the `User_Setup_Select.h` - -Both files are located in `TFT_eSPI` library's folder. - -## Configure LVGL - -LVGL has its own configuration file called `lv_conf.h`. When LVGL is installed, follow these configuration steps: -1. Go to the directory of the installed Arduino libraries -2. Go to `lvgl` and copy `lv_conf_template.h` as `lv_conf.h` into the Arduino Libraries directory next to the `lvgl` library folder. -3. Open `lv_conf.h` and change the first `#if 0` to `#if 1` to enable the content of the file -4. Set the color depth of you display in `LV_COLOR_DEPTH` -5. Set `LV_TICK_CUSTOM 1` - -Finally the layout with `lv_conf.h` should look like this: -``` -arduino - |-libraries - |-lvgl - |-other_lib_1 - |-other_lib_2 - |-lv_conf.h -``` - -## Initialize and run LVGL - -Take a look at [LVGL_Arduino.ino](https://github.com/lvgl/lvgl/blob/master/examples/arduino/LVGL_Arduino/LVGL_Arduino.ino) to see how to initialize LVGL. -`TFT_eSPI` is used as the display driver. - -In the INO file you can see how to register a display and a touchpad for LVGL and call an example. - -## Use the examples and demos - -Note that, there is no dedicated INO file for every example. Instead, you can load an example by calling an `lv_example_...` function. For example `lv_example_btn_1()`. - -**IMPORTANT NOTE 1** -Due to some the limitations of Arduino's build system you need to copy `lvgl/examples` to `lvgl/src/examples`. Similarly for the demos `lvgl/demos` to `lvgl/src/demos`. - - -**IMPORTANT NOTE 2** -Note that the `lv_examples` library is for LVGL v7 and you shouldn't install it for this version (since LVGL v8) -as the examples and demos are now part of the main LVGL library. - -## Debugging and logging - -LVGL can display debug information in case of trouble. -In the `LVGL_Arduino.ino` example there is a `my_print` method, which sends this debug information to the serial interface. -To enable this feature you have to edit the `lv_conf.h` file and enable logging in the section `log settings`: - -```c -/*Log settings*/ -#define USE_LV_LOG 1 /*Enable/disable the log module*/ -#if LV_USE_LOG -/* How important log should be added: - * LV_LOG_LEVEL_TRACE A lot of logs to give detailed information - * LV_LOG_LEVEL_INFO Log important events - * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem - * LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail - * LV_LOG_LEVEL_NONE Do not log anything - */ -# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN -``` - -After enabling the log module and setting LV_LOG_LEVEL accordingly, the output log is sent to the `Serial` port @ 115200 bps. - diff --git a/docs/get-started/platforms/cmake.rst b/docs/get-started/platforms/cmake.rst deleted file mode 100644 index 4a42025c7..000000000 --- a/docs/get-started/platforms/cmake.rst +++ /dev/null @@ -1,137 +0,0 @@ -===== -CMake -===== - -LVGL supports integrating with `CMake `__. It comes -with preconfigured targets for: - -- `Espressif (ESP32) `__ -- `MicroPython `__ -- `Zephyr `__ - -On top of the preconfigured targets you can also use "plain" CMake to -integrate LVGL into any custom C/C++ project. - - -Prerequisites -************* - -* CMake ( >= 3.12.4 ) -* Compatible build tool e.g. - * `Make `__ - * `Ninja `__ - - -Building LVGL with CMake -************************ - -There are many ways to include external CMake projects into your own. A -modern one also used in this example is the CMake `FetchContent `__ -module. This module conveniently allows us to download dependencies -directly at configure time from e.g. `GitHub `__. -Here is an example how we might include LVGL into our own project. - -.. code:: cmake - - cmake_minimum_required(VERSION 3.14) - include(FetchContent) - - project(MyProject LANGUAGES C CXX) - - # Build an executable called "MyFirmware" - add_executable(MyFirmware src/main.c) - - # Specify path to own LVGL config header - set(LV_CONF_PATH - ${CMAKE_CURRENT_SOURCE_DIR}/src/lv_conf.h - CACHE STRING "" FORCE) - - # Fetch LVGL from GitHub - FetchContent_Declare(lvgl GIT_REPOSITORY https://github.com/lvgl/lvgl.git) - FetchContent_MakeAvailable(lvgl) - - # The target "MyFirmware" depends on LVGL - target_link_libraries(MyFirmware PRIVATE lvgl::lvgl) - -This configuration declares a dependency between the two targets -**MyFirmware** and **lvgl**. Upon building the target **MyFirmware** -this dependency will be resolved and **lvgl** will be built and linked -with it. Since LVGL requires a config header called `lv_conf.h `__ -to be includable by its sources we also set the option :c:macro:`LV_CONF_PATH` -to point to our own copy of it. - - -Additional CMake options -======================== - -Besides :c:macro:`LV_CONF_PATH` there are few additional CMake options available. - - -Include paths options ---------------------- - -- :c:macro:`LV_LVGL_H_INCLUDE_SIMPLE`: which specifies whether to ``#include "lvgl.h"`` absolute or relative - - ============ ============== - ON (default) OFF - ============ ============== - "lvgl.h" "../../lvgl.h" - ============ ============== - -- :c:macro:`LV_CONF_INCLUDE_SIMPLE`: which specifies whether to ``#include "lv_conf.h"`` and ``"lv_drv_conf.h"`` absolute or relative - - =============== ===================== - ON (default) OFF - =============== ===================== - "lv_conf.h" "../../lv_conf.h" - "lv_drv_conf.h" "../../lv_drv_conf.h" - =============== ===================== - -.. - - We do not recommend disabling those options unless your folder layout - makes it absolutely necessary. - - -Examples/demos options ----------------------- - -| LVGL `examples `__ and - `demos `__ are built by default in - the main CMake file. -| To disable their built, use: - -- :c:macro:`LV_CONF_BUILD_DISABLE_EXAMPLES`: Set to ``1`` to disable *examples* build -- :c:macro:`LV_CONF_BUILD_DISABLE_DEMOS`: Set to ``1`` to disable *demos* build - - -Building LVGL drivers -********************* - -To build `LVGL drivers `__, you can use: - -.. code:: cmake - - FetchContent_Declare(lv_drivers - GIT_REPOSITORY https://github.com/lvgl/lv_drivers) - FetchContent_MakeAvailable(lv_drivers) - - # The target "MyFirmware" depends on LVGL and drivers - target_link_libraries(MyFirmware PRIVATE lvgl::lvgl lvgl::drivers) - - -Build shared libraries with CMake -********************************* - -By default, LVGL will be built as a static library (archive). CMake can -instead be instructed to build LVGL as shared library (.so/.dll/etc.): - -.. code:: cmake - - set(BUILD_SHARED_LIBS ON) - -OR - -.. code:: console - - $ cmake "-DBUILD_SHARED_LIBS=ON" . diff --git a/docs/get-started/platforms/index.rst b/docs/get-started/platforms/index.rst deleted file mode 100644 index 832a7c2b7..000000000 --- a/docs/get-started/platforms/index.rst +++ /dev/null @@ -1,15 +0,0 @@ -========= -Platforms -========= - -.. toctree:: - :maxdepth: 2 - - pc-simulator - nxp - stm32 - espressif - arduino - tasmota-berry - cmake - mdk diff --git a/docs/index.rst b/docs/index.rst index 950080cae..557017176 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -19,6 +19,7 @@ Welcome to the documentation of LVGL! intro/index examples get-started/index + integration/index porting/index overview/index widgets/index diff --git a/docs/get-started/bindings/cpp.rst b/docs/integration/bindings/cpp.rst similarity index 100% rename from docs/get-started/bindings/cpp.rst rename to docs/integration/bindings/cpp.rst diff --git a/docs/get-started/bindings/index.rst b/docs/integration/bindings/index.rst similarity index 100% rename from docs/get-started/bindings/index.rst rename to docs/integration/bindings/index.rst diff --git a/docs/get-started/bindings/javascript.rst b/docs/integration/bindings/javascript.rst similarity index 100% rename from docs/get-started/bindings/javascript.rst rename to docs/integration/bindings/javascript.rst diff --git a/docs/get-started/bindings/micropython.rst b/docs/integration/bindings/micropython.rst similarity index 100% rename from docs/get-started/bindings/micropython.rst rename to docs/integration/bindings/micropython.rst diff --git a/docs/get-started/bindings/pikascript.rst b/docs/integration/bindings/pikascript.rst similarity index 100% rename from docs/get-started/bindings/pikascript.rst rename to docs/integration/bindings/pikascript.rst diff --git a/docs/get-started/platforms/espressif.rst b/docs/integration/chip/espressif.rst similarity index 100% rename from docs/get-started/platforms/espressif.rst rename to docs/integration/chip/espressif.rst diff --git a/docs/integration/chip/index.rst b/docs/integration/chip/index.rst new file mode 100644 index 000000000..eda0ebe90 --- /dev/null +++ b/docs/integration/chip/index.rst @@ -0,0 +1,10 @@ +============ +Chip vendors +============ + +.. toctree:: + :maxdepth: 2 + + nxp + stm32 + espressif diff --git a/docs/get-started/platforms/nxp.rst b/docs/integration/chip/nxp.rst similarity index 100% rename from docs/get-started/platforms/nxp.rst rename to docs/integration/chip/nxp.rst diff --git a/docs/get-started/platforms/stm32.rst b/docs/integration/chip/stm32.rst similarity index 100% rename from docs/get-started/platforms/stm32.rst rename to docs/integration/chip/stm32.rst diff --git a/docs/integration/driver/display/ili9341.rst b/docs/integration/driver/display/ili9341.rst new file mode 100644 index 000000000..eeddf5f89 --- /dev/null +++ b/docs/integration/driver/display/ili9341.rst @@ -0,0 +1,5 @@ +======= +ILI9341 +======= + +TODO \ No newline at end of file diff --git a/docs/integration/driver/display/index.rst b/docs/integration/driver/display/index.rst new file mode 100644 index 000000000..f13076571 --- /dev/null +++ b/docs/integration/driver/display/index.rst @@ -0,0 +1,8 @@ +======= +Drivers +======= + +.. toctree:: + :maxdepth: 2 + + ili9341 diff --git a/docs/integration/driver/index.rst b/docs/integration/driver/index.rst new file mode 100644 index 000000000..30d43c534 --- /dev/null +++ b/docs/integration/driver/index.rst @@ -0,0 +1,9 @@ +======= +Drivers +======= + +.. toctree:: + :maxdepth: 2 + + display/index + touchpad/index diff --git a/docs/integration/driver/touchpad/ft6x36.rst b/docs/integration/driver/touchpad/ft6x36.rst new file mode 100644 index 000000000..12b141a8b --- /dev/null +++ b/docs/integration/driver/touchpad/ft6x36.rst @@ -0,0 +1,5 @@ +====== +FT6X36 +====== + +TODO \ No newline at end of file diff --git a/docs/integration/driver/touchpad/index.rst b/docs/integration/driver/touchpad/index.rst new file mode 100644 index 000000000..46ae33027 --- /dev/null +++ b/docs/integration/driver/touchpad/index.rst @@ -0,0 +1,8 @@ +======= +Touchpad +======= + +.. toctree:: + :maxdepth: 2 + + ft6x36 diff --git a/docs/get-started/platforms/arduino.rst b/docs/integration/framework/arduino.rst similarity index 100% rename from docs/get-started/platforms/arduino.rst rename to docs/integration/framework/arduino.rst diff --git a/docs/integration/framework/index.rst b/docs/integration/framework/index.rst new file mode 100644 index 000000000..ca642818c --- /dev/null +++ b/docs/integration/framework/index.rst @@ -0,0 +1,11 @@ +========== +Frameworks +========== + +.. toctree:: + :maxdepth: 2 + + arduino + platformio + tasmota-berry + diff --git a/docs/integration/framework/platformio.rst b/docs/integration/framework/platformio.rst new file mode 100644 index 000000000..48c5534a1 --- /dev/null +++ b/docs/integration/framework/platformio.rst @@ -0,0 +1,5 @@ +========== +Platformio +========== + +TODO diff --git a/docs/get-started/platforms/tasmota-berry.rst b/docs/integration/framework/tasmota-berry.rst similarity index 100% rename from docs/get-started/platforms/tasmota-berry.rst rename to docs/integration/framework/tasmota-berry.rst diff --git a/docs/integration/ide/index.rst b/docs/integration/ide/index.rst new file mode 100644 index 000000000..5499b19b4 --- /dev/null +++ b/docs/integration/ide/index.rst @@ -0,0 +1,9 @@ +==== +IDEs +==== + +.. toctree:: + :maxdepth: 2 + + pc-simulator + mdk diff --git a/docs/get-started/platforms/mdk.rst b/docs/integration/ide/mdk.rst similarity index 100% rename from docs/get-started/platforms/mdk.rst rename to docs/integration/ide/mdk.rst diff --git a/docs/get-started/platforms/pc-simulator.rst b/docs/integration/ide/pc-simulator.rst similarity index 100% rename from docs/get-started/platforms/pc-simulator.rst rename to docs/integration/ide/pc-simulator.rst diff --git a/docs/integration/index.rst b/docs/integration/index.rst new file mode 100644 index 000000000..4b45ca924 --- /dev/null +++ b/docs/integration/index.rst @@ -0,0 +1,14 @@ +======================= +Integration and drivers +======================= + +.. toctree:: + :maxdepth: 2 + + build/index + chip/index + driver/index + framework/index + ide/index + os/index + bindings/index diff --git a/docs/get-started/os/freertos.rst b/docs/integration/os/freertos.rst similarity index 100% rename from docs/get-started/os/freertos.rst rename to docs/integration/os/freertos.rst diff --git a/docs/get-started/os/index.rst b/docs/integration/os/index.rst similarity index 100% rename from docs/get-started/os/index.rst rename to docs/integration/os/index.rst diff --git a/docs/get-started/os/nuttx.rst b/docs/integration/os/nuttx.rst similarity index 100% rename from docs/get-started/os/nuttx.rst rename to docs/integration/os/nuttx.rst diff --git a/docs/get-started/os/px5.rst b/docs/integration/os/px5.rst similarity index 100% rename from docs/get-started/os/px5.rst rename to docs/integration/os/px5.rst diff --git a/docs/get-started/os/rt-thread.rst b/docs/integration/os/rt-thread.rst similarity index 100% rename from docs/get-started/os/rt-thread.rst rename to docs/integration/os/rt-thread.rst diff --git a/docs/get-started/os/zephyr.rst b/docs/integration/os/zephyr.rst similarity index 100% rename from docs/get-started/os/zephyr.rst rename to docs/integration/os/zephyr.rst diff --git a/docs/others/index.rst b/docs/others/index.rst index fb95149cb..4c81bd7dc 100644 --- a/docs/others/index.rst +++ b/docs/others/index.rst @@ -10,7 +10,6 @@ Others gridnav file_explorer fragment - msg observer imgfont ime_pinyin diff --git a/docs/others/observer.rst b/docs/others/observer.rst index 26053e0aa..a8aade995 100644 --- a/docs/others/observer.rst +++ b/docs/others/observer.rst @@ -318,6 +318,3 @@ Example API *** - - -