From ffe7181412f604c5e59325c91b5f6be43fccb54a Mon Sep 17 00:00:00 2001 From: shenmengjing Date: Tue, 9 Jul 2024 11:54:00 +0800 Subject: [PATCH] docs: Add some application examples to dedic_gpio --- docs/en/api-reference/peripherals/dedic_gpio.rst | 8 +++++++- docs/zh_CN/api-reference/peripherals/dedic_gpio.rst | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/en/api-reference/peripherals/dedic_gpio.rst b/docs/en/api-reference/peripherals/dedic_gpio.rst index bdb7f4a3f3..319586f4f6 100644 --- a/docs/en/api-reference/peripherals/dedic_gpio.rst +++ b/docs/en/api-reference/peripherals/dedic_gpio.rst @@ -157,7 +157,13 @@ Application Example .. list:: * Software emulation (bit banging) of the UART/I2C/SPI protocols in assembly using the dedicated GPIOs and their associated CPU instructions: :example:`peripherals/dedicated_gpio`. - :SOC_DEDIC_GPIO_HAS_INTERRUPT: * Matrix keyboard example based on dedicated GPIO: :example:`peripherals/gpio/matrix_keyboard`. + :SOC_DEDIC_GPIO_HAS_INTERRUPT: * :example:`peripherals/gpio/matrix_keyboard` demonstrates how to drive a matrix keyboard using the dedicated GPIO APIs, including manipulating the level on a group of GPIOs, triggering edge interrupt, and reading level on a group of GPIOs. + * :example:`peripherals/dedicated_gpio/soft_i2c` demonstrates how to configure and use dedicated/fast GPIOs to emulate an I2C master, perform write-read transactions on the bus, and handle strict timing requirements by placing certain functions in IRAM. + * :example:`peripherals/dedicated_gpio/soft_uart` demonstrates how to emulate a UART bus using dedicated/fast GPIOs on {IDF_TARGET_NAME}, which can send and receive characters on the UART bus using a TX pin and an RX pin, with the baud rate and other configurations adjustable via `menuconfig`. + + .. only:: esp32c2 or esp32c3 or esp32c6 or esp32h2 or esp32p4 + + * :example:`peripherals/dedicated_gpio/soft_spi` demonstrates how to configure and use dedicated/fast GPIOs to emulate a full-duplex SPI bus on {IDF_TARGET_NAME}. API Reference diff --git a/docs/zh_CN/api-reference/peripherals/dedic_gpio.rst b/docs/zh_CN/api-reference/peripherals/dedic_gpio.rst index e3ce374f43..68d58211db 100644 --- a/docs/zh_CN/api-reference/peripherals/dedic_gpio.rst +++ b/docs/zh_CN/api-reference/peripherals/dedic_gpio.rst @@ -152,12 +152,18 @@ GPIO 捆绑包操作 应用示例 -------------------- +-------- .. list:: * 通过汇编代码使用专用的 CPU 指令来操作 GPIO 以模拟 UART/I2C/SPI 协议(Bit Banging) :example:`peripherals/dedicated_gpio`. - :SOC_DEDIC_GPIO_HAS_INTERRUPT: * 基于专用 GPIO 驱动的矩阵键盘::example:`peripherals/gpio/matrix_keyboard`. + :SOC_DEDIC_GPIO_HAS_INTERRUPT: * :example:`peripherals/gpio/matrix_keyboard` 演示了如何使用专用 GPIO API 驱动矩阵键盘,例如改变 GPIO 的电平、触发边缘中断以及读取 GPIO 的电平。 + * :example:`peripherals/dedicated_gpio/soft_i2c` 演示了如何配置和使用专用/快速 GPIO 来模拟 I2C 主机设备、执行总线上的读写操作、以及通过将某些函数放在 IRAM 中来满足严格的时序要求。 + * :example:`peripherals/dedicated_gpio/soft_uart` 演示了如何使用专用/快速 GPIO 在 {IDF_TARGET_NAME} 上模拟 UART 总线。可以通过 TX 管脚和 RX 管脚在 UART 总线上发送和接收字符,还可以通过 `menuconfig` 来调整波特率和其他配置。 + + .. only:: esp32c2 or esp32c3 or esp32c6 or esp32h2 or esp32p4 + + * :example:`peripherals/dedicated_gpio/soft_spi` 演示了如何配置和使用专用/快速 GPIO,在 {IDF_TARGET_NAME} 上模拟全双工 SPI 总线。 API 参考