aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/dboard_manager/magnesium.py
diff options
context:
space:
mode:
authorTrung N Tran <trung.tran@ettus.com>2017-11-16 16:17:11 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:57 -0800
commitb9a0cf1467e89000658f69089bb773722e41ea89 (patch)
tree80ce5beb47c1a93694b16a7bbed365d1a0175c4c /mpm/python/usrp_mpm/dboard_manager/magnesium.py
parent73eb899e533d29c456eed1bc0ae72ff65676daf1 (diff)
downloaduhd-b9a0cf1467e89000658f69089bb773722e41ea89.tar.gz
uhd-b9a0cf1467e89000658f69089bb773722e41ea89.tar.bz2
uhd-b9a0cf1467e89000658f69089bb773722e41ea89.zip
mpm: Enable TX external LO set through args, simplify code
Simplify the process of setting external LO without calling through many API layers. Reviewed-By: Martin Braun <martin.braun@ettus.com>
Diffstat (limited to 'mpm/python/usrp_mpm/dboard_manager/magnesium.py')
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/magnesium.py30
1 files changed, 19 insertions, 11 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
index b11712303..fdcaea0de 100644
--- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py
+++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
@@ -597,6 +597,24 @@ class Magnesium(DboardManagerBase):
self.log.debug("args[tracking_cals]=0x{:02X}".format(self._tracking_cals_mask))
self.mykonos.setup_cal(self._init_cals_mask, self._tracking_cals_mask, self._init_cals_timeout)
+ def init_lo_source(self, args):
+ """Set all LO
+
+ This function will initialize all LO to user specified sources.
+ If there's no source is specified, the default one will be used.
+
+ Arguments:
+ args {string:string} -- device arguments.
+ """
+
+ self.log.info("Setting up LO source..")
+ rx_lo_source = args.get("rx_lo_source", "internal")
+ tx_lo_source = args.get("tx_lo_source", "internal")
+ self.mykonos.set_lo_source("RX", rx_lo_source)
+ self.mykonos.set_lo_source("TX", tx_lo_source)
+ self.log.debug("RX LO source is set at {}".format(self.mykonos.get_lo_source("RX")))
+ self.log.debug("TX LO source is set at {}".format(self.mykonos.get_lo_source("TX")))
+
def init_jesd(self, jesdcore, args):
"""
Bring up the JESD link between Mykonos and the N310.
@@ -608,17 +626,7 @@ class Magnesium(DboardManagerBase):
self.log.trace("Pulsing Mykonos Hard Reset...")
self.cpld.reset_mykonos()
self.log.trace("Initializing Mykonos...")
- rx_lo_source = args.get('rx_lo_source', "internal")
- rx_lo = -1
- if rx_lo_source == "internal":
- rx_lo = 0
- if rx_lo_source == "external":
- rx_lo = 1
- if rx_lo == -1:
- self.log.warning("Please specify rx LO either \"internal\" or \"external\" ")
- else:
- self.mykonos.update_rx_lo_source(rx_lo)
- self.log.debug("RX LO SOURCE is {}".format(self.mykonos.get_rx_lo_source()))
+ self.init_lo_source(args)
self.mykonos.begin_initialization()
# Multi-chip Sync requires two SYSREF pulses at least 17us apart.
jesdcore.send_sysref_pulse()