Revision 19e3114d

b/gnuradio-core/src/python/gnuradio/eng_option.py
63 63

64 64
    @returns a 2-tuple (0|1, 0|1)
65 65
    """
66
    d = { 'A'   : (0, 0),  'A:0' : (0, 0),  'A:1' : (0, 1),
67
          'B'   : (1, 0),  'B:0' : (1, 0),  'B:1' : (1, 1) }
66
    d = { 'A' : (0, 0), 'A:0' : (0, 0), 'A:1' : (0, 1), 'A:2' : (0, 2),
67
          'B' : (1, 0), 'B:0' : (1, 0), 'B:1' : (1, 1), 'B:2' : (1, 2) }
68 68
    try:
69 69
        return d[value.upper()]
70 70
    except:
71 71
        raise OptionValueError(
72
            "option %s: invalid subdev: '%r', must be one of A, B, A:0, A:1, B:0, B:1" % (opt, value))
72
            "option %s: invalid subdev: '%r', must be one of %s" % (opt, value, ', '.join(sorted(d.keys()))))
73 73

74 74
class eng_option (Option):
75 75
    TYPES = Option.TYPES + ("eng_float", "intx", "subdev")
b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml
8 8
	<name>USRP Dual Source</name>
9 9
	<key>usrp_dual_source_x</key>
10 10
	<import>from grc_gnuradio import usrp as grc_usrp</import>
11
	<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')
11
	<make>grc_usrp.dual_source_$(type.fcn)(which=$which, rx_ant_a='$rx_ant_a', rx_ant_b='$rx_ant_b')
12 12
#if $format.eval
13 13
self.$(id).set_format(width=$format.width, shift=$format.shift)
14 14
#end if
......
97 97
		<key>rx_ant_a</key>
98 98
		<type>enum</type>
99 99
		<option>
100
			<name>Side A, RXA</name>
101
			<key>A_RXA</key>
102
			<opt>side:A</opt>
103
			<opt>rx_ant:RXA</opt>
100
			<name>RXA</name>
101
			<key>RXA</key>
104 102
			<opt>flex:</opt>
105 103
		</option>
106 104
		<option>
107
			<name>Side A, RXB</name>
108
			<key>A_RXB</key>
109
			<opt>side:A</opt>
110
			<opt>rx_ant:RXB</opt>
105
			<name>RXB</name>
106
			<key>RXB</key>
111 107
			<opt>flex:</opt>
112 108
		</option>
113 109
		<option>
114
			<name>Side A, TX/RX</name>
115
			<key>A_TXRX</key>
116
			<opt>side:A</opt>
117
			<opt>rx_ant:TX/RX</opt>
118
			<opt>flex:1</opt>
110
			<name>RXAB</name>
111
			<key>RXAB</key>
112
			<opt>flex:</opt>
119 113
		</option>
120 114
		<option>
121
			<name>Side A, RX2</name>
122
			<key>A_RX2</key>
123
			<opt>side:A</opt>
124
			<opt>rx_ant:RX2</opt>
115
			<name>TX/RX</name>
116
			<key>TX/RX</key>
125 117
			<opt>flex:1</opt>
126 118
		</option>
127 119
		<option>
128
			<name>Side B, RXA</name>
129
			<key>B_RXA</key>
130
			<opt>side:B</opt>
131
			<opt>rx_ant:RXA</opt>
132
			<opt>flex:</opt>
120
			<name>RX2</name>
121
			<key>RX2</key>
122
			<opt>flex:1</opt>
133 123
		</option>
134 124
	</param>
135 125
<!--
......
142 132
		<key>rx_ant_b</key>
143 133
		<type>enum</type>
144 134
		<option>
145
			<name>Side B, RXA</name>
146
			<key>B_RXA</key>
147
			<opt>side:B</opt>
148
			<opt>rx_ant:RXA</opt>
135
			<name>RXA</name>
136
			<key>RXA</key>
149 137
			<opt>flex:</opt>
150 138
		</option>
151 139
		<option>
152
			<name>Side B, RXB</name>
153
			<key>B_RXB</key>
154
			<opt>side:B</opt>
155
			<opt>rx_ant:RXB</opt>
140
			<name>RXB</name>
141
			<key>RXB</key>
156 142
			<opt>flex:</opt>
157 143
		</option>
158 144
		<option>
159
			<name>Side B, TX/RX</name>
160
			<key>B_TXRX</key>
161
			<opt>side:B</opt>
162
			<opt>rx_ant:TX/RX</opt>
163
			<opt>flex:1</opt>
145
			<name>RXAB</name>
146
			<key>RXAB</key>
147
			<opt>flex:</opt>
164 148
		</option>
165 149
		<option>
166
			<name>Side B, RX2</name>
167
			<key>B_RX2</key>
168
			<opt>side:B</opt>
169
			<opt>rx_ant:RX2</opt>
150
			<name>TX/RX</name>
151
			<key>TX/RX</key>
170 152
			<opt>flex:1</opt>
171 153
		</option>
172 154
		<option>
173
			<name>Side A, RXB</name>
174
			<key>A_RXB</key>
175
			<opt>side:A</opt>
176
			<opt>rx_ant:RXB</opt>
177
			<opt>flex:</opt>
155
			<name>RX2</name>
156
			<key>RX2</key>
157
			<opt>flex:1</opt>
178 158
		</option>
179 159
	</param>
180
	<check>'$rx_ant_a' != '$rx_ant_b'</check>
181 160
	<source>
182 161
		<name>Aout</name>
183 162
		<type>$type</type>
......
191 170

192 171
The "Receive Antenna Setting" selects one of the SMA connectors as the data source. \
193 172
Flex RF boards use the "TX/RX" and "RX2" settings. \
194
Basic RX and LFRX use the "RXA" and "RXB" settings. \
173
Basic RX and LFRX use the "RXA", "RXB", and "RXAB" settings. \
195 174
All other boards use the "RXA" setting.
196

197
Flex RF boards only: If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \
198
By default, "Auto TR" is disabled.
199 175
	</doc>
200 176
</block>
b/grc/data/platforms/python/blocks/usrp_simple_source_x.xml
103 103
			<opt>flex:</opt>
104 104
		</option>
105 105
		<option>
106
			<name>RXAB</name>
107
			<key>RXAB</key>
108
			<opt>flex:</opt>
109
		</option>
110
		<option>
106 111
			<name>TX/RX</name>
107 112
			<key>TX/RX</key>
108 113
			<opt>flex:1</opt>
......
137 142

138 143
The "Receive Antenna Setting" selects one of the SMA connectors as the data source. \
139 144
Flex RF boards use the "TX/RX" and "RX2" settings. \
140
Basic RX and LFRX use the "RXA" and "RXB" settings. \
145
Basic RX and LFRX use the "RXA", "RXB", and "RXAB" settings. \
141 146
All other boards use the "RXA" setting.
142 147

143
Flex RF boards only: If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \
144
By default, "Auto TR" is disabled.
145

146 148
With the format set to 8 bits and the halfband filters disabled, the USRP can acheive a decimation rate of 4. \
147 149
Disabling the halfband filters requires a special USRP firmware without halfband filters or TX paths. \
148 150
For this reason, the USRP cannot transmit with the halfband filters disabled.
b/grc/src/grc_gnuradio/usrp/common.py
63 63
	Convert the side to a spec number.
64 64
	@param side A or B
65 65
	@param rx_ant antenna type
66
	@return the spec (0/1, 0/1)
66
	@return the spec (0/1, 0/1/2)
67 67
	"""
