aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp
diff options
context:
space:
mode:
authorSugandha Gupta <sugandha.gupta@ettus.com>2018-08-03 18:59:24 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-08-09 17:39:14 -0700
commit885d5a8acc86162d4c728814d6b4f96686404684 (patch)
tree6bbf6d5024e1d3c765d36266b4e3feb61168aecc /host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp
parent4683f0fa1886e3d53749965471ce419d42f04fd2 (diff)
downloaduhd-885d5a8acc86162d4c728814d6b4f96686404684.tar.gz
uhd-885d5a8acc86162d4c728814d6b4f96686404684.tar.bz2
uhd-885d5a8acc86162d4c728814d6b4f96686404684.zip
e320: Fix tx/rx atr - antenna and frequency settings
- Change RX/TX min/max frequency according to AD9361 datasheet - Fix set_atr_bits to change with rx/tx frequency and antenna independently - Make AMP switching active high
Diffstat (limited to 'host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp')
-rw-r--r--host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp
index a753a447c..4bf9b7573 100644
--- a/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp
+++ b/host/lib/usrp/dboard/neon/neon_radio_ctrl_impl.cpp
@@ -204,6 +204,7 @@ void neon_radio_ctrl_impl::set_tx_antenna(
% ant
));
}
+ radio_ctrl_impl::set_tx_antenna(ant, chan);
// We can't actually set the TX antenna, so let's stop here.
}
@@ -224,8 +225,8 @@ void neon_radio_ctrl_impl::set_rx_antenna(
UHD_LOG_TRACE(unique_id(),
"Setting RX antenna to " << ant << " for chan " << chan);
- _set_atr_bits(chan, radio_ctrl_impl::get_rx_frequency(chan), ant);
radio_ctrl_impl::set_rx_antenna(ant, chan);
+ _set_atr_bits(chan);
}
double neon_radio_ctrl_impl::set_tx_frequency(
@@ -236,14 +237,14 @@ double neon_radio_ctrl_impl::set_tx_frequency(
"set_tx_frequency(f=" << freq << ", chan=" << chan << ")");
std::lock_guard<std::mutex> l(_set_lock);
+ double clipped_freq = uhd::clip(freq, AD9361_TX_MIN_FREQ, AD9361_TX_MAX_FREQ);
+
double coerced_freq = _ad9361->tune(
get_which_ad9361_chain(TX_DIRECTION, chan),
- freq);
+ clipped_freq);
radio_ctrl_impl::set_tx_frequency(coerced_freq, chan);
- // Antenna settings
- auto ant = get_tx_antenna(chan);
// Front-end switching
- _set_atr_bits(chan, freq, ant);
+ _set_atr_bits(chan);
return coerced_freq;
}
@@ -256,14 +257,14 @@ double neon_radio_ctrl_impl::set_rx_frequency(
"set_rx_frequency(f=" << freq << ", chan=" << chan << ")");
std::lock_guard<std::mutex> l(_set_lock);
+ double clipped_freq = uhd::clip(freq, AD9361_RX_MIN_FREQ, AD9361_RX_MAX_FREQ);
+
double coerced_freq = _ad9361->tune(
get_which_ad9361_chain(RX_DIRECTION, chan),
- freq);
+ clipped_freq);
radio_ctrl_impl::set_rx_frequency(coerced_freq, chan);
- // Antenna settings
- auto ant = get_rx_antenna(chan);
// Front-end switching
- _set_atr_bits(chan, coerced_freq, ant);
+ _set_atr_bits(chan);
return coerced_freq;
}
@@ -434,13 +435,13 @@ bool neon_radio_ctrl_impl::get_lo_lock_status(
}
void neon_radio_ctrl_impl::_set_atr_bits(
- const size_t chan,
- const double freq,
- const std::string &ant
+ const size_t chan
) {
-
- const uint32_t rx_regs = _get_rx_switches(chan, freq, ant);
- const uint32_t tx_regs = _get_tx_switches(chan, freq);
+ const auto rx_freq = radio_ctrl_impl::get_rx_frequency(chan);
+ const auto tx_freq = radio_ctrl_impl::get_tx_frequency(chan);
+ const auto rx_ant = radio_ctrl_impl::get_rx_antenna(chan);
+ const uint32_t rx_regs = _get_rx_switches(chan, rx_freq, rx_ant);
+ const uint32_t tx_regs = _get_tx_switches(chan, tx_freq);
const uint32_t idle_regs = TX_AMP_OFF << TX_AMP_SHIFT |
TRX1_SW_TX_HB << TRX_SW_SHIFT |
TX_SW2_LB_80 << TX_SW2_SHIFT |
@@ -456,7 +457,7 @@ void neon_radio_ctrl_impl::_set_atr_bits(
// The LED signal names are reversed, but are consistent with the schematic
const int idle_led = 0;
- const bool is_txrx = ant == "TX/RX";
+ const bool is_txrx = rx_ant == "TX/RX";
const int rx_led = 1 << TRX_LED_GRN_SHIFT;
const int tx_led = 1 << TX_LED_RED_SHIFT;
const int txrx_led = 1 << RX_LED_GRN_SHIFT;