mirror of
https://github.com/lvgl/lvgl.git
synced 2024-11-27 03:33:48 +08:00
docs: reorganize and add Integartion and drivers section
This commit is contained in:
parent
14c2ac43d0
commit
a9328bbe82
9
docs/_static/css/custom.css
vendored
9
docs/_static/css/custom.css
vendored
@ -142,4 +142,11 @@ dl.cpp.unexpanded dd {
|
|||||||
div.body {
|
div.body {
|
||||||
min-width: 360px;
|
min-width: 360px;
|
||||||
max-width: 1920px;
|
max-width: 1920px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cpp-expr {
|
||||||
|
font-family: monospace;
|
||||||
|
background-color: #dff0ff;
|
||||||
|
padding: 1px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
@ -23,6 +23,3 @@ are learning to use LVGL:
|
|||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
quick-overview
|
quick-overview
|
||||||
platforms/index
|
|
||||||
os/index
|
|
||||||
bindings/index
|
|
||||||
|
@ -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.
|
|
||||||
|
|
@ -1,137 +0,0 @@
|
|||||||
=====
|
|
||||||
CMake
|
|
||||||
=====
|
|
||||||
|
|
||||||
LVGL supports integrating with `CMake <https://cmake.org/>`__. It comes
|
|
||||||
with preconfigured targets for:
|
|
||||||
|
|
||||||
- `Espressif (ESP32) <https://docs.espressif.com/projects/esp-idf/en/v3.3/get-started-cmake/index.html>`__
|
|
||||||
- `MicroPython <https://docs.micropython.org/en/v1.15/develop/cmodules.html>`__
|
|
||||||
- `Zephyr <https://docs.zephyrproject.org/latest/guides/zephyr_cmake_package.html>`__
|
|
||||||
|
|
||||||
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 <https://www.gnu.org/software/make/>`__
|
|
||||||
* `Ninja <https://ninja-build.org/>`__
|
|
||||||
|
|
||||||
|
|
||||||
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 <https://cmake.org/cmake/help/latest/module/FetchContent.html>`__
|
|
||||||
module. This module conveniently allows us to download dependencies
|
|
||||||
directly at configure time from e.g. `GitHub <https://github.com/>`__.
|
|
||||||
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 <https://github.com/lvgl/lvgl/blob/master/lv_conf_template.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 <https://docs.lvgl.io/master/examples.html>`__ and
|
|
||||||
`demos <https://github.com/lvgl/lvgl/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 <https://github.com/lvgl/lv_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" .
|
|
@ -1,15 +0,0 @@
|
|||||||
=========
|
|
||||||
Platforms
|
|
||||||
=========
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 2
|
|
||||||
|
|
||||||
pc-simulator
|
|
||||||
nxp
|
|
||||||
stm32
|
|
||||||
espressif
|
|
||||||
arduino
|
|
||||||
tasmota-berry
|
|
||||||
cmake
|
|
||||||
mdk
|
|
@ -19,6 +19,7 @@ Welcome to the documentation of LVGL!
|
|||||||
intro/index
|
intro/index
|
||||||
examples
|
examples
|
||||||
get-started/index
|
get-started/index
|
||||||
|
integration/index
|
||||||
porting/index
|
porting/index
|
||||||
overview/index
|
overview/index
|
||||||
widgets/index
|
widgets/index
|
||||||
|
10
docs/integration/chip/index.rst
Normal file
10
docs/integration/chip/index.rst
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
============
|
||||||
|
Chip vendors
|
||||||
|
============
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
nxp
|
||||||
|
stm32
|
||||||
|
espressif
|
5
docs/integration/driver/display/ili9341.rst
Normal file
5
docs/integration/driver/display/ili9341.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
=======
|
||||||
|
ILI9341
|
||||||
|
=======
|
||||||
|
|
||||||
|
TODO
|
8
docs/integration/driver/display/index.rst
Normal file
8
docs/integration/driver/display/index.rst
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
=======
|
||||||
|
Drivers
|
||||||
|
=======
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
ili9341
|
9
docs/integration/driver/index.rst
Normal file
9
docs/integration/driver/index.rst
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
=======
|
||||||
|
Drivers
|
||||||
|
=======
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
display/index
|
||||||
|
touchpad/index
|
5
docs/integration/driver/touchpad/ft6x36.rst
Normal file
5
docs/integration/driver/touchpad/ft6x36.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
======
|
||||||
|
FT6X36
|
||||||
|
======
|
||||||
|
|
||||||
|
TODO
|
8
docs/integration/driver/touchpad/index.rst
Normal file
8
docs/integration/driver/touchpad/index.rst
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
=======
|
||||||
|
Touchpad
|
||||||
|
=======
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
ft6x36
|
11
docs/integration/framework/index.rst
Normal file
11
docs/integration/framework/index.rst
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
==========
|
||||||
|
Frameworks
|
||||||
|
==========
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
arduino
|
||||||
|
platformio
|
||||||
|
tasmota-berry
|
||||||
|
|
5
docs/integration/framework/platformio.rst
Normal file
5
docs/integration/framework/platformio.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
==========
|
||||||
|
Platformio
|
||||||
|
==========
|
||||||
|
|
||||||
|
TODO
|
9
docs/integration/ide/index.rst
Normal file
9
docs/integration/ide/index.rst
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
====
|
||||||
|
IDEs
|
||||||
|
====
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
pc-simulator
|
||||||
|
mdk
|
14
docs/integration/index.rst
Normal file
14
docs/integration/index.rst
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
=======================
|
||||||
|
Integration and drivers
|
||||||
|
=======================
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
build/index
|
||||||
|
chip/index
|
||||||
|
driver/index
|
||||||
|
framework/index
|
||||||
|
ide/index
|
||||||
|
os/index
|
||||||
|
bindings/index
|
@ -10,7 +10,6 @@ Others
|
|||||||
gridnav
|
gridnav
|
||||||
file_explorer
|
file_explorer
|
||||||
fragment
|
fragment
|
||||||
msg
|
|
||||||
observer
|
observer
|
||||||
imgfont
|
imgfont
|
||||||
ime_pinyin
|
ime_pinyin
|
||||||
|
@ -318,6 +318,3 @@ Example
|
|||||||
|
|
||||||
API
|
API
|
||||||
***
|
***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user