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 as48009600192003840057600115200230400.
    /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 as48009600192003840057600115200230400.

  • +
  • 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 as48009600192003840057600115200230400.
    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 as48009600192003840057600115200230400.

  • +
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • +
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.
    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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.
    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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

    -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 as48009600192003840057600115200230400.

  • -
  • 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 Pin Correspondences:** @@ -494,6 +66,7 @@ This class transmits data through the UART. RX pin RTS pin CTS pin + Attention @@ -501,8 +74,9 @@ This class transmits data through the UART. UART1 pin124 pin123 - - + + + UART2 @@ -510,13 +84,15 @@ This class transmits data through the UART. pin31 pin34 pin33 + UART4 pin103 pin104 - - + + + @@ -528,6 +104,7 @@ This class transmits data through the UART. RX pin RTS pin CTS pin + Attention @@ -535,8 +112,9 @@ This class transmits data through the UART. UART1 pin138 pin137 - - + + + UART2 @@ -544,13 +122,15 @@ This class transmits data through the UART. pin68 pin65 pin64 + UART4 pin82(EC200UXXAA is not supported.) pin81 - - + + + @@ -560,6 +140,8 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin Attention @@ -568,19 +150,25 @@ This class transmits data through the UART. UART0(The use of other Uarts is recommended.) pin12 pin11 - + + + UART1 pin63(EC200ACN_LA: pin26) pin66(EC200ACN_LA: pin27) - + + + EC200ACN_LA module uart1 pin is different from other models. UART2 pin67 pin68 - EC200ACN LA module UART1pin is different from other models. + + + @@ -590,6 +178,8 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin Attention @@ -598,19 +188,25 @@ This class transmits data through the UART. UART0(The use of other Uarts is recommended.) pin12 pin11 - + + + UART1 pin63(EC200ACN_LA: pin26) pin66(EC200ACN_LA: pin27) - EC200ACN LA module UART1pin is different from other models. + + + EC200ACN_LA module uart1 pin is different from other models. UART2 pin67 pin68 - + + + @@ -620,6 +216,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -627,16 +226,25 @@ This class transmits data through the UART. UART0 pin71 pin72 + + + UART1 pin3 pin2 + + + UART2 pin32 pin31 + + + @@ -646,6 +254,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -653,16 +264,25 @@ This class transmits data through the UART. UART0 pin71 pin72 + + + UART1 pin3 pin2 + + + UART2 pin32 pin31 + + + @@ -672,6 +292,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -679,16 +302,25 @@ This class transmits data through the UART. UART0 pin21 pin20 + + + UART1 pin27 pin28 + + + UART2 pin50 pin49 + + + @@ -698,6 +330,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -705,16 +340,25 @@ This class transmits data through the UART. UART0 pin39 pin38 + + + UART1 pin50 pin51 + + + UART2 pin18 pin17 + + + @@ -724,6 +368,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -731,15 +378,21 @@ This class transmits data through the UART. UART1 pin29 pin28 + + + - +
