「App:Library:LVGL:docs:Porting:Set up a project」の版間の差分

提供: robot-jp wiki
ナビゲーションに移動検索に移動
24行目: 24行目:
 
|-
 
|-
 
|
 
|
The graphics library itself is the <code>'''lvgl'''</code> directory.  
+
The graphics library itself is the <code style="color: #bb0000;">'''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.
+
It contains a couple of folders but to use <code style="color: #bb0000;">'''lvgl'''</code> you only need <code style="color: #bb0000;">'''.c'''</code> and <code style="color: #bb0000;">'''.h'''</code> files from the <code style="color: #bb0000;">'''src'''</code> folder.
|グラフィックライブラリ自体は <code>'''lvgl'''</code>ディレクトリです。
+
|グラフィックライブラリ自体は <code style="color: #bb0000;">'''lvgl'''</code>ディレクトリです。
いくつかのフォルダがありますが、<code>'''lvgl'''</code> を使うには <code>'''src'''</code> フォルダにある <code>'''.c'''</code> と <code>'''.h'''</code>  のファイルだけが必要です。
+
いくつかのフォルダがありますが、<code style="color: #bb0000;">'''lvgl'''</code> を使うには <code style="color: #bb0000;">'''src'''</code> フォルダにある <code style="color: #bb0000;">'''.c'''</code> と <code style="color: #bb0000;">'''.h'''</code>  のファイルだけが必要です。
 
|}
 
|}
 
:[[App:Library:LVGL:docs:Porting|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Porting|戻る : Previous]]
39行目: 39行目:
 
|-
 
|-
 
|
 
|
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 style="color: #bb0000;">'''lvgl'''</code> folder as it is into your project.
|EclipseやVSCodeのように、IDEが自動的にプロジェクトフォルダにコピーされたフォルダのファイルを追加する場合は、 <code>'''lvgl'''</code> フォルダをそのままプロジェクトにコピーすればOKです。
+
|EclipseやVSCodeのように、IDEが自動的にプロジェクトフォルダにコピーされたフォルダのファイルを追加する場合は、 <code style="color: #bb0000;">'''lvgl'''</code> フォルダをそのままプロジェクトにコピーすればOKです。
 
|}
 
|}
 
:[[App:Library:LVGL:docs:Porting|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Porting|戻る : Previous]]
51行目: 51行目:
 
|-
 
|-
 
|
 
|
LVGL also supports <code>'''make'''</code> and <code>'''CMake'''</code> build systems out of the box.  
+
LVGL also supports <code style="color: #bb0000;">'''make'''</code> and <code style="color: #bb0000;">'''CMake'''</code> build systems out of the box.  
  
 
To add LVGL to your Makefile based build system add these lines to your main Makefile:
 
To add LVGL to your Makefile based build system add these lines to your main Makefile:
61行目: 61行目:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
For integration with CMake take a look this section of the Documentation.
 
For integration with CMake take a look this section of the Documentation.
|LVGLは、 <code>'''make'''</code>と<code>'''CMake'''</code> のビルドシステムもサポートしています。
+
|LVGLは、 <code style="color: #bb0000;">'''make'''</code>と<code style="color: #bb0000;">'''CMake'''</code> のビルドシステムもサポートしています。
 
MakefileベースのビルドシステムにLVGLを追加するには、以下の行をメインのMakefileに追加してください。
 
MakefileベースのビルドシステムにLVGLを追加するには、以下の行をメインのMakefileに追加してください。
 
<syntaxhighlight lang="C++" style="border: 1px dashed gray;">
 
<syntaxhighlight lang="C++" style="border: 1px dashed gray;">
89行目: 89行目:
 
|-
 
|-
 
|
 
|
The <code>lvgl</code> folder also contains an <code>'''examples'''</code> and a <code>'''demos'''</code> folder.  
+
The <code style="color: #bb0000;">lvgl</code> folder also contains an <code style="color: #bb0000;">'''examples'''</code> and a <code style="color: #bb0000;">'''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.
 
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.
+
<code style="color: #bb0000;">'''make'''</code> and <code style="color: #bb0000;">'''CMake'''</code> handles the examples and demos, so no extra action required in these cases.
|lvglフォルダには、<code>'''examples'''</code> と <code>'''demos'''</code> フォルダが含まれています。
+
|lvglフォルダには、<code style="color: #bb0000;">'''examples'''</code> と <code style="color: #bb0000;">'''demos'''</code> フォルダが含まれています。
 
