「App:Library:LVGL:docs:Porting:Set up a project」の版間の差分
| 3行目: | 3行目: | ||
== Set up a project == | == Set up a project == | ||
=== Get the library === | === Get the library === | ||
| − | {| class="wikitable" | + | :{| class="wikitable" |
!英文 | !英文 | ||
!自動翻訳 | !自動翻訳 | ||
| 19行目: | 19行目: | ||
=== Add lvgl to your project === | === Add lvgl to your project === | ||
| − | {| class="wikitable" | + | :{| class="wikitable" |
!英文 | !英文 | ||
!自動翻訳 | !自動翻訳 | ||
| 31行目: | 31行目: | ||
==== Automatically add files ==== | ==== Automatically add files ==== | ||
| − | {| class="wikitable" | + | :{| class="wikitable" |
!英文 | !英文 | ||
!自動翻訳 | !自動翻訳 | ||
| 43行目: | 43行目: | ||
==== Make and CMake ==== | ==== Make and CMake ==== | ||
| − | {| class="wikitable" | + | :{| class="wikitable" |
!英文 | !英文 | ||
!自動翻訳 | !自動翻訳 | ||
| 63行目: | 63行目: | ||
==== Other platforms and tools ==== | ==== Other platforms and tools ==== | ||
| − | {| class="wikitable" | + | :{| class="wikitable" |
!英文 | !英文 | ||
!自動翻訳 | !自動翻訳 | ||
| 74行目: | 74行目: | ||
==== Demos and Examples ==== | ==== Demos and Examples ==== | ||
| − | {| class="wikitable" | + | :{| class="wikitable" |
!英文 | !英文 | ||
!自動翻訳 | !自動翻訳 | ||
| 86行目: | 86行目: | ||
=== Configuration file === | === Configuration file === | ||
| − | {| class="wikitable" | + | :{| class="wikitable" |
!英文 | !英文 | ||
!自動翻訳 | !自動翻訳 | ||
| 175行目: | 175行目: | ||
=== Initialization === | === Initialization === | ||
| − | {| class="wikitable" | + | :{| class="wikitable" |
!英文 | !英文 | ||
!自動翻訳 | !自動翻訳 | ||
2022年6月21日 (火) 21:15時点における版
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.
LVGLはGitHubで入手できます:https://github.com/lvgl/lvgl。 クローンを作成するか、GitHubからライブラリの最新バージョンをダウンロードできます。
Add lvgl to your project
英文 自動翻訳 The graphics library itself is the
lvgldirectory. It contains a couple of folders but to uselvglyou only need.cand.hfiles from thesrcfolder.グラフィックライブラリ自体が lvglディレクトリです。いくつかのフォルダが含まれていますが、使用するにはフォルダのファイルlvglのみが必要です。.c.hsrc
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
lvglfolder as it is into your project.IDEが(EclipseまたはVSCodeのように)プロジェクトフォルダーにコピーされたフォルダーからファイルを自動的に追加する場合は、フォルダーをそのままプロジェクトにコピーするだけです lvgl。
Make and CMake
英文 自動翻訳 LVGL also supports
makeandCMakebuild 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 ?= ${shell pwd} #The path where the lvgl folder is include $(LVGL_DIR)/$(LVGL_DIR_NAME)/lvgl.mkFor integration with CMake take a look this section of the Documentation.
LVGLは、すぐに使用できるシステムのサポート makeとCMake構築も行います。MakefileベースのビルドシステムにLVGLを追加するには、次の行をメインのMakefileに追加します。LVGL_DIR_NAME?= lvgl#lvglフォルダーの名前(名前を変更した場合はこれを変更してください) LVGL_DIR?= $ {shell pwd}#lvglフォルダーがあるパス $(LVGL_DIR)/ $(LVGL_DIR_NAME)/lvgl.mkを含めるCMakeとの統合については、ドキュメントのこのセクションをご覧ください。
Other platforms and tools
英文 自動翻訳 The Get started section contains many platform specific descriptions e.g. for ESP32, Arduino, NXP, RT-Thread, NuttX, etc.
[はじめに]セクションには、ESP32、Arduino、NXP、RT-Thread、NuttXなどのプラットフォーム固有の説明が多数含まれています。
Demos and Examples
英文 自動翻訳 The
lvglfolder also contains anexamplesand ademosfolder. 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.makeandCMakehandles the examples and demos, so no extra action required in these cases.このフォルダには、と lvglフォルダも含まれています。プロジェクトにソースファイルを手動で追加する必要がある場合は、これら2つのフォルダーのソースファイルでも同じことができます。例とデモを処理するため、これらの場合に追加のアクションは必要ありません。examplesdemosmakeCMake
Configuration file
英文 自動翻訳 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.
To get
lv_conf.hcopy lvgl/lv_conf_template.h next to thelvgldirectory and rename it to lv_conf.h.Open the file and change the
#if 0at the beginning to#if 1to enable its content. So the layout of the files should look like this:|-lvgl |-lv_conf.h |-other files and folders
Comments in the config file explain the meaning of the options. Be sure to set at least
LV_COLOR_DEPTHaccording to your display's color depth. Note that, the examples and demos explicitly need to be enabled inlv_conf.h.
Alternatively,lv_conf.hcan be copied to another place but then you should add theLV_CONF_INCLUDE_SIMPLEdefine to your compiler options (e.g.-DLV_CONF_INCLUDE_SIMPLEfor GCC compiler) and set the include path manually (e.g.-I../include/gui). In this case LVGL will attempt to includelv_conf.hsimply with#include "lv_conf.h".
You can even use a different name forlv_conf.h.The custom path can be set via the
LV_CONF_PATHdefine.For example
-DLV_CONF_PATH="/home/joe/my_project/my_custom_conf.h"
IfLV_CONF_SKIPis defined, LVGL will not try to includelv_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 viaKconfigandmenuconfig.You can use
lv_conf.htogether with Kconfig, but keep in mind that the value fromlv_conf.hor build settings (-D...) overwrite the values set in Kconfig.To ignore the configs from
lv_conf.hsimply remove its content, or defineLV_CONF_SKIP.LVGLには、lv_conf.h という設定用のヘッダファイルがあります。 このヘッダを修正して、ライブラリの基本動作の設定、未使用のモジュールや機能の無効化、コンパイル時のメモリバッファのサイズ調整などを行います。
lv_conf.hを入手するには、lvgl/lv_conf_template.hをlvglディレクトリの隣にコピーし、lv_conf.h にリネームしてください。このファイルを開き、冒頭の
そうする事により、ファイルのレイアウトは次のようになります。#if 0を#if 1に変更し、内容を有効にして下さい。| -lvgl | -lv_conf.h |-他の ファイル と フォルダ
設定ファイル内のコメントでオプションの意味を説明しています。少なくとも
LV_COLOR_DEPTHは、ディスプレイの色深度に合わせて設定してください。なお、lv_conf.hでは、例題やデモを明示的に有効化する必要があります。
また,LV_CONF_INCLUDE_SIMPLEをコンパイラのオプションに追加し例:GCCコンパイラでは-DLV_CONF_INCLUDE_SIMPLE),インクルードパスを手動設定(例:-I../include/gui)してください。この場合,LVGLは
lv_conf.hを単に#include"lv_conf.h"でインクルードしようとします.
lv_conf.hを別の名前にすることもできます。カスタムパスは
LV_CONF_PATHの定義で設定することができます。例えば、
-DLV_CONF_PATH="/home/joe/my_project/my_custom_conf.h"
LV_CONF_SKIPが定義されていると、LVGLはlv_conf.hをincludeしようとしません。その代わり、ビルドオプションを使用して設定定義を渡すことができます。
たとえば
"-DLV_COLOR_DEPTH=32-DLV_USE_BTN 1"。設定されていないオプションは、
lv_conf_template.hにあるのと同じデフォルト値が取得されます。
LVGLをKconfigとmenuconfigを通して使うこともできます。あなたはKconfigと共に
lv_conf.hを使うことができますが、、Kconfigの中の値を、lv_conf.hからの値または、build settings(-D...)で上書きする事を忘れてはいけません。lv_conf.hからの config を無視するために、単にその内容を除去するか、又はLV_CONF_SKIPを定義してください。
Initialization
英文 自動翻訳 To use the graphics library you have to initialize it and setup required components.
The order of the initialization is:
- Call
lv_init(). - Initialize your drivers.
- Register the display and input devices drivers in LVGL. Learn more about Display and Input device registration.
- Call
lv_tick_inc(x)everyxmilliseconds in an interrupt to report the elapsed time to LVGL. Learn more. - Call
lv_timer_handler()every few milliseconds to handle LVGL related tasks. Learn more.
グラフィックライブラリを使用するには、初期化および必要なコンポーネントのセットアップを行う必要があります。
初期化の順序は次の通りです。
lv_init()を呼び出します。- ドライバーを初期化します。
- LVGLにディスプレイとインプットデバイスのドライバを登録します。ディスプレイと入力デバイスの登録について、詳しくはこちらをご覧ください。
lv_tick_inc(x)をxmsec毎に割り込みで呼び、経過時間をLVGLに報告します。詳しくはこちら。- 数ミリ秒ごとに
lv_timer_handler()を呼び出し、LVGL関連の処理を行う。詳細はこちら。
- Call