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

提供: robot-jp wiki
ナビゲーションに移動検索に移動
113行目: 113行目:
 
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>.
 
|'''lv_conf.hと呼ばれるLVGL'''の構成ヘッダーファイルがあります。このヘッダーを変更して、ライブラリの基本的な動作を設定したり、未使用のモジュールや機能を無効にしたり、コンパイル時のメモリバッファのサイズを調整したりします。
 
|'''lv_conf.hと呼ばれるLVGL'''の構成ヘッダーファイルがあります。このヘッダーを変更して、ライブラリの基本的な動作を設定したり、未使用のモジュールや機能を無効にしたり、コンパイル時のメモリバッファのサイズを調整したりします。
 +
ディレクトリの横にある'''lvgl/lv_conf_template.h'''を<code>'''lv_conf.h'''</code>コピーして、名前を'''''lv_conf.h'''''に変更します。ファイルを開き、最初のを変更してそのコンテンツを有効にします。したがって、ファイルのレイアウトは次のようになります。 <code>'''lvgl#if 0#if 1'''</code>
 +
 +
 +
 +
 +
 +
 +
 +
  
ディレクトリの横にある'''lvgl/lv_conf_template.h'''を<code>'''lv_conf.h'''</code>コピーして、名前を'''''lv_conf.h'''''に変更します。ファイルを開き、最初のを変更してそのコンテンツを有効にします。したがって、ファイルのレイアウトは次のようになります。 <code>'''lvgl#if 0#if 1'''</code>
 
| -lvgl
 
<nowiki>|</nowiki> -lv_conf 。h
 
<nowiki>|-他の ファイル と フォルダ</nowiki>
 
 
設定ファイルのコメントは、オプションの意味を説明しています。少なくとも<code>'''LV_COLOR_DEPTH'''</code>ディスプレイの色深度に応じて設定してください。例とデモはで明示的に有効にする必要があることに注意してください<code>'''lv_conf.h'''</code>。
 
設定ファイルのコメントは、オプションの意味を説明しています。少なくとも<code>'''LV_COLOR_DEPTH'''</code>ディスプレイの色深度に応じて設定してください。例とデモはで明示的に有効にする必要があることに注意してください<code>'''lv_conf.h'''</code>。
  

2022年6月21日 (火) 20:41時点における版

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のみが必要です。 .c.hsrc
戻る : 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.

IDEが(EclipseまたはVSCodeのように)プロジェクトフォルダーにコピーされたフォルダーからファイルを自動的に追加する場合は、フォルダーをそのままプロジェクトにコピーするだけですlvgl
戻る : 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フォルダーがあるパス
$(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.

[はじめに]セクションには、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フォルダも含まれています。プロジェクトにソースファイルを手動で追加する必要がある場合は、これら2つのフォルダーのソースファイルでも同じことができます。例とデモを処理するため、これらの場合に追加のアクションは必要ありません。 examplesdemosmakeCMake
戻る : 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.

lv_conf.hと呼ばれるLVGLの構成ヘッダーファイルがあります。このヘッダーを変更して、ライブラリの基本的な動作を設定したり、未使用のモジュールや機能を無効にしたり、コンパイル時のメモリバッファのサイズを調整したりします。

ディレクトリの横にあるlvgl/lv_conf_template.hlv_conf.hコピーして、名前をlv_conf.hに変更します。ファイルを開き、最初のを変更してそのコンテンツを有効にします。したがって、ファイルのレイアウトは次のようになります。 lvgl#if 0#if 1





設定ファイルのコメントは、オプションの意味を説明しています。少なくともLV_COLOR_DEPTHディスプレイの色深度に応じて設定してください。例とデモはで明示的に有効にする必要があることに注意してくださいlv_conf.h


または、lv_conf.h別の場所にコピーすることもできますがLV_CONF_INCLUDE_SIMPLE、コンパイラオプションに定義を追加し(-DLV_CONF_INCLUDE_SIMPLEGCCコンパイラなど)、インクルードパスを手動で設定する必要があります(例-I../include/gui)。この場合、LVGLはlv_conf.h単純に。を含めようとし#include "lv_conf.h"ます。


に別の名前を使用することもできますlv_conf.h。カスタムパスは、LV_CONF_PATHdefineを介して設定できます。例えば-DLV_CONF_PATH="/home/joe/my_project/my_custom_conf.h"


が定義されている場合LV_CONF_SKIP、LVGLはを含めようとしませんlv_conf.h。代わりに、ビルドオプションを使用して構成定義を渡すことができます。たとえば"-DLV_COLOR_DEPTH=32 -DLV_USE_BTN 1"。設定されていないオプションは、のオプションと同じデフォルト値を取得しますlv_conf_template.h


KconfigLVGLは、および を介して使用することもできますmenuconfiglv_conf.hKconfigと一緒に使用できますが、からの値lv_conf.hまたはビルド設定(-D...)がKconfigで設定された値を上書きすることに注意してください。構成を無視するには、lv_conf.h単にそのコンテンツを削除するか、を定義します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、経過時間をLVGLに報告します。もっと詳しく知る。
  5. の構成ヘッダーファイルがあります。このヘッダーを変更して、ライブラリの基本的な動作を設定したり、未使用のモジュールや機能を無効にしたり、コンパイル時のメモリバッファのサイズを調整したりします。lv_timer_handler()LVGL関連のタスクを処理するには、数ミリ秒ごとに呼び出します。もっと詳しく知る。
戻る : Previous