aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
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_radio_ctrl_impl.hpp
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_radio_ctrl_impl.hpp')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp25
1 files changed, 23 insertions, 2 deletions
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<size_t, double> 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<magnesium_cpld_ctrl::chan_sel_t, magnesium_cpld_ctrl::sw_trx_t> _sw_trx = {
{magnesium_cpld_ctrl::CHAN1,