68
	try: return (
69
		{'A': 0, 'B': 1}[side.upper()], #side spec is 0 for A, 1 for B
70
		rx_ant.upper() == 'RXB' and 1 or 0, #subdev spec is 1 for RXB
71
	)
68
	#determine the side spec
69
	try: side_spec = {'A': 0, 'B': 1}[side.upper()]
72 70
	except: raise ValueError, 'Side A or B expected.'
71
	#determine the subdevice spec
72
	if rx_ant.upper() == 'RXB': subdev_spec = 1
73
	elif rx_ant.upper() == 'RXAB': subdev_spec = 2
74
	else: subdev_spec = 0
75
	return (side_spec, subdev_spec)
b/grc/src/grc_gnuradio/usrp/dual_usrp.py
27 27
class _dual_source(gr.hier_block2):
28 28
	"""A dual usrp source of IO type short or complex."""
29 29

30
	def __init__(self, which, side_a='A', rx_ant_a='RXA', side_b='B', rx_ant_b='RXA'):
30
	def __init__(self, which, rx_ant_a='RXA', rx_ant_b='RXA'):
31 31
		"""
32 32
		USRP dual source contructor.
33 33
		@param which the unit number
34
		@param side_a A or B
35 34
		@param rx_ant_a the antenna choice
36
		@param side_b A or B
37 35
		@param rx_ant_b the antenna choice
38 36
		"""