+ + + @@ -747,21 +400,33 @@ This class transmits data through the UART. + + + + + + + + + + + +
UART number TX pin RX pinRTS pinCTS pinAttention
UART0 pin23 pin22
UART1 pin27 pin28
UART2 pin64 pin65
UART4 pin35 pin34
@@ -771,6 +436,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -778,21 +446,33 @@ This class transmits data through the UART. UART0 pin71 pin72 + + + UART1(flowctl = 0) pin3 pin2 + + + UART1(flowctl = 1) pin33 pin34 + + + UART2 pin32 pin31 + + + @@ -804,6 +484,7 @@ This class transmits data through the UART. RX pin RTS pin CTS pin + Attention @@ -811,8 +492,9 @@ This class transmits data through the UART. UART1 pin27 pin28 - - + + + UART2 @@ -820,13 +502,15 @@ This class transmits data through the UART. pin34 pin37 pin36 + UART4 pin19 pin18 - - + + + @@ -836,6 +520,8 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin Attention @@ -844,31 +530,41 @@ This class transmits data through the UART. UART0 pin39 pin38 - + + + UART1(flowctl = 0) pin50 pin51 - UART1 is not available for EC800MCNGA, CNGB, CNGD/ EG810MCNGA, and CNGB modules. + + + UART1(flowctl = 1) pin22 pin23 - + + + Uart1 is not available for EC800MCNGA, CNGB, CNGD/ EG810MCNGA, and CNGB modules. UART2 pin18 pin17 - + + + UART4 pin29 pin28 - + + + @@ -878,6 +574,8 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin Attention @@ -886,31 +584,41 @@ This class transmits data through the UART. UART0 pin39 pin38 - + + + UART1(flowctl = 0) pin50 pin51 - UART1 is not available for EC800MCNGA, CNGB, CNGD/ EG810MCNGA, and CNGB modules. + + + UART1(flowctl = 1) pin22 pin23 - + + + Uart1 is not available for EC800MCNGA, CNGB, CNGD/ EG810MCNGA, and CNGB modules. UART2 pin18 pin17 - + + + UART4 pin29 pin28 - + + + @@ -920,6 +628,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -927,21 +638,33 @@ This class transmits data through the UART. UART0 pin23 pin22 + + + UART1(flowctl = 0) pin27 pin28 + + + UART1(flowctl = 1) pin36 pin37 + + + UART2 pin35 pin34 + + + @@ -951,6 +674,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -958,16 +684,25 @@ This class transmits data through the UART. UART0 pin71 pin72 + + + - UART1(EC600ECN LE&LQ is not available.) + UART1 pin70 pin69 + + + EC600ECN_LE&LQ is not available. UART2 pin32 pin31 + + + @@ -977,6 +712,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -984,16 +722,25 @@ This class transmits data through the UART. UART0 pin39 pin38 + + + UART1 pin29 pin28 + + + UART2 pin18 pin17 + + + @@ -1005,6 +752,7 @@ This class transmits data through the UART. RX pin RTS pin CTS pin + Attention @@ -1012,36 +760,41 @@ This class transmits data through the UART. UART0 pin124 pin123 - - + + + UART2 pin32 pin31 - pin34 - pin33 + pin34 + pin33 + UART4 pin116 pin9 - - + + + UART5 pin125 pin126 - - + + + UART6 pin106 pin105 - - + + + @@ -1051,6 +804,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -1058,21 +814,33 @@ This class transmits data through the UART. UART1 pin29 pin28 + + + UART2 pin18 pin17 + + + UART5 pin23 pin22 + + + UART6 pin86 pin83 + + + @@ -1084,6 +852,7 @@ This class transmits data through the UART. RX pin RTS pin CTS pin + Attention @@ -1091,8 +860,9 @@ This class transmits data through the UART. UART1 pin27 pin28 - - + + + UART2 @@ -1100,13 +870,15 @@ This class transmits data through the UART. pin34 pin37 pin36 + - UART4(EG912UGL AA is not available.) + UART4 pin19 pin18 - - + + + EG912UGL_AA is not available. @@ -1116,6 +888,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -1123,21 +898,33 @@ This class transmits data through the UART. UART0 pin71 pin72 + + + UART1(flowctl = 0) pin3 pin2 + + + UART1(flowctl = 1) pin33 pin34 + + + UART2 pin32 pin31 + + + @@ -1147,6 +934,8 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin Attention @@ -1155,25 +944,33 @@ This class transmits data through the UART. UART0 pin39 pin38 - + + + UART1(flowctl = 0) pin50 pin51 + + EG800KCN is not available. UART1(flowctl = 1) pin22 pin23 + + EG800KCN is not available. UART2 pin18 pin17 - + + + @@ -1183,6 +980,8 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin Attention @@ -1191,25 +990,33 @@ This class transmits data through the UART. UART0 pin39 pin38 - + + + UART1(flowctl = 0) pin50 pin51 + + EG800KCN is not available. UART1(flowctl = 1) pin22 pin23 + + EG800KCN is not available. UART2 pin18 pin17 - + + + @@ -1221,6 +1028,7 @@ This class transmits data through the UART. RX pin RTS pin CTS pin + Attention @@ -1228,29 +1036,33 @@ This class transmits data through the UART. UART0 pin39 pin38 - - + + + UART1 pin22 pin23 - - + + + UART2 pin18 pin17 - pin23 - pin22 + pin23 + pin22 + UART3 pin29 pin28 - - + + + @@ -1260,18 +1072,27 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention - UART1 + UART0 pin27 pin26 + + + - UART2 + UART1 pin20 pin19 + + + @@ -1281,6 +1102,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -1288,11 +1112,17 @@ This class transmits data through the UART. UART1 pin35 pin34 + + + UART2 pin28 pin27 + + + @@ -1302,6 +1132,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -1309,6 +1142,9 @@ This class transmits data through the UART. UART0 pin21 pin22 + + + @@ -1318,6 +1154,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -1325,6 +1164,9 @@ This class transmits data through the UART. UART0 pin22 pin21 + + + @@ -1336,6 +1178,7 @@ This class transmits data through the UART. RX pin RTS pin CTS pin + Attention @@ -1343,15 +1186,17 @@ This class transmits data through the UART. UART0 pin23 pin22 - - + + + UART1 pin27 pin28 - - + + + UART2 @@ -1359,13 +1204,15 @@ This class transmits data through the UART. pin34 pin36 pin37 + - UART4(EG915NEU_AG unsupported.) + UART4 pin36 pin37 - - + + + Not supported by EG915NEU_AG. @@ -1375,6 +1222,9 @@ This class transmits data through the UART. UART number TX pin RX pin + RTS pin + CTS pin + Attention @@ -1382,61 +1232,54 @@ This class transmits data through the UART. UART0 pin39 pin38 + + + UART1 pin29 pin28 + + + UART2 pin18 pin17 + + + -
-
-

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.

