diff options
author | manojgudi | 2014-01-30 22:34:00 +0530 |
---|---|---|
committer | manojgudi | 2014-01-30 22:34:00 +0530 |
commit | 324438b65f3a2c58227fb0a304ba36e57a8a1b01 (patch) | |
tree | 2cd40921235623f49b13a35f411559e49da30e82 /gr-serial/grc | |
parent | a92e4f37be9dfb28ad8eb92969d80067f4281864 (diff) | |
download | gnuradio-324438b65f3a2c58227fb0a304ba36e57a8a1b01.tar.gz gnuradio-324438b65f3a2c58227fb0a304ba36e57a8a1b01.tar.bz2 gnuradio-324438b65f3a2c58227fb0a304ba36e57a8a1b01.zip |
gr-serial block
Diffstat (limited to 'gr-serial/grc')
-rw-r--r-- | gr-serial/grc/CMakeLists.txt | 24 | ||||
-rw-r--r-- | gr-serial/grc/serial.xml | 110 |
2 files changed, 134 insertions, 0 deletions
diff --git a/gr-serial/grc/CMakeLists.txt b/gr-serial/grc/CMakeLists.txt new file mode 100644 index 000000000..89e6e9ce7 --- /dev/null +++ b/gr-serial/grc/CMakeLists.txt @@ -0,0 +1,24 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +install(FILES + serial.xml + DESTINATION ${GRC_BLOCKS_DIR} + COMPONENT "serial_python" +) 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> |