合宙ESP32C3使用PlatformIO开发点亮ST7735S_platformio开发esp32-c3

修改配置文件

[env:esp32-c3-devkitm-1]
;平台 
platform = espressif32@5.4.0
;模块
board = esp32-c3-devkitm-1
;闪存芯片接口方式
board_build.flash_mode = dio
;框架
framework = espidf
;串口监视波特率
monitor_speed = 115200
;串口监视过滤器 解码异常 颜色展示
monitor_filters = direct, esp32_exception_decoder
;内置调试器 重点是配置这个
debug_tool = esp-builtin

安装依赖

我这里git拉取都使用的ssh的方式,如果是http的方式,自己修改一下连接

LVGL 依赖库
git submodule add -b release/v7 git@github.com:lvgl/lvgl.git components/lvgl

ESP32 芯片系列的 LVGL 驱动库
git submodule add git@github.com:lvgl/lvgl_esp32_drivers.git components/lvgl_esp32_drivers

直接编译会提示'SPI_HOST_MAX' undeclared错误

components\lvgl_esp32_drivers\lvgl_helpers.c: In function 'lvgl_spi_driver_init':
components\lvgl_esp32_drivers\lvgl_helpers.c:157:28: error: 'SPI_HOST_MAX' undeclared (first use in this function); did you mean 'GPIO_PORT_MAX'?
     assert((0 <= host) && (SPI_HOST_MAX > host));

components\lvgl_esp32_drivers\lvgl_helpers.h头部增加

#define SPI\_HOST\_MAX 2

components\lvgl_esp32_drivers目录提交一下git更改

Lvgl 示例
git submodule add -b release/v7 git@github.com:littlevgl/lv_examples.git components/lv_examples/lv_examples

为了等下测试方便,我们这里自己新增一些文件

增加自定义文件

增加文件:components\lv_examples\CMakeLists.txt

if(ESP_PLATFORM)

file(GLOB_RECURSE SOURCES lv_examples/*.c)

idf_component_register(SRCS ${SOURCES}
                       INCLUDE_DIRS .
                       REQUIRES lvgl)

else()
    message(FATAL_ERROR "LVGL LV examples: ESP_PLATFORM is not defined. Try reinstalling ESP-IDF.")
endif()


增加文件:components\lv_examples\component.mk

#
# Component Makefile
#

CFLAGS += -DLV_LVGL_H_INCLUDE_SIMPLE

COMPONENT_SRCDIRS := lv_examples           \
    lv_examples/src/lv_demo_benchmark      \
    lv_examples/src/lv_demo_keypad_encoder \
    lv_examples/src/demo_stress            \
    lv_examples/src/lv_demo_widgets        \
    lv_examples/src/lv_ex_style            \
    lv_examples/src/lv_ex_widgets          \
    lv_examples/assets

COMPONENT_ADD_INCLUDEDIRS := $(COMPONENT_SRCDIRS) .


增加文件:components\lv_examples\Kconfig

# Kconfig for lv\_examples v7.4.0

menu "lv\_examples configuration"

    config LV_EX_PRINTF
        bool "Enable printf-ing data in demos and examples."
    
    choice LV_EX_CHOICE
        prompt "Select the demo you want to run."
        default LV_USE_DEMO_WIDGETS

        confi
  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值