aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-07 15:41:46 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:05 -0800
commitdb6264c28e2f460e605fd5781f5188067ab4743b (patch)
treed906ac50633b197a18655523e47e61afae214815 /host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
parent298304b1192ac44d5732d16439ff9c84e09922ef (diff)
downloaduhd-db6264c28e2f460e605fd5781f5188067ab4743b.tar.gz
uhd-db6264c28e2f460e605fd5781f5188067ab4743b.tar.bz2
uhd-db6264c28e2f460e605fd5781f5188067ab4743b.zip
mg: Add static gain tables and -support
- Adds two new compilation units (magnesium_gain_table.* and magnesium_radio_ctrl_gain.cpp) - Static gain tables are hard-coded in that file, includes method to look up gain table entries for a given frequency and gain - DSA code moved back to accept attenuation - TX/RX switch code needed update to enable bypass for certain gains
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.hpp37
1 files changed, 25 insertions, 12 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 75a91d0b4..c8597fdf7 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.hpp
@@ -123,19 +123,29 @@ private:
/**************************************************************************
* Gain Controls (implemented in magnesium_radio_ctrl_gain.cpp)
*************************************************************************/
- double _dsa_set_gain(
- const double gain,
+ //! Set the attenuation of the DSA
+ double _dsa_set_att(
+ const double att,
const size_t chan,
const direction_t dir
);
- double _dsa_get_gain(
+ double _dsa_get_att(
const size_t chan,
const direction_t dir
);
+ //! Write the DSA word
+ void _set_dsa_val(
+ const size_t chan,
+ const direction_t dir,
+ const uint32_t dsa_val
+ );
+
+
double _set_all_gain(
const double gain,
+ const double freq,
const size_t chan,
const direction_t dir
);
@@ -145,22 +155,18 @@ private:
const direction_t dir
);
- void _set_dsa_val(
- const size_t chan,
- const direction_t dir,
- const uint32_t dsa_val
- );
-
/**************************************************************************
* CPLD Controls (implemented in magnesium_radio_ctrl_cpld.cpp)
*************************************************************************/
void _update_rx_freq_switches(
const double freq,
+ const bool bypass_lnas,
const size_t chan
);
void _update_tx_freq_switches(
const double freq,
+ const bool bypass_amps,
const size_t chan
);
@@ -212,15 +218,22 @@ private:
//! Front panel GPIO controller. Note that only one radio block per
// module can be the FP-GPIO master.
usrp::gpio_atr::gpio_atr_3000::sptr _fp_gpio;
+
//! AD9371 gain
double _ad9371_rx_gain = 0.0;
double _ad9371_tx_gain = 0.0;
- //! DSA gain
- double _dsa_rx_gain = 0.0;
- double _dsa_tx_gain = 0.0;
+
+ //! DSA attenuation
+ double _dsa_rx_att = 0.0;
+ double _dsa_tx_att = 0.0;
+
//! All gain
double _all_rx_gain = 0.0;
double _all_tx_gain = 0.0;
+
+ bool _rx_bypass_lnas = true;
+ bool _tx_bypass_amp = true;
+
//! 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,