summaryrefslogtreecommitdiff
path: root/usrp/host
diff options
context:
space:
mode:
authorjblum2009-02-17 23:03:39 +0000
committerjblum2009-02-17 23:03:39 +0000
commit9030fb71746966a9ef6eb6ae2dc0aebdc6016987 (patch)
treea2f6a296048eeb1363cd8c77b68b36177473c1b4 /usrp/host
parenteb2648dc72e7edb0adb0d810fc4166633c26aea0 (diff)
downloadgnuradio-9030fb71746966a9ef6eb6ae2dc0aebdc6016987.tar.gz
gnuradio-9030fb71746966a9ef6eb6ae2dc0aebdc6016987.tar.bz2
gnuradio-9030fb71746966a9ef6eb6ae2dc0aebdc6016987.zip
usrp methods for computing the mux for dual subdevices
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10457 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp/host')
-rw-r--r--usrp/host/lib/legacy/usrp_standard.cc32
-rw-r--r--usrp/host/lib/legacy/usrp_standard.h2
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.