もし、ソースファイルを手動でプロジェクトに追加する必要があった場合、この2つのフォルダのソースファイルについても同じように追加することができます。
 
もし、ソースファイルを手動でプロジェクトに追加する必要があった場合、この2つのフォルダのソースファイルについても同じように追加することができます。
  
<code>'''make'''</code> と <code>'''CMake'''</code> は、examples と demos を処理するので、これらの場合、余分なアクションは必要ありません。
+
<code style="color: #bb0000;">'''make'''</code> と <code style="color: #bb0000;">'''CMake'''</code> は、examples と demos を処理するので、これらの場合、余分なアクションは必要ありません。
 
|}
 
|}
 
:[[App:Library:LVGL:docs:Porting|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Porting|戻る : Previous]]
112行目: 112行目:
 
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.
 
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 <code>'''lv_conf.h'''</code> copy '''lvgl/lv_conf_template.h''' next to the <code>'''lvgl'''</code> directory and rename it to '''''lv_conf.h'''''.  
+
To get <code style="color: #bb0000;">'''lv_conf.h'''</code> copy '''lvgl/lv_conf_template.h''' next to the <code style="color: #bb0000;">'''lvgl'''</code> directory and rename it to '''''lv_conf.h'''''.  
  
Open the file and change the <code>'''#if 0'''</code> at the beginning to <code>'''#if 1'''</code> to enable its content. So the layout of the files should look like this:
+
Open the file and change the <code style="color: #bb0000;">'''#if 0'''</code> at the beginning to <code style="color: #bb0000;">'''#if 1'''</code> to enable its content. So the layout of the files should look like this:
 
<syntaxhighlight lang="C++" style="border: 1px dashed gray;">
 
<syntaxhighlight lang="C++" style="border: 1px dashed gray;">
 
|-lvgl
 
|-lvgl
120行目: 120行目:
 
|-other files and folders
 
|-other files and folders
 
</syntaxhighlight>
 
</syntaxhighlight>
Comments in the config file explain the meaning of the options. Be sure to set at least <code>'''LV_COLOR_DEPTH'''</code> according to your display's color depth. Note that, the examples and demos explicitly need to be enabled in <code>'''lv_conf.h'''</code>.
+
Comments in the config file explain the meaning of the options. Be sure to set at least <code style="color: #bb0000;">'''LV_COLOR_DEPTH'''</code> according to your display's color depth. Note that, the examples and demos explicitly need to be enabled in <code style="color: #bb0000;">'''lv_conf.h'''</code>.
  
  
Alternatively, <code>'''lv_conf.h'''</code> can be copied to another place but then you should add the <code>'''LV_CONF_INCLUDE_SIMPLE'''</code> define to your compiler options (e.g. <code>'''-DLV_CONF_INCLUDE_SIMPLE'''</code> for GCC compiler) and set the include path manually (e.g. <code>'''-I../include/gui'''</code>). In this case LVGL will attempt to include <code>'''lv_conf.h'''</code> simply with <code>'''#include "lv_conf.h"'''</code>.
+
Alternatively, <code style="color: #bb0000;">'''lv_conf.h'''</code> can be copied to another place but then you should add the <code style="color: #bb0000;">'''LV_CONF_INCLUDE_SIMPLE'''</code> define to your compiler options (e.g. <code style="color: #bb0000;">'''-DLV_CONF_INCLUDE_SIMPLE'''</code> for GCC compiler) and set the include path manually (e.g. <code style="color: #bb0000;">'''-I../include/gui'''</code>). In this case LVGL will attempt to include <code style="color: #bb0000;">'''lv_conf.h'''</code> simply with <code style="color: #bb0000;">'''#include "lv_conf.h"'''</code>.
  
  
You can even use a different name for <code>'''lv_conf.h'''</code>.  
+
You can even use a different name for <code style="color: #bb0000;">'''lv_conf.h'''</code>.  
  
