commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10491 - in gnuradio/branches/releases/3.2: gnuradio-c


From: jcorgan
Subject: [Commit-gnuradio] r10491 - in gnuradio/branches/releases/3.2: gnuradio-core/src/python/gnuradio gr-usrp/src grc/data/platforms/python/blocks grc/scripts grc/src/grc_gnuradio/usrp usrp/host/lib/legacy
Date: Mon, 23 Feb 2009 16:07:47 -0700 (MST)

Author: jcorgan
Date: 2009-02-23 16:07:46 -0700 (Mon, 23 Feb 2009)
New Revision: 10491

Modified:
   
gnuradio/branches/releases/3.2/gnuradio-core/src/python/gnuradio/eng_option.py
   gnuradio/branches/releases/3.2/gr-usrp/src/usrp.i
   gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.cc
   gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.h
   gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.i
   gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.cc
   gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.h
   gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.i
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
   gnuradio/branches/releases/3.2/grc/scripts/usrp_probe
   gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/common.py
   gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/dual_usrp.py
   gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/simple_usrp.py
   gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_basic.cc
   gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_boards.cc
   gnuradio/branches/releases/3.2/usrp/host/lib/legacy/usrp_standard.cc
   gnuradio/branches/releases/3.2/usrp/host/lib/legacy/usrp_standard.h
Log:
Merged r10448:10449, r10457:r10458 from trunk into release 3.2 branch

Modified: 
gnuradio/branches/releases/3.2/gnuradio-core/src/python/gnuradio/eng_option.py
===================================================================
--- 
gnuradio/branches/releases/3.2/gnuradio-core/src/python/gnuradio/eng_option.py  
    2009-02-23 23:03:17 UTC (rev 10490)
+++ 
gnuradio/branches/releases/3.2/gnuradio-core/src/python/gnuradio/eng_option.py  
    2009-02-23 23:07:46 UTC (rev 10491)
