diff --git a/en/peripherals/machine.UART.md b/en/peripherals/machine.UART.md index 02019d2b948faca85ebf1340d016d6bd74936a33..bec8ed7e6fb51f29e1228348c47e8f1f43ae742e 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:1
It 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 data0
It 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
uart.control_485
This API is not supported by this model
该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
参数描述:
GPIOn
- 需要控制的GPIO引脚号,参照Pin模块的引脚定义,int类型。
GPIOn
- 需要控制的GPIO引脚号,参照Pin模块的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
该型号不支持此API