aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/dboard_manager/e31x_db.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2022-01-07 14:16:42 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2022-01-10 08:02:41 -0600
commit6666f36c267fc9ca908032fb719ec318c142636f (patch)
treeddfaf98d398e0f51d6cea1da4c61306c680a49f5 /mpm/python/usrp_mpm/dboard_manager/e31x_db.py
parentedf16b3a85507064d42da2021d5eaea4002f7912 (diff)
downloaduhd-6666f36c267fc9ca908032fb719ec318c142636f.tar.gz
uhd-6666f36c267fc9ca908032fb719ec318c142636f.tar.bz2
uhd-6666f36c267fc9ca908032fb719ec318c142636f.zip
mpm: e320/e31x: Fix lo-lock sensors
The LO-locked sensors on these devices were getting routed to the MPM API call get_lo_lock_sensor(), which takes a 'which' argument (rx or tx). However, UHD wants to pass a 'chan' argument (0 or 1). The way the code was structured, it would always return 'False' (LO not locked) when the argument was neither 'rx' or 'tx'. The solution is to add get_rx_lo_lock_sensor() and get_tx_lo_lock_sensor(), which generate the appropriate 'which' argument, but discard the 'chan' argument (there is only one LO per Tx and Rx, respectively).
Diffstat (limited to 'mpm/python/usrp_mpm/dboard_manager/e31x_db.py')
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/e31x_db.py29
1 files changed, 20 insertions, 9 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/e31x_db.py b/mpm/python/usrp_mpm/dboard_manager/e31x_db.py
index 861264e88..d95e3a13a 100644
--- a/mpm/python/usrp_mpm/dboard_manager/e31x_db.py
+++ b/mpm/python/usrp_mpm/dboard_manager/e31x_db.py
@@ -36,15 +36,15 @@ class E31x_db(DboardManagerBase):
'rssi' : 'get_rssi_sensor',
# For backward compatibility reasons we have the same sensor with two
# different names
- 'lo_lock' : 'get_lo_lock_sensor',
- 'lo_locked' : 'get_lo_lock_sensor',
+ 'lo_lock' : 'get_rx_lo_lock_sensor',
+ 'lo_locked' : 'get_rx_lo_lock_sensor',
}
tx_sensor_callback_map = {
'ad9361_temperature': 'get_catalina_temp_sensor',
# For backward compatibility reasons we have the same sensor with two
# different names
- 'lo_lock' : 'get_lo_lock_sensor',
- 'lo_locked' : 'get_lo_lock_sensor',
+ 'lo_lock' : 'get_tx_lo_lock_sensor',
+ 'lo_locked' : 'get_tx_lo_lock_sensor',
}
# Maps the chipselects to the corresponding devices:
spi_chipselect = {"catalina": 0}
@@ -157,20 +157,19 @@ class E31x_db(DboardManagerBase):
Return LO lock status (Boolean!) of AD9361. 'which' must be
either 'tx' or 'rx'
"""
+ assert which in ('rx', 'tx')
mboard_regs_control = \
MboardRegsControl(self.mboard_regs_label, self.log)
if which == "tx":
return mboard_regs_control.get_ad9361_tx_lo_lock()
- if which == "rx":
- return mboard_regs_control.get_ad9361_rx_lo_lock()
- self.log.warning("get_ad9361_lo_lock(): Invalid which param `{}'"
- .format(which))
- return False
+ # else:
+ return mboard_regs_control.get_ad9361_rx_lo_lock()
def get_lo_lock_sensor(self, which):
"""
Get sensor dict with LO lock status
"""
+ assert which in ('rx', 'tx')
self.log.trace("Reading LO Lock.")
lo_locked = self.get_ad9361_lo_lock(which)
return {
@@ -180,6 +179,18 @@ class E31x_db(DboardManagerBase):
'value': str(lo_locked).lower(),
}
+ def get_rx_lo_lock_sensor(self, _chan):
+ """
+ RX-specific version of get_lo_lock_sensor() (for UHD API)
+ """
+ return self.get_lo_lock_sensor('rx')
+
+ def get_tx_lo_lock_sensor(self, _chan):
+ """
+ TX-specific version of get_lo_lock_sensor() (for UHD API)
+ """
+ return self.get_lo_lock_sensor('tx')
+
def get_catalina_temp_sensor(self, _):
"""
Get temperature sensor reading of Catalina.