@@ -63,13 +63,13 @@
 
     @returns a 2-tuple (0|1, 0|1)
     """
-    d = { 'A'   : (0, 0),  'A:0' : (0, 0),  'A:1' : (0, 1),
-          'B'   : (1, 0),  'B:0' : (1, 0),  'B:1' : (1, 1) }
+    d = { 'A' : (0, 0), 'A:0' : (0, 0), 'A:1' : (0, 1), 'A:2' : (0, 2),
+          'B' : (1, 0), 'B:0' : (1, 0), 'B:1' : (1, 1), 'B:2' : (1, 2) }
     try:
         return d[value.upper()]
     except:
         raise OptionValueError(
-            "option %s: invalid subdev: '%r', must be one of A, B, A:0, A:1, 
B:0, B:1" % (opt, value))
+            "option %s: invalid subdev: '%r', must be one of %s" % (opt, 
value, ', '.join(sorted(d.keys()))))
 
 class eng_option (Option):
     TYPES = Option.TYPES + ("eng_float", "intx", "subdev")

Modified: gnuradio/branches/releases/3.2/gr-usrp/src/usrp.i
===================================================================
--- gnuradio/branches/releases/3.2/gr-usrp/src/usrp.i   2009-02-23 23:03:17 UTC 
(rev 10490)
+++ gnuradio/branches/releases/3.2/gr-usrp/src/usrp.i   2009-02-23 23:07:46 UTC 
(rev 10491)
@@ -48,14 +48,18 @@
   return self._real_selected_subdev(ss)
 
 # Allow subdev_spec to be tuple
-def __determine_tx_mux_value(self, subdev_spec):
+def __determine_tx_mux_value(self, subdev_spec, subdev_spec_=None):
     ss = usrp_subdev_spec(subdev_spec[0], subdev_spec[1])
-    return self._real_determine_tx_mux_value(ss)
+    if subdev_spec_ is None: return self._real_determine_tx_mux_value(ss)
+    ss_ = usrp_subdev_spec(subdev_spec_[0], subdev_spec_[1])
+    return self._real_determine_tx_mux_value(ss, ss_)
 
 # Allow subdev_spec to be tuple
-def __determine_rx_mux_value(self, subdev_spec):
+def __determine_rx_mux_value(self, subdev_spec, subdev_spec_=None):
     ss = usrp_subdev_spec(subdev_spec[0], subdev_spec[1])
-    return self._real_determine_rx_mux_value(ss)
+    if subdev_spec_ is None: return self._real_determine_rx_mux_value(ss)
+    ss_ = usrp_subdev_spec(subdev_spec_[0], subdev_spec_[1])
+    return self._real_determine_rx_mux_value(ss, ss_)
 
 # Allow subdev_spec to be tuple
 def __pick_subdev(self, candidates=[]):
@@ -86,12 +90,12 @@
     return u.tune(chan, subdev, target_freq)
 
 # Allow to be called as free function
-def determine_tx_mux_value(u, subdev_spec):
-    return u.determine_tx_mux_value(subdev_spec)
+def determine_tx_mux_value(u, subdev_spec, subdev_spec_=None):
+    return u.determine_tx_mux_value(subdev_spec, subdev_spec_)
 
 # Allow to be called as free function
-def determine_rx_mux_value(u, subdev_spec):
-    return u.determine_rx_mux_value(subdev_spec)
+def determine_rx_mux_value(u, subdev_spec, subdev_spec_=None):
+    return u.determine_rx_mux_value(subdev_spec, subdev_spec_)
 
 # Allow to be called as free function
 def selected_subdev(u, subdev_spec):

Modified: gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.cc
===================================================================
--- gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.cc        
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.cc        
2009-02-23 23:07:46 UTC (rev 10491)
@@ -151,6 +151,12 @@
   return d_usrp->determine_tx_mux_value(ss);
 }
 
+int
+usrp_sink_base::determine_tx_mux_value(usrp_subdev_spec ss_a, usrp_subdev_spec 
ss_b)
+{
+  return d_usrp->determine_tx_mux_value(ss_a, ss_b);
+}
+
 bool
 usrp_sink_base::set_tx_freq (int channel, double freq)
 {

Modified: gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.h
===================================================================
--- gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.h 2009-02-23 
23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.h 2009-02-23 
23:07:46 UTC (rev 10491)
@@ -88,6 +88,7 @@
   bool set_nchannels (int nchan);
   bool set_mux (int mux);
   int determine_tx_mux_value(usrp_subdev_spec ss);
+  int determine_tx_mux_value(usrp_subdev_spec ss_a, usrp_subdev_spec ss_b);
 
   /*!
    * \brief set the frequency of the digital up converter.

Modified: gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.i
===================================================================
--- gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.i 2009-02-23 
23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/gr-usrp/src/usrp_sink_base.i 2009-02-23 
23:07:46 UTC (rev 10491)
@@ -35,6 +35,7 @@
   bool set_mux (int mux);
   %rename(_real_determine_tx_mux_value) determine_tx_mux_value;
   int determine_tx_mux_value(usrp_subdev_spec ss);
+  int determine_tx_mux_value(usrp_subdev_spec ss_a, usrp_subdev_spec ss_b);
   bool set_tx_freq (int channel, double freq);
   long dac_rate() const { return converter_rate(); }
   long dac_freq() const { return converter_rate(); }

Modified: gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.cc
===================================================================
--- gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.cc      
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.cc      
2009-02-23 23:07:46 UTC (rev 10491)
@@ -148,6 +148,12 @@
   return d_usrp->determine_rx_mux_value(ss);
 }
 
+int
+usrp_source_base::determine_rx_mux_value(usrp_subdev_spec ss_a, 
usrp_subdev_spec ss_b)
+{
+  return d_usrp->determine_rx_mux_value(ss_a, ss_b);
+}
+
 bool
 usrp_source_base::set_rx_freq (int channel, double freq)
 {

Modified: gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.h
===================================================================
--- gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.h       
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.h       
2009-02-23 23:07:46 UTC (rev 10491)
@@ -101,6 +101,7 @@
   bool set_nchannels (int nchan);
   bool set_mux (int mux);
   int determine_rx_mux_value(usrp_subdev_spec ss);
+  int determine_rx_mux_value(usrp_subdev_spec ss_a, usrp_subdev_spec ss_b);
 
   /*!
    * \brief set the center frequency of the digital down converter.

Modified: gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.i
===================================================================
--- gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.i       
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/gr-usrp/src/usrp_source_base.i       
2009-02-23 23:07:46 UTC (rev 10491)
@@ -35,6 +35,7 @@
   bool set_mux (int mux);
   %rename(_real_determine_rx_mux_value) determine_rx_mux_value;
   int determine_rx_mux_value(usrp_subdev_spec ss);
+  int determine_rx_mux_value(usrp_subdev_spec ss_a, usrp_subdev_spec ss_b);
   bool set_rx_freq (int channel, double freq);
   bool set_fpga_mode (int mode);
   bool set_ddc_phase(int channel, int phase);

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
===================================================================
--- 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
      2009-02-23 23:03:17 UTC (rev 10490)
+++ 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
      2009-02-23 23:07:46 UTC (rev 10491)
@@ -8,7 +8,7 @@
        <name>USRP Dual Source</name>
        <key>usrp_dual_source_x</key>
        <import>from grc_gnuradio import usrp as grc_usrp</import>
-       <make>grc_usrp.dual_source_$(type.fcn)(which=$which, 
side_a='$rx_ant_a.side', rx_ant_a='$rx_ant_a.rx_ant', side_b='$rx_ant_b.side', 
rx_ant_b='$rx_ant_b.rx_ant')
+       <make>grc_usrp.dual_source_$(type.fcn)(which=$which, 
rx_ant_a='$rx_ant_a', rx_ant_b='$rx_ant_b')
 #if $format.eval
 self.$(id).set_format(width=$format.width, shift=$format.shift)
 #end if
@@ -97,39 +97,24 @@
                <key>rx_ant_a</key>
                <type>enum</type>
                <option>
-                       <name>Side A, RXA</name>
-                       <key>A_RXA</key>
-                       <opt>side:A</opt>
-                       <opt>rx_ant:RXA</opt>
-                       <opt>flex:</opt>
+                       <name>RXA</name>
+                       <key>RXA</key>
                </option>
                <option>
-                       <name>Side A, RXB</name>
-                       <key>A_RXB</key>
-                       <opt>side:A</opt>
-                       <opt>rx_ant:RXB</opt>
-                       <opt>flex:</opt>
+                       <name>RXB</name>
+                       <key>RXB</key>
                </option>
                <option>
-                       <name>Side A, TX/RX</name>
-                       <key>A_TXRX</key>
-                       <opt>side:A</opt>
-                       <opt>rx_ant:TX/RX</opt>
-                       <opt>flex:1</opt>
+                       <name>RXAB</name>
+                       <key>RXAB</key>
                </option>
                <option>
-                       <name>Side A, RX2</name>
-                       <key>A_RX2</key>
-                       <opt>side:A</opt>
-                       <opt>rx_ant:RX2</opt>
-                       <opt>flex:1</opt>
+                       <name>TX/RX</name>
+                       <key>TX/RX</key>
                </option>
                <option>
-                       <name>Side B, RXA</name>
-                       <key>B_RXA</key>
-                       <opt>side:B</opt>
-                       <opt>rx_ant:RXA</opt>
-                       <opt>flex:</opt>
+                       <name>RX2</name>
+                       <key>RX2</key>
                </option>
        </param>
 <!--
@@ -142,42 +127,26 @@
                <key>rx_ant_b</key>
                <type>enum</type>
                <option>
-                       <name>Side B, RXA</name>
-                       <key>B_RXA</key>
-                       <opt>side:B</opt>
-                       <opt>rx_ant:RXA</opt>
-                       <opt>flex:</opt>
+                       <name>RXA</name>
+                       <key>RXA</key>
                </option>
                <option>
-                       <name>Side B, RXB</name>
-                       <key>B_RXB</key>
-                       <opt>side:B</opt>
-                       <opt>rx_ant:RXB</opt>
-                       <opt>flex:</opt>
+                       <name>RXB</name>
+                       <key>RXB</key>
                </option>
                <option>
-                       <name>Side B, TX/RX</name>
-                       <key>B_TXRX</key>
-                       <opt>side:B</opt>
-                       <opt>rx_ant:TX/RX</opt>
-                       <opt>flex:1</opt>
+                       <name>RXAB</name>
+                       <key>RXAB</key>
                </option>
                <option>
-                       <name>Side B, RX2</name>
-                       <key>B_RX2</key>
-                       <opt>side:B</opt>
-                       <opt>rx_ant:RX2</opt>
-                       <opt>flex:1</opt>
+                       <name>TX/RX</name>
+                       <key>TX/RX</key>
                </option>
                <option>
-                       <name>Side A, RXB</name>
-                       <key>A_RXB</key>
-                       <opt>side:A</opt>
-                       <opt>rx_ant:RXB</opt>
-                       <opt>flex:</opt>
+                       <name>RX2</name>
+                       <key>RX2</key>
                </option>
        </param>
-       <check>'$rx_ant_a' != '$rx_ant_b'</check>
        <source>
                <name>Aout</name>
                <type>$type</type>
@@ -191,10 +160,7 @@
 
 The "Receive Antenna Setting" selects one of the SMA connectors as the data 
source. \
 Flex RF boards use the "TX/RX" and "RX2" settings. \
-Basic RX and LFRX use the "RXA" and "RXB" settings. \
+Basic RX and LFRX use the "RXA", "RXB", and "RXAB" settings. \
 All other boards use the "RXA" setting.
-
-Flex RF boards only: If enabled, "Auto Transmit/Receive Switching" handles the 
preference for transmit packets vs receive packets. \
-By default, "Auto TR" is disabled.
        </doc>
 </block>

Modified: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
===================================================================
--- 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
    2009-02-23 23:03:17 UTC (rev 10490)
+++ 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
    2009-02-23 23:07:46 UTC (rev 10491)
@@ -95,22 +95,22 @@
                <option>
                        <name>RXA</name>
                        <key>RXA</key>
-                       <opt>flex:</opt>
                </option>
                <option>
                        <name>RXB</name>
                        <key>RXB</key>
-                       <opt>flex:</opt>
                </option>
                <option>
+                       <name>RXAB</name>
+                       <key>RXAB</key>
+               </option>
+               <option>
                        <name>TX/RX</name>
                        <key>TX/RX</key>
-                       <opt>flex:1</opt>
                </option>
                <option>
                        <name>RX2</name>
                        <key>RX2</key>
-                       <opt>flex:1</opt>
                </option>
        </param>
        <param>
@@ -137,12 +137,9 @@
 
 The "Receive Antenna Setting" selects one of the SMA connectors as the data 
source. \
 Flex RF boards use the "TX/RX" and "RX2" settings. \
-Basic RX and LFRX use the "RXA" and "RXB" settings. \
+Basic RX and LFRX use the "RXA", "RXB", and "RXAB" settings. \
 All other boards use the "RXA" setting.
 
-Flex RF boards only: If enabled, "Auto Transmit/Receive Switching" handles the 
preference for transmit packets vs receive packets. \
-By default, "Auto TR" is disabled.
-
 With the format set to 8 bits and the halfband filters disabled, the USRP can 
acheive a decimation rate of 4. \
 Disabling the halfband filters requires a special USRP firmware without 
halfband filters or TX paths. \
 For this reason, the USRP cannot transmit with the halfband filters disabled.

Modified: gnuradio/branches/releases/3.2/grc/scripts/usrp_probe
===================================================================
--- gnuradio/branches/releases/3.2/grc/scripts/usrp_probe       2009-02-23 
23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/grc/scripts/usrp_probe       2009-02-23 
23:07:46 UTC (rev 10491)
@@ -81,19 +81,14 @@
                """Probe the USRP device and copy the results into the query 
