aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-15 22:13:30 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:06 -0800
commit96f209a56176d5c2fcda47e9a8f149862274f4e2 (patch)
treed3b79d1786db6deb3ff607d8d8d6f7917cc62ac8 /mpm/python
parentb12b9465ed13bf2eb7c0fe379c22dcb3b86c4054 (diff)
downloaduhd-96f209a56176d5c2fcda47e9a8f149862274f4e2.tar.gz
uhd-96f209a56176d5c2fcda47e9a8f149862274f4e2.tar.bz2
uhd-96f209a56176d5c2fcda47e9a8f149862274f4e2.zip
mpm: mg: Add lowband LO lock and AD9371 lock sensors
Note: The AD9371 lock sensors are only stubbed out for now.
Diffstat (limited to 'mpm/python')
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/base.py2
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/magnesium.py56
2 files changed, 55 insertions, 3 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/base.py b/mpm/python/usrp_mpm/dboard_manager/base.py
index 2b42e47c5..bbba27613 100644
--- a/mpm/python/usrp_mpm/dboard_manager/base.py
+++ b/mpm/python/usrp_mpm/dboard_manager/base.py
@@ -116,7 +116,7 @@ class DboardManagerBase(object):
Power down the dboard. Does not have be implemented. If it does, it
needs to be safe to call multiple times.
"""
- self.log.info("deinit() called, but not implemented.")
+ self.log.debug("deinit() called, but not implemented.")
def get_serial(self):
"""
diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
index 46192d332..217517a56 100644
--- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py
+++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
@@ -286,8 +286,14 @@ class Magnesium(DboardManagerBase):
# See DboardManagerBase for documentation on these fields
#########################################################################
pids = [0x150]
- #file system path to i2c-adapter/mux
- base_i2c_adapter = '/sys/class/i2c-adapter'
+ rx_sensor_callback_map = {
+ 'lowband_lo_locked': 'get_lowband_tx_lo_locked_sensor',
+ 'ad9371_lo_locked': 'get_ad9371_tx_lo_locked_sensor',
+ }
+ tx_sensor_callback_map = {
+ 'lowband_lo_locked': 'get_lowband_rx_lo_locked_sensor',
+ 'ad9371_lo_locked': 'get_ad9371_rx_lo_locked_sensor',
+ }
# Maps the chipselects to the corresponding devices:
spi_chipselect = {"cpld": 0, "lmk": 1, "mykonos": 2, "phase_dac": 3}
@staticmethod
@@ -311,6 +317,8 @@ class Magnesium(DboardManagerBase):
"mykonos": create_spidev_iface,
"phase_dac": create_spidev_iface_phasedac,
}
+ #file system path to i2c-adapter/mux
+ base_i2c_adapter = '/sys/class/i2c-adapter'
# Map I2C channel to slot index
i2c_chan_map = {0: 'i2c-9', 1: 'i2c-10'}
user_eeprom = {
@@ -658,3 +666,47 @@ class Magnesium(DboardManagerBase):
assert which.lower() in ('tx', 'rx')
return self.cpld.get_lo_lock_status(which)
+ def get_lowband_tx_lo_locked_sensor(self):
+ " TX lowband LO lock sensor "
+ self.log.trace("Querying TX lowband LO lock status...")
+ lock_status = self.get_lowband_lo_lock('tx')
+ return {
+ 'name': 'lowband_lo_locked',
+ 'type': 'BOOLEAN',
+ 'unit': 'locked' if lock_status else 'unlocked',
+ 'value': str(lock_status).lower(),
+ }
+
+ def get_lowband_rx_lo_locked_sensor(self):
+ " RX lowband LO lock sensor "
+ self.log.trace("Querying RX lowband LO lock status...")
+ lock_status = self.get_lowband_lo_lock('rx')
+ return {
+ 'name': 'lowband_lo_locked',
+ 'type': 'BOOLEAN',
+ 'unit': 'locked' if lock_status else 'unlocked',
+ 'value': str(lock_status).lower(),
+ }
+
+ def get_ad9371_tx_lo_locked_sensor(self):
+ " TX ad9371 LO lock sensor "
+ self.log.trace("Querying TX AD9371 LO lock status...")
+ lock_status = True # FIXME
+ return {
+ 'name': 'ad9371_lo_locked',
+ 'type': 'BOOLEAN',
+ 'unit': 'locked' if lock_status else 'unlocked',
+ 'value': str(lock_status).lower(),
+ }
+
+ def get_ad9371_rx_lo_locked_sensor(self):
+ " RX ad9371 LO lock sensor "
+ self.log.trace("Querying RX AD9371 LO lock status...")
+ lock_status = True # FIXME
+ return {
+ 'name': 'ad9371_lo_locked',
+ 'type': 'BOOLEAN',
+ 'unit': 'locked' if lock_status else 'unlocked',
+ 'value': str(lock_status).lower(),
+ }
+