diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-11-16 16:41:32 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:07 -0800 |
commit | b14cafd90c84e69cdb77aec2d8553c4d45213b8f (patch) | |
tree | 31207b8e54653391c9ebe2663ac4136691089507 /mpm/python | |
parent | 688247e5451216e82c3817e75d0c2bcfb70488c9 (diff) | |
download | uhd-b14cafd90c84e69cdb77aec2d8553c4d45213b8f.tar.gz uhd-b14cafd90c84e69cdb77aec2d8553c4d45213b8f.tar.bz2 uhd-b14cafd90c84e69cdb77aec2d8553c4d45213b8f.zip |
mpm: mg: Add dboard sensors for low- and highband LO lock status
- Add LO locked APIs to Magnesium
- Add LO locked sensor APIs for RX/TX and highband/lowband LOs
- Poll all those sensors from magnesium_radio_ctrl_impl
Reviewed-By: Steven Bingler <steven.bingler@ni.com>
Reviewed-By: Trung Tran <trung.tran@ettus.com>
Diffstat (limited to 'mpm/python')
-rw-r--r-- | mpm/python/usrp_mpm/dboard_manager/base.py | 9 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/dboard_manager/magnesium.py | 31 |
2 files changed, 26 insertions, 14 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/base.py b/mpm/python/usrp_mpm/dboard_manager/base.py index ef12c697a..82263bddc 100644 --- a/mpm/python/usrp_mpm/dboard_manager/base.py +++ b/mpm/python/usrp_mpm/dboard_manager/base.py @@ -135,7 +135,10 @@ class DboardManagerBase(object): """ self.log.warning("update_ref_clock_freq() called but not implemented") - def get_sensors(self, direction): + ########################################################################## + # Sensors + ########################################################################## + def get_sensors(self, direction, chan=0): """ Return a list of RX daughterboard sensor names. @@ -146,7 +149,7 @@ class DboardManagerBase(object): else: return list(self.tx_sensor_callback_map.keys()) - def get_sensor(self, direction, sensor_name): + def get_sensor(self, direction, sensor_name, chan=0): """ Return a dictionary that represents the sensor values for a given sensor. If the requested sensor sensor_name does not exist, throw an @@ -166,5 +169,5 @@ class DboardManagerBase(object): raise RuntimeError(error_msg) return getattr( self, callback_map.get('sensor_name') - )() + )(chan) diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py index 1e24eb046..d3c8c0bb6 100644 --- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py +++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py @@ -722,11 +722,19 @@ class Magnesium(DboardManagerBase): either 'tx' or 'rx' """ assert which.lower() in ('tx', 'rx') - return self.cpld.get_lo_lock_status(which) + return self.cpld.get_lo_lock_status(which.upper()) - def get_lowband_tx_lo_locked_sensor(self): + def get_ad9371_lo_lock(self, which): + """ + Return LO lock status (Boolean!) of the lowband LOs. 'which' must be + either 'tx' or 'rx' + """ + return self.mykonos.get_lo_locked(which.upper()) + + def get_lowband_tx_lo_locked_sensor(self, chan): " TX lowband LO lock sensor " - self.log.trace("Querying TX lowband LO lock status...") + self.log.trace("Querying TX lowband LO lock status for chan %d...", + chan) lock_status = self.get_lowband_lo_lock('tx') return { 'name': 'lowband_lo_locked', @@ -735,9 +743,10 @@ class Magnesium(DboardManagerBase): 'value': str(lock_status).lower(), } - def get_lowband_rx_lo_locked_sensor(self): + def get_lowband_rx_lo_locked_sensor(self, chan): " RX lowband LO lock sensor " - self.log.trace("Querying RX lowband LO lock status...") + self.log.trace("Querying RX lowband LO lock status for chan %d...", + chan) lock_status = self.get_lowband_lo_lock('rx') return { 'name': 'lowband_lo_locked', @@ -746,10 +755,10 @@ class Magnesium(DboardManagerBase): 'value': str(lock_status).lower(), } - def get_ad9371_tx_lo_locked_sensor(self): + def get_ad9371_tx_lo_locked_sensor(self, chan): " TX ad9371 LO lock sensor " - self.log.trace("Querying TX AD9371 LO lock status...") - lock_status = True # FIXME + self.log.trace("Querying TX AD9371 LO lock status for chan %d...", chan) + lock_status = self.get_ad9371_lo_lock('tx') return { 'name': 'ad9371_lo_locked', 'type': 'BOOLEAN', @@ -757,10 +766,10 @@ class Magnesium(DboardManagerBase): 'value': str(lock_status).lower(), } - def get_ad9371_rx_lo_locked_sensor(self): + def get_ad9371_rx_lo_locked_sensor(self, chan): " RX ad9371 LO lock sensor " - self.log.trace("Querying RX AD9371 LO lock status...") - lock_status = True # FIXME + self.log.trace("Querying RX AD9371 LO lock status for chan %d...", chan) + lock_status = self.get_ad9371_lo_lock('tx') return { 'name': 'ad9371_lo_locked', 'type': 'BOOLEAN', |