text box."""
                dboard = usrp_dboard_param.evaluate()
                side = {'a': 0, 'b': 1}[dboard[-1]]
-               if dboard.startswith('rx'): #for the rx query, use the source 
and rx methods
-                       make = usrp.source_c
-                       get_mux = usrp.determine_rx_mux_value
-               elif dboard.startswith('tx'): #for the tx query, use the sink 
and tx methods
-                       make = usrp.sink_c
-                       get_mux = usrp.determine_tx_mux_value
+               if dboard.startswith('rx'): make = usrp.source_c
+               elif dboard.startswith('tx'): make = usrp.sink_c
                try:
                        u = make(which=usrp_which_param.evaluate())
                        subdev_spec = (side, 0)
                        subdev = usrp.selected_subdev(u, subdev_spec) #get the 
subdev
                        msg = ">>> USRP Probe\n"
                        msg = "%s\nName:\n\t%s\n"%(msg, str(subdev.name()))
-                       msg = "%s\nAutomated Mux:\n\t0x%08x\n"%(msg, 
0xFFFFFFFFL & long(get_mux(u, subdev_spec))) #ensure that the value is 
displayed as: 8 nibbles, unsigned, hex
                        msg = "%s\nConverter Rate:\n\t%s\n"%(msg, 
u.converter_rate())
                        msg = "%s\nUses Quadrature:\n\t%s\n"%(msg, 
str(subdev.is_quadrature()))
                        gain_min, gain_max, gain_step = subdev.gain_range()

Modified: gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/common.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/common.py  
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/common.py  
2009-02-23 23:07:46 UTC (rev 10491)
@@ -63,10 +63,13 @@
        Convert the side to a spec number.
        @param side A or B
        @param rx_ant antenna type
-       @return the spec (0/1, 0/1)
+       @return the spec (0/1, 0/1/2)
        """
