diff options
author | Martin Braun <martin.braun@ettus.com> | 2021-03-08 14:49:09 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-05-06 15:14:55 -0500 |
commit | 438e27bc73b3ec2546e992be825e53fd812150b4 (patch) | |
tree | 1a65a9b2dee050217af99638d616651fd22a84fb /host/lib/usrp/dboard | |
parent | 04ddba298cbce051547e1a3587b1107ca02a2a34 (diff) | |
download | uhd-438e27bc73b3ec2546e992be825e53fd812150b4.tar.gz uhd-438e27bc73b3ec2546e992be825e53fd812150b4.tar.bz2 uhd-438e27bc73b3ec2546e992be825e53fd812150b4.zip |
n320: Add correction APIs to radio_control object
The N320, like the X310, has some frontend corrections (IQ balance, DC
offset) which can be controlled from software. The property tree entries
exist for these, but the radio_control APIs do not (which also disables
the multi_usrp APIs).
This makes it harder to disable DC offset or IQ balance corrections from
software, and disables our calibration utilities.
Diffstat (limited to 'host/lib/usrp/dboard')
-rw-r--r-- | host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp | 51 | ||||
-rw-r--r-- | host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp | 12 |
2 files changed, 63 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp b/host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp index 5ac0a35cf..5f80b84a1 100644 --- a/host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp +++ b/host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp @@ -596,6 +596,57 @@ std::string rhodium_radio_control_impl::get_fe_name( return RHODIUM_FE_NAME; } +/****************************************************************************** + * Calibration Identification API Calls + *****************************************************************************/ +void rhodium_radio_control_impl::set_tx_dc_offset( + const std::complex<double>& offset, size_t) +{ + _tx_fe_core->set_dc_offset(offset); +} + +meta_range_t rhodium_radio_control_impl::get_tx_dc_offset_range(size_t) const +{ + return get_tree() + ->access<meta_range_t>(FE_PATH / "tx_fe_corrections" / 0 / "dc_offset/range") + .get(); +} + +void rhodium_radio_control_impl::set_tx_iq_balance( + const std::complex<double>& correction, size_t) +{ + _tx_fe_core->set_iq_balance(correction); +} + +void rhodium_radio_control_impl::set_rx_dc_offset(const bool enb, size_t) +{ + _rx_fe_core->set_dc_offset(enb); +} + +void rhodium_radio_control_impl::set_rx_dc_offset( + const std::complex<double>& offset, size_t) +{ + _rx_fe_core->set_dc_offset(offset); +} + +meta_range_t rhodium_radio_control_impl::get_rx_dc_offset_range(size_t) const +{ + return get_tree() + ->access<meta_range_t>(FE_PATH / "rx_fe_corrections" / 0 / "dc_offset/range") + .get(); +} + +void rhodium_radio_control_impl::set_rx_iq_balance(const bool enb, size_t) +{ + _rx_fe_core->set_iq_balance(enb); +} + +void rhodium_radio_control_impl::set_rx_iq_balance( + const std::complex<double>& correction, size_t) +{ + _rx_fe_core->set_iq_balance(correction); +} + /************************************************************************** * GPIO Controls *************************************************************************/ diff --git a/host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp b/host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp index 696f81c85..a99289f21 100644 --- a/host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp +++ b/host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp @@ -161,6 +161,18 @@ public: std::string get_fe_name( const size_t chan, const uhd::direction_t direction) const override; + /************************************************************************** + * Calibration API Calls + *************************************************************************/ + void set_tx_dc_offset(const std::complex<double>& offset, size_t chan) override; + meta_range_t get_tx_dc_offset_range(size_t chan) const override; + void set_tx_iq_balance(const std::complex<double>& correction, size_t chan) override; + void set_rx_dc_offset(const bool enb, size_t chan = ALL_CHANS) override; + void set_rx_dc_offset(const std::complex<double>& offset, size_t chan) override; + meta_range_t get_rx_dc_offset_range(size_t chan) const override; + void set_rx_iq_balance(const bool enb, size_t chan) override; + void set_rx_iq_balance(const std::complex<double>& correction, size_t chan) override; + /************************************************************************ * ??? calls ***********************************************************************/ |