立创泰山派 Debian 编译运行LVGL lv_port_linux v8.2

前置条件

立创泰山派SDK

  1. tspi_linux_sdk_repo_20240131.tar.gz
    https://tmp.link/f/65f7265e94536

  2. 编译debian>生成img>烧录 详情查看地址

    https://lceda001.feishu.cn/wiki/SRaFwXXNUi5Lmtkf4nqcKhyxnJ3

  3. MIPI屏幕 这里使用31pin 800*1280MIPI屏幕 进行演示 请自行选用并点亮屏幕 详情查看

    https://lceda001.feishu.cn/wiki/NiQKwDgsuiwLiHkCtFtcZnoFnFg

  4. SSH搭建 必须 因为运行必须要关闭图形化界面 这里我在开发板上安装了宝塔面板使用终端
    https://lceda001.feishu.cn/wiki/NggWw6XZliI5D1k9aircDS2Jnkb

下载 lv_port_linux v8.2

下载 lv_port_linux v8.2 https://github.com/lvgl/lv_port_linux/tree/release/v8.2

以下推荐直接点击链接下载压缩包 并解压
下载 lv_drivers https://github.com/lvgl/lv_drivers/tree/49c4b178494625efefb07891d1c8b9c13914edff
下载 lvgl https://github.com/lvgl/lvgl/tree/0b5a1d4b23975b920ff841ea9cd038802f51711b

下载并解压完成后复制两个文件夹中的内容到 lv_port_linux 文件夹中的lv_drivers、lvgl整备后的文件夹内容
至此完成了基础整备

开始编译工作

编译lv_port_linux

将lv_port_linux移动至开发板>>>>使用命令进入lv_port_linux文件夹运行命令

make -j4    
ls

等待编译成功查看文件夹 内容为
lv_port_linux编译完成后
可以看到生成了demo文件

关闭图形化界面 并重启

关闭图形化命令 没有SSH 关闭后无法操作开发板 只能重新烧录img文件

sudo systemctl set-default multi-user.target  # 设置默认目标为命令行模式 ‌:ml-citation{ref="2" data="citationList"}  

启用图形化命令

sudo systemctl set-default graphical.target  # 设置默认目标为图形模式 ‌:ml-citation{ref="1,2" data="citationList"}  

重启命令

sudo reboot    #重启

完成操作为 显示立创泰山派LOGO 关闭图形化界面现象

运行demo 以下操作均依赖SSH

使用SSH 进入lv_port_linux

sudo ./demo

启动完成后现象为
启动成功现象

进行代码适配

进入/lv_port_linux/main.c 修改你的屏幕大小

    disp_drv.hor_res  = 800;
    disp_drv.ver_res  = 1280;

进入/lv_port_linux/lv_drv_conf.h 修改鼠标输入事件

开发板插入鼠标

sudo evtest

查看鼠标
我的鼠标事件为8 键入8

8

移动插入开发板的鼠标 输出鼠标事件为
移动鼠标事件
修改 进入/lv_port_linux/lv_drv_conf.h 修改鼠标输入事件 为你的鼠标事件

#  define EVDEV_NAME   "/dev/input/event10"      

进入/lv_port_linux/lv_conf.h 修改显示帧率和性能监测

#define LV_DISP_DEF_REFR_PERIOD 16      /*[ms]*/


#define LV_INDEV_DEF_READ_PERIOD 16     /*[ms]*/

16为62帧


/*1: Show CPU usage and FPS count*/
#define LV_USE_PERF_MONITOR 1
#if LV_USE_PERF_MONITOR
    #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
#endif

/*1: Show the used memory and the memory fragmentation
 * Requires LV_MEM_CUSTOM = 0*/
#define LV_USE_MEM_MONITOR 1
#if LV_USE_MEM_MONITOR
    #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
#endif

LV_USE_PERF_MONITOR 和 LV_USE_MEM_MONITOR 置为1

重新编译 lv_port_linux

清除之前编译的内容

make clean
make -j4

运行demo

sudo ./demo

完成适配现象

切换demo显示

进入/lv_port_linux/lv_conf.h 修改显示文字大小 必须修改否则编译报错
显示文字大小统统置为 1

#define LV_FONT_MONTSERRAT_8  1
#define LV_FONT_MONTSERRAT_10 1
#define LV_FONT_MONTSERRAT_12 1
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 1
#define LV_FONT_MONTSERRAT_18 1
#define LV_FONT_MONTSERRAT_20 1
#define LV_FONT_MONTSERRAT_22 1
#define LV_FONT_MONTSERRAT_24 1
#define LV_FONT_MONTSERRAT_26 1
#define LV_FONT_MONTSERRAT_28 1
#define LV_FONT_MONTSERRAT_30 1
#define LV_FONT_MONTSERRAT_32 1
#define LV_FONT_MONTSERRAT_34 1
#define LV_FONT_MONTSERRAT_36 1
#define LV_FONT_MONTSERRAT_38 1
#define LV_FONT_MONTSERRAT_40 1
#define LV_FONT_MONTSERRAT_42 1
#define LV_FONT_MONTSERRAT_44 1
#define LV_FONT_MONTSERRAT_46 1
#define LV_FONT_MONTSERRAT_48 1
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#define LV_USE_DEMO_WIDGETS        0                        
#if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW  0
#endif

/*Demonstrate the usage of encoder and keyboard*/
#define LV_USE_DEMO_KEYPAD_AND_ENCODER     0

/*Benchmark your system*/
#define LV_USE_DEMO_BENCHMARK   1

/*Stress test for LVGL*/
#define LV_USE_DEMO_STRESS      0

/*Music player demo*/
#define LV_USE_DEMO_MUSIC       0

LV_USE_DEMO_WIDGETS 置为 0 LV_USE_DEMO_BENCHMARK 置为 1

进入/lv_port_linux/main.c 修改显示demo

    /*Create a Demo*/
    lv_demo_widgets();                  //修改为    lv_demo_benchmark();  与上面LV_USE_DEMO后的地方一致就行 **小写**

重新编译 lv_port_linux

清除之前编译的内容

make clean
make -j4

运行demo

sudo ./demo

运行结果为
性能测试中
运行完成显示测试结果 这是一个性能测试

重新启用图形化界面

启用图形化命令

sudo systemctl set-default graphical.target  # 设置默认目标为图形模式 ‌:ml-citation{ref="1,2" data="citationList"}  

重启命令

sudo reboot    #重启

结束

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值