-       try: return (
-               {'A': 0, 'B': 1}[side.upper()], #side spec is 0 for A, 1 for B
-               rx_ant.upper() == 'RXB' and 1 or 0, #subdev spec is 1 for RXB
-       )
+       #determine the side spec
+       try: side_spec = {'A': 0, 'B': 1}[side.upper()]
        except: raise ValueError, 'Side A or B expected.'
+       #determine the subdevice spec
+       if rx_ant.upper() == 'RXB': subdev_spec = 1
+       elif rx_ant.upper() == 'RXAB': subdev_spec = 2
+       else: subdev_spec = 0
+       return (side_spec, subdev_spec)

Modified: gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/dual_usrp.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/dual_usrp.py       
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/dual_usrp.py       
2009-02-23 23:07:46 UTC (rev 10491)
@@ -27,13 +27,11 @@
 class _dual_source(gr.hier_block2):
        """A dual usrp source of IO type short or complex."""
 
-       def __init__(self, which, side_a='A', rx_ant_a='RXA', side_b='B', 
rx_ant_b='RXA'):
+       def __init__(self, which, rx_ant_a='RXA', rx_ant_b='RXA'):
                """
                USRP dual source contructor.
                @param which the unit number
-               @param side_a A or B
                @param rx_ant_a the antenna choice
-               @param side_b A or B
                @param rx_ant_b the antenna choice
                """
                #initialize hier2 block
