App:Library:LVGL:docs:Porting:Set up a project
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.
The graphics library is the lvgl directory which should be copied into your project.
LVGLはGitHubで入手できます:https://github.com/lvgl/lvgl クローンするか、GitHubから最新版のライブラリをダウンロードして下さい。
グラフィック ライブラリは、プロジェクトにコピーする必要がある lvgl ディレクトリです。
Configuration file
英文 自動翻訳 There is a configuration header file for LVGL called lv_conf.h.
It sets the library's basic behaviour, disables unused modules and features, adjusts the size of memory buffers in compile-time, etc.
Copy lvgl/lv_conf_template.h next to the
lvgldirectory and rename it to lv_conf.h.Open the file and change the
#if 0at the beginning to#if 1to enable its content.
lv_conf.hcan be copied to another place as well 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.In the config file comments explain the meaning of the options.
Check at least these three configuration options and modify them according to your hardware:
- LV_HOR_RES_MAX Your display's horizontal resolution.
- LV_VER_RES_MAX Your display's vertical resolution.
- LV_COLOR_DEPTH 8 for (RG332), 16 for (RGB565) or 32 for (RGB888 and ARGB8888).
LVGLには、lv_conf.h という設定用のヘッダファイルがあります。 ライブラリの基本的な動作を設定し、未使用のモジュールと機能を無効にし、コンパイル時のメモリ バッファのサイズを調整します。
lvgl/lv_conf_template.hをlvglディレクトリの隣にコピーし、lv_conf.h にリネームしてください。このファイルを開き、冒頭の
#if 0を#if 1に変更し、内容を有効にして下さい。そうする事により、ファイルのレイアウトは次のようになります。
lv_conf.hを別の場所にコピーすることもできますが、定義LV_CONF_INCLUDE_SIMPLEをコンパイラ オプション (GCC コンパイラの場合は-DLV_CONF_INCLUDE_SIMPLEなど) に追加し、インクルード パスを手動で設定する必要があります。
configファイルのコメントでは、オプションの意味が説明されています。少なくとも次の 3 つの構成オプションを確認し、ハードウェアに応じて変更します。
- LV_HOR_RES_MAX ディスプレイの水平解像度。
- LV_VER_RES_MAX ディスプレイの垂直解像度。
- LV_COLOR_DEPTH (RG332) の場合は 8、(RGB565) の場合は 16、(RGB888 および ARGB8888) の場合は 32。
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