English | 中文
EN: A template project for running LVGL with PlatformIO. It supports a desktop SDL2 emulator and the STM32F429 Discovery board, with a clean structure that can be used as a starting point for embedded UI projects.
中文:一个用于在 PlatformIO 中运行 LVGL 的模板工程,支持桌面 SDL2 模拟器和 STM32F429 Discovery 开发板,可作为嵌入式 UI 项目的起点。
- LVGL demo wired for both PC (SDL2) and STM32F429 Discovery. / LVGL 示例同时适配 PC(SDL2) 与 STM32F429 Discovery。
- PlatformIO environments preconfigured for emulator and hardware builds. / 已预配置模拟器与硬件构建环境。
- HAL adapters and SDL2 drivers organized under
hal/. / HAL 适配层与 SDL2 驱动统一放在hal/目录。 - CI build on Linux, macOS, and Windows. / 支持 Linux、macOS、Windows 的 CI 构建。
- Visual Studio Code + PlatformIO extension / VS Code + PlatformIO 扩展
- Python 3
- SDL2 for desktop emulator / 桌面模拟器需要 SDL2
- Open this folder in VS Code. / 在 VS Code 中打开本目录。
- Install the PlatformIO extension when prompted. / 按提示安装 PlatformIO 扩展。
- Build or run from the PlatformIO sidebar. / 从 PlatformIO 侧边栏构建或运行。
pio run -e emulator_64bits
pio run -e emulator_64bits -t execute
pio run -e stm32f429_discoLinux (Ubuntu, Debian, ...) / Linux(Ubuntu、Debian 等)
sudo apt-get install libsdl2-devmacOS (Homebrew) / macOS(Homebrew)
brew install sdl2On Apple Silicon, if you see x86_64/arm64 linker mismatches, either add -arch arm64 to build_flags or run the emulator via system Python. / 在 Apple Silicon 上,如果遇到 x86_64/arm64 链接架构不匹配,可在 build_flags 中加入 -arch arm64,或通过系统 Python 运行模拟器。
pio run -e emulator_64bits -t executeWindows (MSYS2) / Windows(MSYS2)
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2Then add the MSYS2 mingw64/bin path to your system PATH. / 然后将 MSYS2 的 mingw64/bin 路径加入系统 PATH。
.
├─ hal/ # Hardware/SDL2 adapters / 硬件与 SDL2 适配层
├─ lib/ # Local libraries / 本地库
├─ src/ # Application code / 应用代码
├─ support/ # Helper scripts/assets / 辅助脚本与资源
├─ test/ # PlatformIO tests / PlatformIO 测试
└─ platformio.ini # Build environments / 构建环境配置
- The emulator environment uses SDL2 and compiles LVGL demos by default. / 模拟器环境使用 SDL2,并默认编译 LVGL demo。
- Remove demo build flags if you want a clean application skeleton. / 如果需要干净的应用骨架,可移除 demo 构建参数。
MIT License. This project is based on the LVGL PlatformIO example and includes LVGL under its own license. See LICENSE for details. / MIT License。本项目基于 LVGL PlatformIO 示例,并包含按其自身许可发布的 LVGL。详见 LICENSE。
