diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-10-12 10:49:10 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:04:02 -0800 |
commit | 016866d3f1ea71389b8bc618c9ed1ea7a2fa7155 (patch) | |
tree | cd5f647c69abd7ef76a98e7ff905d4ebcc397d6c /mpm/python/usrp_mpm | |
parent | d601fd03d5655f9e744a7b5454aac40492d7ad09 (diff) | |
download | uhd-016866d3f1ea71389b8bc618c9ed1ea7a2fa7155.tar.gz uhd-016866d3f1ea71389b8bc618c9ed1ea7a2fa7155.tar.bz2 uhd-016866d3f1ea71389b8bc618c9ed1ea7a2fa7155.zip |
mpm: Provide default dboard EEPROM getter/setters
The setter will throw an exception though. It is supposed to be
overriden by device-specific classes.
Diffstat (limited to 'mpm/python/usrp_mpm')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index dc52b3a1b..305b57006 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -523,3 +523,31 @@ class PeriphManagerBase(object): self.log.warn("Called set_mb_eeprom(), but not implemented!") raise NotImplementedError + def get_db_eeprom(self, dboard_idx): + """ + Return a dictionary representing the content of the daughterboard + EEPROM. + + By default, will simply return the device info of the dboard. + Typically, this gets overloaded by the device specific class. + + Arguments: + dboard_idx -- Slot index of dboard + """ + self.log.debug("Calling base-class get_db_eeprom(). This may not be " \ + "what you want.") + return self.dboards[dboard_idx].device_info + + def set_db_eeprom(self, dboard_idx, eeprom_data): + """ + Write new EEPROM contents with eeprom_map. + + Arguments: + dboard_idx -- Slot index of dboard + eeprom_data -- Dictionary of EEPROM data to be written. It's up to the + specific device implementation on how to handle it. + """ + self.log.warn("Attempted to write dboard `%d' EEPROM, but function " \ + "is not implemented.", dboard_idx) + raise NotImplementedError + |