summaryrefslogtreecommitdiff
path: root/usrp2/firmware/lib/db_xcvr2450.c
diff options
context:
space:
mode:
authorJosh Blum2010-03-16 18:22:10 -0700
committerJosh Blum2010-03-16 18:22:10 -0700
commitd43d40813c1a8343a86abb231876a8b7c0e9f806 (patch)
treee919c7da99aca7918ca5533e899cd7c9bbbf76bd /usrp2/firmware/lib/db_xcvr2450.c
parent19d3c0cab37123f8bfd19fdfc576f44b6069300f (diff)
parentac422b700282e21956dbf7643ee2dfbeeebdaf45 (diff)
downloadgnuradio-d43d40813c1a8343a86abb231876a8b7c0e9f806.tar.gz
gnuradio-d43d40813c1a8343a86abb231876a8b7c0e9f806.tar.bz2
gnuradio-d43d40813c1a8343a86abb231876a8b7c0e9f806.zip
Merge branch 'master' of http://gnuradio.org/git/gnuradio into uhd
Diffstat (limited to 'usrp2/firmware/lib/db_xcvr2450.c')
-rw-r--r--usrp2/firmware/lib/db_xcvr2450.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/usrp2/firmware/lib/db_xcvr2450.c b/usrp2/firmware/lib/db_xcvr2450.c
index a48af9035..4cdcf031e 100644
--- a/usrp2/firmware/lib/db_xcvr2450.c
+++ b/usrp2/firmware/lib/db_xcvr2450.c
@@ -64,6 +64,8 @@ bool xcvr2450_set_freq(struct db_base *db, u2_fxpt_freq_t freq, u2_fxpt_freq_t *
bool xcvr2450_set_gain_rx(struct db_base *db, u2_fxpt_gain_t gain);
bool xcvr2450_set_gain_tx(struct db_base *db, u2_fxpt_gain_t gain);
bool xcvr2450_set_tx_enable(struct db_base *db, bool on);
+bool xcvr2450_set_rx_antenna(struct db_base *db, int ant);
+bool xcvr2450_set_tx_antenna(struct db_base *db, int ant);
struct db_xcvr2450_common {
int d_mimo, d_int_div, d_frac_div, d_highband, d_five_gig;
@@ -154,6 +156,7 @@ struct db_xcvr2450_rx db_xcvr2450_rx = {
.base.atr_mask = RX_ATR_MASK,
.base.atr_txval = 0x0,
.base.atr_rxval = 0x0,
+ .base.set_antenna = xcvr2450_set_rx_antenna,
.common = &db_xcvr2450_common,
};
@@ -178,6 +181,7 @@ struct db_xcvr2450_tx db_xcvr2450_tx = {
.base.atr_mask = TX_ATR_MASK,
.base.atr_txval = 0x0,
.base.atr_rxval = 0x0,
+ .base.set_antenna = xcvr2450_set_tx_antenna,
.common = &db_xcvr2450_common,
};
@@ -494,3 +498,24 @@ xcvr2450_set_tx_enable(struct db_base *dbb, bool on){
set_gpio(db);
return true;
}
+
+/**************************************************
+ * Set Antennas
+ **************************************************/
+bool xcvr2450_set_rx_antenna(struct db_base *dbb, int ant){
+ printf("xcvr set rx ant %d\n", ant);
+ if (ant > 1) return false;
+ struct db_xcvr2450_dummy *db = (struct db_xcvr2450_dummy *) dbb;
+ db->common->d_rx_ant = ant;
+ set_gpio(db);
+ return true;
+}
+
+bool xcvr2450_set_tx_antenna(struct db_base *dbb, int ant){
+ printf("xcvr set tx ant %d\n", ant);
+ if (ant > 1) return false;
+ struct db_xcvr2450_dummy *db = (struct db_xcvr2450_dummy *) dbb;
+ db->common->d_tx_ant = ant;
+ set_gpio(db);
+ return true;
+}