当前位置: 首页 > news >正文

esp32 idf中的外部组件

通常外部组件都定义在“main/idf_component.yml”里面。
例如小智智能语音的外部组件:

## IDF Component Manager Manifest File
dependencies:
  waveshare/esp_lcd_sh8601: "1.0.2"
  espressif/esp_lcd_ili9341: "==1.2.0"
  espressif/esp_lcd_gc9a01: "^2.0.1"
  espressif/esp_lcd_st77916: "^1.0.1"
  espressif/esp_lcd_spd2010: "==1.0.2"
  espressif/esp_io_expander_tca9554: "==2.0.0"
  espressif/esp_lcd_panel_io_additions: "^1.0.1"
  78/esp_lcd_nv3023: "~1.0.0"
  78/esp-wifi-connect: "~2.3.1"
  78/esp-opus-encoder: "~2.3.0"
  78/esp-ml307: "~1.7.3"
  78/xiaozhi-fonts: "~1.3.2"
  espressif/led_strip: "^2.4.1"
  espressif/esp_codec_dev: "~1.3.2"
  espressif/esp-sr: "^2.0.3"
  espressif/button: "^3.3.1"
  espressif/knob: "^1.0.0"
  lvgl/lvgl: "~9.2.2"
  esp_lvgl_port: "~2.4.4"
  espressif/esp_io_expander_tca95xx_16bit: "^2.0.0"
  tny-robotics/sh1106-esp-idf:
    version: "^1.0.0"
    rules:
      - if: 'idf_version >= "5.4.0"'
  ## Required IDF version
  idf:
    version: ">=5.3"

可见这里用了很多的外部的组件。组件名称后面就是要求的版本号。
版本选择符

在指定依赖版本时,可以使用不同的符号来表示希望接受的版本范围:

^(caret):允许安装不改变最左边非零数字的更新版本。例如,^2.0.1 可以安装从 2.0.1<3.0.0 的任何版本(包括 2.0.2, 2.1.0, 2.9.9 等等)。
~(tilde):只允许补丁版本的更新。例如,~2.0.1 只会安装从 2.0.1<2.1.0 的版本(即只能是 2.0.x 形式的版本)。
==:精确匹配版本号。例如,2.0.1 将严格使用这个确切版本。

但这些组件哪里来的呢?
idf.py build之后,可以在“managed_components”文件夹下查看这些组件的源码。
打开任意一个组件文件夹,里面有个xxx.yml的文件,比如“managed_components\espressif__button\idf_component.yml”这个文件,

dependencies:
  cmake_utilities: 0.*
  idf: '>=4.0'
description: GPIO and ADC button driver
documentation: https://docs.espressif.com/projects/esp-iot-solution/en/latest/input_device/button.html
issues: https://github.com/espressif/esp-iot-solution/issues
repository: git://github.com/espressif/esp-iot-solution.git
repository_info:
  commit_sha: ef19f4a5524a0ea147c9eccde0438123b41aeeb1
  path: components/button
url: https://github.com/espressif/esp-iot-solution/tree/master/components/button
version: 3.5.0

上面就是espressif__button的版本地址,还可以看到版本是3.5.0,这个版本跟配置文件所要求的“espressif/button: “^3.3.1””是匹配的。

关于esp32的组件,可以查看下面的链接获取更多的信息,也可以自己编写组件了。
https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32s3/api-guides/build-system.html

http://www.dtcms.com/a/104672.html

相关文章:

  • OpenAI最近放出大新闻,准备在接下来的几个月内推出一款“开放”的语言模型
  • 基于HUTOOL实现RSA工具类
  • Vue3+Vite+TypeScript+Element Plus开发-02.Element Plus安装与配置
  • deepseek使用记录26——思维混乱背后的理论泡沫与骗局
  • LeetCode 热题 100_打家劫舍(83_198_中等_C++)(动态规划)
  • (C语言)虚数运算(结构体教程)(指针解法)(C语言教程)
  • 关于点扩散函数小记
  • 《向量数据库指南》——深度解析Kubernetes Operator在Mlivus Cloud中的实现原理
  • FPGA实现数码管显示分秒时间
  • 【编译原理】第三章 词法分析
  • Kubernetes高级应用(NFS存储)
  • 机器人基础知识-1
  • java学习+题解
  • 面试遇到的几个问题小记20250401
  • 【学习记录】pytorch载入模型的部分参数
  • 蓝桥杯省模赛 台阶方案
  • 微信登录、商品浏览前瞻
  • 简单版CentOS7配置haproxy
  • PyTorch 深度学习实战(31):可解释性AI与特征可视化
  • 数据层的基本操作(2)
  • 如何将生活场景转换为数据模型模型仿真?
  • MSSQL:模拟故障
  • 基于 Spring Boot 的项目模板搭建指南
  • linux如何与windows进行共享文件夹开发,不用来回用git进行拉来拉去,这个对于swoole开发者来说特别重要
  • 自然语言处理(27:(终章Attention 3.)Attention的评价)
  • Linux Vim 编辑器的使用
  • 在线转换ico格式工具,给qt生成的exe添加桌面图标
  • Java 基础-28- 多态 — 多态下的类型转换问题
  • 4月01日,每日信息差
  • Pytorch学习笔记(十九)Image and Video - Spatial Transformer Networks Tutorial