aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_bands.cpp
diff options
context:
space:
mode:
authorThomas Vogel <thomas.vogel@ni.com>2019-07-01 17:12:08 +0200
committerBrent Stapleton <brent.stapleton@ettus.com>2019-07-24 11:16:37 -0700
commite76988c579e5e154416d94c27be89bd5f6dc56fa (patch)
treefb4b9fc6ca91c8a3778b296b2890e3dd08e5252d /host/lib/usrp/dboard/magnesium/magnesium_bands.cpp
parent8b294082d4804198c45b0acb1ad6393e4f6ef0da (diff)
downloaduhd-e76988c579e5e154416d94c27be89bd5f6dc56fa.tar.gz
uhd-e76988c579e5e154416d94c27be89bd5f6dc56fa.tar.bz2
uhd-e76988c579e5e154416d94c27be89bd5f6dc56fa.zip
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
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_bands.cpp')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_bands.cpp33
1 files changed, 13 insertions, 20 deletions
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<double>(freq) < MAGNESIUM_LOWBAND_FREQ) {
band = rx_band::LOWBAND;
- } else if (fp_compare_epsilon<double>(freq) < MAGNESIUM_RX_BAND1_MIN_FREQ) {
+ } else if (fp_compare_epsilon<double>(freq) < band_map.at(1)) {
band = rx_band::BAND0;
- } else if (fp_compare_epsilon<double>(freq) < MAGNESIUM_RX_BAND2_MIN_FREQ) {
+ } else if (fp_compare_epsilon<double>(freq) < band_map.at(2)) {
band = rx_band::BAND1;
- } else if (fp_compare_epsilon<double>(freq) < MAGNESIUM_RX_BAND3_MIN_FREQ) {
+ } else if (fp_compare_epsilon<double>(freq) < band_map.at(3)) {
band = rx_band::BAND2;
- } else if (fp_compare_epsilon<double>(freq) < MAGNESIUM_RX_BAND4_MIN_FREQ) {
+ } else if (fp_compare_epsilon<double>(freq) < band_map.at(4)) {
band = rx_band::BAND3;
- } else if (fp_compare_epsilon<double>(freq) < MAGNESIUM_RX_BAND5_MIN_FREQ) {
+ } else if (fp_compare_epsilon<double>(freq) < band_map.at(5)) {
band = rx_band::BAND4;
- } else if (fp_compare_epsilon<double>(freq) < MAGNESIUM_RX_BAND6_MIN_FREQ) {
+ } else if (fp_compare_epsilon<double>(freq) < band_map.at(6)) {
band = rx_band::BAND5;
} else if (fp_compare_epsilon<double>(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<double>(freq) < MAGNESIUM_LOWBAND_FREQ) {
band = tx_band::LOWBAND;
- } else if (fp_compare_epsilon<double>(freq) < MAGNESIUM_TX_BAND1_MIN_FREQ) {
+ } else if (fp_compare_epsilon<double>(freq) < band_map.at(1)) {
band = tx_band::BAND0;
- } else if (fp_compare_epsilon<double>(freq) < MAGNESIUM_TX_BAND2_MIN_FREQ) {
+ } else if (fp_compare_epsilon<double>(freq) < band_map.at(2)) {
band = tx_band::BAND1;
- } else if (fp_compare_epsilon<double>(freq) < MAGNESIUM_TX_BAND3_MIN_FREQ) {
+ } else if (fp_compare_epsilon<double>(freq) < band_map.at(3)) {
band = tx_band::BAND2;
} else if (fp_compare_epsilon<double>(freq) <= MAGNESIUM_MAX_FREQ) {
band = tx_band::BAND3;