diff options
Diffstat (limited to 'gr-serial/grc/serial.xml')
-rw-r--r-- | gr-serial/grc/serial.xml | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/gr-serial/grc/serial.xml b/gr-serial/grc/serial.xml new file mode 100644 index 000000000..239b4ae88 --- /dev/null +++ b/gr-serial/grc/serial.xml @@ -0,0 +1,110 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Add Block: +## all types, 1 output, 2 to inf inputs +################################################### + --> +<block> + <name>serial</name> + <key>gr_serial</key> + <category>serial</category> + + <import>from gnuradio import gr_ser</import> + <make>gr_ser.ser() +self.$(id).set_parameters($port, $baud, $bytesize, $parity, $stopbits) + </make> + <param> + <name>IO Type</name> + <key>type</key> + <type>enum</type> + <option><name>F32_F32</name><key>f32_f32</key></option> + <option><name>S32_S32</name><key>s32_s32</key></option> + <option><name>S16_S16</name><key>s16_s16</key></option> + <option><name>S8_S8</name><key>s8_s8</key></option> + </param> + <param> + <name>Num Inputs</name> + <key>num_inputs</key> + <value>1</value> + <type>int</type> + </param> + + <param> + <name>Vec Length</name> + <key>vlen</key> + <value>1</value> + <type>int</type> + </param> + + + <!-- Serial Port options --> + <param> + <name>Port</name> + <key>port</key> + <value>/dev/ttyUSB0</value> + <type>string</type> + </param> + + <param> + <name>Baud</name> + <key>baud</key> + <value>9600</value> + <type>int</type> + </param> + + <param> + <name>Byte Size</name> + <key>bytesize</key> + <value>8</value> + <type>int</type> + </param> + + <param> + <name>parity</name> + <key>parity</key> + <value>N</value> + <type>string</type> + </param> + + <param> + <name>Stop Bits</name> + <key>stopbits</key> + <value>1</value> + <type>int</type> + </param> + + + + + <!-- + Check if number of inputs are greater than 0, and if vector length + is greater than 0. + --> + <check>$num_inputs > 0</check> + <check>$vlen > 0</check> + + <sink> + <name>in</name> + <type>$(str($type).split('_')[0])</type> + <vlen>$vlen</vlen> + <nports>$num_inputs</nports> + </sink> + + <source> + <name>out</name> + <type>$(str($type).split('_')[1])</type> + <vlen>$vlen</vlen> + </source> + <doc> + +Generic Serial Block implemented using pyserial + +> Port +> Baud +> Byte Size +> Parity +> Stop Bits + + </doc> +</block> |