From e76988c579e5e154416d94c27be89bd5f6dc56fa Mon Sep 17 00:00:00 2001 From: Thomas Vogel Date: Mon, 1 Jul 2019 17:12:08 +0200 Subject: n310: add capability to control RF filter bypass and freq.band limits With the keywords "rx_gain_profile", "tx_gain_profile" and the new values "default_bypass_always_off" and "default_bypass_always_on" the customer can control whether the filter bypass shall be applied as defined in the gain-table or whether to switch the bypass to ON or OFF for all gains. With the keywords "rx_band_map" and "tx_band_map" the user can define custom frequency borders for the band mapping. These new keywords can be used in the uhd.con, e.g.: [type=n3xx] rx_gain_profile=default_bypass_always_off tx_gain_profile=default_bypass_always_on rx_band_map=431e6;601e6;1051e6;1601e6;2101e6;2701e6 tx_band_map=723.18e6;1623.18e6;3323.18e6 --- .../dboard/magnesium/magnesium_radio_ctrl_impl.hpp | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp') diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp index dcadb5dea..165e3c996 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp @@ -29,6 +29,8 @@ namespace uhd { namespace rfnoc { * * This daughterboard is used on the USRP N310 and N300. */ + + class magnesium_radio_ctrl_impl : public radio_ctrl_impl, public rpc_block_ctrl { public: @@ -50,6 +52,19 @@ public: //! Frequency bands for TX. Bands are a function of the analog filter banks enum class tx_band { INVALID_BAND, LOWBAND, BAND0, BAND1, BAND2, BAND3 }; + typedef std::unordered_map band_map_t; + + band_map_t rx_band_map_dflt = {{0, 0.0}, + {1, 430e6}, + {2, 600e6}, + {3, 1050e6}, + {4, 1600e6}, + {5, 2100e6}, + {6, 2700e6}}; + + band_map_t tx_band_map_dflt = { + {0, 0.0}, {1, 723.17e6}, {2, 1623.17e6}, {3, 3323.17e6}}; + /************************************************************************ * Structors ***********************************************************************/ @@ -146,10 +161,10 @@ private: //! Map a frequency in Hz to an rx_band value. Will return // rx_band::INVALID_BAND if the frequency is out of range. - rx_band _map_freq_to_rx_band(const double freq); + rx_band _map_freq_to_rx_band(const band_map_t band_map, const double freq); //! Map a frequency in Hz to an tx_band value. Will return // tx_band::INVALID_BAND if the frequency is out of range. - tx_band _map_freq_to_tx_band(const double freq); + tx_band _map_freq_to_tx_band(const band_map_t band_map, const double freq); /************************************************************************** * Sensors @@ -179,6 +194,8 @@ private: void _update_freq(const size_t chan, const uhd::direction_t dir); + void _remap_band_limits(const std::string band_map, const uhd::direction_t dir); + /************************************************************************** * CPLD Controls (implemented in magnesium_radio_ctrl_cpld.cpp) *************************************************************************/ @@ -207,6 +224,7 @@ private: const std::string name, const double freq, const size_t chan); + /************************************************************************** * Private attributes *************************************************************************/ @@ -289,6 +307,9 @@ private: bool _rx_bypass_lnas = true; bool _tx_bypass_amp = true; + band_map_t _rx_band_map = rx_band_map_dflt; + band_map_t _tx_band_map = tx_band_map_dflt; + //! TRX switch state of 2 channels std::map _sw_trx = { {magnesium_cpld_ctrl::CHAN1, -- cgit v1.2.3