diff options
author | Martin Braun <martin.braun@ettus.com> | 2022-03-11 12:20:30 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-03-28 12:54:07 -0700 |
commit | a705845c4cd42186b8da9853b6d2d31eb3f72848 (patch) | |
tree | 472e1ab2017533f9384b40565bd98bace2295520 /mpm/python/usrp_mpm/periph_manager/e320.py | |
parent | f73e32729d0607a1ffacbfe5a6378a43ed07f6c2 (diff) | |
download | uhd-a705845c4cd42186b8da9853b6d2d31eb3f72848.tar.gz uhd-a705845c4cd42186b8da9853b6d2d31eb3f72848.tar.bz2 uhd-a705845c4cd42186b8da9853b6d2d31eb3f72848.zip |
mpm: e3xx: Fix get_sync_sources() API
get_sync_sources() was not implemented for E31x and E320. Because UHD
assumes this exists, calling this would cause an error like this:
>>> import uhd
>>> U = uhd.usrp.MultiUSRP("type=e3xx")
>>> U.get_sync_sources(0)
Traceback (most recent call last):
File "<input>", line 1, in <module>
U.get_sync_sources(0)
RuntimeError: rpc::timeout: Timeout of 2000ms while calling RPC function
'get_sync_sources'
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/e320.py')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/e320.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/e320.py b/mpm/python/usrp_mpm/periph_manager/e320.py index f3a8da12d..c06ba897a 100644 --- a/mpm/python/usrp_mpm/periph_manager/e320.py +++ b/mpm/python/usrp_mpm/periph_manager/e320.py @@ -463,6 +463,25 @@ class e320(ZynqComponents, PeriphManagerBase): self._time_source = time_source self.mboard_regs_control.set_time_source(time_source, self.get_ref_clock_freq()) + def get_sync_sources(self): + """ + List sync sources. + """ + valid_sync_sources = { + # clock, time. Reminder: 'internal' is an alias for 'gpsdo' + # pylint: disable=bad-whitespace + ('internal', 'internal'), + ('external', 'internal'), + ('external', 'external'), + ('gpsdo', 'gpsdo' ), + ('gpsdo', 'internal'), + # pylint: enable=bad-whitespace + } + return [{ + "time_source": time_source, + "clock_source": clock_source + } for (clock_source, time_source) in valid_sync_sources] + ########################################################################### # GPIO API ########################################################################### |