从零到一:基于Esp32与LVGL的ST7789屏幕驱动全流程实战

使用ESP32驱动ST7789,效果很好的IPS显示屏 前言 在平台上面购买了这一种模块,然后这种模块是IPS液晶屏,显示效果会比早期那种好一些。显示屏的控制芯片是ST7789 我准备使用ESP32进行驱动,测试上使用简单的Arduino IDE,那么具体要怎么样让这一屏幕正常的显示? 应用库与具体配置 如果是使用avr的MCU例如Arduino UNO一类可以使用这一个库,GitHub - cbm80amiga/Arduino_ST7789_Fast: Fast SPI library for the ST7789 IPS 阅读详情

1. 环境准备与工程创建

第一次接触ESP32和ST7789屏幕的组合时,我被各种配置项搞得晕头转向。后来发现只要环境搭对了,后面就像搭积木一样简单。这里我用的是VSCode+ESP-IDF的组合,实测比Arduino环境更稳定,适合长期开发。

安装ESP-IDF插件时有个小技巧:不要直接点安装,先去官网下载离线安装包。我遇到过网络问题导致的环境配置失败,离线包能避免90%的奇怪错误。装好后创建新工程,选择"ESP-IDF: New Project",工程名建议包含"st7789"方便后续管理。

创建工程时有个关键选择:SPI模式还是8080并行接口?ST7789通常用SPI,占用引脚少。我建议新手直接选官方例程中的"spi_lcd_touch"模板,这个已经包含了基础驱动框架,能省去很多底层配置工作。

2. 驱动文件改造实战

官方组件库默认没有ST7789驱动,但有个好消息:GC9A01的驱动和ST7789兼容度很高。我试过直接修改,成功率在95%以上。具体操作分三步走:

第一步找到managed_components/espressif__esp_lcd_gc9a01文件夹,复制后重命名为espressif__esp_lcd_st7789。注意这里有两个下划线,我第一次漏掉导致编译失败。

第二步是全局替换,用VSCode的全局搜索功能(Ctrl+Shift+F)替换所有"GC9A01"为"ST7789"。这里有个坑:头文件里的宏定义也要改,比如GC9A01_CMD_SLPOUT要改成ST7789_CMD_SLPOUT。我建议用区分大小写的替换模式,避免漏改。

第三步修改Kconfig文件,在main/Kconfig.projbuild里添加:

config LCD_CONTROLLER_ST7789
    bool "ST7789"
    default y
【ESP32】打造全网最强esp-idf基础教程——11.LVGL移植(基于ST7789芯片) 本课内容涵盖了SPI、LCD、LVGL知识,每一个点单独来讲都是比较丰富的内容,尤其是LVGL,LVGL(Light and Versatile Graphics Library)是一个开源的图形用户界面(GUI)库,专为嵌入式系统设计,旨在提供轻量级、高度可移植、灵活且易于使用的图形界面解决方案 阅读详情

相关推荐

stm32驱动st7789 TFT-LCD屏幕显示

stm32驱动tft-lcd显示图片、文字、字符串

weixin_51513612的博客 2万+

[ESP32]:LVGL与ST7789屏幕驱动实战:从组件配置到UI设计

本文详细介绍了如何在ESP32上集成LVGL与ST7789屏幕驱动,从基础介绍、开发环境搭建到UI设计和性能优化。通过实战案例和代码示例,帮助开发者快速掌握SPI通信配置、LVGL初始化及高级功能实现,解决常见显示问题,提升嵌入式GUI开发效率。

weixin_28285943的博客 609

【LVGL 学习】LVGL 在 arduino 环境的安装

1. 前提条件 使用 arduino IDE开发 使用 ESP32 作为主控 屏幕使用 ST7789 驱动,240*240像素TFT屏幕 注意:屏幕驱动部分不再这个赘述,以后开贴另行发布 2. 安装 LVGL 库 打开 arduino 菜单栏中 -> 项目 -> 加载库 -> 管理库 搜索 LVGL 本人使用版本是8.0.2, 8.0一下版本貌似不支持GIF 1. 成功安装后,LVGL库就安装到了 首选项中, 项目文件夹位置 一栏中所设置的项目文件夹位置,我这里设置的是

一名嵌入式界的小学生 6028

ESP32 IDF驱动ST7789+移植LVGL(v8.4)

ESP32 IDF LVGL移植

