diff --git a/en/peripherals/machine.UART.md b/en/peripherals/machine.UART.md index 48631c4292a8dfb3cda34ef3848c1d64208a97b1..f699449763091795c20a15ff34fc830de1ae6788 100644 --- a/en/peripherals/machine.UART.md +++ b/en/peripherals/machine.UART.md @@ -7,481 +7,53 @@ This class transmits data through the UART. ### `machine.UART`
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-Parametric Description
+Parametric Description:
UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT UART4
- STDOUT PORT
UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT UART4
- STDOUT PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
/EC600U series support 2400, 4800, 9600, 14400, 19200, 28800, 33600, 38400, 57600, 115200, 230400, 460800, 921600, 1000000.
databits
- Data bit [5 ~ 8], int type, EC600U only supports 8 bits.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- The data bit only supports 8 bits, int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-Parametric Description
+Parametric Description:
UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT UART4
- STDOUT PORT
UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
EC200U系列支持2400、4800、9600、14400、19200、28800、33600、38400、57600、115200、230400、460800、921600、1000000。
databits
- Data bits [5 ~ 8], int type, only 8 bits supported.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5-8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-Parametric Description
+Parametric Description:
UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT (BG95M3 is not supported.)
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5-8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT (不支持BG95M3)
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT UART4
- STDOUT PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
EG915U series support 2400, 4800, 9600, 14400, 19200, 28800, 33600, 38400, 57600, 115200, 230400, 460800, 921600, 1000000.
databits
- Data bits [5 ~ 8], int type, only 8 bits supported.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
EG912U series support 2400, 4800, 9600, 14400, 19200, 28800, 33600, 38400, 57600, 115200, 230400, 460800, 921600, 1000000.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT UART4
- STDOUT PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-Parametric Description
-UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [5 ~ 8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
UART number | TX pin | RX pin | +RTS pin | +CTS pin | +Attention | @@ -747,21 +400,33 @@ This class transmits data through the UART.UART0 | pin23 | pin22 | ++ | + |
---|---|---|---|---|---|
UART1 | pin27 | pin28 | ++ | + | |
UART2 | pin64 | pin65 | ++ | + | |
UART4 | pin35 | pin34 | ++ | + |
To use UART4 in BG95 series, you need to call modem.main_uart_enable_set(1) to enable UART4, and restart it as follows
+To use UART4, you need to call modem.main_uart_enable_set(1) to enable UART4, and restart it as follows
import modem
modem.main_uart_enable_get()
#Get the Main UART enable status 1-enabled, 0-not enabled
modem.main_uart_enable_set(1)
#Set the Main_UART enable state 1- enabled, 0- not enabled, restart to take effect
+import modem
+# Get Main UART enabled status 1-enabled, 0-not enabled
+modem.main_uart_enable_get()
+# Set Main_UART enable state 1- enabled, 0- Not enabled, restart to take effect
+modem.main_uart_enable_set(1)
When flowctl = 1, uart1 of EC600M only maps uart1 to different pins and does not turn on the flow control function.
+When flowctl = 1, uart1 only maps uart1 to different pins and does not turn on the flow control function.
When flowctl = 1, uart1 of EC800M only maps uart1 to different pins, and the flow control function is not turned on.
-When flowctl = 1, uart1 of EG810M only maps uart1 to different pins and does not turn on the flow control function.
-When flowctl = 1, uart1 of EG912N only maps uart1 to different pins and does not turn on the flow control function.
-When flowctl = 1, uart1 of EC600K only maps uart1 to different pins and does not turn on the flow control function.
-The uart1 of EC800K only maps uart1 to different pins when flowctl = 1, and the flow control function is not turned on.
-After the FCM360W UART2 is initialized, the interaction port will not be used. You need to execute uart2.close() in the code or restart the module to continue to use the interaction port.
+UART2 is initialized after the interaction port will not be used, you need to execute uart2.close() in the code or restart the module to continue to use the interaction port.
FCM362K UART1 is initialized after the interaction port will not be used, you need to execute uart1.close() in the code or restart the module to continue to use the interaction port.
+UART1 is initialized after the interaction port will not be used, you need to execute uart1.close() in the code or restart the module to continue to use the interaction port.
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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
+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](machine.Pin.md), 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
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
Return value Description:
Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
uart.control_485(UART.GPIOn, direction)
+from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-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.
-
-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 data
0
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
-
-
-Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
-Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-
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.
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
Return value Description:
-Returns an integer value on success0
,Returns an integer value on failure-1
。
Example:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
uart1.control_485(UART.GPIO24, 1)
-Example:
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
参数描述:
UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT UART4
- STDOUT PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
/EC600U系列支持2400、4800、9600、14400、19200、28800、33600、38400、57600、115200、230400、460800、921600、1000000。
databits
- 数据位[5 ~ 8],int类型,EC600U仅支持8位。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT UART4
- STDOUT PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
EC200U系列支持2400、4800、9600、14400、19200、28800、33600、38400、57600、115200、230400、460800、921600、1000000。
databits
- 数据位[5 ~ 8],int类型,仅支持8位。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
databits
- 数据位仅支持8位,int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
参数描述:
UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT UART4
- STDOUT PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
参数描述:
@@ -127,7 +47,7 @@UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
databits
- 数据位仅支持8位,int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
参数描述:
@@ -151,7 +71,7 @@class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
参数描述:
@@ -166,503 +86,235 @@class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT UART4
- STDOUT PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
EG915U系列支持2400、4800、9600、14400、19200、28800、33600、38400、57600、115200、230400、460800、921600、1000000。
databits
- 数据位[5 ~ 8],int类型,仅支持8位。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
uart编号 | +TX引脚 | +RX引脚 | +RTS引脚 | +CTS引脚 | +注意 | + + + +
---|---|---|---|---|---|
uart1 | +引脚号124 | +引脚号123 | ++ | + | + |
uart2 | +引脚号32 | +引脚号31 | +引脚号34 | +引脚号33 | ++ |
uart4 | +引脚号103 | +引脚号104 | ++ | + | + |
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
uart编号 | +TX引脚 | +RX引脚 | +RTS引脚 | +CTS引脚 | +注意 | + + + +
---|---|---|---|---|---|
uart1 | +引脚号138 | +引脚号137 | ++ | + | + |
uart2 | +引脚号67 | +引脚号68 | +引脚号65 | +引脚号64 | ++ |
uart4 | +引脚号82(EC200UXXAA不支持) | +引脚号81 | ++ | + | + |
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
uart编号 | +TX引脚 | +RX引脚 | +RTS引脚 | +CTS引脚 | +注意 | + + + +
---|---|---|---|---|---|
uart0(建议使用其他uart) | +引脚号12 | +引脚号11 | ++ | + | + |
uart1 | +引脚号63(EC200ACN_LA: 引脚号26) | +引脚号66(EC200ACN_LA: 引脚号27) | ++ | + | EC200ACN_LA模组uart1引脚号与其他型号不同 | +
uart2 | +引脚号67 | +引脚号68 | ++ | + | + |
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
EG912U系列支持2400、4800、9600、14400、19200、28800、33600、38400、57600、115200、230400、460800、921600、1000000。
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT uart4
- STDOUT PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
-
-参数描述:
-UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[5 ~ 8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
uart编号 | TX引脚 | RX引脚 | RTS引脚 | CTS引脚 | +注意 | |||||
---|---|---|---|---|---|---|---|---|---|---|
uart1 | -引脚号124 | -引脚号123 | -- | + | uart0(建议使用其他uart) | +引脚号12 | +引脚号11 | ++ | + | |
uart2 | -引脚号32 | -引脚号31 | -引脚号34 | -引脚号33 | +uart1 | +引脚号63(EC200ACN_LA: 引脚号26) | +引脚号66(EC200ACN_LA: 引脚号27) | ++ | + | EC200ACN_LA模组uart1引脚号与其他型号不同 |
uart4 | -引脚号103 | -引脚号104 | -- | + | uart2 | +引脚号67 | +引脚号68 | ++ | + |
uart编号 | TX引脚 | RX引脚 | RTS引脚 | CTS引脚 | +注意 | |||||
---|---|---|---|---|---|---|---|---|---|---|
uart1 | -引脚号138 | -引脚号137 | -- | + | uart0 | +引脚号71 | +引脚号72 | ++ | + | |
uart2 | -引脚号67 | -引脚号68 | -引脚号65 | -引脚号64 | +uart1 | +引脚号3 | +引脚号2 | ++ | + | |
uart4 | -引脚号82(EC200UXXAA不支持) | -引脚号81 | -- | + | uart2 | +引脚号32 | +引脚号31 | ++ | + |
uart编号 | TX引脚 | RX引脚 | +RTS引脚 | +CTS引脚 | 注意 |
---|---|---|---|
uart0(建议使用其他uart) | -引脚号12 | -引脚号11 | -- |
uart1 | -引脚号63(EC200ACN_LA: 引脚号26) | -引脚号66(EC200ACN_LA: 引脚号27) | -- |
uart2 | -引脚号67 | -引脚号68 | -EC200ACN_LA模组uart1引脚号与其他型号不同 | -
uart编号 | -TX引脚 | -RX引脚 | -注意 | - - - -
---|---|---|---|
uart0(建议使用其他uart) | -引脚号12 | -引脚号11 | -- |
uart1 | -引脚号63(EC200ACN_LA: 引脚号26) | -引脚号66(EC200ACN_LA: 引脚号27) | -EC200ACN_LA模组uart1引脚号与其他型号不同 | -
uart2 | -引脚号67 | -引脚号68 | -- |
uart编号 | -TX引脚 | -RX引脚 | - - - -
---|---|---|
uart0 | -引脚号71 | -引脚号72 | -
uart1 | -引脚号3 | -引脚号2 | -
uart2 | -引脚号32 | -引脚号31 | -
uart编号 | -TX引脚 | -RX引脚 | - - - -||||||
---|---|---|---|---|---|---|---|---|
uart0 | -引脚号71 | -引脚号72 | +uart0 | +引脚号71 | +引脚号72 | ++ | + | |
uart1 | 引脚号3 | 引脚号2 | ++ | + | ||||
uart2 | 引脚号32 | 引脚号31 | ++ | + |
uart编号 | TX引脚 | RX引脚 | +RTS引脚 | +CTS引脚 | +注意 | @@ -747,21 +432,33 @@uart0 | 引脚号23 | 引脚号22 | ++ | + |
---|---|---|---|---|---|
uart1 | 引脚号27 | 引脚号28 | ++ | + | |
uart2 | 引脚号64 | 引脚号65 | ++ | + | |
uart4 | 引脚号35 | 引脚号34 | ++ | + |
BG95系列使用UART4需要先调用modem.main_uart_enable_set(1)使能UART4,重启生效,如下
+使用UART4需要先调用modem.main_uart_enable_set(1)使能UART4,重启生效,如下
import modem
#获取Main_UART使能状态 1-使能,0-不使能
@@ -1416,11 +1307,11 @@ modem.main_uart_enable_set(1)
- FCM360W UART2被初始化后交互口将无法使用,需要在代码中执行uart2.close()或者重启模组才可继续使用交互口。
+ UART2被初始化后交互口将无法使用,需要在代码中执行uart2.close()或者重启模组才可继续使用交互口。
- FCM362K UART1被初始化后交互口将无法使用,需要在代码中执行uart1.close()或者重启模组才可继续使用交互口。
+ UART1被初始化后交互口将无法使用,需要在代码中执行uart1.close()或者重启模组才可继续使用交互口。
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
-
-该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
-参数描述:
-GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
-成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
-
uart.control_485
uart.control_485(UART.GPIOn, direction)
diff --git a/zh/peripherals/misc.ADC.md b/zh/peripherals/misc.ADC.md
index b5027608fbc73a444b0885c7d6d7bb7f97657691..d2353b2a41bb38efe73d60253dc926fab1379df9 100644
--- a/zh/peripherals/misc.ADC.md
+++ b/zh/peripherals/misc.ADC.md
@@ -492,7 +492,6 @@ ADC.close()