diff options
author | Lane Kolbly <lane.kolbly@ni.com> | 2021-11-03 13:23:19 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-11-04 11:32:21 -0700 |
commit | ae12c802e7d37b2299add50c3e6f00d3a351adc8 (patch) | |
tree | 8958c1652531a71fe18cb8f959521a9398f8615e /mpm/python/usrp_mpm | |
parent | a94ea11f00bba2c4227c9ab173eb4b6ef1049bad (diff) | |
download | uhd-ae12c802e7d37b2299add50c3e6f00d3a351adc8.tar.gz uhd-ae12c802e7d37b2299add50c3e6f00d3a351adc8.tar.bz2 uhd-ae12c802e7d37b2299add50c3e6f00d3a351adc8.zip |
mpm: x4xx: Allow GPIO0 and GPIO1 as port names
Diffstat (limited to 'mpm/python/usrp_mpm')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py b/mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py index 0eddb58e9..144314eba 100644 --- a/mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py +++ b/mpm/python/usrp_mpm/periph_manager/x4xx_periphs.py @@ -400,10 +400,12 @@ class DioControl: :raises RuntimeError: name could not be normalized """ assert isinstance(name, str) - if not name.upper() in self.DIO_PORTS + ("A", "B"): + gpio0_names = (self.DIO_PORTS[0], self.X4XX_GPIO_BANKS[0], "A") + gpio1_names = (self.DIO_PORTS[1], self.X4XX_GPIO_BANKS[1], "B") + if name.upper() not in gpio0_names + gpio1_names: raise RuntimeError("Could not map %s to port name" % name) - return self.DIO_PORTS[0] if name.upper() in (self.DIO_PORTS[0], "A") \ - else self.DIO_PORTS[1] + return self.DIO_PORTS[0] if name.upper() in gpio0_names \ + else self.DIO_PORTS[1] # -------------------------------------------------------------------------- # Helper to format status output |