hallo8888的博客 780

ESP32-S3 学习笔记(2)-屏幕驱动和lvgl移植

本文介绍了ESP32驱动ST7789屏幕并移植LVGL图形库的全过程。首先通过SPI协议实现了ST7789驱动,包括引脚配置、初始化流程和刷新机制。然后将LVGL移植到ESP32平台,重点解决了显示缓存分配、坐标校准等关键问题。文中详细说明了硬件接口配置、显存管理方法,并提供了屏幕坐标校准函数来解决显示偏移问题。最后指出实际应用中需要注意的细节问题,为开发者提供了完整的嵌入式GUI开发解决方案。

qq_26048279的博客 1804

从零到一:Esp32+LVGL+ST7789屏幕驱动与GUI开发实战指南

本文提供了一份详细的Esp32嵌入式GUI开发实战指南,涵盖从环境搭建到界面优化的全流程。通过VSCode与ESP-IDF工具链,详细讲解了如何驱动ST7789屏幕并集成LVGL图形库,包括工程创建、驱动适配、配置优化及常见问题排查,帮助开发者快速实现从硬件连接到流畅GUI界面的开发。

weixin_28256233的博客 163

ESP32S3+LVGL+SquareLine_Studio:从UI设计到屏幕驱动的全流程实战

本文详细介绍了如何利用ESP32S3芯片与LVGL图形库结合SquareLine_Studio工具,实现从UI设计到屏幕驱动的全流程开发。通过实战案例展示硬件连接、开发环境配置、UI设计技巧及性能优化方法,帮助开发者快速构建嵌入式设备的图形界面,特别适合物联网和智能硬件项目。

weixin_33712987的博客 395

使用ESP32调试ST7789V屏幕:从零实现驱动

手把手实现ESP32对ST7789V屏幕的驱动调试,涵盖接线、初始化及显示优化细节。通过实际操作解决常见通信问题,让st7789v快速稳定显示内容,适合嵌入式开发入门与实战。

weixin_33773084的博客 1042

从零到一:基于Gui Guider 1.9.0与LVGL 9.2.2的ESP32 ST7789 UI开发实战

本文详细介绍了基于Gui Guider 1.9.0与LVGL 9.2.2的ESP32 ST7789 UI开发实战,从环境准备、项目配置到中文显示解决方案和高级功能实现,提供了完整的配置教程和优化技巧,帮助开发者快速掌握嵌入式UI开发。

weixin_30296405的博客 408

从零到一:ESP32与ST7789屏幕的LVGL图形界面开发实战

本文详细介绍了从零开始使用ESP32与ST7789屏幕进行LVGL图形界面开发的完整流程。涵盖硬件准备、环境搭建、TFT_eSPI库配置、LVGL移植及优化技巧,并通过实战项目演示如何创建天气显示界面。特别针对ESP32与ST7789的兼容性问题提供解决方案,帮助开发者快速实现嵌入式图形界面开发。

weixin_29190573的博客 410

ESP32-S3实战:LVGL图形库与ST7789V屏幕的深度适配指南

本文详细介绍了ESP32-S3与ST7789V屏幕的深度适配指南,涵盖LVGL图形库的移植与优化。从SPI配置、显存管理到颜色格式处理,提供了实战经验与性能调优技巧,帮助开发者解决常见问题并提升显示效果。特别针对ESP32-S3的硬件特性,给出了内存优化和电源管理的专业建议。

weixin_30687051的博客 474

LVGL v8学习笔记 |12 - 移植LVGL 8.3到ESP32C3开发板(ST7789)

因为驱动使用的是我自己编写的,所以修改lvgl依赖:components\lvgl\env_support\cmake\esp.cmake。将下载的 lvgl-8.3.6 文件夹直接复制到components路径中,并修改文件夹名称为lvgl。ESP32-IDF底层是基于freertos的,所以所以要创建一个独立的刷屏任务,在main文件夹下新建。最后在app_main任务中调用gui_task_create()即可。(2)examples/porting下的文件也进行重命名,去掉。

Mculover666的博客(嵌入式) 2412

Qt实现仿微信在线聊天工具(服务器、客户端)V1_ 01

在主控类中绑定登录类的信号 void signalLoginOK() ,跳过验证步骤,先实现页面的跳转MyChatToolClient.h文件//登录成功槽函数 private :MyChatToolClient.cpp文件} //登录成功槽函数 void MyChatToolClient :: slotLoginOk() {//关闭登录窗口并释放空间 m_loginWin -> close();//新建并打开聊天窗口 m_chatWin = new ChatWindow;