@@ -44,16 +42,11 @@
                )
                #create usrp object
                self._make_usrp(which=which, nchan=2)
-               #get the mux for output A
-               subdev_spec_a = common.to_spec(side_a, rx_ant_a)
-               self._subdev_a = usrp.selected_subdev(self._get_u(), 
subdev_spec_a)
-               mux_a = usrp.determine_rx_mux_value(self._get_u(), 
subdev_spec_a)
-               #get the mux for output B
-               subdev_spec_b = common.to_spec(side_b, rx_ant_b)
-               self._subdev_b = usrp.selected_subdev(self._get_u(), 
subdev_spec_b)
-               mux_b = usrp.determine_rx_mux_value(self._get_u(), 
subdev_spec_b)
-               #move the lower byte of the mux b into the second byte of the 
mux a
-               self._get_u().set_mux(((mux_b & 0xff) << 8) | (mux_a - (mux_a & 
0xff00)))
+               subdev_spec_a = common.to_spec('A', rx_ant_a)
+               subdev_spec_b = common.to_spec('B', rx_ant_b)
+               
self._get_u().set_mux(self._get_u().determine_rx_mux_value(subdev_spec_a, 
subdev_spec_b))
+               self._subdev_a = self._get_u().selected_subdev(subdev_spec_a)
+               self._subdev_b = self._get_u().selected_subdev(subdev_spec_b)
                #connect
                deinter = gr.deinterleave(self._get_io_size())
                self.connect(self._get_u(), deinter)
