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 --- host/lib/usrp/dboard/magnesium/magnesium_bands.cpp | 33 +++++++++------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'host/lib/usrp/dboard/magnesium/magnesium_bands.cpp') diff --git a/host/lib/usrp/dboard/magnesium/magnesium_bands.cpp b/host/lib/usrp/dboard/magnesium/magnesium_bands.cpp index 4792dcac6..13cc52d49 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_bands.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_bands.cpp @@ -67,12 +67,6 @@ namespace { * passes). Frequencies need to be chosen to allow as much of the full * bandwidth through unattenuated. */ -constexpr double MAGNESIUM_RX_BAND1_MIN_FREQ = 430e6; -constexpr double MAGNESIUM_RX_BAND2_MIN_FREQ = 600e6; -constexpr double MAGNESIUM_RX_BAND3_MIN_FREQ = 1050e6; -constexpr double MAGNESIUM_RX_BAND4_MIN_FREQ = 1600e6; -constexpr double MAGNESIUM_RX_BAND5_MIN_FREQ = 2100e6; -constexpr double MAGNESIUM_RX_BAND6_MIN_FREQ = 2700e6; /* Note on the TX filter bank: * @@ -96,13 +90,12 @@ constexpr double MAGNESIUM_RX_BAND6_MIN_FREQ = 2700e6; * through unattenuated (so don't go all the way up to the cutoff frequency * of that filter, OK). */ -constexpr double MAGNESIUM_TX_BAND1_MIN_FREQ = 723.17e6; -constexpr double MAGNESIUM_TX_BAND2_MIN_FREQ = 1623.17e6; -constexpr double MAGNESIUM_TX_BAND3_MIN_FREQ = 3323.17e6; + } // namespace + magnesium_radio_ctrl_impl::rx_band magnesium_radio_ctrl_impl::_map_freq_to_rx_band( - const double freq) + const band_map_t band_map, const double freq) { magnesium_radio_ctrl_impl::rx_band band; @@ -110,17 +103,17 @@ magnesium_radio_ctrl_impl::rx_band magnesium_radio_ctrl_impl::_map_freq_to_rx_ba band = rx_band::INVALID_BAND; } else if (fp_compare_epsilon(freq) < MAGNESIUM_LOWBAND_FREQ) { band = rx_band::LOWBAND; - } else if (fp_compare_epsilon(freq) < MAGNESIUM_RX_BAND1_MIN_FREQ) { + } else if (fp_compare_epsilon(freq) < band_map.at(1)) { band = rx_band::BAND0; - } else if (fp_compare_epsilon(freq) < MAGNESIUM_RX_BAND2_MIN_FREQ) { + } else if (fp_compare_epsilon(freq) < band_map.at(2)) { band = rx_band::BAND1; - } else if (fp_compare_epsilon(freq) < MAGNESIUM_RX_BAND3_MIN_FREQ) { + } else if (fp_compare_epsilon(freq) < band_map.at(3)) { band = rx_band::BAND2; - } else if (fp_compare_epsilon(freq) < MAGNESIUM_RX_BAND4_MIN_FREQ) { + } else if (fp_compare_epsilon(freq) < band_map.at(4)) { band = rx_band::BAND3; - } else if (fp_compare_epsilon(freq) < MAGNESIUM_RX_BAND5_MIN_FREQ) { + } else if (fp_compare_epsilon(freq) < band_map.at(5)) { band = rx_band::BAND4; - } else if (fp_compare_epsilon(freq) < MAGNESIUM_RX_BAND6_MIN_FREQ) { + } else if (fp_compare_epsilon(freq) < band_map.at(6)) { band = rx_band::BAND5; } else if (fp_compare_epsilon(freq) <= MAGNESIUM_MAX_FREQ) { band = rx_band::BAND6; @@ -132,7 +125,7 @@ magnesium_radio_ctrl_impl::rx_band magnesium_radio_ctrl_impl::_map_freq_to_rx_ba } magnesium_radio_ctrl_impl::tx_band magnesium_radio_ctrl_impl::_map_freq_to_tx_band( - const double freq) + const band_map_t band_map, const double freq) { magnesium_radio_ctrl_impl::tx_band band; @@ -140,11 +133,11 @@ magnesium_radio_ctrl_impl::tx_band magnesium_radio_ctrl_impl::_map_freq_to_tx_ba band = tx_band::INVALID_BAND; } else if (fp_compare_epsilon(freq) < MAGNESIUM_LOWBAND_FREQ) { band = tx_band::LOWBAND; - } else if (fp_compare_epsilon(freq) < MAGNESIUM_TX_BAND1_MIN_FREQ) { + } else if (fp_compare_epsilon(freq) < band_map.at(1)) { band = tx_band::BAND0; - } else if (fp_compare_epsilon(freq) < MAGNESIUM_TX_BAND2_MIN_FREQ) { + } else if (fp_compare_epsilon(freq) < band_map.at(2)) { band = tx_band::BAND1; - } else if (fp_compare_epsilon(freq) < MAGNESIUM_TX_BAND3_MIN_FREQ) { + } else if (fp_compare_epsilon(freq) < band_map.at(3)) { band = tx_band::BAND2; } else if (fp_compare_epsilon(freq) <= MAGNESIUM_MAX_FREQ) { band = tx_band::BAND3; -- cgit v1.2.3