App:Library:LVGL:docs:Introduction

提供: robot-jp wiki
ナビゲーションに移動検索に移動

https://docs.lvgl.io/8.2/intro/index.html

Introduction

(序文)

英文 自動翻訳

LVGL (Light and Versatile Graphics Library) is a free and open-source graphics library providing everything you need to create an embedded GUI with easy-to-use graphical elements, beautiful visual effects and a low memory footprint.

LVGL(Light and Versatile Graphics Library)は、無料のオープンソースグラフィックライブラリであり、使いやすいグラフィック要素、美しい視覚効果、および低メモリフットプリントを備えた埋め込みGUIを作成するために必要なすべてを提供します。

戻る : Previous


Requirements

(要求事項)

英文 自動翻訳

Basically, every modern controller which is able to drive a display is suitable to run LVGL.

The minimal requirements are:

  • 16, 32 or 64 bit microcontroller or processor
  • > 16 MHz clock speed is recommended
  • Flash/ROM: > 64 kB for the very essential components (> 180 kB is recommended)
  • RAM:
    • Static RAM usage: ~2 kB depending on the used features and object types
    • Stack: > 2kB (> 8 kB is recommended)
    • Dynamic data (heap): > 4 KB (> 32 kB is recommended if using several objects).     Set by LV_MEM_SIZE in lv_conf.h.
    • Display buffer: > "Horizontal resolution" pixels (> 10× "Horizontal resolution" is recommended)
    • One frame buffer in the MCU or in an external display controller
  • C99 or newer compiler
  • Basic C (or C++) knowledge: pointers, structs, callbacks.


Note that memory usage may vary depending on architecture, compiler and build options.

基本的に、ディスプレイを駆動できる最新のコントローラーはすべて、LVGLの実行に適しています。

