当前位置:网站首页>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
边栏推荐
- 机器学习理论基础篇--关于机器学习的一些术语
- Log4j2 cross thread print traceid
- 机器学习理论之(8):模型集成 Ensemble Learning
- STM32: LCD显示
- 14个py小游戏源代码分享第二弹
- Notepad + + replaces tabs with spaces
- 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
- Analysez l'objet promise avec le noyau dur (Connaissez - vous les sept API communes obligatoires et les sept questions clés?)
- Tangle
- ctfshow-web361(SSTI)
猜你喜欢
STM32 learning record 0008 - GPIO things 1
QT add external font ttf
WiFi ap6212 driver transplantation and debugging analysis technical notes
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
ctfshow-web362(SSTI)
logstash 7. There is a time problem in X. the difference between @ timestamp and local time is 8 hours
Summary of actual business optimization scheme - main directory - continuous update
使用晨曦记账本,分析某个时间段每个账户收支结余
硬核解析Promise對象(這七個必會的常用API和七個關鍵問題你都了解嗎?)
Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
随机推荐
K210串口通信
22年字节跳动飞书人力套件三面面经
os_authent_prefix
From introduction to mastery of MATLAB (2)
Linux installs MySQL in RPM (super simple)
Quantexa CDI(场景决策智能)Syneo平台介绍
特征选择feature_selection--SelectKBest
Implementation of TCP UDP communication with golang language
视频边框背景如何虚化,简单操作几步实现
机器学习实战 -朴素贝叶斯
【ACM】509. Fibonacci number (DP Trilogy)
Configure iptables
WIN1 remote "this may be due to credssp encryption Oracle correction" solution
Ucosiii transplantation and use, reference punctual atom
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
Using transmittablethreadlocal to realize parameter cross thread transmission
回路-通路
Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash
Daily CISSP certification common mistakes (April 11, 2022)
Promote QT default control to custom control