diff options
author | Josh Blum <josh@joshknows.com> | 2010-02-17 18:29:16 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-02-17 18:29:16 -0800 |
commit | f439fe8218b05a67148332ffefd2053ba3c0c19d (patch) | |
tree | 6fcc768397dac3266649557cbb33bdd7091856bd /firmware | |
parent | b9497ba5b8ff66856e13100160275ddc4a884db0 (diff) | |
download | uhd-f439fe8218b05a67148332ffefd2053ba3c0c19d.tar.gz uhd-f439fe8218b05a67148332ffefd2053ba3c0c19d.tar.bz2 uhd-f439fe8218b05a67148332ffefd2053ba3c0c19d.zip |
Added control for usrp2 aux dac and adc control.
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/microblaze/apps/txrx.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/firmware/microblaze/apps/txrx.c b/firmware/microblaze/apps/txrx.c index 2cf3c46ed..bc8598768 100644 --- a/firmware/microblaze/apps/txrx.c +++ b/firmware/microblaze/apps/txrx.c @@ -45,6 +45,8 @@ #include "usrp2/fw_common.h" #include <db.h> #include <i2c.h> +#include <lsdac.h> +#include <lsadc.h> #define FW_SETS_SEQNO 1 // define to 0 or 1 (FIXME must be 1 for now) @@ -347,6 +349,43 @@ void handle_udp_ctrl_packet( } break; + /******************************************************************* + * AUX DAC/ADC + ******************************************************************/ + case USRP2_CTRL_ID_WRITE_THIS_TO_THE_AUX_DAC_BRO: + if (ctrl_data_in->data.aux_args.dir == USRP2_DIR_RX){ + lsdac_write_rx( + ctrl_data_in->data.aux_args.which, + ctrl_data_in->data.aux_args.value + ); + } + + if (ctrl_data_in->data.aux_args.dir == USRP2_DIR_TX){ + lsdac_write_tx( + ctrl_data_in->data.aux_args.which, + ctrl_data_in->data.aux_args.value + ); + } + + ctrl_data_out.id = USRP2_CTRL_ID_DONE_WITH_THAT_AUX_DAC_DUDE; + break; + + case USRP2_CTRL_ID_READ_FROM_THIS_AUX_ADC_BRO: + if (ctrl_data_in->data.aux_args.dir == USRP2_DIR_RX){ + ctrl_data_out.data.aux_args.value = lsadc_read_rx( + ctrl_data_in->data.aux_args.which + ); + } + + if (ctrl_data_in->data.aux_args.dir == USRP2_DIR_TX){ + ctrl_data_out.data.aux_args.value = lsadc_read_tx( + ctrl_data_in->data.aux_args.which + ); + } + + ctrl_data_out.id = USRP2_CTRL_ID_DONE_WITH_THAT_AUX_ADC_DUDE; + break; + default: ctrl_data_out.id = USRP2_CTRL_ID_HUH_WHAT; |