The custom path can be set via the <code>'''LV_CONF_PATH'''</code> define.  
+
The custom path can be set via the <code style="color: #bb0000;">'''LV_CONF_PATH'''</code> define.  
  
For example <code>'''-DLV_CONF_PATH="/home/joe/my_project/my_custom_conf.h"'''</code>
+
For example <code style="color: #bb0000;">'''-DLV_CONF_PATH="/home/joe/my_project/my_custom_conf.h"'''</code>
  
  
If <code>'''LV_CONF_SKIP'''</code> is defined, LVGL will not try to include <code>'''lv_conf.h'''</code>.  
+
If <code style="color: #bb0000;">'''LV_CONF_SKIP'''</code> is defined, LVGL will not try to include <code style="color: #bb0000;">'''lv_conf.h'''</code>.  
  
 
Instead you can pass the config defines using build options.  
 
Instead you can pass the config defines using build options.  
  
For example <code>'''"-DLV_COLOR_DEPTH=32 -DLV_USE_BTN 1"'''</code>.  
+
For example <code style="color: #bb0000;">'''"-DLV_COLOR_DEPTH=32 -DLV_USE_BTN 1"'''</code>.  
  
The unset options will get a default value which is the same as the ones in <code>'''lv_conf_template.h'''</code>.
+
The unset options will get a default value which is the same as the ones in <code style="color: #bb0000;">'''lv_conf_template.h'''</code>.
  
  
LVGL also can be used via <code>'''Kconfig'''</code> and <code>'''menuconfig'''</code>.  
+
LVGL also can be used via <code style="color: #bb0000;">'''Kconfig'''</code> and <code style="color: #bb0000;">'''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.  
+
You can use <code style="color: #bb0000;">'''lv_conf.h'''</code> together with Kconfig, but keep in mind that the value from <code style="color: #bb0000;">'''lv_conf.h'''</code> or build settings (<code style="color: #bb0000;">'''-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>.
+
To ignore the configs from <code style="color: #bb0000;">'''lv_conf.h'''</code> simply remove its content, or define <code style="color: #bb0000;">'''LV_CONF_SKIP'''</code>.
 
|LVGLには、'''lv_conf.h''' という設定用のヘッダファイルがあります。
 
|LVGLには、'''lv_conf.h''' という設定用のヘッダファイルがあります。
 
このヘッダを修正して、ライブラリの基本動作の設定、未使用のモジュールや機能の無効化、コンパイル時のメモリバッファのサイズ調整などを行います。
 
このヘッダを修正して、ライブラリの基本動作の設定、未使用のモジュールや機能の無効化、コンパイル時のメモリバッファのサイズ調整などを行います。
  
<code>'''lv_conf.h'''</code> を入手するには、'''lvgl/lv_conf_template.h'''を<code>'''lvgl'''</code>ディレクトリの隣にコピーし、'''''lv_conf.h''''' にリネームしてください。
+
<code style="color: #bb0000;">'''lv_conf.h'''</code> を入手するには、'''lvgl/lv_conf_template.h'''を<code style="color: #bb0000;">'''lvgl'''</code>ディレクトリの隣にコピーし、'''''lv_conf.h''''' にリネームしてください。
  
このファイルを開き、冒頭の <code>'''#if 0'''</code> を <code>'''#if 1'''</code> に変更し、内容を有効にして下さい。
+
このファイルを開き、冒頭の <code style="color: #bb0000;">'''#if 0'''</code> を <code style="color: #bb0000;">'''#if 1'''</code> に変更し、内容を有効にして下さい。
  
 
そうする事により、ファイルのレイアウトは次のようになります。
 