@@ -1516,456 +1359,23 @@ This method disables the UART. `-1` - Failed execution
-
-### `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.

    -
  • -
  • 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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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.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:
    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

    +
  • 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

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

-
    -
  • 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:
    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

    -
  • -
-

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)
+
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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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

-
    -
  • 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:
    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

    -
  • -
-

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:

diff --git a/en/peripherals/misc.ADC.md b/en/peripherals/misc.ADC.md index 5f96003fef97e9ca026afb9b52a8ca95712c9b0a..a208c39322f466f2c9f36b1cf3aa856b6cfb2800 100644 --- a/en/peripherals/misc.ADC.md +++ b/en/peripherals/misc.ADC.md @@ -486,7 +486,6 @@ If successful, a specified channel voltage value is returned. ADC0 Pin number2 - diff --git a/zh/peripherals/machine.UART.md b/zh/peripherals/machine.UART.md index 36e6d97bf7ea6c27627511bd3cef612fc9b860fc..50fc1b9353f794c916ea32b07dcdfcb1f27b0114 100644 --- a/zh/peripherals/machine.UART.md +++ b/zh/peripherals/machine.UART.md @@ -7,95 +7,15 @@ ### `machine.UART`
-
+
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类型,支持常用波特率,如48009600192003840057600115200230400等;
    /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类型,支持常用波特率,如48009600192003840057600115200230400等;
    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类型,支持常用波特率,如48009600192003840057600115200230400等;

  • -
  • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

  • -
  • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

  • -
  • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

  • -
  • 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类型。

    @@ -103,12 +23,12 @@
-
+
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类型,支持常用波特率,如48009600192003840057600115200230400等;

  • databits - 数据位[5 ~ 8],int类型。

  • @@ -119,7 +39,7 @@
