From 438e27bc73b3ec2546e992be825e53fd812150b4 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 8 Mar 2021 14:49:09 +0100 Subject: 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. --- .../usrp/dboard/rhodium/rhodium_radio_control.cpp | 51 ++++++++++++++++++++++ .../usrp/dboard/rhodium/rhodium_radio_control.hpp | 12 +++++ 2 files changed, 63 insertions(+) (limited to 'host/lib/usrp/dboard') 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& 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(FE_PATH / "tx_fe_corrections" / 0 / "dc_offset/range") + .get(); +} + +void rhodium_radio_control_impl::set_tx_iq_balance( + const std::complex& 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& 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(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& 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& 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& 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& 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& correction, size_t chan) override; + /************************************************************************ * ??? calls ***********************************************************************/ -- cgit v1.2.3