Merge branch 'docs/update_application_examples_of_uart' into 'master'

docs: Update the application examples in uart.rst

See merge request espressif/esp-idf!32653
This commit is contained in:
Zhang Shu Xian 2024-09-02 14:03:26 +08:00
commit ff3e93af28
2 changed files with 14 additions and 40 deletions

View File

@ -415,26 +415,13 @@ This galvanically isolated circuit does not require RTS pin control by a softwar
Application Examples
--------------------
The table below describes the code examples available in the directory :example:`peripherals/uart/`.
.. list-table::
:widths: 35 65
:header-rows: 1
* - Code Example
- Description
* - :example:`peripherals/uart/uart_echo`
- Configuring UART settings, installing the UART driver, and reading/writing over the UART1 interface.
* - :example:`peripherals/uart/uart_events`
- Reporting various communication events, using pattern detection interrupts.
* - :example:`peripherals/uart/uart_async_rxtxtasks`
- Transmitting and receiving data in two separate FreeRTOS tasks over the same UART.
* - :example:`peripherals/uart/uart_select`
- Using synchronous I/O multiplexing for UART file descriptors.
* - :example:`peripherals/uart/uart_echo_rs485`
- Setting up UART driver to communicate over RS485 interface in half-duplex mode. This example is similar to :example:`peripherals/uart/uart_echo` but allows communication through an RS485 interface chip connected to {IDF_TARGET_NAME} pins.
* - :example:`peripherals/uart/nmea0183_parser`
- Obtaining GPS information by parsing NMEA0183 statements received from GPS via the UART peripheral.
* :example:`peripherals/uart/uart_async_rxtxtasks` demonstrates how to use two asynchronous tasks for communication via the same UART interface, with one task transmitting "Hello world" periodically and the other task receiving and printing data from the UART.
* :example:`peripherals/uart/uart_echo` demonstrates how to use the UART interfaces to echo back any data received on the configured UART.
* :example:`peripherals/uart/uart_echo_rs485` demonstrates how to use the ESP32's UART software driver in RS485 half duplex transmission mode to echo any data it receives on UART port back to the sender in the RS485 network, requiring external connection of bus drivers.
* :example:`peripherals/uart/uart_events` demonstrates how to use the UART driver to handle special UART events, read data from UART0, and echo it back to the monitoring console.
* :example:`peripherals/uart/uart_repl` demonstrates how to use and connect two UARTs, allowing the UART used for stdout to send commands and receive replies from another console UART without human interaction.
* :example:`peripherals/uart/uart_select` demonstrates the use of ``select()`` for synchronous I/O multiplexing on the UART interface, allowing for non-blocking read and write from/to various sources such as UART and sockets, where a ready resource can be served without being blocked by a busy resource.
* :example:`peripherals/uart/nmea0183_parser` demonstrates how to parse NMEA-0183 data streams from GPS/BDS/GLONASS modules using the ESP UART Event driver and ESP event loop library, and output common information such as UTC time, latitude, longitude, altitude, and speed.
API Reference

View File

@ -415,26 +415,13 @@ RS485 特定通信模式简介
应用示例
--------------------
下表列出了目录 :example:`peripherals/uart/` 下可用的代码示例。
.. list-table::
:widths: 35 65
:header-rows: 1
* - 代码示例
- 描述
* - :example:`peripherals/uart/uart_echo`
- 配置 UART 设置、安装 UART 驱动程序以及通过 UART1 接口读取/写入。
* - :example:`peripherals/uart/uart_events`
- 报告各种通信事件,使用模式检测中断。
* - :example:`peripherals/uart/uart_async_rxtxtasks`
- 通过同一 UART 在两个独立的 FreeRTOS 任务中发送和接收数据。
* - :example:`peripherals/uart/uart_select`
- 针对 UART 文件描述符使用同步 I/O 多路复用。
* - :example:`peripherals/uart/uart_echo_rs485`
- 设置 UART 驱动程序以半双工模式通过 RS485 接口进行通信。此示例与 :example:`peripherals/uart/uart_echo` 类似,但允许通过连接到 {IDF_TARGET_NAME} 管脚的 RS485 接口芯片进行通信。
* - :example:`peripherals/uart/nmea0183_parser`
- 解析通过 UART 外设从 GPS 收到的 NMEA0183 语句来获取 GPS 信息。
* :example:`peripherals/uart/uart_async_rxtxtasks` 演示了通过同一 UART 接口完成两个独立任务的通信。其中一个任务定期发送 "Hello world",另一个任务接收并打印 UART 接收到的数据。
* :example:`peripherals/uart/uart_echo` 演示了使用 UART 接口回显接收到的所有数据。
* :example:`peripherals/uart/uart_echo_rs485` 演示了如何使用 UART 软件驱动程序以 RS485 半双工传输模式回显接收到的 UART 数据,要求外部连接总线驱动器。
* :example:`peripherals/uart/uart_events` 演示了如何使用 UART 驱动程序处理特殊的 UART 事件,从 UART0 读取数据,并将数据回显到监视控制台。
* :example:`peripherals/uart/uart_repl` 演示了如何使用和连接两个 UART 接口,使用于标准输出的 UART 可以发送命令并接收来自另一个控制台 UART 的回复,无需人工交互。
* :example:`peripherals/uart/uart_select` 演示了在 UART 接口上使用 ``select()`` 函数来同步 I/O 多路复用,允许从/向各种来源(如 UART 和套接字)进行非阻塞读写操作,从而立即处理准备就绪的资源。
* :example:`peripherals/uart/nmea0183_parser` 演示了如何使用 ESP UART 事件驱动程序和 ESP 事件循环库来解析来自 GPS/BDS/GLONASS 模块的 NMEA-0183 数据流,并输出常见的信息,如 UTC 时间、纬度、经度、海拔和速度。
API 参考