1、LVGL官网
2、What is LVGL
lvgl是一个小型开源嵌入式 GUI 库,界面精美,消耗资源小,可移植度高,支持响应式布局,全库采用纯 c 语言开发,移植上手简单。
支持平台: NXP LPC or iMX, STM32, PIC, Arduino, ESP32, Raspberry等等
简单说用lvgl可以在嵌入式上搞一下漂亮的GUI...
3、安装cmake
LVGL编译需要Cmake Version >3.10
wget https://cmake.org/files/v3.11/cmake-3.11.1.tar.gz .
tar -xvf cmake-3.11.1.tar.gz
配置编译安装cmake3.11:
./configure
make
sudo make install
4、编译LVGL simulator
git clone --recursive https://github.com/littlevgl/pc_simulator_sdl_eclipse.git
cd pc_simulator_sdl_eclipse
cmake
make -j4
./bin/main
运行结果:
在main.c中添加music demo,重新编译make -j4,运行./bin/main 即可
--- a/lv_ex_conf.h
+++ b/lv_ex_conf.h
@@ -37,7 +37,7 @@
#define LV_USE_DEMO_STRESS 1
/*Music player for LVGL*/
-#define LV_USE_DEMO_MUSIC 0
+#define LV_USE_DEMO_MUSIC 1
diff --git a/main.c b/main.c
index 7b433e6..705a205 100644
--- a/main.c
+++ b/main.c
@@ -59,8 +59,10 @@ int main(int argc, char **argv)
/*Initialize the HAL (display, input devices, tick) for LVGL*/
hal_init();
- lv_demo_widgets();
+// lv_demo_widgets();
// lv_demo_printer();
+ lv_demo_music();