「App:Library:LVGL:docs:Porting:Set up a project」の版間の差分
| 10行目: | 10行目: | ||
| | | | ||
|} | |} | ||
| + | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
=== Get the library === | === Get the library === | ||
| + | {| class="wikitable" | ||
| + | !英文 | ||
| + | !自動翻訳 | ||
| + | |- | ||
| + | | | ||
LVGL is available on GitHub: <nowiki>https://github.com/lvgl/lvgl</nowiki>. | LVGL is available on GitHub: <nowiki>https://github.com/lvgl/lvgl</nowiki>. | ||
You can clone it or Download the latest version of the library from GitHub. | You can clone it or Download the latest version of the library from GitHub. | ||
| + | | | ||
| + | |} | ||
| + | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
| + | |||
=== Add lvgl to your project === | === Add lvgl to your project === | ||
| + | {| class="wikitable" | ||
| + | !英文 | ||
| + | !自動翻訳 | ||
| + | |- | ||
| + | | | ||
The graphics library itself is the <code>'''lvgl'''</code> directory. It contains a couple of folders but to use <code>'''lvgl'''</code> you only need <code>'''.c'''</code> and <code>'''.h'''</code> files from the <code>'''src'''</code> folder. | The graphics library itself is the <code>'''lvgl'''</code> directory. It contains a couple of folders but to use <code>'''lvgl'''</code> you only need <code>'''.c'''</code> and <code>'''.h'''</code> files from the <code>'''src'''</code> folder. | ||
| + | | | ||
| + | |} | ||
| + | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
| + | |||
==== Automatically add files ==== | ==== Automatically add files ==== | ||
| + | {| class="wikitable" | ||
| + | !英文 | ||
| + | !自動翻訳 | ||
| + | |- | ||
| + | | | ||
If your IDE automatically adds the files from the folders copied to the project folder (as Eclipse or VSCode does), you can simply copy the <code>'''lvgl'''</code> folder as it is into your project. | If your IDE automatically adds the files from the folders copied to the project folder (as Eclipse or VSCode does), you can simply copy the <code>'''lvgl'''</code> folder as it is into your project. | ||
| + | | | ||
| + | |} | ||
| + | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
| + | |||
==== Make and CMake ==== | ==== Make and CMake ==== | ||
| + | {| class="wikitable" | ||
| + | !英文 | ||
| + | !自動翻訳 | ||
| + | |- | ||
| + | | | ||
LVGL also supports <code>'''make'''</code> and <code>'''CMake'''</code> build systems out of the box. To add LVGL to your Makefile based build system add these lines to your main Makefile: | LVGL also supports <code>'''make'''</code> and <code>'''CMake'''</code> build systems out of the box. To add LVGL to your Makefile based build system add these lines to your main Makefile: | ||
LVGL_DIR_NAME ?= lvgl #The name of the lvgl folder (change this if you have renamed it) | LVGL_DIR_NAME ?= lvgl #The name of the lvgl folder (change this if you have renamed it) | ||
| 28行目: | 61行目: | ||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/lvgl.mk | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/lvgl.mk | ||
For integration with CMake take a look this section of the Documentation. | For integration with CMake take a look this section of the Documentation. | ||
| + | | | ||
| + | |} | ||
| + | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
| + | |||
==== Other platforms and tools ==== | ==== Other platforms and tools ==== | ||
| − | + | {| class="wikitable" | |
| + | !英文 | ||
| + | !自動翻訳 | ||
| + | |- | ||
| + | | | ||
The Get started section contains many platform specific descriptions e.g. for ESP32, Arduino, NXP, RT-Thread, NuttX, etc. | The Get started section contains many platform specific descriptions e.g. for ESP32, Arduino, NXP, RT-Thread, NuttX, etc. | ||
==== Demos and Examples ==== | ==== Demos and Examples ==== | ||
| + | {| class="wikitable" | ||
| + | !英文 | ||
| + | !自動翻訳 | ||
| + | |- | ||
| + | | | ||
The <code>lvgl</code> folder also contains an <code>examples</code> and a <code>demos</code> folder. If you needed to add the source files manually to your project, you can do the same with the source files of these two folders too. <code>make</code> and <code>CMake</code> handles the examples and demos, so no extra action required in these cases. | The <code>lvgl</code> folder also contains an <code>examples</code> and a <code>demos</code> folder. If you needed to add the source files manually to your project, you can do the same with the source files of these two folders too. <code>make</code> and <code>CMake</code> handles the examples and demos, so no extra action required in these cases. | ||
| + | | | ||
| + | |} | ||
| + | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
| + | |||
=== Configuration file === | === Configuration file === | ||
| + | {| class="wikitable" | ||
| + | !英文 | ||
| + | !自動翻訳 | ||
| + | |- | ||
| + | | | ||
There is a configuration header file for LVGL called '''lv_conf.h'''. You modify this header to set the library's basic behavior, disable unused modules and features, adjust the size of memory buffers in compile-time, etc. | There is a configuration header file for LVGL called '''lv_conf.h'''. You modify this header to set the library's basic behavior, disable unused modules and features, adjust the size of memory buffers in compile-time, etc. | ||
| 52行目: | 107行目: | ||
LVGL also can be used via <code>'''Kconfig'''</code> and <code>'''menuconfig'''</code>. You can use <code>'''lv_conf.h'''</code> together with Kconfig, but keep in mind that the value from <code>'''lv_conf.h'''</code> or build settings (<code>'''-D...'''</code>) overwrite the values set in Kconfig. To ignore the configs from <code>'''lv_conf.h'''</code> simply remove its content, or define <code>'''LV_CONF_SKIP'''</code>. | LVGL also can be used via <code>'''Kconfig'''</code> and <code>'''menuconfig'''</code>. You can use <code>'''lv_conf.h'''</code> together with Kconfig, but keep in mind that the value from <code>'''lv_conf.h'''</code> or build settings (<code>'''-D...'''</code>) overwrite the values set in Kconfig. To ignore the configs from <code>'''lv_conf.h'''</code> simply remove its content, or define <code>'''LV_CONF_SKIP'''</code>. | ||
| − | + | | | |
| + | |} | ||
| + | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
=== Initialization === | === Initialization === | ||
| + | {| class="wikitable" | ||
| + | !英文 | ||
| + | !自動翻訳 | ||
| + | |- | ||
| + | | | ||
To use the graphics library you have to initialize it and setup required components. The order of the initialization is: | To use the graphics library you have to initialize it and setup required components. The order of the initialization is: | ||
| 63行目: | 125行目: | ||
# Call <code>'''lv_tick_inc(x)'''</code> every <code>'''x'''</code> milliseconds in an interrupt to report the elapsed time to LVGL. Learn more. | # Call <code>'''lv_tick_inc(x)'''</code> every <code>'''x'''</code> milliseconds in an interrupt to report the elapsed time to LVGL. Learn more. | ||
# Call <code>'''lv_timer_handler()'''</code> every few milliseconds to handle LVGL related tasks. Learn more. | # Call <code>'''lv_timer_handler()'''</code> every few milliseconds to handle LVGL related tasks. Learn more. | ||
| − | + | | | |
| − | + | |} | |
| − | + | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | |
| − | |||
| − | [[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
2022年6月21日 (火) 20:18時点における版
https://docs.lvgl.io/8.2/porting/project.html
Set up a project
| 英文 | 自動翻訳 |
|---|---|
Get the library
| 英文 | 自動翻訳 |
|---|---|
|
LVGL is available on GitHub: https://github.com/lvgl/lvgl. You can clone it or Download the latest version of the library from GitHub. |
Add lvgl to your project
| 英文 | 自動翻訳 |
|---|---|
|
The graphics library itself is the |
Automatically add files
| 英文 | 自動翻訳 |
|---|---|
|
If your IDE automatically adds the files from the folders copied to the project folder (as Eclipse or VSCode does), you can simply copy the |
Make and CMake
| 英文 | 自動翻訳 |
|---|---|
|
LVGL also supports LVGL_DIR_NAME ?= lvgl #The name of the lvgl folder (change this if you have renamed it)
LVGL_DIR ?= ${shell pwd} #The path where the lvgl folder is
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/lvgl.mk
For integration with CMake take a look this section of the Documentation. |
Other platforms and tools
| 英文 | 自動翻訳 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The Get started section contains many platform specific descriptions e.g. for ESP32, Arduino, NXP, RT-Thread, NuttX, etc. Demos and Examples
Configuration fileComments in the config file explain the meaning of the options. Be sure to set at leastLV_COLOR_DEPTH according to your display's color depth. Note that, the examples and demos explicitly need to be enabled in lv_conf.h.
Alternatively, lv_conf.h can be copied to another place but then you should add the LV_CONF_INCLUDE_SIMPLE define to your compiler options (e.g. -DLV_CONF_INCLUDE_SIMPLE for GCC compiler) and set the include path manually (e.g. -I../include/gui). In this case LVGL will attempt to include lv_conf.h simply with #include "lv_conf.h".
You can even use a different name for lv_conf.h. The custom path can be set via the LV_CONF_PATH define. For example -DLV_CONF_PATH="/home/joe/my_project/my_custom_conf.h"
If LV_CONF_SKIP is defined, LVGL will not try to include lv_conf.h. Instead you can pass the config defines using build options. For example "-DLV_COLOR_DEPTH=32 -DLV_USE_BTN 1". The unset options will get a default value which is the same as the ones in lv_conf_template.h.
LVGL also can be used via Kconfig and menuconfig. You can use lv_conf.h together with Kconfig, but keep in mind that the value from lv_conf.h or build settings (-D...) overwrite the values set in Kconfig. To ignore the configs from lv_conf.h simply remove its content, or define LV_CONF_SKIP.
Initialization
|