aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLane Kolbly <lane.kolbly@ni.com>2021-01-13 16:33:29 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2021-01-25 15:27:49 -0600
commit5471a1f521ba98003a06d2674360f70a7a86bdfd (patch)
tree3cdce8d9a82ba3dee6c9998a63c5962489fe98ca
parent8aa73deb5a89450c0218a34ad08f4e806833159a (diff)
downloaduhd-5471a1f521ba98003a06d2674360f70a7a86bdfd.tar.gz
uhd-5471a1f521ba98003a06d2674360f70a7a86bdfd.tar.bz2
uhd-5471a1f521ba98003a06d2674360f70a7a86bdfd.zip
mpm: Implement get_sync_source and get_sync_sources.
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py12
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n3xx.py9
2 files changed, 21 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index c09cde611..324e47dc9 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -978,3 +978,15 @@ class PeriphManagerBase(object):
assert src in self.get_gpio_srcs(bank), \
"Invalid GPIO source: {}".format(src)
raise NotImplementedError("set_gpio_src() not available on this device!")
+
+ #######################################################################
+ # Sync API
+ #######################################################################
+ def get_sync_source(self):
+ """
+ Gets the current time and clock source
+ """
+ return {
+ "time_source": self.get_time_source(),
+ "clock_source": self.get_clock_source(),
+ }
diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx.py b/mpm/python/usrp_mpm/periph_manager/n3xx.py
index 9bb1f00df..1291b2977 100644
--- a/mpm/python/usrp_mpm/periph_manager/n3xx.py
+++ b/mpm/python/usrp_mpm/periph_manager/n3xx.py
@@ -595,6 +595,15 @@ class n3xx(ZynqComponents, PeriphManagerBase):
}
self.set_sync_source(source)
+ def get_sync_sources(self):
+ """
+ Enumerate permissible time/clock source combinations for sync
+ """
+ return [{
+ "time_source": time_source,
+ "clock_source": clock_source
+ } for (clock_source, time_source) in self.valid_sync_sources]
+
def set_sync_source(self, args):
"""
Selects reference clock and PPS sources. Unconditionally re-applies the time