diff options
Diffstat (limited to 'usrp/host')
-rw-r--r-- | usrp/host/lib/legacy/usrp_standard.cc | 32 | ||||
-rw-r--r-- | usrp/host/lib/legacy/usrp_standard.h | 2 |
2 files changed, 32 insertions, 2 deletions
diff --git a/usrp/host/lib/legacy/usrp_standard.cc b/usrp/host/lib/legacy/usrp_standard.cc index d2360cc6f..afbbaa8d9 100644 --- a/usrp/host/lib/legacy/usrp_standard.cc +++ b/usrp/host/lib/legacy/usrp_standard.cc @@ -627,7 +627,22 @@ usrp_standard_rx::determine_rx_mux_value(const usrp_subdev_spec &ss) throw std::runtime_error("internal error"); } - +int +usrp_standard_rx::determine_rx_mux_value(const usrp_subdev_spec &ss_a, const usrp_subdev_spec &ss_b) +{ + if (ss_a.side == ss_b.side && ss_a.subdev == ss_b.subdev){ + throw std::runtime_error("Cannot compute dual mux, repeated subdevice"); + } + std::vector<db_base_sptr> db_a = this->db(ss_a.side); + std::vector<db_base_sptr> db_b = this->db(ss_b.side); + if (db_a[ss_a.subdev]->is_quadrature() != db_b[ss_b.subdev]->is_quadrature()){ + throw std::runtime_error("Cannot compute dual mux when mixing quadrature and non-quadrature subdevices"); + } + int mux_a = determine_rx_mux_value(ss_a); + int mux_b = determine_rx_mux_value(ss_b); + //move the lower byte of the mux b into the second byte of the mux a + return ((mux_b & 0xff) << 8) | (mux_a & 0xffff00ff); +} bool usrp_standard_rx::set_rx_freq (int channel, double freq) @@ -961,7 +976,20 @@ usrp_standard_tx::determine_tx_mux_value(const usrp_subdev_spec &ss) } } - +int +usrp_standard_tx::determine_tx_mux_value(const usrp_subdev_spec &ss_a, const usrp_subdev_spec &ss_b) +{ + if (ss_a.side == ss_b.side && ss_a.subdev == ss_b.subdev){ + throw std::runtime_error("Cannot compute dual mux, repeated subdevice"); + } + int mux_a = determine_tx_mux_value(ss_a); + //Get the mux b: + // DAC0 becomes DAC2 + // DAC1 becomes DAC3 + unsigned int mask[2] = {0x0022, 0x2200}; + int mux_b = determine_tx_mux_value(ss_b) + mask[ss_b.side]; + return mux_b | mux_a; +} #ifdef USE_FPGA_TX_CORDIC diff --git a/usrp/host/lib/legacy/usrp_standard.h b/usrp/host/lib/legacy/usrp_standard.h index b7145b843..1e018c74d 100644 --- a/usrp/host/lib/legacy/usrp_standard.h +++ b/usrp/host/lib/legacy/usrp_standard.h @@ -179,6 +179,7 @@ class usrp_standard_rx : public usrp_basic_rx, public usrp_standard_common * and the characteristics of the respective daughterboard. */ int determine_rx_mux_value(const usrp_subdev_spec &ss); + int determine_rx_mux_value(const usrp_subdev_spec &ss_a, const usrp_subdev_spec &ss_b); /*! * \brief set the frequency of the digital down converter. @@ -389,6 +390,7 @@ class usrp_standard_tx : public usrp_basic_tx, public usrp_standard_common * and the characteristics of the respective daughterboard. */ int determine_tx_mux_value(const usrp_subdev_spec &ss); + int determine_tx_mux_value(const usrp_subdev_spec &ss_a, const usrp_subdev_spec &ss_b); /*! * \brief set the frequency of the digital up converter. |