当前位置:网站首页>ESP32 LVGL8. 1. Detailed migration tutorial of m5stack + lvgl + IDF (27)
ESP32 LVGL8. 1. Detailed migration tutorial of m5stack + lvgl + IDF (27)
2022-04-23 18:38:00 【Please call me Xiao Peng】
Tips : This blog serves as a learning note , If there are mistakes, I hope to correct them
List of articles
One 、ESP32 LVGL transplant ( You can update to the latest version ) Transplant preparation
Transplant download website :Github, Then you need to download some files , Among them, we found something that belongs to lv_port_esp32、lvgl ,lv_demos,lvgl_esp32_drivers Four files . take LVGL、lvgl_demos、lv_esp32_drivers Copy the file in to components File subdirectory .
Two 、 Migrate modified files
compile , Then the error report is lvgl History settings in components\lv_examples Documents in lv_ex_conf.h Does not match the header file controlled in the process , It needs to be modified to lv_demo_conf.h, And switch the contents , I use it directly here VS Of control files in simulation engineering .
After compiling, the music appears Demo The font cannot be found in the file in , Then you can go directly here sdkconfig Check the font .
Solve the problem of compiling Fonts , To configure sdkconfig, Select one of the gears
Open it and find lvgl Font in , Check among them 12、16 Font number
There are still errors after compilation , And in main.c There is a wavy line under the header file in the file , And can't jump , At this time, we can use the menu bar at the bottom Click on Win32, Then click edit configuration UI, And then click c_cpp_properties.json, Realization UI Configuration of , This time will be right Vscode Some configuration of the compilation environment , But I still can't jump , At this time, the contents of the project folder that has been mutated should be copied here , Then compile again to solve this problem .
Good configuration json After compiling the environment again, there are several errors , First solve the errors in the driver , Our memory size is undefined , We're at that point .h In file #define LV_HOR_RES_MAX 240 Specifically 240 The size of the LCD screen should also be set according to the pixels of the LCD screen .
And solve it lvgl_helpers.c Mistakes in , from .c It can be seen from the document that assert((0 <= host) && (SPI_HOST_MAX > host)); Report errors , You can comment out or define directly here #define SPI_HOST_MAX 3 , Here is just an assertion used as a debugging Library . Should be ESP32 Yes 3 individual SPI, Macro definition max 3
Finally, solve the error in the main function , There are several undefined functions , Let's have a look at lvgl/src/hal Under the document lv_hal_disp.c There is no sub function , Then we'll replace this function with lv_disp_draw_buf_init, This is lv_port_esp32 This document should also be used before, not LVGL8 The version of the hal The firmware API, Just replace it . Besides, there are static lv_disp_buf_t disp_buf; Medium lv_disp_buf_t Unknown type name , This is also API Are not compatible , Here it is modified as lv_disp_draw_buf_t That's all right. . The last one is disp_drv.buffer Display error , This is also before API Are not compatible , Here it is disp_drv.draw_buf that will do , The compilation can be passed .
Configure LCD pixels .
disp_drv.hor_res = 320; /*Set the horizontal resolution in pixels*/
disp_drv.ver_res = 240; /*Set the vertical resolution in pixels*/
To configure esp32 sdkconfig Configure the LCD control pin .
adopt sdkconfig Configure chip memory and main frequency , I'm here M5Stock To configure 8M 240Mhz Main frequency .
modify ILI9341 Configuration of conforms to M5Stack.
Finally, let's download and test to see if it's normal , The test program can be in main.c In file , It needs to be revised , In this file is lvgl7 Version of , Therefore, it needs to be modified to conform to lvgl8 Version of .
Finally, download the display, but the color display is wrong , At this time, we need to modify sdkconfig The configuration in the .
3、 ... and 、 The final display after transplantation
Four 、 Download link
版权声明
本文为[Please call me Xiao Peng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210609450077.html
边栏推荐
- Teach you to quickly rename folder names in a few simple steps
- Halo open source project learning (VII): caching mechanism
- 使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
- 数据库上机实验四(数据完整性与存储过程)
- Software test summary
- Daily CISSP certification common mistakes (April 15, 2022)
- Daily network security certification test questions (April 13, 2022)
- CISSP certified daily knowledge points (April 18, 2022)
- From introduction to mastery of MATLAB (2)
- Excel intercept text
猜你喜欢
多功能工具箱微信小程序源码
iptables初探
解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
七、DOM(下) - 章节课后练习题及答案
硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
Jeecg boot microservice architecture
ctfshow-web361(SSTI)
函数递归以及趣味问题的解决
Druid SQL和Security在美团点评的实践
Analysez l'objet promise avec le noyau dur (Connaissez - vous les sept API communes obligatoires et les sept questions clés?)
随机推荐
CANopen usage method and main parameters of object dictionary
QT curve / oscilloscope customplot control
Cygwin64 right click to add menu, and open cygwin64 here
Daily CISSP certification common mistakes (April 19, 2022)
硬核解析Promise對象(這七個必會的常用API和七個關鍵問題你都了解嗎?)
How to virtualize the video frame and background is realized in a few simple steps
Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash
Tangle
Interpretation and compilation of JVM
CISSP certified daily knowledge points (April 14, 2022)
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
深入理解 Golang 中的 new 和 make 是什么, 差异在哪?
Sentinel服务熔断实战(sentinel整合ribbon+openFeign+fallback)
22年字节跳动飞书人力套件三面面经
ESP32 LVGL8. 1 - BTN button (BTN 15)
Druid SQL和Security在美团点评的实践
Const keyword, variable and function are decorated with const
机器学习理论之(7):核函数 Kernels —— 一种帮助 SVM 实现非线性化决策边界的方式
In shell programming, the shell file with relative path is referenced
玻璃体中的硫酸软骨素