summaryrefslogtreecommitdiff
path: root/gr-uhd/grc/gen_uhd_usrp_blocks.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-09-07 09:50:10 -0700
committerMartin Braun <martin.braun@ettus.com>2015-09-07 10:10:01 -0700
commitc0bd17b4279f4b8f8ab71acf89418ff955827b4d (patch)
tree55143c9dba93f571d8a9b907a81d308362c7e401 /gr-uhd/grc/gen_uhd_usrp_blocks.py
parent2de30034b054d942a6d58fbabb0d3b9bfc05704a (diff)
Revert "Revert "uhd: Rearranged GRC bindings for USRP blocks""
This reverts commit 5d29a17c12d19ebc5f4494b8ae1be77568b235e7. Well, also fixes a bug where older FGs would throw a template error.
Diffstat (limited to 'gr-uhd/grc/gen_uhd_usrp_blocks.py')
-rw-r--r--gr-uhd/grc/gen_uhd_usrp_blocks.py115
1 files changed, 104 insertions, 11 deletions
diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py
index 72f1b50135..41938574b7 100644
--- a/gr-uhd/grc/gen_uhd_usrp_blocks.py
+++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py
@@ -81,6 +81,14 @@ self.\$(id).set_antenna(\$ant$(n), $n)
\#if \$bw$(n)()
self.\$(id).set_bandwidth(\$bw$(n), $n)
\#end if
+#if $sourk == 'source'
+ \#if \$dc_offs_enb$(n)()
+self.\$(id).set_rx_dc_offset(\$dc_offs_enb$(n), $n)
+ \#end if
+ \#if \$iq_imbal_enb$(n)()
+self.\$(id).set_rx_iq_balance(\$iq_imbal_enb$(n), $n)
+ \#end if
+#end if
\#end if
#end for
</make>
@@ -92,7 +100,7 @@ self.\$(id).set_normalized_gain(\$gain$(n), $n)
\#else
self.\$(id).set_gain(\$gain$(n), $n)
\#end if
-</callback>
+ </callback>
<callback>set_antenna(\$ant$(n), $n)</callback>
<callback>set_bandwidth(\$bw$(n), $n)</callback>
#end for
@@ -137,6 +145,10 @@ self.\$(id).set_gain(\$gain$(n), $n)
<key>sc16</key>
</option>
<option>
+ <name>Complex int12</name>
+ <key>sc12</key>
+ </option>
+ <option>
<name>Complex int8</name>
<key>sc8</key>
</option>
@@ -226,6 +238,22 @@ self.\$(id).set_gain(\$gain$(n), $n)
<name>Default</name>
<key>0.0</key>
</option>
+ <option>
+ <name>200 MHz</name>
+ <key>200e6</key>
+ </option>
+ <option>
+ <name>184.32 MHz</name>
+ <key>184.32e6</key>
+ </option>
+ <option>
+ <name>120 MHz</name>
+ <key>120e6</key>
+ </option>
+ <option>
+ <name>30.72 MHz</name>
+ <key>30.72e6</key>
+ </option>
</param>
<param>
<name>Num Mboards</name>
@@ -327,7 +355,8 @@ self.\$(id).set_gain(\$gain$(n), $n)
<sink>
<name>command</name>
<type>message</type>
- <optional>1</optional>
+ <optional>1</optional>
+ <hide>\$hide_cmd_port</hide>
</sink>
<$sourk>
<name>$direction</name>
@@ -413,20 +442,21 @@ http://code.ettus.com/redmine/ettus/projects/uhd/wiki
</block>
"""
-PARAMS_TMPL = """
- <param>
+PARAMS_TMPL = """ <param>
<name>Ch$(n): Center Freq (Hz)</name>
<key>center_freq$(n)</key>
<value>0</value>
<type>real</type>
<hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
+ <tab>RF Options</tab>
</param>
<param>
- <name>Ch$(n): Gain Value</name>
+ <name>Ch$(n): Gain Value</name>
<key>gain$(n)</key>
<value>0</value>
<type>float</type>
<hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
+ <tab>RF Options</tab>
</param>
<param>
<name>Ch$(n): Gain Type</name>
@@ -448,6 +478,7 @@ PARAMS_TMPL = """
<name>Normalized</name>
<key>True</key>
</option>
+ <tab>RF Options</tab>
</param>
<param>
<name>Ch$(n): Antenna</name>
@@ -463,6 +494,17 @@ PARAMS_TMPL = """
part
\#end if
</hide>
+#if $sourk == 'sink'
+ <option>
+ <name>TX/RX</name>
+ <key>TX/RX</key>
+ </option>
+#end if
+ <option>
+ <name>RX2</name>
+ <key>RX2</key>
+ </option>
+ <tab>RF Options</tab>
</param>
<param>
<name>Ch$(n): Bandwidth (Hz)</name>
@@ -478,18 +520,68 @@ PARAMS_TMPL = """
part
\#end if
</hide>
+ <tab>RF Options</tab>
+ </param>
+#if $sourk == 'source'
+ <param>
+ <name>Ch$(n): Enable DC Offset Correction</name>
+ <key>dc_offs_enb$(n)</key>
+ <value>""</value>
+ <type>raw</type>
+ <hide>
+ \#if not \$nchan() > $n
+ all
+ \#else
+ part
+ \#end if
+ </hide>
+ <tab>FE Corrections</tab>
+ </param>
+ <param>
+ <name>Ch$(n): Enable IQ Imbalance Correction</name>
+ <key>iq_imbal_enb$(n)</key>
+ <value>""</value>
+ <type>raw</type>
+ <hide>
+ \#if not \$nchan() > $n
+ all
+ \#else
+ part
+ \#end if
+ </hide>
+ <tab>FE Corrections</tab>
+ </param>
+#end if
+"""
+
+SHOW_CMD_PORT_PARAM = """
+ <param>
+ <name>Show Command Port</name>
+ <key>hide_cmd_port</key>
+ <value>False</value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Yes</name>
+ <key>False</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>True</key>
+ </option>
+ <tab>Advanced</tab>
</param>
"""
-LENTAG_PARAM = """ <param>
- <name>Length tag name</name>
+TSBTAG_PARAM = """ <param>
+ <name>TSB tag name</name>
<key>len_tag_name</key>
<value></value>
<type>string</type>
<hide>\#if len(str(\$len_tag_name())) then 'none' else 'part'#</hide>
</param>"""
-LENTAG_ARG = """
+TSBTAG_ARG = """
#if $len_tag_name()
$len_tag_name,
#end if"""
@@ -512,10 +604,11 @@ if __name__ == '__main__':
direction = 'in'
else: raise Exception, 'is %s a source or sink?'%file
- params = ''.join([parse_tmpl(PARAMS_TMPL, n=n) for n in range(max_num_channels)])
+ params = ''.join([parse_tmpl(PARAMS_TMPL, n=n, sourk=sourk) for n in range(max_num_channels)])
+ params += SHOW_CMD_PORT_PARAM
if sourk == 'sink':
- params += LENTAG_PARAM
- lentag_arg = LENTAG_ARG
+ params += TSBTAG_PARAM
+ lentag_arg = TSBTAG_ARG
else: lentag_arg = ''
open(file, 'w').write(parse_tmpl(MAIN_TMPL,
lentag_arg=lentag_arg,