summaryrefslogtreecommitdiff
path: root/gr-serial/grc/serial.xml
blob: f63588d8e7b0493254864af9786f414b8f62e07c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?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.serial import gr_serial as gr_serial </import>
    <make>gr_serial.HierBlock($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 &gt; 0</check>
    <check>$vlen &gt; 0</check>
    
    <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>