ESP32 使用LVGL案例
2023-02-18 16:30:03 时间
一、完成LVGL移植
在使用LVGL提供的测试案例时,需要先移植LVGL,不明白的小伙伴看我之前的笔记 esp-idf 移植 lvgl8.3.3 。
移植完成后的项目文件如下图所示
二、添加需要的测试案例
-
在项目的
components
文件下创建lvgl_examples
,并导入需要测试的案例,如下图所示:
注意:这里不要把所有案例都拷贝过来,因为其中有部分文件关联的文件太多,处理起来比较麻烦 -
修改
lv_examples.h
文件
注意:后面可以根据自己的需要,不断添加文件,取消对应模块的注释即可
三、创建 make 和 cmake 文件
-
在在项目的
components
文件下创建 创建CMakeLists.txt
和component.mk
,如下图所示:
-
在
CMakeLists.txt
文件中添加下面信息if(ESP_PLATFORM) file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_LIST_DIR}/*.c) idf_component_register(SRCS ${SOURCES} INCLUDE_DIRS . REQUIRES lvgl) else() message(FATAL_ERROR "LVGL lvgl_examples: ESP_PLATFORM is not defined. Try reinstalling ESP-IDF.") endif()
如下图所示:
-
在
component.mk
文件中添加下面信息# # Component Makefile # CFLAGS += -DLV_LVGL_H_INCLUDE_SIMPLE COMPONENT_SRCDIRS := . \ anim \ get_started COMPONENT_ADD_INCLUDEDIRS := $(COMPONENT_SRCDIRS) .
如下图所示:
四、使用添加的案例
完成后使用就变得很简单了,只需要在使用的地方添加 lv_examples.h
头文件即可,因为此头文件中包含了所有的测试函数声明,如下图所示:
相关文章
- 论文解读《Bilinear Graph Neural Network with Neighbor Interactions》
- 论文解读《Deep Attention-guided Graph Clustering with Dual Self-supervision》
- 论文解读(ClusterSCL)《ClusterSCL: Cluster-Aware Supervised Contrastive Learning on Graphs》
- 论文解读(SimGRACE)《SimGRACE: A Simple Framework for Graph Contrastive Learning without Data Augmentation》
- 论文解读(GTN)《Graph Transformer Networks》
- 论文解读(SAGPool)《Self-Attention Graph Pooling》
- 论文解读(DiffPool)《Hierarchical Graph Representation Learning with Differentiable Pooling》
- 论文解读《Deeper Insights into Graph Convolutional Networks for Semi-Supervised Learning》
- 论文解读(GMT)《Accurate Learning of Graph Representations with Graph Multiset Pooling》
- 论文解读《Measuring and Relieving the Over-smoothing Problem for Graph NeuralNetworks from the Topological View》
- 论文解读(DAGNN)《Towards Deeper Graph Neural Networks》
- 论文解读(Debiased)《Debiased Contrastive Learning》
- 论文解读(IGSD)《Iterative Graph Self-Distillation》
- 论文解读(SUBG-CON)《Sub-graph Contrast for Scalable Self-Supervised Graph Representation Learning》
- 论文解读(MERIT)《Multi-Scale Contrastive Siamese Networks for Self-Supervised Graph Representation Learning》
- 论文解读(MCNS)《Understanding Negative Sampling in Graph RepresentationLearning》
- 论文解读(GROC)《Towards Robust Graph Contrastive Learning》
- 图神经网络的攻击防御
- 论文解读(CGC)《CGC: Contrastive Graph Clustering for Community Detection and Tracking》
- 论文解读(DCRN)《Deep Graph Clustering via Dual Correlation Reduction》