diff options
author | Josh Blum | 2010-02-25 16:50:44 -0800 |
---|---|---|
committer | Josh Blum | 2010-02-25 16:50:44 -0800 |
commit | 752df2b84454756685dc2a05c232b59e3ebdaa2e (patch) | |
tree | e802a8dbcca00803d54a48a5e7488cfcd7695833 /usrp2/firmware | |
parent | 803cb1d7974ed7d419550cc66480c107c2f0d454 (diff) | |
download | gnuradio-752df2b84454756685dc2a05c232b59e3ebdaa2e.tar.gz gnuradio-752df2b84454756685dc2a05c232b59e3ebdaa2e.tar.bz2 gnuradio-752df2b84454756685dc2a05c232b59e3ebdaa2e.zip |
setting xcvr antennas through api
Diffstat (limited to 'usrp2/firmware')
-rw-r--r-- | usrp2/firmware/apps/app_common_v2.c | 4 | ||||
-rw-r--r-- | usrp2/firmware/lib/db_xcvr2450.c | 25 |
2 files changed, 27 insertions, 2 deletions
diff --git a/usrp2/firmware/apps/app_common_v2.c b/usrp2/firmware/apps/app_common_v2.c index 2d767b5a5..7716ed992 100644 --- a/usrp2/firmware/apps/app_common_v2.c +++ b/usrp2/firmware/apps/app_common_v2.c @@ -495,11 +495,11 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len) goto generic_reply; case OP_RX_ANTENNA: - db_set_antenna(rx_dboard, ((op_config_mimo_t *)payload)->flags); + ok = db_set_antenna(rx_dboard, ((op_config_mimo_t *)payload)->flags); goto generic_reply; case OP_TX_ANTENNA: - db_set_antenna(tx_dboard, ((op_config_mimo_t *)payload)->flags); + ok = db_set_antenna(tx_dboard, ((op_config_mimo_t *)payload)->flags); goto generic_reply; case OP_BURN_MAC_ADDR: 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; +} |