From b21f38784342234627c9f43d7013f139800322b1 Mon Sep 17 00:00:00 2001 From: jblum Date: Mon, 26 Jan 2009 21:17:41 +0000 Subject: new and improved simple/dual usrp blocks and wrapper classes git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10305 221aa14e-8319-0410-a670-987f0aec2ac5 --- .../platforms/python/blocks/usrp2_sink_xxxx.xml | 62 +------ .../platforms/python/blocks/usrp2_source_xxxx.xml | 62 +------ .../platforms/python/blocks/usrp_dual_sink_x.xml | 126 ++++++++------ .../platforms/python/blocks/usrp_dual_source_x.xml | 188 ++++++++++++++------- .../platforms/python/blocks/usrp_simple_sink_x.xml | 97 +++++------ .../python/blocks/usrp_simple_source_x.xml | 130 ++++++-------- 6 files changed, 297 insertions(+), 368 deletions(-) (limited to 'grc/data') diff --git a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml index 352fe4ce0..fe00908e0 100644 --- a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml +++ b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml @@ -17,14 +17,7 @@ usrp2.sink_$(type.fcn)($interface, $mac_addr) #end if self.$(id).set_interp($interpolation) self.$(id).set_center_freq($frequency) -self.$(id).set_gain($gain) -#if $auto_tr.eval -self.$(id).set_auto_tr($auto_tr) -#end if -#if $tx_enb.eval -self.$(id).set_enable($tx_enb) -#end if - +self.$(id).set_gain($gain) set_interp($interpolation) set_center_freq($frequency) set_gain($gain) @@ -70,50 +63,6 @@ self.$(id).set_enable($tx_enb) gain real - - Auto T/R - auto_tr - - enum - $auto_tr.hide - - - - - - TX Enable - tx_enb - - enum - $tx_enb.hide - - - - in $type @@ -124,14 +73,5 @@ The USRP2 sink inputs 100 Megasamples per second / interpolation. To use the default ethernet device, leave interface blank. \ For systems with only 1 USRP2, you may leave the mac address blank. \ For multi-USRP2 systems, specify the mac address in the form 00:50:C2:85:3x:xx. - ---- Flex RF specific --- -The "Auto TR" and "TX Enable" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board. - -If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \ -By default, "Auto TR" is disabled. - -The "Transmit Enable" configures the transmitter to be on or off. \ -Do not leave this unconfigured. diff --git a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml index 548baa8d9..bd92ec65b 100644 --- a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml +++ b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml @@ -17,14 +17,7 @@ usrp2.source_$(type.fcn)($interface, $mac_addr) #end if self.$(id).set_decim($decimation) self.$(id).set_center_freq($frequency) -self.$(id).set_gain($gain) -#if $auto_tr.eval -self.$(id).set_auto_tr($auto_tr) -#end if -#if $rx_ant.eval -self.$(id).select_rx_antenna($rx_ant) -#end if - +self.$(id).set_gain($gain) set_decim($decimation) set_center_freq($frequency) set_gain($gain) @@ -70,50 +63,6 @@ self.$(id).select_rx_antenna($rx_ant) gain real - - Auto T/R - auto_tr - - enum - $auto_tr.hide - - - - - - RX Antenna - rx_ant - - enum - $rx_ant.hide - - - - out $type @@ -124,14 +73,5 @@ The USRP2 source outputs 100 Megasamples per second / decimation. To use the default ethernet device, leave interface blank. \ For systems with only 1 USRP2, you may leave the mac address blank. \ For multi-USRP2 systems, specify the mac address in the form 00:50:C2:85:3x:xx. - ---- Flex RF specific --- -The "Auto TR" and "RX Antenna" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board. - -If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \ -By default, "Auto TR" is disabled. - -The "Receive Antenna Setting" selects one of the SMA connectors as the data source. \ -By default, 'TX/RX' is selected. diff --git a/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml b/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml index 68213080c..3e665c0f8 100644 --- a/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml +++ b/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml @@ -8,22 +8,34 @@ USRP Dual Sink usrp_dual_sink_x from grc_gnuradio import usrp as grc_usrp - grc_usrp.dual_sink_$(type.fcn)( - number=$number, - frequency_a=$frequency_a, - frequency_b=$frequency_b, - interpolation=$interpolation, - gain_a=$gain_a, - gain_b=$gain_b, - mux=$mux, - auto_tr=$auto_tr, - tx_enb_a=$tx_enb_a, - tx_enb_b=$tx_enb_b, -) + grc_usrp.dual_sink_$(type.fcn)(number=$number) +self.$(id).set_interp_rate($interpolation) +self.$(id).set_frequency_a($frequency_a, verbose=True) +self.$(id).set_frequency_b($frequency_b, verbose=True) +self.$(id).set_gain_a($gain_a) +self.$(id).set_gain_b($gain_b) +################################################## +## Flex RF A +################################################## +#if $tx_enb_a.eval +self.$(id).set_enable_a($tx_enb_a) +#end if +#if $auto_tr_a.eval and $tx_enb_a.eval +self.$(id).set_auto_tr_a($auto_tr_a) +#end if +################################################## +## Flex RF B +################################################## +#if $tx_enb_b.eval +self.$(id).set_enable_b($tx_enb_b) +#end if +#if $auto_tr_b.eval and $tx_enb_b.eval +self.$(id).set_auto_tr_b($auto_tr_b) +#end if set_interp_rate($interpolation) set_frequency_a($frequency_a) - set_gain_a($gain_a) set_frequency_b($frequency_b) + set_gain_a($gain_a) set_gain_b($gain_b) Input Type @@ -46,6 +58,11 @@ 0 int + + Interpolation + interpolation + int + Frequency A frequency_a @@ -56,11 +73,6 @@ frequency_b real - - Interpolation - interpolation - int - Gain A gain_a @@ -71,22 +83,20 @@ gain_b real + - Mux - mux - 0x0 - hex - part - - - Auto T/R - auto_tr - None + TX Enable A + tx_enb_a + enum - $auto_tr.hide + $tx_enb_a.hide - TX Enable A - tx_enb_a - None + Auto T/R A + auto_tr_a + enum - $tx_enb_a.hide + #if $tx_enb_a.eval then 'none' else 'all'# + TX Enable B tx_enb_b - None + enum $tx_enb_b.hide + + Auto T/R B + auto_tr_b + + enum + #if $tx_enb_b.eval then 'none' else 'all'# + + + + Ain $type @@ -155,13 +186,10 @@ The USRP sink inputs 128 Megasamples per second / interpolation. ---- Flex RF specific --- -The "Auto TR" and "TX Enable" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board. +Flex RF boards only: The "Transmit Enable" configures the transmitter to be on or off. \ +Do not leave this unconfigured. -If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \ +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. - -The "Transmit Enable" configures the transmitter to be on or off. \ -Do not leave this unconfigured. diff --git a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml index 33ff12cb7..2ed8f7656 100644 --- a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml +++ b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml @@ -8,22 +8,28 @@ USRP Dual Source usrp_dual_source_x from grc_gnuradio import usrp as grc_usrp - grc_usrp.dual_source_$(type.fcn)( - number=$number, - frequency_a=$frequency_a, - frequency_b=$frequency_b, - decimation=$decimation, - gain_a=$gain_a, - gain_b=$gain_b, - mux=$mux, - auto_tr=$auto_tr, - rx_ant_a=$rx_ant_a, - rx_ant_b=$rx_ant_b, -) + grc_usrp.dual_source_$(type.fcn)(number=$number, 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') +self.$(id).set_decim_rate($decimation) +self.$(id).set_frequency_a($frequency_a, verbose=True) +self.$(id).set_frequency_b($frequency_b, verbose=True) +self.$(id).set_gain_a($gain_a) +self.$(id).set_gain_b($gain_b) +################################################## +## Flex RF A +################################################## +#if $auto_tr_a.eval and $rx_ant_a.flex +self.$(id).set_auto_tr_a($auto_tr_a) +#end if +################################################## +## Flex RF B +################################################## +#if $auto_tr_b.eval and $rx_ant_b.flex +self.$(id).set_auto_tr_b($auto_tr_b) +#end if set_decim_rate($decimation) set_frequency_a($frequency_a) - set_gain_a($gain_a) set_frequency_b($frequency_b) + set_gain_a($gain_a) set_gain_b($gain_b) Output Type @@ -46,6 +52,11 @@ 0 int + + Decimation + decimation + int + Frequency A frequency_a @@ -56,11 +67,6 @@ frequency_b real - - Decimation - decimation - int - Gain A gain_a @@ -71,77 +77,132 @@ gain_b real + - Mux - mux - 0x0 - hex - part + RX Antenna A + rx_ant_a + enum + + + + + - Auto T/R - auto_tr - None + Auto T/R A + auto_tr_a + enum - $auto_tr.hide + #if $rx_ant_a.flex then 'none' else 'all'# + - RX Antenna A - rx_ant_a - None + RX Antenna B + rx_ant_b enum - $rx_ant_a.hide + + - RX Antenna B - rx_ant_b - None + Auto T/R B + auto_tr_b + enum - $rx_ant_b.hide + #if $rx_ant_b.flex then 'none' else 'all'# @@ -155,13 +216,12 @@ The USRP source outputs 64 Megasamples per second / decimation. ---- Flex RF specific --- -The "Auto TR" and "RX Antenna" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board. +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. \ +All other boards use the "RXA" setting. -If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \ +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. - -The "Receive Antenna Setting" selects one of the SMA connectors as the data source. \ -By default, 'TX/RX' is selected. diff --git a/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml b/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml index 31d01c9bf..885aec852 100644 --- a/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml +++ b/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml @@ -8,16 +8,16 @@ USRP Sink usrp_simple_sink_x from grc_gnuradio import usrp as grc_usrp - grc_usrp.simple_sink_$(type.fcn)( - number=$number, - subdev_spec=$subdev_spec, - frequency=$frequency, - interpolation=$interpolation, - gain=$gain, - mux=$mux, - auto_tr=$auto_tr, - tx_enb=$tx_enb, -) + grc_usrp.simple_sink_$(type.fcn)(number=$number, side='$side') +self.$(id).set_interp_rate($interpolation) +self.$(id).set_frequency($frequency, verbose=True) +self.$(id).set_gain($gain) +#if $tx_enb.eval +self.$(id).set_enable($tx_enb) +#end if +#if $auto_tr.eval and $tx_enb.eval +self.$(id).set_auto_tr($auto_tr) +#end if set_interp_rate($interpolation) set_frequency($frequency) set_gain($gain) @@ -43,54 +43,43 @@ int - Subdev Spec - subdev_spec - auto - enum - - - + Interpolation + interpolation + int Frequency frequency real - - Interpolation - interpolation - int - Gain gain real - Mux - mux - 0x0 - hex - part + Side + side + A + enum + + - Auto T/R - auto_tr - None + TX Enable + tx_enb + enum - $auto_tr.hide + $tx_enb.hide - TX Enable - tx_enb - None + Auto T/R + auto_tr + enum - $tx_enb.hide + #if $tx_enb.eval then 'none' else 'all'# @@ -133,13 +119,10 @@ The USRP sink inputs 128 Megasamples per second / interpolation. ---- Flex RF specific --- -The "Auto TR" and "TX Enable" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board. +Flex RF boards only: The "Transmit Enable" configures the transmitter to be on or off. \ +Do not leave this unconfigured. -If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \ +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. - -The "Transmit Enable" configures the transmitter to be on or off. \ -Do not leave this unconfigured. diff --git a/grc/data/platforms/python/blocks/usrp_simple_source_x.xml b/grc/data/platforms/python/blocks/usrp_simple_source_x.xml index e537f700f..e1c43238a 100644 --- a/grc/data/platforms/python/blocks/usrp_simple_source_x.xml +++ b/grc/data/platforms/python/blocks/usrp_simple_source_x.xml @@ -8,16 +8,13 @@ USRP Source usrp_simple_source_x from grc_gnuradio import usrp as grc_usrp - grc_usrp.simple_source_$(type.fcn)( - number=$number, - subdev_spec=$subdev_spec, - frequency=$frequency, - decimation=$decimation, - gain=$gain, - mux=$mux, - auto_tr=$auto_tr, - rx_ant=$rx_ant, -) + grc_usrp.simple_source_$(type.fcn)(number=$number, side='$side', rx_ant='$rx_ant') +self.$(id).set_decim_rate($decimation) +self.$(id).set_frequency($frequency, verbose=True) +self.$(id).set_gain($gain) +#if $auto_tr.eval and $rx_ant.flex +self.$(id).set_auto_tr($auto_tr) +#end if set_decim_rate($decimation) set_frequency($frequency) set_gain($gain) @@ -43,95 +40,77 @@ int - Subdev Spec - subdev_spec - auto - enum - - - - - + Decimation + decimation + int Frequency frequency real - - Decimation - decimation - int - Gain gain real - Mux - mux - 0x0 - hex - part - - - Auto T/R - auto_tr - None + Side + side + A enum - $auto_tr.hide - RX Antenna rx_ant - None + RXA enum - $rx_ant.hide + + + + Auto T/R + auto_tr + + enum + #if $rx_ant.flex then 'none' else 'all'# + + + @@ -141,13 +120,12 @@ The USRP source outputs 64 Megasamples per second / decimation. ---- Flex RF specific --- -The "Auto TR" and "RX Antenna" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board. +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. \ +All other boards use the "RXA" setting. -If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \ +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. - -The "Receive Antenna Setting" selects one of the SMA connectors as the data source. \ -By default, 'TX/RX' is selected. -- cgit