查看: 1144|回复: 0

[评测分享] 【树莓派5 测评】 + 21.LVGL的仿真体验(zmj)

[复制链接]
  • TA的每日心情
    奋斗
    5 天前
  • 签到天数: 249 天

    连续签到: 2 天

    [LV.8]以坛为家I

    发表于 2024-5-6 20:08:32 | 显示全部楼层 |阅读模式
    分享到:
    【树莓派5 测评】 + 21.LVGL的仿真体验(zmj)


    1.        LVGL简介
    LVGL的作者是来自匈牙利的Gabor Kiss-Vamosikisvegabor,LVGL用C语言编写,以实现最大的兼容性(与C ++兼容),模拟器可在没有嵌入式硬件的PC上启动嵌入式GUI设计,同时LVGL作为一个图形库,它自带着接近三十多种小工具可以供开发者使用。这些强大的构建块按钮搭配上带有非常丝滑的动画以及可以做到平滑滚动的高级图形,同时兼具着不高的配置要求以及开源属性,显著的优势使得LVGL蔚然成风,成为广大开发者在选择GUI时的第一选择。
    1. //------LVGL官网
    2. https://docs.lvgl.io/master/
    3. //------LVGL代码仓库
    4. https://github.com/orgs/lvgl
    5. //------LVGL仿真模拟器:lv_port_pc_vscode
    6. https://github.com/lvgl/lv_port_pc_vscode
    复制代码
    2.        LVGL仿真测试
    LVGL官方推荐使用VS模拟器进行仿真测试:
    LVGL测试流程:安装依赖、下载lv_sim_vscode_sdl、编译、测试。
    详细指令如下:
    1. //------LVGL测试指令
    2. //---安装依赖
    3. sudo apt-get update && sudo apt-get install -y build-essential libsdl2-dev
    4. //---下载lv_sim_vscode_sdl
    5. git clone --recursive https://github.com/lvgl/lv_sim_vscode_sdl
    6. //---编译
    7. cd lv_sim_vscode_sdl
    8. cmake ./
    9. make
    10. //---测试demo
    11. cd bin
    12. ./main
    13. //------详细Log信息
    14. zhaomeijing@raspberrypi5:~/workspace/21_lvgl$ \
    15. sudo apt-get update && sudo apt-get install -y build-essential libsdl2-dev
    16. zhaomeijing@raspberrypi5:~/workspace/21_lvgl$ \
    17. git clone --recursive https://github.com/lvgl/lv_sim_vscode_sdl
    18. zhaomeijing@raspberrypi5:~/workspace/21_lvgl$ cd lv_sim_vscode_sdl
    19. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl$ ll
    20. total 76
    21. drwxr-xr-x  5 zhaomeijing zhaomeijing  4096 May  6 16:50 ./
    22. drwxr-xr-x  3 zhaomeijing zhaomeijing  4096 May  6 17:54 ../
    23. -rw-r--r--  1 zhaomeijing zhaomeijing  3347 May  6 16:50 CMakeLists.txt
    24. drwxr-xr-x  9 zhaomeijing zhaomeijing  4096 May  6 16:50 .git/
    25. -rw-r--r--  1 zhaomeijing zhaomeijing   176 May  6 16:50 .gitignore
    26. -rw-r--r--  1 zhaomeijing zhaomeijing   162 May  6 16:50 .gitmodules
    27. -rw-r--r--  1 zhaomeijing zhaomeijing  1083 May  6 16:50 licence.txt
    28. -rw-r--r--  1 zhaomeijing zhaomeijing 31682 May  6 16:50 lv_conf.h
    29. drwxr-xr-x 11 zhaomeijing zhaomeijing  4096 May  6 16:52 lvgl/
    30. drwxr-xr-x  3 zhaomeijing zhaomeijing  4096 May  6 16:50 main/
    31. -rw-r--r--  1 zhaomeijing zhaomeijing  2156 May  6 16:50 README.md
    32. -rw-r--r--  1 zhaomeijing zhaomeijing  1631 May  6 16:50 simulator.code-workspace
    33. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl$ cmake ./
    34. -- The C compiler identification is GNU 12.2.0
    35. -- The CXX compiler identification is GNU 12.2.0
    36. -- Detecting C compiler ABI info
    37. -- Detecting C compiler ABI info - done
    38. -- Check for working C compiler: /usr/bin/cc - skipped
    39. -- Detecting C compile features
    40. -- Detecting C compile features - done
    41. -- Detecting CXX compiler ABI info
    42. -- Detecting CXX compiler ABI info - done
    43. -- Check for working CXX compiler: /usr/bin/c++ - skipped
    44. -- Detecting CXX compile features
    45. -- Detecting CXX compile features - done
    46. -- The ASM compiler identification is GNU
    47. -- Found assembler: /usr/bin/cc
    48. -- Configuring done
    49. -- Generating done
    50. -- Build files have been written to: /home/zhaomeijing/workspace/21_lvgl/lv_sim_vscode_sdl
    51. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl$ ll
    52. total 124
    53. drwxr-xr-x  8 zhaomeijing zhaomeijing  4096 May  6 17:20 ./
    54. drwxr-xr-x  5 zhaomeijing zhaomeijing  4096 May  6 17:18 ../
    55. drwxr-xr-x  2 zhaomeijing zhaomeijing  4096 May  6 17:20 bin/
    56. -rw-r--r--  1 zhaomeijing zhaomeijing 16436 May  6 17:20 CMakeCache.txt
    57. drwxr-xr-x  7 zhaomeijing zhaomeijing  4096 May  6 17:20 CMakeFiles/
    58. -rw-r--r--  1 zhaomeijing zhaomeijing  1865 May  6 17:20 cmake_install.cmake
    59. -rw-r--r--  1 zhaomeijing zhaomeijing  3347 May  6 16:50 CMakeLists.txt
    60. drwxr-xr-x  9 zhaomeijing zhaomeijing  4096 May  6 16:50 .git/
    61. -rw-r--r--  1 zhaomeijing zhaomeijing   176 May  6 16:50 .gitignore
    62. -rw-r--r--  1 zhaomeijing zhaomeijing   162 May  6 16:50 .gitmodules
    63. drwxr-xr-x  2 zhaomeijing zhaomeijing  4096 May  6 17:20 lib/
    64. -rw-r--r--  1 zhaomeijing zhaomeijing  1083 May  6 16:50 licence.txt
    65. -rw-r--r--  1 zhaomeijing zhaomeijing 31682 May  6 16:50 lv_conf.h
    66. drwxr-xr-x 12 zhaomeijing zhaomeijing  4096 May  6 17:20 lvgl/
    67. drwxr-xr-x  3 zhaomeijing zhaomeijing  4096 May  6 16:50 main/
    68. -rw-r--r--  1 zhaomeijing zhaomeijing 10680 May  6 17:20 Makefile
    69. -rw-r--r--  1 zhaomeijing zhaomeijing  2156 May  6 16:50 README.md
    70. -rw-r--r--  1 zhaomeijing zhaomeijing  1631 May  6 16:50 simulator.code-workspace
    71. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl$ ll bin
    72. total 8
    73. drwxr-xr-x 2 zhaomeijing zhaomeijing 4096 May  6 17:20 ./
    74. drwxr-xr-x 8 zhaomeijing zhaomeijing 4096 May  6 17:20 ../
    75. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl$ make
    76. [  0%] Building C object lvgl/CMakeFiles/lvgl.dir/src/core/lv_group.c.o
    77. [  0%] Building C object lvgl/CMakeFiles/lvgl.dir/src/core/lv_obj.c.o
    78. [  0%] Building C object lvgl/CMakeFiles/lvgl.dir/src/core/lv_obj_class.c.o
    79. [  0%] Building C object lvgl/CMakeFiles/lvgl.dir/src/core/lv_obj_draw.c.o
    80. [  0%] Building C object lvgl/CMakeFiles/lvgl.dir/src/core/lv_obj_event.c.o
    81. [  0%] Building C object lvgl/CMakeFiles/lvgl.dir/src/core/lv_obj_id_builtin.c.o
    82. [  1%] Building C object lvgl/CMakeFiles/lvgl.dir/src/core/lv_obj_pos.c.o
    83. ......
    84. [ 99%] Building C object lvgl/CMakeFiles/lvgl_examples.dir/examples/widgets/win/lv_example_win_1.c.o
    85. [ 99%] Linking C static library ../lib/liblvgl_examples.a
    86. [ 99%] Built target lvgl_examples
    87. [ 99%] Building C object CMakeFiles/main.dir/main/src/main.c.o
    88. [ 99%] Building C object CMakeFiles/main.dir/main/src/mouse_cursor_icon.c.o
    89. [100%] Linking CXX executable bin/main
    90. [100%] Built target main
    91. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl$ ll
    92. total 124
    93. drwxr-xr-x  8 zhaomeijing zhaomeijing  4096 May  6 17:20 ./
    94. drwxr-xr-x  5 zhaomeijing zhaomeijing  4096 May  6 17:18 ../
    95. drwxr-xr-x  2 zhaomeijing zhaomeijing  4096 May  6 17:22 bin/
    96. -rw-r--r--  1 zhaomeijing zhaomeijing 16436 May  6 17:20 CMakeCache.txt
    97. drwxr-xr-x  7 zhaomeijing zhaomeijing  4096 May  6 17:22 CMakeFiles/
    98. -rw-r--r--  1 zhaomeijing zhaomeijing  1865 May  6 17:20 cmake_install.cmake
    99. -rw-r--r--  1 zhaomeijing zhaomeijing  3347 May  6 16:50 CMakeLists.txt
    100. drwxr-xr-x  9 zhaomeijing zhaomeijing  4096 May  6 16:50 .git/
    101. -rw-r--r--  1 zhaomeijing zhaomeijing   176 May  6 16:50 .gitignore
    102. -rw-r--r--  1 zhaomeijing zhaomeijing   162 May  6 16:50 .gitmodules
    103. drwxr-xr-x  2 zhaomeijing zhaomeijing  4096 May  6 17:22 lib/
    104. -rw-r--r--  1 zhaomeijing zhaomeijing  1083 May  6 16:50 licence.txt
    105. -rw-r--r--  1 zhaomeijing zhaomeijing 31682 May  6 16:50 lv_conf.h
    106. drwxr-xr-x 12 zhaomeijing zhaomeijing  4096 May  6 17:20 lvgl/
    107. drwxr-xr-x  3 zhaomeijing zhaomeijing  4096 May  6 16:50 main/
    108. -rw-r--r--  1 zhaomeijing zhaomeijing 10680 May  6 17:20 Makefile
    109. -rw-r--r--  1 zhaomeijing zhaomeijing  2156 May  6 16:50 README.md
    110. -rw-r--r--  1 zhaomeijing zhaomeijing  1631 May  6 16:50 simulator.code-workspace
    111. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl$ ll bin
    112. total 1056
    113. drwxr-xr-x 2 zhaomeijing zhaomeijing    4096 May  6 17:22 ./
    114. drwxr-xr-x 8 zhaomeijing zhaomeijing    4096 May  6 17:20 ../
    115. -rwxr-xr-x 1 zhaomeijing zhaomeijing 1071536 May  6 17:22 main*
    116. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl$ cd bin
    117. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl/bin$ ./main
    118. [Warn]  (7.230, +7230)   lv_demo_widgets: LV_FONT_MONTSERRAT_20 is not enabled for the widgets demo. Using LV_FONT_DEFAULT instead. lv_demo_widgets.c:139
    119. [Warn]  (334.156, +326926)       indev_pointer_proc: X is 992 which is greater than hor. res lv_indev.c:651
    120. [Warn]  (334.414, +258)  indev_pointer_proc: X is 992 which is greater than hor. res lv_indev.c:651
    121. [Warn]  (336.981, +2567)         indev_pointer_proc: X is 737 which is greater than hor. res lv_indev.c:651
    122. [Warn]  (337.595, +614)  indev_pointer_proc: X is 737 which is greater than hor. res lv_indev.c:651
    123. zhaomeijing@raspberrypi5:~/workspace/21_lvgl/lv_sim_vscode_sdl/bin$
    复制代码
    //------LVGL仿真结果
    image-20240506173458391.png
    //------界面效果
    image-20240506173507511.png
    总结,以上这些内容就是LVGL的简单介绍以及仿真测试,这里只是起到一个抛**引玉的效果,对于LVGL整个应用来讲这些只是九牛一毛,还需要更深入的学习才能掌握LVGL的应用,有兴趣的小伙伴可以动手尝试一下。
    //------end

    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条

    手机版|小黑屋|与非网

    GMT+8, 2024-11-18 22:41 , Processed in 0.135692 second(s), 20 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.