summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-08-09 11:25:01 +1000
committerDamien George <damien@micropython.org>2024-10-15 12:23:06 +1100
commit651b63cd79229e9c8073885f926e26ef1a7f081a (patch)
tree598f8177da7e3f3779e0e0b731e17b468dc275fd /tests
parentfda7ae83a879c6be878febea70b604093e2de3b2 (diff)
tests/ports/rp2: Add simple rp2-specific UART test.
To test construction of UART instances. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/ports/rp2/rp2_uart.py10
-rw-r--r--tests/ports/rp2/rp2_uart.py.exp1
2 files changed, 11 insertions, 0 deletions
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)