そうする事により、ファイルのレイアウトは次のようになります。
161行目: 161行目:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
設定ファイル内のコメントでオプションの意味を説明しています。少なくとも<code>'''LV_COLOR_DEPTH'''</code>は、ディスプレイの色深度に合わせて設定してください。なお、<code>'''lv_conf.h'''</code>では、例題やデモを明示的に有効化する必要があります。
+
設定ファイル内のコメントでオプションの意味を説明しています。少なくとも<code style="color: #bb0000;">'''LV_COLOR_DEPTH'''</code>は、ディスプレイの色深度に合わせて設定してください。なお、<code style="color: #bb0000;">'''lv_conf.h'''</code>では、例題やデモを明示的に有効化する必要があります。
  
  
また,<code>'''LV_CONF_INCLUDE_SIMPLE'''</code>をコンパイラのオプションに追加し例:GCCコンパイラでは<code>'''-DLV_CONF_INCLUDE_SIMPLE'''</code>),インクルードパスを手動設定(例:<code>'''-I../include/gui'''</code>)してください。
+
また,<code style="color: #bb0000;">'''LV_CONF_INCLUDE_SIMPLE'''</code>をコンパイラのオプションに追加し例:GCCコンパイラでは<code style="color: #bb0000;">'''-DLV_CONF_INCLUDE_SIMPLE'''</code>),インクルードパスを手動設定(例:<code style="color: #bb0000;">'''-I../include/gui'''</code>)してください。
  
この場合,LVGLは <code>'''lv_conf.h'''</code> を単に<code>'''#include"lv_conf.h"'''</code>でインクルードしようとします.
+
この場合,LVGLは <code style="color: #bb0000;">'''lv_conf.h'''</code> を単に<code style="color: #bb0000;">'''#include"lv_conf.h"'''</code>でインクルードしようとします.
  
  
<code>'''lv_conf.h'''</code> を別の名前にすることもできます。
+
<code style="color: #bb0000;">'''lv_conf.h'''</code> を別の名前にすることもできます。
  
カスタムパスは <code>'''LV_CONF_PATH'''</code> の定義で設定することができます。
+
カスタムパスは <code style="color: #bb0000;">'''LV_CONF_PATH'''</code> の定義で設定することができます。
  
例えば、 <code>'''-DLV_CONF_PATH="/home/joe/my_project/my_custom_conf.h"'''</code>
+
例えば、 <code style="color: #bb0000;">'''-DLV_CONF_PATH="/home/joe/my_project/my_custom_conf.h"'''</code>
  
  
<code>'''LV_CONF_SKIP'''</code>が定義されていると、LVGLは<code>'''lv_conf.h'''</code>をincludeしようとしません。
+
<code style="color: #bb0000;">'''LV_CONF_SKIP'''</code>が定義されていると、LVGLは<code style="color: #bb0000;">'''lv_conf.h'''</code>をincludeしようとしません。
  
 
その代わり、ビルドオプションを使用して設定定義を渡すことができます。
 
その代わり、ビルドオプションを使用して設定定義を渡すことができます。
  
たとえば<code>'''"-DLV_COLOR_DEPTH=32-DLV_USE_BTN 1"'''</code>。
+
たとえば<code style="color: #bb0000;">'''"-DLV_COLOR_DEPTH=32-DLV_USE_BTN 1"'''</code>。
  
設定されていないオプションは、<code>'''lv_conf_template.h'''</code> にあるのと同じデフォルト値が取得されます。
+
設定されていないオプションは、<code style="color: #bb0000;">'''lv_conf_template.h'''</code> にあるのと同じデフォルト値が取得されます。
  
  
LVGLを <code>'''Kconfig'''</code>と<code>'''menuconfig'''</code>を通して使うこともできます。
+
LVGLを <code style="color: #bb0000;">'''Kconfig'''</code>と<code style="color: #bb0000;">'''menuconfig'''</code>を通して使うこともできます。
  
