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 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp') 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 *************************************************************************/ -- cgit v1.2.3