diff options
Diffstat (limited to 'host/tests/devtest/gpio_test.py')
-rwxr-xr-x | host/tests/devtest/gpio_test.py | 23 |
1 files changed, 22 insertions, 1 deletions
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 |