aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/dboard_manager/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/python/usrp_mpm/dboard_manager/base.py')
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/base.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/base.py b/mpm/python/usrp_mpm/dboard_manager/base.py
index be37a6264..978f1c5ae 100644
--- a/mpm/python/usrp_mpm/dboard_manager/base.py
+++ b/mpm/python/usrp_mpm/dboard_manager/base.py
@@ -24,6 +24,9 @@ class DboardManagerBase(object):
# Very important: A list of PIDs that apply to the current device. Must be
# list, even if there's only one entry.
pids = []
+ # tuple of id and name of the first revision,
+ # id and name of revisions are consecutive (2, B), (3, C), ...
+ first_revision = (1, 'A')
# See PeriphManager.mboard_sensor_callback_map for a description.
rx_sensor_callback_map = {}
# See PeriphManager.mboard_sensor_callback_map for a description.
@@ -91,6 +94,13 @@ class DboardManagerBase(object):
"""
self.log.debug("deinit() called, but not implemented.")
+ def tear_down(self):
+ """
+ Tear down all members that need to be specially handled before
+ deconstruction.
+ """
+ pass
+
def get_serial(self):
"""
Return this daughterboard's serial number as a string. Will return an
@@ -98,6 +108,33 @@ class DboardManagerBase(object):
"""
return self.device_info.get("serial", "")
+ def get_revision(self):
+ """
+ Return this daughterboard's revision number as integer. Will return
+ -1 if no revision can be found or revision is not an integer
+ """
+ try:
+ return int(self.device_info.get('rev', '-1'))
+ except ValueError:
+ return -1
+
+ def get_revision_string(self):
+ """
+ Converts revision number to string.
+ """
+ return chr(ord(self.first_revision[1])
+ + self.get_revision()
+ - self.first_revision[0])
+
+ ##########################################################################
+ # Clocking
+ ##########################################################################
+ def reset_clock(self, value):
+ """
+ Called when the motherboard is reconfiguring its clocks.
+ """
+ pass
+
def update_ref_clock_freq(self, freq, **kwargs):
"""
Call this function if the frequency of the reference clock changes.