summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-03-17 13:18:20 +1100
committerDamien George <damien@micropython.org>2025-04-09 00:22:33 +1000
commit037f2dad72a7d11d461330873b50bb9ccf4fed69 (patch)
tree26b25f7336c7825faa2def8590bb8caef87eff48 /tests
parent2ad592530256ebfdab6459e918748b729a3de7de (diff)
downloadmicropython-037f2dad72a7d11d461330873b50bb9ccf4fed69.tar.gz
micropython-037f2dad72a7d11d461330873b50bb9ccf4fed69.zip
tests: Update UART and SPI tests to work on Alif boards.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/extmod/machine_spi_rate.py5
-rw-r--r--tests/extmod/machine_uart_irq_txidle.py5
-rw-r--r--tests/extmod/machine_uart_tx.py6
-rw-r--r--tests/extmod_hardware/machine_uart_irq_rx.py6
-rw-r--r--tests/extmod_hardware/machine_uart_irq_rxidle.py6
5 files changed, 23 insertions, 5 deletions
diff --git a/tests/extmod/machine_spi_rate.py b/tests/extmod/machine_spi_rate.py
index 7022955a3d..c65095f22a 100644
--- a/tests/extmod/machine_spi_rate.py
+++ b/tests/extmod/machine_spi_rate.py
@@ -13,7 +13,10 @@ MAX_DELTA_MS = 8
# Configure pins based on the port/board details.
# Values are tuples of (spi_id, sck, mosi, miso)
-if "pyboard" in sys.platform:
+if "alif" in sys.platform:
+ MAX_DELTA_MS = 20
+ spi_instances = ((0, None, None, None),)
+elif "pyboard" in sys.platform:
spi_instances = (
(1, None, None, None), # "explicit choice of sck/mosi/miso is not implemented"
(2, None, None, None),
diff --git a/tests/extmod/machine_uart_irq_txidle.py b/tests/extmod/machine_uart_irq_txidle.py
index feb95fabaa..084e982576 100644
--- a/tests/extmod/machine_uart_irq_txidle.py
+++ b/tests/extmod/machine_uart_irq_txidle.py
@@ -12,7 +12,10 @@ except (ImportError, AttributeError):
import time, sys
# Configure pins based on the target.
-if "rp2" in sys.platform:
+if "alif" in sys.platform:
+ uart_id = 1
+ tx_pin = None
+elif "rp2" in sys.platform:
uart_id = 0
tx_pin = "GPIO0"
rx_pin = "GPIO1"
diff --git a/tests/extmod/machine_uart_tx.py b/tests/extmod/machine_uart_tx.py
index e9652f3c7a..f0cc912da6 100644
--- a/tests/extmod/machine_uart_tx.py
+++ b/tests/extmod/machine_uart_tx.py
@@ -14,7 +14,11 @@ bit_margin = 0
timing_margin_us = 100
# Configure pins based on the target.
-if "esp32" in sys.platform:
+if "alif" in sys.platform:
+ uart_id = 1
+ pins = {}
+ bit_margin = 1
+elif "esp32" in sys.platform:
uart_id = 1
pins = {}
timing_margin_us = 400
diff --git a/tests/extmod_hardware/machine_uart_irq_rx.py b/tests/extmod_hardware/machine_uart_irq_rx.py
index bf34900bd0..ecc95e62ae 100644
--- a/tests/extmod_hardware/machine_uart_irq_rx.py
+++ b/tests/extmod_hardware/machine_uart_irq_rx.py
@@ -15,7 +15,11 @@ import time, sys
byte_by_byte = False
# Configure pins based on the target.
-if "esp32" in sys.platform:
+if "alif" in sys.platform:
+ uart_id = 1
+ tx_pin = None
+ rx_pin = None
+elif "esp32" in sys.platform:
uart_id = 1
tx_pin = 4
rx_pin = 5
diff --git a/tests/extmod_hardware/machine_uart_irq_rxidle.py b/tests/extmod_hardware/machine_uart_irq_rxidle.py
index 182ab24ebe..af2412c75e 100644
--- a/tests/extmod_hardware/machine_uart_irq_rxidle.py
+++ b/tests/extmod_hardware/machine_uart_irq_rxidle.py
@@ -14,7 +14,11 @@ except (ImportError, AttributeError):
import time, sys
# Configure pins based on the target.
-if "esp32" in sys.platform:
+if "alif" in sys.platform:
+ uart_id = 1
+ tx_pin = None
+ rx_pin = None
+elif "esp32" in sys.platform:
uart_id = 1
tx_pin = 4
rx_pin = 5