aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/dboard_manager/magnesium.py
diff options
context:
space:
mode:
authorAndrej Rode <andrej.rode@ettus.com>2017-03-27 18:03:52 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:45 -0800
commit6a12add1560545438e1bebc05efbafd05aace4f9 (patch)
treec94dbbbd4da0c7ef41fc8849f174875a13f0b511 /mpm/python/usrp_mpm/dboard_manager/magnesium.py
parentba4fad345d7489b40a7dab83842ac21d13c4f460 (diff)
downloaduhd-6a12add1560545438e1bebc05efbafd05aace4f9.tar.gz
uhd-6a12add1560545438e1bebc05efbafd05aace4f9.tar.bz2
uhd-6a12add1560545438e1bebc05efbafd05aace4f9.zip
mpm: mpm reorganization
Diffstat (limited to 'mpm/python/usrp_mpm/dboard_manager/magnesium.py')
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/magnesium.py32
1 files changed, 25 insertions, 7 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
index d48768208..f13f1de77 100644
--- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py
+++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
@@ -17,34 +17,52 @@
"""
magnesium dboard implementation module
"""
-from base import dboard_manager
-from base import lib
-from base import log
+from . import lib
+from .base import DboardManagerBase
import struct
+from logging import getLogger
-class magnesium(dboard_manager):
+LOG = getLogger(__name__)
+
+
+class magnesium(DboardManagerBase):
+ """
+ Holds all dboard specific information and methods of the magnesium dboard
+ """
hw_pid = 2
special_eeprom_addrs = {"special0": "something"}
spi_chipselect = {"0": "lmk", "1": "mykonos", "2": "random"}
spidevs = {}
+ lmk = ""
+ mykonos = ""
+ random = ""
def __init__(self, spi_devices, eeprom_data, *args, **kwargs):
# eeprom_data is a tuple (head_dict, raw_data)
if len(spi_devices) != len(self.spi_chipselect):
- log.error("Expected {0} spi devices, found {1} spi devices".format(len(spi_devices), len(self.spi_chipselect)))
+ LOG.error("Expected {0} spi devices, found {1} spi devices".format(len(spi_devices), len(self.spi_chipselect)))
exit(1)
for spi in spi_devices:
device = self.spi_chipselect.get(spi[-1], None)
if self.chipselect is None:
- log.error("Unexpected chipselect {0}".format(spi[-1]))
+ LOG.error("Unexpected chipselect {0}".format(spi[-1]))
exit(1)
setattr(self, device, spi)
super(magnesium, self).__init__(*args, **kwargs)
def init_device(self):
- self._device = lib.db.magnesium(self.lmk, self.mykonos, self.random)
+ """
+ Execute necessary init dance to bring up dboard
+ """
+ LOG.debug("initialize hardware")
+
+ self._device = lib.dboards.magnesium(
+ self.lmk, self.mykonos, self.random)
def read_eeprom_v1(self, data):
+ """
+ read eeprom data version 1
+ """
# magnesium eeprom contains
# nothing
return struct.unpack_from("x", data)