diff options
Diffstat (limited to 'firmware/microblaze/apps')
-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; |