aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/common/ad9361_ctrl.cpp
diff options
context:
space:
mode:
authorSugandha Gupta <sugandha.gupta@ettus.com>2018-06-05 13:48:07 -0700
committerMartin Braun <martin.braun@ettus.com>2018-06-15 16:37:03 -0500
commit67b5827faecd3dc3d9977dff7366b8ea2ab4c87a (patch)
tree8d4d6b3645cd4b1aa72e26b4be4b5e81d5c45bfa /host/lib/usrp/common/ad9361_ctrl.cpp
parentf9101d7cc7552755d597982eeccecabe88b8a022 (diff)
downloaduhd-67b5827faecd3dc3d9977dff7366b8ea2ab4c87a.tar.gz
uhd-67b5827faecd3dc3d9977dff7366b8ea2ab4c87a.tar.bz2
uhd-67b5827faecd3dc3d9977dff7366b8ea2ab4c87a.zip
ad9361: Add API to set 1R1T/2R2T timing modes
LVDS interface can support both timing modes 1R1T/2R2T The API sets the required bit in catalina registers.
Diffstat (limited to 'host/lib/usrp/common/ad9361_ctrl.cpp')
-rw-r--r--host/lib/usrp/common/ad9361_ctrl.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/host/lib/usrp/common/ad9361_ctrl.cpp b/host/lib/usrp/common/ad9361_ctrl.cpp
index 2b6821fc0..1982d83e7 100644
--- a/host/lib/usrp/common/ad9361_ctrl.cpp
+++ b/host/lib/usrp/common/ad9361_ctrl.cpp
@@ -168,6 +168,20 @@ public:
}
+ //! set which timing mode to use - 1R1T, 2R2T
+ void set_timing_mode(const std::string &timing_mode)
+ {
+ boost::lock_guard<boost::mutex> lock(_mutex);
+
+ _use_safe_spi();
+ if ((timing_mode != "2R2T") && (timing_mode != "1R1T")) {
+ throw uhd::assertion_error("ad9361_ctrl: Timing mode not supported");
+ }
+ _device.set_timing_mode((timing_mode == "2R2T")? ad9361_device_t::TIMING_MODE_2R2T : ad9361_device_t::TIMING_MODE_1R1T);
+ _use_timed_spi();
+
+ }
+
//! tune the given frontend, return the exact value
double tune(const std::string &which, const double freq)
{