aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/dboard_manager/eiscat.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-06-03 01:33:54 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:59 -0800
commit40235b8c5aba6acec2acdc4135b828b1d9785a96 (patch)
tree6570aa9f99872979e51106f5249fe82080c611dc /mpm/python/usrp_mpm/dboard_manager/eiscat.py
parent0d659863da607acaaf15ab69a662af2da006f65e (diff)
downloaduhd-40235b8c5aba6acec2acdc4135b828b1d9785a96.tar.gz
uhd-40235b8c5aba6acec2acdc4135b828b1d9785a96.tar.bz2
uhd-40235b8c5aba6acec2acdc4135b828b1d9785a96.zip
mpm/mpmd: Call init() during UHD session init, not on hwd spawn
Diffstat (limited to 'mpm/python/usrp_mpm/dboard_manager/eiscat.py')
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/eiscat.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/eiscat.py b/mpm/python/usrp_mpm/dboard_manager/eiscat.py
index dc4ee1cac..980a64fcc 100644
--- a/mpm/python/usrp_mpm/dboard_manager/eiscat.py
+++ b/mpm/python/usrp_mpm/dboard_manager/eiscat.py
@@ -17,10 +17,10 @@
"""
EISCAT rx board implementation module
"""
-from builtins import range
-from builtins import object
import time
+from builtins import range
+from builtins import object
from ..mpmlog import get_logger
from ..uio import UIO
from . import lib
@@ -28,8 +28,6 @@ from .base import DboardManagerBase
from .lmk_eiscat import LMK04828EISCAT
from usrp_mpm.cores import ClockSynchronizer
-N_CHANS = 8 # Chans per dboard
-
def create_spidev_iface_sane(dev_node):
"""
Create a regs iface from a spidev node (sane values)
@@ -410,6 +408,12 @@ class EISCAT(DboardManagerBase):
self.clock_synchronizer = None
self._spi_ifaces = None
+ def is_initialized(self):
+ """
+ Returns True if the daughterboard is a usable state and ready to stream
+ """
+ return self.initialized
+
def init(self, args):
"""
Execute necessary actions to bring up the daughterboard:
@@ -425,6 +429,9 @@ class EISCAT(DboardManagerBase):
For operation (streaming), the ADCs and deframers still need to be
initialized.
+
+ Note that this function will do nothing if the device was previously
+ initialized.
"""
def _init_dboard_regs():
" Create a UIO object to talk to dboard regs "
@@ -493,6 +500,12 @@ class EISCAT(DboardManagerBase):
adc.reset()
return adcs
# Go, go, go!
+ if self.initialized and not args.get("force_init", False):
+ self.log.info(
+ "Dboard was previously initialized; skipping init. " \
+ "Specify force_init=1 to force initialization."
+ )
+ return True
self.log.info("init() called with args `{}'".format(
",".join(['{}={}'.format(x, args[x]) for x in args])
))
@@ -534,6 +547,7 @@ class EISCAT(DboardManagerBase):
self._spi_ifaces['adc0'], self._spi_ifaces['adc1'],
))
self.log.trace("ADC Reset Sequence Complete!")
+ return True
def send_sysref(self):
@@ -582,12 +596,13 @@ class EISCAT(DboardManagerBase):
def shutdown(self):
"""
- Safely turn off the daughterboard
+ Safely turn off the daughterboard. This will take away power to the
+ components; a re-initialization will be necessary after calling this.
"""
self.log.info("Shutting down daughterboard")
+ self.initialized = False
self._deinit_power(self.radio_regs)
-
def _init_power(self, regs):
"""
Turn on power to the dboard.