あなたはKconfigと共に<code>'''lv_conf.h'''</code>を使うことができますが、、Kconfigの中の値を、<code>'''lv_conf.h'''</code>からの値または、build settings(<code>'''-D...'''</code>)で上書きする事を忘れてはいけません。<code>'''lv_conf.h'''</code>からの config を無視するために、単にその内容を除去するか、又は <code>'''LV_CONF_SKIP'''</code>を定義してください。
+
あなたはKconfigと共に<code style="color: #bb0000;">'''lv_conf.h'''</code>を使うことができますが、、Kconfigの中の値を、<code style="color: #bb0000;">'''lv_conf.h'''</code>からの値または、build settings(<code style="color: #bb0000;">'''-D...'''</code>)で上書きする事を忘れてはいけません。<code style="color: #bb0000;">'''lv_conf.h'''</code>からの config を無視するために、単にその内容を除去するか、又は <code style="color: #bb0000;">'''LV_CONF_SKIP'''</code>を定義してください。
 
|}
 
|}
  
202行目: 202行目:
 
The order of the initialization is:
 
The order of the initialization is:
  
# Call <code>'''lv_init()'''</code>.
+
# Call <code style="color: #bb0000;">'''lv_init()'''</code>.
 
# Initialize your drivers.
 
# Initialize your drivers.
 
# Register the display and input devices drivers in LVGL. Learn more about Display and Input device registration.
 
# Register the display and input devices drivers in LVGL. Learn more about Display and Input device registration.
# 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 style="color: #bb0000;">'''lv_tick_inc(x)'''</code> every <code style="color: #bb0000;">'''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 style="color: #bb0000;">'''lv_timer_handler()'''</code> every few milliseconds to handle LVGL related tasks. Learn more.
 
|
 
|
 
グラフィックライブラリを使用するには、初期化および必要なコンポーネントのセットアップを行う必要があります。
 
グラフィックライブラリを使用するには、初期化および必要なコンポーネントのセットアップを行う必要があります。
212行目: 212行目:
 
初期化の順序は次の通りです。
 
初期化の順序は次の通りです。
  
#<code>'''lv_init()'''</code> を呼び出します。
+
#<code style="color: #bb0000;">'''lv_init()'''</code> を呼び出します。
 
# ドライバーを初期化します。
 
# ドライバーを初期化します。
 
# LVGLにディスプレイとインプットデバイスのドライバを登録します。ディスプレイと入力デバイスの登録について、詳しくはこちらをご覧ください。
 
# LVGLにディスプレイとインプットデバイスのドライバを登録します。ディスプレイと入力デバイスの登録について、詳しくはこちらをご覧ください。
#<code>'''lv_tick_inc(x)'''</code> を <code>'''x'''</code>  msec毎に割り込みで呼び、経過時間をLVGLに報告します。詳しくはこちら。
+
#<code style="color: #bb0000;">'''lv_tick_inc(x)'''</code> を <code style="color: #bb0000;">'''x'''</code>  msec毎に割り込みで呼び、経過時間をLVGLに報告します。詳しくはこちら。
# 数ミリ秒ごとに <code>'''lv_timer_handler()'''</code> を呼び出し、LVGL関連の処理を行う。詳細はこちら。
+
# 数ミリ秒ごとに <code style="color: #bb0000;">'''lv_timer_handler()'''</code> を呼び出し、LVGL関連の処理を行う。詳細はこちら。
 
|}
 
|}
 
:[[App:Library:LVGL:docs:Porting|戻る : Previous]]
 
:[[App:Library:LVGL:docs:Porting|戻る : Previous]]

2022年6月29日 (水) 13:31時点における版

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から最新版のライブラリをダウンロードして下さい。

戻る : Previous


Add lvgl to your project

英文 自動翻訳

The graphics library itself is the lvgl directory.

It contains a couple of folders but to use lvgl you only need .c and .h files from the src folder.

