当前位置:   article > 正文

创龙T113学习记录--LVGL8.2编译_t113 lvgl

t113 lvgl

开发板:TLT113-MiniEVM_V1.2

系统:Ubuntu 20.04

源码下载:

1.github上面通过git拉取lv_port_linux_frame_buffer,并切换到release/v8.2分支

2.在lv_port_linux_frame_buffer文件夹下拉取lvgl代码,并切换到release/v8.2分支

3.在lv_port_linux_frame_buffer文件夹下继续拉取lv_drivers,并切换到release/v8.2分支

4.在lv_port_linux_frame_buffer文件夹下继续拉取lv_demos

此时,文件层级关系如下图所示:

LVGL头文件修改:

由于lv_port_linux_frame_buffer文件夹下本身带有lv_conf.h和lv_drv_conf.h,直接在其基础上进行修改了

lv_conf.h修改:

颜色格式,由于开发板外接的HDMI-1080的屏,本处没有修改

  1. /*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
  2. #define LV_COLOR_DEPTH 32

为了查看帧率,使能了LV_USE_PERF_MONITOR

  1. /*1: Show CPU usage and FPS count*/
  2. #define LV_USE_PERF_MONITOR 1
  3. #if LV_USE_PERF_MONITOR
  4. #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
  5. #endif

FONT USAGE中,使能用到的字体

  1. /*==================
  2. * FONT USAGE
  3. *===================*/
  4. /*Montserrat fonts with ASCII range and some symbols using bpp = 4
  5. *https://fonts.google.com/specimen/Montserrat*/
  6. #define LV_FONT_MONTSERRAT_8 0
  7. #define LV_FONT_MONTSERRAT_10 0
  8. #define LV_FONT_MONTSERRAT_12 1
  9. #define LV_FONT_MONTSERRAT_14 1
  10. #define LV_FONT_MONTSERRAT_16 1
  11. #define LV_FONT_MONTSERRAT_18 0
  12. #define LV_FONT_MONTSERRAT_20 0
  13. #define LV_FONT_MONTSERRAT_22 0
  14. #define LV_FONT_MONTSERRAT_24 0
  15. #define LV_FONT_MONTSERRAT_26 0
  16. #define LV_FONT_MONTSERRAT_28 0
  17. #define LV_FONT_MONTSERRAT_30 0
  18. #define LV_FONT_MONTSERRAT_32 0
  19. #define LV_FONT_MONTSERRAT_34 0
  20. #define LV_FONT_MONTSERRAT_36 0
  21. #define LV_FONT_MONTSERRAT_38 0
  22. #define LV_FONT_MONTSERRAT_40 0
  23. #define LV_FONT_MONTSERRAT_42 0
  24. #define LV_FONT_MONTSERRAT_44 0
  25. #define LV_FONT_MONTSERRAT_46 0
  26. #define LV_FONT_MONTSERRAT_48 0

lvgl官方demo使能:

#define LV_USE_DEMO_WIDGETS        1

lv_drv_conf.h修改:

由于没有使用DRM/KMS方式,使用的是fb的方式,所以使能了fb:

  1. /*-----------------------------------------
  2. * Linux frame buffer device (/dev/fbx)
  3. *-----------------------------------------*/
  4. #ifndef USE_FBDEV
  5. # define USE_FBDEV 1
  6. #endif
  7. #if USE_FBDEV
  8. # define FBDEV_PATH "/dev/fb0"
  9. #endif

开发板使用鼠标作为了输入设备,经查为event6:

故修改输入设备节点为event6

  1. /*-------------------------------------------------
  2. * Mouse or touchpad as evdev interface (for Linux based systems)
  3. *------------------------------------------------*/
  4. #ifndef USE_EVDEV
  5. # define USE_EVDEV 1
  6. #endif
  7. #ifndef USE_BSD_EVDEV
  8. # define USE_BSD_EVDEV 0
  9. #endif
  10. #if USE_EVDEV || USE_BSD_EVDEV
  11. # define EVDEV_NAME "/dev/input/event6" /*You can use the "evtest" Linux tool to get the list of devices and test them*/

main.c中修改了分辨率:

  1. /*Initialize and register a display driver*/
  2. static lv_disp_drv_t disp_drv;
  3. lv_disp_drv_init(&disp_drv);
  4. disp_drv.draw_buf = &disp_buf;
  5. disp_drv.flush_cb = fbdev_flush;
  6. disp_drv.hor_res = 1920;
  7. disp_drv.ver_res = 1080;
  8. lv_disp_drv_register(&disp_drv);

Makfile更改:

指定编译器:

CC = /home/hbb/T113/T113-i_v1.0/out/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc

由于工具链不支持如下编译选项,因此在CFLAGS注释掉如下内容:

  1. #-Wshift-negative-value
  2. CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wstack-usage=2048 -Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare

开始编译:

在lv_port_linux_frame_buffer文件夹下,编译,完成后查看:

成功的话,出现demo文件

已经搭建好了ssh,使用scp传到开发板:

  1. hbb@hbb-Code-01-Series-PF5NU1G:~/T113/lv_port_linux_frame_buffer$ scp demo root@192.168.1.251:/root
  2. demo 100% 1028KB 10.9MB/s 00:00

在开发板上运行此demo:

鼠标在demo启动前插入没有问题,如果是在启动后再插入,出现无法操作的情况,putty倒是有插入的打印信息,先这样吧,下次再查查看是哪里没配置好。

最后跑了下benchmark例程,1080P下92帧,不确定正不正常。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/762268
推荐阅读
相关标签
  

闽ICP备14008679号