diff options
author | Julian Arnold <julian.arnold@ettus.com> | 2015-03-05 15:25:13 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-03-05 17:18:53 -0800 |
commit | be14725245cca756e19c48d84aedc54064e8706c (patch) | |
tree | 8d366a8ad3ab05a87f05f714c215866907cf23b6 /host/lib/usrp/common/ad9361_ctrl.cpp | |
parent | 99ab759233c85de000d16ad0f10660819e9456f1 (diff) | |
download | uhd-be14725245cca756e19c48d84aedc54064e8706c.tar.gz uhd-be14725245cca756e19c48d84aedc54064e8706c.tar.bz2 uhd-be14725245cca756e19c48d84aedc54064e8706c.zip |
b2xx: AGC support
Diffstat (limited to 'host/lib/usrp/common/ad9361_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/common/ad9361_ctrl.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/host/lib/usrp/common/ad9361_ctrl.cpp b/host/lib/usrp/common/ad9361_ctrl.cpp index ada74cda5..a0a5fa663 100644 --- a/host/lib/usrp/common/ad9361_ctrl.cpp +++ b/host/lib/usrp/common/ad9361_ctrl.cpp @@ -107,6 +107,27 @@ public: return _device.set_gain(direction, chain, value); } + void set_agc(const std::string &which, bool enable) + { + boost::lock_guard<boost::mutex> lock(_mutex); + + ad9361_device_t::chain_t chain =_get_chain_from_antenna(which); + _device.set_agc(chain, enable); + } + + void set_agc_mode(const std::string &which, const std::string &mode) + { + boost::lock_guard<boost::mutex> lock(_mutex); + ad9361_device_t::chain_t chain =_get_chain_from_antenna(which); + if(mode == "slow") { + _device.set_agc_mode(chain, ad9361_device_t::GAIN_MODE_SLOW_AGC); + } else if (mode == "fast"){ + _device.set_agc_mode(chain, ad9361_device_t::GAIN_MODE_FAST_AGC); + } else { + throw uhd::runtime_error("ad9361_ctrl got an invalid AGC option."); + } + } + //! set a new clock rate, return the exact value double set_clock_rate(const double rate) { |