feat(gpio): add a dump API to dump IO configurations

Closes https://github.com/espressif/esp-idf/issues/12176
This commit is contained in:
Song Ruo Jing
2023-09-22 17:36:51 +08:00
parent 4356deda2f
commit 321f628ff5
17 changed files with 557 additions and 13 deletions
@@ -10,6 +10,34 @@ GPIO 汇总
:start-after: gpio-summary
:end-before: ---
GPIO 驱动提供了一个函数 :cpp:func:`gpio_dump_io_configuration` 用来输出指定管脚的实时配置状态,包括上下拉、输入输出使能、管脚映射等。输出示例如下:
::
================IO DUMP Start================
IO[4] -
Pullup: 1, Pulldown: 0, DriveCap: 2
InputEn: 1, OutputEn: 0, OpenDrain: 0
FuncSel: 1 (GPIO)
GPIO Matrix SigIn ID: (simple GPIO input)
SleepSelEn: 1
IO[18] -
Pullup: 0, Pulldown: 0, DriveCap: 2
InputEn: 0, OutputEn: 1, OpenDrain: 0
FuncSel: 1 (GPIO)
GPIO Matrix SigOut ID: 256 (simple GPIO output)
SleepSelEn: 1
IO[26] **RESERVED** -
Pullup: 1, Pulldown: 0, DriveCap: 2
InputEn: 1, OutputEn: 0, OpenDrain: 0
FuncSel: 0 (IOMUX)
SleepSelEn: 1
=================IO DUMP End==================
当 IO 管脚是通过 GPIO 交换矩阵连接到内部外设信号,输出信息打印中的外设信号 ID 定义可以在 ``soc/gpio_sig_map.h`` 文件中查看。``**RESERVED**`` 字样则表示此 IO 被用于连接 FLASH 或 PSRAM,因此该引脚不应该被其他任何应用场景所征用并进行重新配置。
.. only:: SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
@@ -96,6 +124,7 @@ API 参考 - 普通 GPIO
------------------------
.. include-build-file:: inc/rtc_io.inc
.. include-build-file:: inc/lp_io.inc
.. include-build-file:: inc/rtc_io_types.inc
.. only:: SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER or SOC_GPIO_FLEX_GLITCH_FILTER_NUM