aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/tests/devtest/devtest_x4x0.py8
-rwxr-xr-xhost/tests/devtest/gpio_test.py23
2 files changed, 30 insertions, 1 deletions
diff --git a/host/tests/devtest/devtest_x4x0.py b/host/tests/devtest/devtest_x4x0.py
index c0b8bf4aa..d1add6a66 100644
--- a/host/tests/devtest/devtest_x4x0.py
+++ b/host/tests/devtest/devtest_x4x0.py
@@ -71,5 +71,13 @@ from test_pps_test import uhd_test_pps_test
# from gpio_test import gpio_test
# from bitbang_test import bitbang_test
+from gpio_test import gpio_atr_readback_test
+gpio_atr_readback_test.test_params = [
+ ("GPIOA", "DB0_RF0"),
+ ("GPIOA", "DB0_RF1"),
+ ("GPIOB", "DB1_RF0"),
+ ("GPIOB", "DB1_RF1"),
+]
+
from list_sensors_test import list_sensors_test
from python_api_test import uhd_python_api_test
diff --git a/host/tests/devtest/gpio_test.py b/host/tests/devtest/gpio_test.py
index 31a6d5e1d..179ace5b3 100755
--- a/host/tests/devtest/gpio_test.py
+++ b/host/tests/devtest/gpio_test.py
@@ -7,7 +7,7 @@
""" Test for gpio. """
import re
-from uhd_test_base import uhd_example_test_case
+from uhd_test_base import uhd_example_test_case, uhd_test_case, UHDPythonTestCase
class gpio_test(uhd_example_test_case):
""" Run gpio. """
@@ -37,3 +37,24 @@ class gpio_test(uhd_example_test_case):
print(app.stderr)
self.report_example_results(test_name, run_results)
return run_results
+
+
+class gpio_atr_readback_test(UHDPythonTestCase):
+ test_params = []
+
+ def test_all(self):
+ import uhd
+ usrp = uhd.usrp.MultiUSRP(self.args_str)
+
+ for gpio, source in self.test_params:
+ usrp.set_gpio_src("GPIO0", [source] * 12)
+
+ usrp.set_gpio_attr(gpio, "ATR_0X", 0xABC, 0xFFF)
+ usrp.set_gpio_attr(gpio, "ATR_RX", 0xCAB, 0xFFF)
+ usrp.set_gpio_attr(gpio, "ATR_TX", 0xABA, 0xFFF)
+ usrp.set_gpio_attr(gpio, "ATR_XX", 0xBAB, 0xFFF)
+
+ assert usrp.get_gpio_attr(gpio, "ATR_0X") == 0xABC
+ assert usrp.get_gpio_attr(gpio, "ATR_RX") == 0xCAB
+ assert usrp.get_gpio_attr(gpio, "ATR_TX") == 0xABA
+ assert usrp.get_gpio_attr(gpio, "ATR_XX") == 0xBAB