グラフィックライブラリ自体は lvglディレクトリです。

いくつかのフォルダがありますが、lvgl を使うには src フォルダにある .c.h のファイルだけが必要です。

戻る : Previous


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 lvgl folder as it is into your project.

EclipseやVSCodeのように、IDEが自動的にプロジェクトフォルダにコピーされたフォルダのファイルを追加する場合は、 lvgl フォルダをそのままプロジェクトにコピーすればOKです。
戻る : Previous


Make and CMake

英文 自動翻訳

LVGL also supports make and CMake 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 ?= ${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.

LVGLは、 makeCMake のビルドシステムもサポートしています。

MakefileベースのビルドシステムにLVGLを追加するには、以下の行をメインのMakefileに追加してください。

LVGL_DIR_NAME ?= lvgl     #lvglフォルダの名前(名前を変更した場合は変更してください。)
LVGL_DIR ?= ${shell pwd}  #lvglフォルダのあるパス
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/lvgl.mk

CMakeとの統合については、ドキュメントのこのセクションを参照してください。

戻る : Previous

Other platforms and tools

英文 自動翻訳

The Get started section contains many platform specific descriptions e.g. for ESP32, Arduino, NXP, RT-Thread, NuttX, etc.

Get startedセクションには、ESP32、Arduino、NXP、RT-Thread、NuttXなど、プラットフォーム固有の記述が多く含まれています。
戻る : Previous

Demos and Examples

英文 自動翻訳

The lvgl folder also contains an examples and a demos 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.

make and CMake handles the examples and demos, so no extra action required in these cases.

lvglフォルダには、examplesdemos フォルダが含まれています。

もし、ソースファイルを手動でプロジェクトに追加する必要があった場合、この2つのフォルダのソースファイルについても同じように追加することができます。

makeCMake は、examples と demos を処理するので、これらの場合、余分なアクションは必要ありません。

戻る : Previous


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.h copy lvgl/lv_conf_template.h next to the lvgl directory and rename it to lv_conf.h.

Open the file and change the #if 0 at the beginning to #if 1 to 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_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.

LVGLには、lv_conf.h という設定用のヘッダファイルがあります。

このヘッダを修正して、ライブラリの基本動作の設定、未使用のモジュールや機能の無効化、コンパイル時のメモリバッファのサイズ調整などを行います。

lv_conf.h を入手するには、lvgl/lv_conf_template.hlvglディレクトリの隣にコピーし、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を Kconfigmenuconfigを通して使うこともできます。

あなたはKconfigと共にlv_conf.hを使うことができますが、、Kconfigの中の値を、lv_conf.hからの値または、build settings(-D...)で上書きする事を忘れてはいけません。lv_conf.hからの config を無視するために、単にその内容を除去するか、又は LV_CONF_SKIPを定義してください。

戻る : Previous

Initialization

英文 自動翻訳

To use the graphics library you have to initialize it and setup required components.

The order of the initialization is:

  1. Call lv_init().
  2. Initialize your drivers.
  3. Register the display and input devices drivers in LVGL. Learn more about Display and Input device registration.
  4. Call lv_tick_inc(x) every x milliseconds in an interrupt to report the elapsed time to LVGL. Learn more.
  5. Call lv_timer_handler() every few milliseconds to handle LVGL related tasks. Learn more.

グラフィックライブラリを使用するには、初期化および必要なコンポーネントのセットアップを行う必要があります。

初期化の順序は次の通りです。

  1. lv_init() を呼び出します。
  2. ドライバーを初期化します。
  3. LVGLにディスプレイとインプットデバイスのドライバを登録します。ディスプレイと入力デバイスの登録について、詳しくはこちらをご覧ください。
  4. lv_tick_inc(x)x msec毎に割り込みで呼び、経過時間をLVGLに報告します。詳しくはこちら。
  5. 数ミリ秒ごとに lv_timer_handler() を呼び出し、LVGL関連の処理を行う。詳細はこちら。
戻る : Previous