39 37
		#initialize hier2 block
......
44 42
		)
45 43
		#create usrp object
46 44
		self._make_usrp(which=which, nchan=2)
47
		#get the mux for output A
48
		subdev_spec_a = common.to_spec(side_a, rx_ant_a)
45
		#get the mux for side A
46
		subdev_spec_a = common.to_spec('A', rx_ant_a)
49 47
		self._subdev_a = usrp.selected_subdev(self._get_u(), subdev_spec_a)
50 48
		mux_a = usrp.determine_rx_mux_value(self._get_u(), subdev_spec_a)
51
		#get the mux for output B
52
		subdev_spec_b = common.to_spec(side_b, rx_ant_b)
49
		#get the mux for side B
50
		subdev_spec_b = common.to_spec('B', rx_ant_b)
53 51
		self._subdev_b = usrp.selected_subdev(self._get_u(), subdev_spec_b)
54 52
		mux_b = usrp.determine_rx_mux_value(self._get_u(), subdev_spec_b)
55 53
		#move the lower byte of the mux b into the second byte of the mux a
b/usrp/host/lib/legacy/db_basic.cc
197 197

198 198
  // This bit of info is useful when setting up the USRP Rx mux register.
199 199
  
200
  return false;
200
  return (d_subdev == 2);
201 201
}
202 202

203 203

b/usrp/host/lib/legacy/db_boards.cc
46 46
  case(USRP_DBID_BASIC_RX):
47 47
    db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 0)));
48 48
    db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 1)));
49
    db.push_back(db_base_sptr(new db_basic_rx(usrp, which_side, 2)));
49 50
    break;
50 51

51 52
  case(USRP_DBID_LF_TX):
......
55 56
  case(USRP_DBID_LF_RX):
56 57
    db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 0)));
57 58
    db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 1)));
59
    db.push_back(db_base_sptr(new db_lf_rx(usrp, which_side, 2)));
58 60
    break;
59 61
    
60 62
  case(USRP_DBID_DBS_RX):
b/usrp/host/lib/legacy/usrp_standard.cc
585 585
  // classes for the selected side.
586 586
  std::vector<db_base_sptr> db = this->db(ss.side);
587 587
  
588
  unsigned int subdev0_uses, subdev1_uses, uses;
588
  unsigned int uses;
589 589

590 590
  // compute bitmasks of used A/D's
591 591
  
592
  if(db[0]->is_quadrature())
593
    subdev0_uses = 0x3;               // uses A/D 0 and 1
594
  else
595
    subdev0_uses = 0x1;               // uses A/D 0 only
596

597
  if(db.size() > 1)                   // more than 1 subdevice?
598
    subdev1_uses = 0x2;               // uses A/D 1 only
599
  else
600
    subdev1_uses = 0x0;               // uses no A/D (doesn't exist)
601
  
602
  if(ss.subdev == 0)
603
    uses = subdev0_uses;
592
  if(db[ss.subdev]->is_quadrature())
593
    uses = 0x3;               // uses A/D 0 and 1
594
  else if (ss.subdev == 0)
595
    uses = 0x1;               // uses A/D 0 only
604 596
  else if(ss.subdev == 1)
605
    uses = subdev1_uses;
597
    uses = 0x2;               // uses A/D 1 only
606 598
  else
607
    throw std::invalid_argument("subdev_spec");
608

599
    uses = 0x0;               // uses no A/D (doesn't exist)
600
  
609 601
  if(uses == 0){
610
    throw std::runtime_error("Daughterboard doesn't have a subdevice 1");
602
    throw std::runtime_error("Determine RX Mux Error");
611 603
  }
612 604
  
613
  bool swap_iq = db[0]->i_and_q_swapped();
605
  bool swap_iq = db[ss.subdev]->i_and_q_swapped();
614 606
  
615 607
  truth_table_element truth_table[8] = {
616 608
    // (side, uses, swap_iq) : mux_val
......
959 951

960 952
  std::vector<db_base_sptr> db = this->db(ss.side);
961 953
  
962
  if(db[0]->i_and_q_swapped()) {
954
  if(db[ss.subdev]->i_and_q_swapped()) {
963 955
    unsigned int mask[2] = {0x0089, 0x8900};
964 956
    return mask[ss.side];
965 957
  }

Also available in: Unified diff