aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/cores
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2015-10-07 13:10:01 -0700
committerMartin Braun <martin.braun@ettus.com>2015-12-10 14:21:49 -0800
commitf90b62f3871fb701a8d9cb7c91c1a7f3421fced9 (patch)
tree85d85ed9be444df4348e397bdaa707cfbb5d4597 /host/lib/usrp/cores
parent21df150ec873f15c4e85f9564b56586e3fe2afcf (diff)
downloaduhd-f90b62f3871fb701a8d9cb7c91c1a7f3421fced9.tar.gz
uhd-f90b62f3871fb701a8d9cb7c91c1a7f3421fced9.tar.bz2
uhd-f90b62f3871fb701a8d9cb7c91c1a7f3421fced9.zip
B210: Add VITA time synchronization on internal signal
Diffstat (limited to 'host/lib/usrp/cores')
-rw-r--r--host/lib/usrp/cores/time_core_3000.cpp13
-rw-r--r--host/lib/usrp/cores/time_core_3000.hpp2
2 files changed, 13 insertions, 2 deletions
diff --git a/host/lib/usrp/cores/time_core_3000.cpp b/host/lib/usrp/cores/time_core_3000.cpp
index ffae5dc0d..694edf31c 100644
--- a/host/lib/usrp/cores/time_core_3000.cpp
+++ b/host/lib/usrp/cores/time_core_3000.cpp
@@ -24,8 +24,9 @@
#define REG_TIME_LO _base + 4
#define REG_TIME_CTRL _base + 8
-#define CTRL_LATCH_TIME_PPS (1 << 1)
-#define CTRL_LATCH_TIME_NOW (1 << 0)
+#define CTRL_LATCH_TIME_NOW (1 << 0)
+#define CTRL_LATCH_TIME_PPS (1 << 1)
+#define CTRL_LATCH_TIME_SYNC (1 << 2)
using namespace uhd;
@@ -99,6 +100,14 @@ struct time_core_3000_impl : time_core_3000
_iface->poke32(REG_TIME_CTRL, CTRL_LATCH_TIME_NOW);
}
+ void set_time_sync(const uhd::time_spec_t &time)
+ {
+ const boost::uint64_t ticks = time.to_ticks(_tick_rate);
+ _iface->poke32(REG_TIME_HI, boost::uint32_t(ticks >> 32));
+ _iface->poke32(REG_TIME_LO, boost::uint32_t(ticks >> 0));
+ _iface->poke32(REG_TIME_CTRL, CTRL_LATCH_TIME_SYNC);
+ }
+
void set_time_next_pps(const uhd::time_spec_t &time)
{
const boost::uint64_t ticks = time.to_ticks(_tick_rate);
diff --git a/host/lib/usrp/cores/time_core_3000.hpp b/host/lib/usrp/cores/time_core_3000.hpp
index 7463386ba..7dde4e797 100644
--- a/host/lib/usrp/cores/time_core_3000.hpp
+++ b/host/lib/usrp/cores/time_core_3000.hpp
@@ -53,6 +53,8 @@ public:
virtual void set_time_now(const uhd::time_spec_t &time) = 0;
+ virtual void set_time_sync(const uhd::time_spec_t &time) = 0;
+
virtual void set_time_next_pps(const uhd::time_spec_t &time) = 0;
};