aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrung Tran <trung.tran@ettus.com>2017-11-21 15:04:06 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:06 -0800
commit048ad8fe27edd565cc56e6dcf093792689162f23 (patch)
treef8ed66699240b764a7bd93a3b993e109cbd9f714
parent05e93b66e9fd2df5622b025160b7ae2a2a670442 (diff)
downloaduhd-048ad8fe27edd565cc56e6dcf093792689162f23.tar.gz
uhd-048ad8fe27edd565cc56e6dcf093792689162f23.tar.bz2
uhd-048ad8fe27edd565cc56e6dcf093792689162f23.zip
mg: ad9371: Add API to toggle LO source
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.cpp26
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp9
2 files changed, 35 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.cpp b/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.cpp
index 2fe31f066..e6ad6ab57 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.cpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.cpp
@@ -111,3 +111,29 @@ double magnesium_ad9371_iface::get_bandwidth(const size_t chan, const direction_
return 0.0;
}
+std::string magnesium_ad9371_iface::set_lo_source(
+ const std::string &source,
+ const uhd::direction_t dir
+) {
+ // There is only one LO for 2 channels. Using channel 0 for 'which'
+ auto which = _get_which(dir, 0);
+ UHD_LOG_TRACE(_L, "calling " << _rpc_prefix << "set_lo_source "
+ << which << "with " << source);
+ auto retval = _rpcc->request_with_token<std::string>(
+ _rpc_prefix + "set_lo_source", which, source);
+ UHD_LOG_TRACE(_L, _rpc_prefix << "set_lo_source returned " << retval);
+ return retval;
+}
+
+std::string magnesium_ad9371_iface::get_lo_source(
+ const uhd::direction_t dir
+) {
+ // There is only one LO for 2 channels. Using channel 0 for 'which'
+ auto which = _get_which(dir,0);
+ UHD_LOG_TRACE(_L, "calling " << _rpc_prefix << "get_lo_source " << which);
+ auto retval = _rpcc->request_with_token<std::string>(
+ _rpc_prefix + "get_lo_source", which);
+ UHD_LOG_TRACE(_L, _rpc_prefix << "get_lo_source returned " << retval);
+ return retval;
+}
+
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp b/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp
index 9529e1519..5598b2540 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_ad9371_iface.hpp
@@ -55,6 +55,15 @@ public:
const uhd::direction_t dir
);
+ std::string set_lo_source(
+ const std::string &source,
+ const uhd::direction_t dir
+ );
+
+ std::string get_lo_source(
+ const uhd::direction_t dir
+ );
+
private:
//! Reference to the RPC client
uhd::rpc_client::sptr _rpcc;