From 79331caea13d43ba8573873044d32a8844abc4ab Mon Sep 17 00:00:00 2001 From: Lysanderli Date: Mon, 28 Jul 2025 19:03:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9UART=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/peripherals/machine.UART.md | 7 ++++--- zh/peripherals/machine.UART.md | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/en/peripherals/machine.UART.md b/en/peripherals/machine.UART.md index 02019d2..bec8ed7 100644 --- a/en/peripherals/machine.UART.md +++ b/en/peripherals/machine.UART.md @@ -1253,15 +1253,16 @@ This method disables the UART. `-1` - Failed execution +### `uart.control_485` +
-

uart.control_485

uart.control_485(UART.GPIOn, direction)
 

This method is used to control the 485 communication direction, and the specified GPIO is pulled up and down before and after the serial port sends data to indicate the 485 communication direction.

Parametric Description:

    -
  • GPIOn - GPIO Pin number to control, refer to pin definition in [Pin module](machine.Pin.md), int type.

    +
  • GPIOn - GPIO Pin number to control, refer to pin definition in Pin module, int type.

  • direction - Pin level change, int type, described as follows:
    1It indicates that the pin level change is: the serial port is pulled up by low before sending data, and then pulled down by high after sending data
    0It indicates that the pin level change is: the serial port is pulled down by high before sending data, and then pulled up by low after sending data

  • @@ -1274,10 +1275,10 @@ This method disables the UART.
-

uart.control_485

This API is not supported by this model

+
### `uart.set_callback` diff --git a/zh/peripherals/machine.UART.md b/zh/peripherals/machine.UART.md index e45de61..b60faef 100644 --- a/zh/peripherals/machine.UART.md +++ b/zh/peripherals/machine.UART.md @@ -1292,7 +1292,7 @@ uart.close()

该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。

参数描述: