diff options
author | Julian Arnold <julian.arnold@ettus.com> | 2015-02-23 17:08:21 -0800 |
---|---|---|
committer | Julian Arnold <julian.arnold@ettus.com> | 2015-02-23 17:47:27 -0800 |
commit | 566dbc2b5d0751167c9d868743dbebfff4d22afe (patch) | |
tree | 2648136464cf6f1fc32719649a0c0b070d0f94b5 /host/lib/usrp/e300/e300_remote_codec_ctrl.cpp | |
parent | 2b06c3815551c99d7691a7aa3dbcf6eaedc9e998 (diff) | |
download | uhd-566dbc2b5d0751167c9d868743dbebfff4d22afe.tar.gz uhd-566dbc2b5d0751167c9d868743dbebfff4d22afe.tar.bz2 uhd-566dbc2b5d0751167c9d868743dbebfff4d22afe.zip |
e3xx: support for dc offset and iq balance control
Diffstat (limited to 'host/lib/usrp/e300/e300_remote_codec_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/e300/e300_remote_codec_ctrl.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp index 0ea837a85..15222a96a 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp @@ -130,6 +130,34 @@ public: return sensor_value_t("temp", _retval.temp, "C"); } + void set_dc_offset_auto(const std::string &which, const bool on) + { + _clear(); + _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_DC_OFFSET_AUTO); + if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); + _args.use_dc_correction = on ? 1 : 0; + + _transact(); + } + + void set_iq_balance_auto(const std::string &which, const bool on) + { + _clear(); + _args.action = uhd::htonx<boost::uint32_t>(transaction_t::ACTION_SET_IQ_BALANCE_AUTO); + if (which == "TX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX1); + else if (which == "TX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_TX2); + else if (which == "RX1") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx<boost::uint32_t>(transaction_t::CHAIN_RX2); + else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); + _args.use_iq_correction = on ? 1 : 0; + + _transact(); + } + private: void _transact() { { |