0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LVGLをWindowsPCで動かす

0
Posted at

はじめに

M5Stack Tab5 で Meshtastic の記事のとおり M5Stack Tab5 で Meshtastic を動作させようと試行錯誤していたところ、 M5Stack Tab5 は ESP32P4 を搭載で高性能だし、高解像度の画面があるし、Bluetooth でスマホと連携させなくても単体で Meshtastic 端末として使えるのに、という思いが強くなってきました。

Meshtastic の MUI/Device-UI は LVGL を使っているので、LVGL について勉強します。勉強するためには MCU/MPU ではなく Windows PC 上で試行する方が便利です。

LVGL はオープンソースの組み込み MCU/MPU 向けの GUI コンポーネントです。

Windows PC で動かす

Windows PC で LVGL を動かすためのガイドは こちら にあります。VSCode、Visual Studio、Eclipse 向けのプロジェクトが提供されています。

準備

今回は VSCode 版を使ってみます。以下のものが必要です。

  • MinGW(x86の開発環境)
  • CMake(ビルドツール)
  • SDL2(Windows UIのインターフェース)

CMake は PlatformIO で開発をしている場合はすでにインストールされている可能性があります。

SDL2 (Simple DirectMedia Layer 2) は、C のネイティブアプリから Windows の GUI インターフェースを提供します。
vcpkg を使ってインストールする方法も紹介されていますが、vcpkg の導入に Visual Studio が必要だったりして重いので、こちら からバイナリーリリースをダウンロードした方が簡単です。
現時点ではバージョン2系は 2.32.10 が最終のようです。mingw 用を適当な場所にダウンロードしたら、PATH に x86_64-w64-mingw32\bin ディレクトリーを追加、環境変数 SDL2_DIR に cmake ディレクトリーを設定します。

ビルド

git clone https://github.com/lvgl/lv_port_pc_vscode

VSCode

上記で展開したフォルダーからワークスペースをVSCodeで開き、Run and Debug から Debug LVGL demo with gdb を実行します。

cmake

mkdir build
cd build
cmake ..
make -j

実行

..\bin\main.exe

こんなウインドウが表示されます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?