From 651b63cd79229e9c8073885f926e26ef1a7f081a Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 9 Aug 2024 11:25:01 +1000 Subject: [PATCH] tests/ports/rp2: Add simple rp2-specific UART test. To test construction of UART instances. Signed-off-by: Damien George --- tests/ports/rp2/rp2_uart.py | 10 ++++++++++ tests/ports/rp2/rp2_uart.py.exp | 1 + 2 files changed, 11 insertions(+) create mode 100644 tests/ports/rp2/rp2_uart.py create mode 100644 tests/ports/rp2/rp2_uart.py.exp diff --git a/tests/ports/rp2/rp2_uart.py b/tests/ports/rp2/rp2_uart.py new file mode 100644 index 000000000..da8859934 --- /dev/null +++ b/tests/ports/rp2/rp2_uart.py @@ -0,0 +1,10 @@ +# Test construction of machine.UART objects. + +import sys +from machine import UART + +print(UART(0, tx=0, rx=1)) + +if "RP2350" in sys.implementation._machine: + # Test that UART can be constructed using other tx/rx pins. + UART(0, tx=2, rx=3) diff --git a/tests/ports/rp2/rp2_uart.py.exp b/tests/ports/rp2/rp2_uart.py.exp new file mode 100644 index 000000000..72cd5fb00 --- /dev/null +++ b/tests/ports/rp2/rp2_uart.py.exp @@ -0,0 +1 @@ +UART(0, baudrate=115200, bits=8, parity=None, stop=1, tx=0, rx=1, txbuf=256, rxbuf=256, timeout=0, timeout_char=1, invert=None, irq=0)