Leo的博客 1876

深度学习笔记(3)——kernel(内核)与filter(滤波器)

本文仅仅简单介绍了kernel和filter的概念,介绍了确定filter和kernel个数的方法。

cs111211的博客 7148

CD-HIT的使用

继续我的生信笔记系列。从某网站的附带文献中读到该工具,搜索了一下,发现网上的大佬们都在讲如何用它去冗余,相对官方页面的介绍而言很是片面,于是刚好有聚类的需求的我准备对其全体功能做做实验,学习一下由李伟忠博士在伯纳姆研究所(现为桑福德伯纳姆医学研究所)亚当·戈兹克博士的实验室开发的牛工具。 首先是官方介绍: CD-HIT是一个非常广泛使用的程序,用于蛋白质或核苷酸序列的聚类和比较。最初由李伟忠博士在伯纳姆研究所(现为桑福德伯纳姆医学研究所)亚当·戈兹克博士的实验室开发,CD-HIT速度非常快,可以处理非常

一名学术waste的note pro 1万+

LoRaWAN数据包分析工具

前言:LoRaWAN的射频数据包是加密的,而且有些字段是某个字节的某几位,看着不是那么直观,因此在某些情况下需要借助工具来分析数据包。 1、安装npm 这个工具是用JavaScript写的,其中用到了一些依赖库,而npm就可以一次性把这些依赖库下载下来,因此我们先要下载安装npm这个工具。 安装:sudo apt install npm 输入y,等待安装完成: 检查是否安装成功:npm -v 说明安装完成。 2、安装LoRa数据包分析工具lora-packet 安装:npm i.

freemote的博客 4634

让 ABAP 复杂内表优雅“喂饱”:Complex Internal Table Filling 全面实战指南

本文为ABAP开发者系统梳理了复杂内表的填充与复制方法。重点介绍了work area的两种声明方式、APPEND操作的多形态用法及其初始值语义,以及VALUE #( )构造器的逐行与整表写法。同时讲解了CORRESPONDING的同名字段映射功能,帮助开发者在"航司与航线"等复杂业务场景中实现最佳实践。文章还涵盖内存优化、可读性建议和常见误区,提供可运行样例,适用于ABAP On-Premise和SAP BTP环境。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 170

10. 重磅!Spring AI 1.0 正式发布,Java 开发者的 AI神器!

重磅!Spring AI 1.0 正式发布,Java 开发者的 AI神器! 全网最详细的Spring AI 文章,每章都会提供代码入口,让你更容易得入门和理解Spring AI 相关概念,直接节约你百分之六十的学习成本时间。

gorgor在码农 1070

具身智能:原理、算法与系统 第1章 具身智能的本质与范畴

从学术定义的角度,具身智能可被界定为"与物理环境进行有目的的能量与信息交换"的智能形式。这一定义揭示了具身智能的两个本质维度:信息处理维度与能量交互维度。与传统人工智能系统仅在信息空间操作不同,具身智能系统必须同时处理信息流与能量流,在物理约束下实现感知、认知与行动的统一。具身智能体具有三个核心构成要素:物理身体(Physical Body)、感知系统(Sensory System)与效应器(Effectors)。这三者共同构成了感知与行动的基础,使智能体能够通过物理交互而非纯粹符号操作来理解世界。

VectorShift的博客 273

SAP SLT 在 carve-out 场景中的关键作用:从理论到实操全景展现

深入剖析 SAP Landscape Transformation(SLT Replication Server)在 carve‑out 场景中的价值,需要从 carve‑out 本身的背景逻辑说起。carve‑out 指的是企业因并购、拆分、剥离商业单元等因素,而将 SAP 系统中某部分业务(例如组织单元、公司代码、模块数据等) separated 出来,导入到独立的系统中。这一过程极具挑战性,既要确保业务连续性,又要实现数据精准迁移和系统隔离 (

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 7558

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

上一篇: 手把手教你用Node.js复现百度翻译Acs-Token加密(附完整CryptoJS代码)
下一篇: C# OpenCvSharp 实现4K高清摄像头实时图像处理
weixin_33725722
博客等级 码龄11年 4560粉丝 2202原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址