@@ -99,16 +92,11 @@
                )
                #create usrp object
                self._make_usrp(which=which, nchan=2)
-               #get the mux for side A
                subdev_spec_a = common.to_spec('A')
-               self._subdev_a = usrp.selected_subdev(self._get_u(), 
subdev_spec_a)
-               mux_a = usrp.determine_tx_mux_value(self._get_u(), 
subdev_spec_a)
-               #get the mux for side B
                subdev_spec_b = common.to_spec('B')
-               self._subdev_b = usrp.selected_subdev(self._get_u(), 
subdev_spec_b)
-               mux_b = usrp.determine_tx_mux_value(self._get_u(), 
subdev_spec_b)
-               #set the mux
-               self._get_u().set_mux(mux_a | mux_b)
+               
self._get_u().set_mux(self._get_u().determine_tx_mux_value(subdev_spec_a, 
subdev_spec_b))
+               self._subdev_a = self._get_u().selected_subdev(subdev_spec_a)
+               self._subdev_b = self._get_u().selected_subdev(subdev_spec_b)
                #connect
                inter = gr.interleave(self._get_io_size())
                self.connect(inter, self._get_u())

Modified: 
gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/simple_usrp.py
===================================================================
--- gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/simple_usrp.py     
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/grc/src/grc_gnuradio/usrp/simple_usrp.py     
2009-02-23 23:07:46 UTC (rev 10491)
@@ -46,8 +46,8 @@
                if self._no_hb: self._make_usrp(which=which, nchan=1, 
fpga_filename="std_4rx_0tx.rbf")
                else: self._make_usrp(which=which, nchan=1)
                subdev_spec = common.to_spec(side, rx_ant)
-               
self._get_u().set_mux(usrp.determine_rx_mux_value(self._get_u(), subdev_spec))
-               self._subdev = usrp.selected_subdev(self._get_u(), subdev_spec)
+               
self._get_u().set_mux(self._get_u().determine_rx_mux_value(subdev_spec))
+               self._subdev = self._get_u().selected_subdev(subdev_spec)
                if common.is_flex(rx_ant): 
self._subdev.select_rx_antenna(rx_ant)
                #connect
                self.connect(self._get_u(), self)
@@ -89,8 +89,8 @@
                #create usrp object
                self._make_usrp(which=which, nchan=1)
                subdev_spec = common.to_spec(side)
-               
self._get_u().set_mux(usrp.determine_tx_mux_value(self._get_u(), subdev_spec))
-               self._subdev = usrp.selected_subdev(self._get_u(), subdev_spec)
+               
self._get_u().set_mux(self._get_u().determine_tx_mux_value(subdev_spec))
+               self._subdev = self._get_u().selected_subdev(subdev_spec)
                #connect
                self.connect(self, self._get_u())
 

