aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/cores
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-12-15 15:17:36 -0800
committerAshish Chaudhari <ashish@ettus.com>2015-12-15 15:17:36 -0800
commitf44f7f2ca7dbbd1a72f5b3d239856a1954569884 (patch)
tree310055d734a28063359b26f7cdc4d4704c517b9e /host/lib/usrp/cores
parent75ea07bd6d19494e018cd5c3109e1f85969b7ac6 (diff)
parent10178875a154e58af6c14774621776d13e7e3daa (diff)
downloaduhd-f44f7f2ca7dbbd1a72f5b3d239856a1954569884.tar.gz
uhd-f44f7f2ca7dbbd1a72f5b3d239856a1954569884.tar.bz2
uhd-f44f7f2ca7dbbd1a72f5b3d239856a1954569884.zip
Merge branch 'maint'
Conflicts: host/lib/usrp/b200/b200_impl.hpp host/lib/usrp/e300/e300_fpga_defs.hpp host/lib/usrp/x300/x300_fw_common.h
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;
};