最小要件は次のとおりです。

  • 16、32、または64ビットのマイクロコントローラーまたはプロセッサー
  • >16MHzのクロック速度をお勧めします
  • フラッシュ/ROM:非常に重要なコンポーネントの場合は> 64 kB(> 180 kBを推奨)
  • RAM:
    • Static RAMの使用量:最大2 kB  使用する機能とオブジェクトタイプによる
    • Stack:> 2kB(> 8 kBを推奨)
    • Dynamic data (heap):> 4 KB(> 32 kBを推奨 複数のオブジェクトを使用する場合)。 lv_conf.hLV_MEM_SIZE で設定します。
    • Display buffer:> "水平解像度" ピクセル数(> 10×”水平解像度" を推奨)
    • MCUまたは外部ディスプレイコントローラの1つのフレームバッファ
  • C99以降のコンパイラ
  • 基本的なC(またはC ++)の知識: ポインター構造体コールバック


注:メモリ使用量は、アーキテクチャ、コンパイラ、およびビルドオプションによって異なる場合があります。

戻る : Previous

License

(ライセンス)

英文 自動翻訳

The LVGL project (including all repositories) is licensed under MIT license. This means you can use it even in commercial projects.

It's not mandatory, but we highly appreciate it if you write a few words about your project in the My projects category of the forum or a private message to lvgl.io.

Although you can get LVGL for free there is a massive amount of work behind it. It's created by a group of volunteers who made it available for you in their free time.

To make the LVGL project sustainable, please consider contributing to the project. You can choose from many different ways of contributing such as simply writing a tweet about you using LVGL, fixing bugs, translating the documentation, or even becoming a maintainer.

LVGLプロジェクト(すべてのリポジトリを含む)は、MITライセンスの下でライセンスされています。これは、商業プロジェクトでも使用できることを意味します。

必須ではありませんが、フォーラムの My Project カテゴリにプロジェクトについていくつかの単語を書き込んだり、lvgl.ioへのプライベートメッセージを書き込んだりしていただければ幸いです。

LVGLは無料で入手できますが、その背後には膨大な量の作業があります。それは彼らの自由な時間にあなたのためにそれを利用可能にしたボランティアのグループによって作成されました。

LVGLプロジェクトを持続可能にするために、プロジェクトへの貢献を検討してください。LVGLを使用して自分に関するツイートを書く、バグを修正する、ドキュメントを翻訳する、さらにはメンテナになるなど、さまざまな貢献方法から選択できます。

戻る : Previous

Repository layout

(リポジトリの配置)

英文 自動翻訳

All repositories of the LVGL project are hosted on GitHub: https://github.com/lvgl

You will find these repositories there:

LVGLプロジェクトのすべてのリポジトリは、GitHubでホストされています:https://github.com/lvgl

これらのリポジトリはそこにあります:

  • lvgl 多くの例を含むライブラリ自体。
  • lv_demo LVGLで作成されたデモ。
  • lv_drivers デバイスドライバーの表示と入力
  • blog ブログのサイトのソース(https://blog.lvgl.io
  • sim オンラインシミュレーターのサイトのソース(https://sim.lvgl.io
  • lv_sim_... さまざまなIDEおよびプラットフォーム用のシミュレータプロジェクト
  • lv_port_... 開発ボードへのLVGLポート
  • lv_binding_.. 他の言語との結合
  • lv_... 他のプラットフォームへの移植
戻る : Previous

Release policy

(リリースの方針)

英文 自動翻訳
The core repositories follow the rules of Semantic versioning:
  • Major versions for incompatible API changes. E.g. v5.0.0, v6.0.0
  • Minor version for new but backward-compatible functionalities. E.g. v6.1.0, v6.2.0
  • Patch version for backward-compatible bug fixes. E.g. v6.1.1, v6.1.2

Tags like vX.Y.Z are created for every release.

コアリポジトリは、セマンティックバージョニングのルールに従います。
  • 互換性のないAPI変更のメジャーバージョン。例:v5.0.0、v6.0.0
  • 新しいが下位互換性のある機能のマイナーバージョン。例:v6.1.0、v6.2.0
  • 下位互換性のあるバグ修正のためのパッチバージョン。例:v6.1.1、v6.1.2

のようなタグvX.Y.Zは、リリースごとに作成されます。

Release cycle

  • Bug fixes: Released on demand even weekly
  • Minor releases: Every 3-4 months
  • Major releases: Approximately yearly

リリースサイクル

  • バグ修正:毎週でもオンデマンドでリリース
  • マイナーリリース:3〜4か月ごと
  • メジャーリリース:約毎年

Branches

The core repositories have at least the following branches:

  • master latest version, patches are merged directly here.
  • release/vX.Y stable versions of the minor releases
  • fix/some-description temporary branches for bug fixes
  • feat/some-description temporary branches for features

ブランチ

コアリポジトリには、少なくとも次のブランチがあります。

  • master最新バージョンでは、パッチはここに直接マージされます。
  • release/vX.Yマイナーリリースの安定バージョン
  • fix/some-descriptionバグ修正のための一時的なブランチ
  • feat/some-description機能の一時的なブランチ

Changelog

The changes are recorded in CHANGELOG.md.

変更ログ

変更履歴はCHANGELOG.mdに記録されています。

Version support

Before v8 every minor release of major releases is supported for 1 year. Starting from v8, every minor release is supported for 1 year.

バージョンサポート

v8より前では、メジャーリリースのすべてのマイナーリリースが1年間サポートされています。v8以降、すべてのマイナーリリースが1年間サポートされます。

Version Release date Support end Active
v5.3 Feb 1, 2019 Feb 1, 2020 No
v6.1 Nov 26, 2019 Nov 26, 2020 No
v7.11 Mar 16, 2021 Mar 16, 2022 Yes
v8.0 1 Jun, 2021 1 Jun, 2022 Yes
v8.1 10 Nov, 2021 10 Nov, 2022 Yes
v8.2 In progress
戻る : Previous

FAQ

(よくある質問)

英文 自動翻訳

Where can I ask questions?

You can ask questions in the forum: https://forum.lvgl.io/.

We use GitHub issues for development related discussion.

You should use them only if your question or issue is tightly related to the development of the library.

Before posting a question, please ready this FAQ section as you might find answer to your issue here too.

どこで質問できますか?

フォーラムで質問できます:https://forum.lvgl.io/

開発関連の討論にはGitHub issuesを使用します。

質問や問題がライブラリの開発に密接に関連している場合にだけ、これらを使用するべきです。

質問を投稿する前に、このFAQセクションを確認して、回答が見つかるかどうかを確認して下さい。

Is my MCU/hardware supported?

Every MCU which is capable of driving a display via parallel port, SPI, RGB interface or anything else and fulfills the Requirements is supported by LVGL.

This includes:

  • "Common" MCUs like STM32F, STM32H, NXP Kinetis, LPC, iMX, dsPIC33, PIC32 etc.
  • Bluetooth, GSM, Wi-Fi modules like Nordic NRF and Espressif ESP32
  • Linux with frame buffer device such as /dev/fb0. This includes Single-board computers like the Raspberry Pi
  • Anything else with a strong enough MCU and a peripheral to drive a display

私のMCU/ハードウェアはサポートされていますか?

パラレルポート、SPI、RGBインターフェイスなどを介してディスプレイを駆動でき、要件を満たすすべてのMCUは、LVGLでサポートされています。

以下を含みます:

  • STM32F, STM32H, NXP Kinetis, LPC, iMX, dsPIC33, PIC32 等の"一般的な"MCU。
  • Bluetooth, GSM, Nordic NRF, Espressif ESP32 等のWi-Fiモジュール
  • / dev/fb0のようなフレームバッファデバイスを備えたLinux。これには Raspberry Pi のようなシングルボードコンピューター が含まれます
  • その他、ディスプレイを駆動するのに十分な強度のMCUと周辺機器を備えているもの

Is my display supported?

LVGL needs just one simple driver function to copy an array of pixels into a given area of the display.

If you can do this with your display then you can use it with LVGL.

Some examples of the supported display types:

  • TFTs with 16 or 24 bit color depth
  • Monitors with an HDMI port
  • Small monochrome displays
  • Gray-scale displays
  • even LED matrices
  • or any other display where you can control the color/state of the pixels


See the Porting section to learn more.

私のディスプレイはサポートされていますか?

LVGLは、ピクセルの配列をディスプレイの特定の領域にコピーするために1つの単純なドライバー関数を必要とします。

ディスプレイでこれを行うことができれば LVGL で使用できます。

サポートされている表示タイプの例:

  • 16ビット色または24ビット色のTFT
  • HDMIポート付きモニター
  • 小さなモノクロディスプレイ
  • グレースケールディスプレイ
  • LEDマトリックス
  • その他、ピクセルの色/状態を制御できるディスプレイ


詳細については、section "Porting(移植)" を参照してください。

LVGL doesn't start, randomly crashes or nothing is drawn on the display. What can be the problem?

  • Try increasing LV_MEM_SIZE.
  • Be sure lv_disp_drv_t, lv_indev_drv_t and lv_fs_drv_t are global or static.
  • Be sure your display works without LVGL. E.g. paint it to red on start up.
  • Enable Logging
  • Enable asserts in lv_conf.h (LV_USE_ASSERT_...)
  • If you use an RTOS
    • increase the stack size of the task which calls lv_timer_handler()
    • Be sure you used a mutex as described here

LVGLが起動しない、ランダムにクラッシュする、またはディスプレイに何も表示されない。何が問題になる可能性がありますか?

  • LV_MEM_SIZE の値を増やしてみてください
  • lv_disp_drv_t , lv_indev_drv_t , lv_fs_drv_t が全て global または static であることを確認してください。
  • ディスプレイが LVGLなしで機能することを確認してください。たとえば、起動時に赤に塗りつぶす等。
  • logging を有効にする
  • lv_conf.hLV_USE_ASSERT_...) で assert を有効にする
  • RTOSを使用している場合
    • lv_timer_handler() で呼び出すタスクのスタックサイズを増やす
    • ここで説明 されているように mutex を使用していることを確認してください

My display driver is not called. What have I missed?

Be sure you are calling lv_tick_inc(x) in an interrupt and lv_timer_handler() in your main while(1).


Learn more in the Tick and Task handler sections.

ディスプレイドライバが呼び出されません。何が原因でしょうか?

lv_tick_inc(x) を割込から呼び出し、

lv_timer_handler() をメインの while(1) で呼び出していることを確認してください


詳細については、section "tick" と "task handler" をご覧ください。

Why is the display driver called only once? Only the upper part of the display is refreshed.

Be sure you are calling lv_disp_flush_ready(drv) at the end of your "display flush callback".

ディスプレイドライバが1回しか呼び出されないのはなぜですか?displayの上部だけが更新されます。

"display flush callback" の最後にある lv_disp_flush_ready(drv) を呼び出していることを確認してください。

Why do I see only garbage on the screen?

Probably there a bug in your display driver.

Try the following code without using LVGL.

You should see a square with red-blue gradient.

 #define BUF_W 20
 #define BUF_H 10
 
 lv_color_t buf[BUF_W * BUF_H];
 lv_color_t * buf_p = buf;
 uint16_t x, y;
 for(y = 0; y < BUF_H; y++) {
     lv_color_t c = lv_color_mix(LV_COLOR_BLUE, LV_COLOR_RED, (y * 255) / BUF_H);
     for(x = 0; x < BUF_W; x++){
         (*buf_p) =  c;
         buf_p++;
     }
 }
 
 lv_area_t a;
 a.x1 = 10;
 a.y1 = 40;
 a.x2 = a.x1 + BUF_W - 1;
 a.y2 = a.y1 + BUF_H - 1;
 my_flush_cb(NULL, &a, buf);

画面にゴミだけが表示されるのはなぜですか?

おそらく、あなたのディスプレイドライバにバグがあります。

LVGLを使用せずに次のコードを試してください。

赤青のグラデーションの正方形が表示されるはずです。

 #define BUF_W 20
 #define BUF_H 10
 
 lv_color_t buf[BUF_W * BUF_H];
 lv_color_t * buf_p = buf;
 uint16_t x, y;
 for(y = 0; y < BUF_H; y++) {
     lv_color_t c = lv_color_mix(LV_COLOR_BLUE, LV_COLOR_RED, (y * 255) / BUF_H);
     for(x = 0; x < BUF_W; x++){
         (*buf_p) =  c;
         buf_p++;
     }
 }
 
 lv_area_t a;
 a.x1 = 10;
 a.y1 = 40;
 a.x2 = a.x1 + BUF_W - 1;
 a.y2 = a.y1 + BUF_H - 1;
 my_flush_cb(NULL, &a, buf);

Why do I see nonsense colors on the screen?

Probably LVGL's color format is not compatible with your display's color format. Check LV_COLOR_DEPTH in lv_conf.h.

If you are using 16-bit colors with SPI (or another byte-oriented interface) you probably need to set LV_COLOR_16_SWAP  1 in lv_conf.h.

It swaps the upper and lower bytes of the pixels.

画面に意味のない色が表示されるのはなぜですか?

おそらく、LVGLのカラーフォーマットが、あなたのディスプレイのカラーフォーマットと互換性がないのだと思います。

lv_conf.h の中の LV_COLOR_DEPTH を確認して下さい。。

もし、あなたが SPI(又は他のbyte単位I/F) で16bit colorを使用している場合、おそらくlv_conf.h の中の LV_COLOR_16_SWAP  1設定する必要があると思います。

これにより ピクセルの上位バイトと下位バイトを入れ替えます。

How to speed up my UI?

  • Turn on compiler optimization and enable cache if your MCU has it
  • Increase the size of the display buffer
  • Use two display buffers and flush the buffer with DMA (or similar peripheral) in the background
  • Increase the clock speed of the SPI or parallel port if you use them to drive the display
  • If your display has an SPI port consider changing to a model with a parallel interface because it has much higher throughput
  • Keep the display buffer in internal RAM (not in external SRAM) because LVGL uses it a lot and it should have a fast access time

UIを高速化する方法は?

  • コンパイラの最適化をオンにし、MCUにキャッシュがある場合はキャッシュを有効にします
  • 表示バッファのサイズを大きくします
  • 2つのディスプレイバッファを使用し、DMA(または同様の周辺機器)によりバックグラウンドでバッファをフラッシュします
  • SPIまたはパラレルポートを使用してディスプレイを駆動する場合は、それらのクロック周波数を増やしてください
  • SPIポートを持つディスプレイの場合、より高いスループットを持つパラレルインターフェース搭載モデルへの変更をご検討ください。
  • LVGLはディスプレイバッファを頻繁に使用し、アクセス時間が高速である必要があるため、ディスプレイバッファを(外部SRAMではなく)内部RAMに保持します。

How to reduce flash/ROM usage?

You can disable all the unused features (such as animations, file system, GPU etc.) and object types in lv_conf.h.

If you are using GCC you can add -fdata-sections -ffunction-sections compiler flags and --gc-sections linker flag to remove unused functions and variables from the final binary.

Flash/ROMの使用量を減らす方法は?

lv_conf.h の中で、未使用の機能(アニメーション、ファイルシステム、GPUなど)とオブジェクトタイプをすべて無効にすることができます。

GCCを使用している場合、コンパイラフラグ -fdata-sections -ffunction-sections とリンカフラグ --gc-sections を追加する事により、未使用の関数と変数を最終的なバイナリから削除する事ができます。

How to reduce the RAM usage

  • Lower the size of the Display buffer
  • Reduce LV_MEM_SIZE in lv_conf.h. This memory is used when you create objects like buttons, labels, etc.
  • To work with lower LV_MEM_SIZE you can create objects only when required and delete them when they are not needed anymore

RAM使用量を減らす方法

  • Display buffer のサイズを小さくします
  • lv_conf.h の中の LV_MEM_SIZE を小さくします。このメモリは、ボタンやラベルなどのオブジェクトを作成するときに使用されます。
  • 少ない LV_MEM_SIZE で作業するには、必要なときだけオブジェクトを作成し、不要になったら削除します。

How to work with an operating system?

To work with an operating system where tasks can interrupt each other (preemptively) you should protect LVGL related function calls with a mutex.

See the Operating system and interrupts section to learn more.

オペレーティングシステムから操作する方法は?

タスクが(プリエンプティブに)相互に割り込むことができるオペレーティングシステムで作業するには、mutex を使用してLVGL関連の関数呼び出しを保護する必要があります。

詳細は、section "Operating system and interrupts" を参照してください。

戻る : Previous