-
+
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类型,支持常用波特率,如48009600192003840057600115200230400等;

  • -
  • 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类型。

    @@ -135,7 +55,7 @@
  • -
    +
    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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;
      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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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引脚对应关系 :** -
    -
    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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;
      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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

      -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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类型,支持常用波特率,如48009600192003840057600115200230400等;

    • -
    • 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引脚对应关系 :** - -
    - +
    + - - - - - + + + + + + - - - - - + + + + + + - - - - - + + + + + +
    uart编号 TX引脚 RX引脚 RTS引脚 CTS引脚注意
    uart1引脚号124引脚号123uart0(建议使用其他uart)引脚号12引脚号11
    uart2引脚号32引脚号31引脚号34引脚号33uart1引脚号63(EC200ACN_LA: 引脚号26)引脚号66(EC200ACN_LA: 引脚号27) EC200ACN_LA模组uart1引脚号与其他型号不同
    uart4引脚号103引脚号104uart2引脚号67引脚号68
    - +
    + - - - - - + + + + + + - - - - - + + + + + + - - - - - + + + + + +
    uart编号 TX引脚 RX引脚 RTS引脚 CTS引脚注意
    uart1引脚号138引脚号137uart0引脚号71引脚号72
    uart2引脚号67引脚号68引脚号65引脚号64uart1引脚号3引脚号2
    uart4引脚号82(EC200UXXAA不支持)引脚号81uart2引脚号32引脚号31
    - +
    + + - - - - - - - - - - - - - - - - - - -
    uart编号 TX引脚 RX引脚RTS引脚CTS引脚 注意
    uart0(建议使用其他uart)引脚号12引脚号11
    uart1引脚号63(EC200ACN_LA: 引脚号26)引脚号66(EC200ACN_LA: 引脚号27)
    uart2引脚号67引脚号68EC200ACN_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引脚号72uart0引脚号71引脚号72
    uart1 引脚号3 引脚号2
    uart2 引脚号32 引脚号31
    @@ -672,6 +324,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -679,16 +334,25 @@ uart0 引脚号21 引脚号20 + + + uart1 引脚号27 引脚号28 + + + uart2 引脚号50 引脚号49 + + + @@ -698,6 +362,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -705,16 +372,25 @@ uart0 引脚号39 引脚号38 + + + uart1 引脚号50 引脚号51 + + + uart2 引脚号18 引脚号17 + + + @@ -724,6 +400,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -731,15 +410,21 @@ uart1 引脚号29 引脚号28 + + + - +
    + + + @@ -747,21 +432,33 @@ + + + + + + + + + + + +
    uart编号 TX引脚 RX引脚RTS引脚CTS引脚注意
    uart0 引脚号23 引脚号22
    uart1 引脚号27 引脚号28
    uart2 引脚号64 引脚号65
    uart4 引脚号35 引脚号34
    @@ -771,6 +468,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -778,21 +478,33 @@ uart0 引脚号71 引脚号72 + + + uart1(flowctl = 0) 引脚号3 引脚号2 + + + uart1(flowctl = 1) 引脚号33 引脚号34 + + + uart2 引脚号32 引脚号31 + + + @@ -804,6 +516,7 @@ RX引脚 RTS引脚 CTS引脚 + 注意 @@ -811,8 +524,9 @@ uart1 引脚号27 引脚号28 - - + + + uart2 @@ -820,13 +534,15 @@ 引脚号34 引脚号37 引脚号36 + uart4 引脚号19 引脚号18 - - + + + @@ -836,6 +552,8 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 注意 @@ -844,31 +562,41 @@ uart0 引脚号39 引脚号38 - + + + uart1(flowctl = 0) 引脚号50 引脚号51 - EC800MCNGA 、CNGB、CNGD/ EG810MCNGA、CNGB 模块的 uart1 不可用 + + + uart1(flowctl = 1) 引脚号22 引脚号23 - + + + EC800MCNGA 、CNGB、CNGD/ EG810MCNGA、CNGB 模块的 uart1 不可用 uart2 引脚号18 引脚号17 - + + + uart4 引脚号29 引脚号28 - + + + @@ -878,6 +606,8 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 注意 @@ -886,31 +616,41 @@ uart0 引脚号39 引脚号38 - + + + uart1(flowctl = 0) 引脚号50 引脚号51 - EC800MCNGA 、CNGB、CNGD/ EG810MCNGA、CNGB 模块的 uart1 不可用 + + + uart1(flowctl = 1) 引脚号22 引脚号23 - + + + EC800MCNGA 、CNGB、CNGD/ EG810MCNGA、CNGB 模块的 uart1 不可用 uart2 引脚号18 引脚号17 - + + + uart4 引脚号29 引脚号28 - + + + @@ -920,6 +660,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -927,21 +670,33 @@ uart0 引脚号23 引脚号22 + + + uart1(flowctl = 0) 引脚号27 引脚号28 + + + uart1(flowctl = 1) 引脚号36 引脚号37 + + + uart2 引脚号35 引脚号34 + + + @@ -951,6 +706,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -958,16 +716,25 @@ uart0 引脚号71 引脚号72 + + + - uart1(EC600ECN_LE&LQ不可用) + uart1 引脚号70 引脚号69 + + + EC600ECN_LE&LQ不可用 uart2 引脚号32 引脚号31 + + + @@ -977,6 +744,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -984,16 +754,25 @@ uart0 引脚号39 引脚号38 + + + uart1 引脚号29 引脚号28 + + + uart2 引脚号18 引脚号17 + + + @@ -1005,6 +784,7 @@ RX引脚 RTS引脚 CTS引脚 + 注意 @@ -1012,8 +792,9 @@ uart0 引脚号124 引脚号123 - - + + + uart2 @@ -1021,27 +802,31 @@ 引脚号31 引脚34 引脚33 + uart4 引脚号116 引脚号9 - - + + + uart5 引脚号125 引脚号126 - - + + + uart6 引脚号106 引脚号105 - - + + + @@ -1051,6 +836,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -1058,21 +846,33 @@ uart1 引脚号29 引脚号28 + + + uart2 引脚号18 引脚号17 + + + uart5 引脚号23 引脚号22 + + + uart6 引脚号86 引脚号83 + + + @@ -1084,6 +884,7 @@ RX引脚 RTS引脚 CTS引脚 + 注意 @@ -1091,8 +892,9 @@ uart1 引脚号27 引脚号28 - - + + + uart2 @@ -1100,13 +902,15 @@ 引脚号34 引脚号37 引脚号36 + - uart4(EG912UGL_AA不可用) + uart4 引脚号19 引脚号18 - - + + + EG912UGL_AA不可用 @@ -1116,6 +920,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -1123,21 +930,33 @@ uart0 引脚号71 引脚号72 + + + uart1(flowctl = 0) 引脚号3 引脚号2 + + + uart1(flowctl = 1) 引脚号33 引脚号34 + + + uart2 引脚号32 引脚号31 + + + @@ -1147,6 +966,8 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 注意 @@ -1155,25 +976,33 @@ uart0 引脚号39 引脚号38 - + + + uart1(flowctl = 0) 引脚号50 引脚号51 + + EG800KCN不可用 uart1(flowctl = 1) 引脚号22 引脚号23 + + EG800KCN不可用 uart2 引脚号18 引脚号17 - + + + @@ -1183,6 +1012,8 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 注意 @@ -1191,25 +1022,33 @@ uart0 引脚号39 引脚号38 - + + + uart1(flowctl = 0) 引脚号50 引脚号51 + + EG800KCN不可用 uart1(flowctl = 1) 引脚号22 引脚号23 + + EG800KCN不可用 uart2 引脚号18 引脚号17 - + + + @@ -1221,6 +1060,7 @@ RX引脚 RTS引脚 CTS引脚 + 注意 @@ -1228,15 +1068,17 @@ uart0 引脚号39 引脚号38 - - + + + uart1 引脚号22 引脚号23 - - + + + uart2 @@ -1244,13 +1086,15 @@ 引脚号17 引脚23 引脚22 + uart3 引脚号29 引脚号28 - - + + + @@ -1260,18 +1104,27 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 - uart1 + uart0 引脚号27 引脚号26 + + + - uart2 + uart1 引脚号20 引脚号19 + + + @@ -1281,6 +1134,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -1288,11 +1144,17 @@ uart1 引脚号35 引脚号34 + + + uart2 引脚号28 引脚号27 + + + @@ -1302,6 +1164,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -1309,6 +1174,9 @@ uart0 引脚号21 引脚号22 + + + @@ -1318,6 +1186,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -1325,6 +1196,9 @@ uart0 引脚号22 引脚号21 + + + @@ -1336,6 +1210,7 @@ RX引脚 RTS引脚 CTS引脚 + 注意 @@ -1343,15 +1218,17 @@ uart0 引脚号23 引脚号22 - - + + + uart1 引脚号27 引脚号28 - - + + + uart2 @@ -1359,13 +1236,15 @@ 引脚号34 引脚号36 引脚号37 + - uart4(EG915NEU_AG不支持) + uart4 引脚号36 引脚号37 - - + + + EG915NEU_AG不支持 @@ -1375,6 +1254,9 @@ uart编号 TX引脚 RX引脚 + RTS引脚 + CTS引脚 + 注意 @@ -1382,16 +1264,25 @@ uart0 引脚号39 引脚号38 + + + uart1 引脚号29 引脚号28 + + + uart2 引脚号18 引脚号17 + + + @@ -1399,7 +1290,7 @@
    -

    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()或者重启模组才可继续使用交互口。

    @@ -1498,440 +1389,7 @@ uart.close() 成功返回整型值`0`,失败返回整型值`-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)
    -
    -

    该方法用于控制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() ADC0 引脚号2 -