aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/base.py
diff options
context:
space:
mode:
authorToni Jones <toni.jones@ni.com>2019-04-12 15:12:06 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2021-03-04 12:09:39 -0600
commit1a9033b3e96654dcd374f9d2effe5751b36130f2 (patch)
treecfb8ea8bbd48b66f591d78d8069420cb8009bab2 /mpm/python/usrp_mpm/periph_manager/base.py
parent7a9ec29dbc9fac710beebbafa2cb221695eda189 (diff)
downloaduhd-1a9033b3e96654dcd374f9d2effe5751b36130f2.tar.gz
uhd-1a9033b3e96654dcd374f9d2effe5751b36130f2.tar.bz2
uhd-1a9033b3e96654dcd374f9d2effe5751b36130f2.zip
mpm: Add DboardIface for MB DB driver control
Add DboardIface class which will act as an interface to bridge the gap between MB and DB drivers in MPM. The DboardIface will be implemented by each Motherboard with MB specific information. Dboard objects will then instantiate the class in order to utilize the implemented control functions.
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/base.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index c2da31b8f..2b4b297ed 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -117,6 +117,10 @@ class PeriphManagerBase(object):
# The index of the first port of the RFNoC crossbar which is connected to
# an RFNoC block
crossbar_base_port = 0
+ # A DboardIface class which will be passed to the discovered DB
+ # constructors.
+ # If None, the MB does not support the DB Iface architecture.
+ db_iface = None
# Address of the daughterboard EEPROMs. This could be something like
# "e0004000.i2c". This value will be passed to get_eeprom_paths() to
# determine a full path to an EEPROM device.
@@ -488,6 +492,10 @@ class PeriphManagerBase(object):
'spi_nodes': spi_nodes,
'default_args': default_args,
})
+ # If the MB supports the DB Iface architecture, pass
+ # the corresponding DB Iface to the dboard class
+ if self.db_iface is not None:
+ dboard_info['db_iface'] = self.db_iface(dboard_idx, self)
# This will actually instantiate the dboard class:
self.dboards.append(db_class(dboard_idx, **dboard_info))
self.log.info("Initialized %d daughterboard(s).", len(self.dboards))