Modified: gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_basic.cc
===================================================================
--- gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_basic.cc     
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_basic.cc     
2009-02-23 23:07:46 UTC (rev 10491)
@@ -197,7 +197,7 @@
 
   // This bit of info is useful when setting up the USRP Rx mux register.
   
-  return false;
+  return (d_subdev == 2);
 }
 
 

Modified: gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_boards.cc
===================================================================
--- gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_boards.cc    
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/usrp/host/lib/legacy/db_boards.cc    
2009-02-23 23:07:46 UTC (rev 10491)
@@ -46,6 +46,7 @@
   case(USRP_DBID_BASIC_RX):
     db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 0)));
     db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 1)));
+    db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 2)));
     break;
 
   case(USRP_DBID_LF_TX):
@@ -55,6 +56,7 @@
   case(USRP_DBID_LF_RX):
     db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 0)));
     db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 1)));
+    db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 2)));
     break;
     
   case(USRP_DBID_DBS_RX):

Modified: gnuradio/branches/releases/3.2/usrp/host/lib/legacy/usrp_standard.cc
===================================================================
--- gnuradio/branches/releases/3.2/usrp/host/lib/legacy/usrp_standard.cc        
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/usrp/host/lib/legacy/usrp_standard.cc        
2009-02-23 23:07:46 UTC (rev 10491)
@@ -585,32 +585,24 @@
   // classes for the selected side.
   std::vector<db_base_sptr> db = this->db(ss.side);
   
-  unsigned int subdev0_uses, subdev1_uses, uses;
+  unsigned int uses;
 
   // compute bitmasks of used A/D's
   
-  if(db[0]->is_quadrature())
-    subdev0_uses = 0x3;               // uses A/D 0 and 1
+  if(db[ss.subdev]->is_quadrature())
+    uses = 0x3;               // uses A/D 0 and 1
+  else if (ss.subdev == 0)
+    uses = 0x1;               // uses A/D 0 only
+  else if(ss.subdev == 1)
+    uses = 0x2;               // uses A/D 1 only
   else
-    subdev0_uses = 0x1;               // uses A/D 0 only
-
-  if(db.size() > 1)                   // more than 1 subdevice?
-    subdev1_uses = 0x2;               // uses A/D 1 only
-  else
-    subdev1_uses = 0x0;               // uses no A/D (doesn't exist)
+    uses = 0x0;               // uses no A/D (doesn't exist)
   
-  if(ss.subdev == 0)
-    uses = subdev0_uses;
-  else if(ss.subdev == 1)
-    uses = subdev1_uses;
-  else
-    throw std::invalid_argument("subdev_spec");
-
   if(uses == 0){
-    throw std::runtime_error("Daughterboard doesn't have a subdevice 1");
+    throw std::runtime_error("Determine RX Mux Error");
   }
   
-  bool swap_iq = db[0]->i_and_q_swapped();
+  bool swap_iq = db[ss.subdev]->i_and_q_swapped();
   
   truth_table_element truth_table[8] = {
     // (side, uses, swap_iq) : mux_val
@@ -635,8 +627,20 @@
   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)
+{
+  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)
 {
@@ -959,7 +963,7 @@
 
   std::vector<db_base_sptr> db = this->db(ss.side);
   
-  if(db[0]->i_and_q_swapped()) {
+  if(db[ss.subdev]->i_and_q_swapped()) {
     unsigned int mask[2] = {0x0089, 0x8900};
     return mask[ss.side];
   }
@@ -969,8 +973,21 @@
   }
 }
 
+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
 
 bool

Modified: gnuradio/branches/releases/3.2/usrp/host/lib/legacy/usrp_standard.h
===================================================================
--- gnuradio/branches/releases/3.2/usrp/host/lib/legacy/usrp_standard.h 
2009-02-23 23:03:17 UTC (rev 10490)
+++ gnuradio/branches/releases/3.2/usrp/host/lib/legacy/usrp_standard.h 
2009-02-23 23:07:46 UTC (rev 10491)
@@ -179,6 +179,7 @@
    * 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 @@
    * 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]