aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_rfx.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-16 10:36:59 -0800
committerJosh Blum <josh@joshknows.com>2011-11-16 10:36:59 -0800
commit65b6acc1ac877849eb6cbe1a654562ca22e42c07 (patch)
treebeca09db5794eb5a797c1c94e6ed4ad523a17f84 /host/lib/usrp/dboard/db_rfx.cpp
parenteb11b05298dde8df750e903fe7d791050666278d (diff)
parent95568c8b30490f630a72b665b135c46549ee5882 (diff)
downloaduhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.tar.gz
uhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.tar.bz2
uhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.zip
Merge branch 'calibration'
Diffstat (limited to 'host/lib/usrp/dboard/db_rfx.cpp')
-rw-r--r--host/lib/usrp/dboard/db_rfx.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp
index 3896534cd..58382f180 100644
--- a/host/lib/usrp/dboard/db_rfx.cpp
+++ b/host/lib/usrp/dboard/db_rfx.cpp
@@ -56,9 +56,9 @@ using namespace boost::assign;
/***********************************************************************
* The RFX Series constants
**********************************************************************/
-static const std::vector<std::string> rfx_tx_antennas = list_of("TX/RX");
+static const std::vector<std::string> rfx_tx_antennas = list_of("TX/RX")("CAL");
-static const std::vector<std::string> rfx_rx_antennas = list_of("TX/RX")("RX2");
+static const std::vector<std::string> rfx_rx_antennas = list_of("TX/RX")("RX2")("CAL");
static const uhd::dict<std::string, gain_range_t> rfx_rx_gain_ranges = map_list_of
("PGA0", gain_range_t(0, 70, 0.022))
@@ -271,10 +271,17 @@ void rfx_xcvr::set_rx_ant(const std::string &ant){
assert_has(rfx_rx_antennas, ant, "rfx rx antenna name");
//set the rx atr regs that change with antenna setting
- this->get_iface()->set_atr_reg(
- dboard_iface::UNIT_RX, dboard_iface::ATR_REG_RX_ONLY,
- _power_up | MIXER_ENB | ((ant == "TX/RX")? ANT_TXRX : ANT_RX2)
- );
+ if (ant == "CAL") {
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_TX_ONLY, _power_up | ANT_TXRX | MIXER_DIS);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_FULL_DUPLEX, _power_up | ANT_TXRX | MIXER_ENB);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_RX_ONLY, _power_up | MIXER_ENB | ANT_TXRX );
+ }
+ else {
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_TX_ONLY, _power_up | ANT_XX | MIXER_DIS);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_FULL_DUPLEX, _power_up | ANT_RX2| MIXER_ENB);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_RX_ONLY, _power_up | MIXER_ENB |
+ ((ant == "TX/RX")? ANT_TXRX : ANT_RX2));
+ }
//shadow the setting
_rx_ant = ant;
@@ -282,7 +289,16 @@ void rfx_xcvr::set_rx_ant(const std::string &ant){
void rfx_xcvr::set_tx_ant(const std::string &ant){
assert_has(rfx_tx_antennas, ant, "rfx tx antenna name");
- //only one antenna option, do nothing
+
+ //set the tx atr regs that change with antenna setting
+ if (ant == "CAL") {
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_TX_ONLY, _power_up | ANT_RX | MIXER_ENB);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_FULL_DUPLEX, _power_up | ANT_RX | MIXER_ENB);
+ }
+ else {
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_TX_ONLY, _power_up | ANT_TX | MIXER_ENB);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_FULL_DUPLEX, _power_up | ANT_TX | MIXER_ENB);
+ }
}
/***********************************************************************