当前位置:网站首页>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
边栏推荐
- Solution to Chinese garbled code after reg file is imported into the registry
- Daily CISSP certification common mistakes (April 19, 2022)
- CANopen usage method and main parameters of object dictionary
- 配置iptables
- How to restore MySQL database after win10 system is reinstalled (mysql-8.0.26-winx64. Zip)
- Introduction to quantexa CDI syneo platform
- ctfshow-web362(SSTI)
- 22年字节跳动飞书人力套件三面面经
- Daily network security certification test questions (April 13, 2022)
- CANopen STM32 transplantation
猜你喜欢
Query the logistics update quantity according to the express order number
listener.log
Use of regular expressions in QT
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
QT add external font ttf
函数递归以及趣味问题的解决
根据快递单号查询物流查询更新量
【ACM】376. Swing sequence
With the use of qchart, the final UI interface can be realized. The control of qweight can be added and promoted to a user-defined class. Only the class needs to be promoted to realize the coordinate
纠结
随机推荐
七、DOM(下) - 章节课后练习题及答案
ctfshow-web361(SSTI)
iptables初探
【科普】CRC校验(一)什么是CRC校验?
【数学建模】—— 层次分析法(AHP)
Custom prompt box MessageBox in QT
SQL database syntax learning notes
Iptables - L executes slowly
Introduction to QT programming
Linux installs MySQL in RPM (super simple)
Ctfshow - web362 (ssti)
14 py games source code share the second bullet
The first leg of the national tour of shengteng AI developer creation and enjoyment day was successfully held in Xi'an
解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
Excel intercept text
函数递归以及趣味问题的解决
QT add external font ttf
机器学习实战 -朴素贝叶斯
Quantexa CDI(场景决策智能)Syneo平台介绍
Solution to Chinese garbled code after reg file is imported into the registry