Commit 4cbe368ff53524066bdbb36c5c005a18810bdbe9
1 parent
21598fce16
Exists in
master
move gr_rp_blocks
Showing 13 changed files with 0 additions and 1 deletions Inline Diff
- redpitaya/client/gr_add_const_set_offset.xml
- redpitaya/client/gr_nco_counter_send_conf.xml
- redpitaya/client/gr_rp_blocks/gr_add_const_set_offset.xml
- redpitaya/client/gr_rp_blocks/gr_nco_counter_send_conf.xml
- redpitaya/client/gr_rp_blocks/gr_source_test.xml
- redpitaya/client/gr_rp_blocks/gr_source_test.xml.old
- redpitaya/client/gr_rp_blocks/redpitaya_gnuradio.py
- redpitaya/client/gr_rp_blocks/redpitaya_gnuradio.pyc
- redpitaya/client/gr_source_test.xml
- redpitaya/client/gr_source_test.xml.old
- redpitaya/client/redpitaya_gnuradio.py
- redpitaya/client/redpitaya_gnuradio.pyc
- redpitaya/client/sourceme.bma
redpitaya/client/gr_add_const_set_offset.xml
<?xml version="1.0"?> | 1 | File was deleted | ||
<!-- | 2 | |||
# GNU Radio blocks for the Red Pitaya transceiver | 3 | |||
# Copyright (C) 2015 Renzo Davoli | 4 | |||
# | 5 | |||
# This program is free software; you can redistribute it and/or | 6 | |||
# modify it under the terms of the GNU General Public License | 7 | |||
# as published by the Free Software Foundation; either version 2 | 8 | |||
# of the License, or (at your option) any later version. | 9 | |||
# | 10 | |||
# This program is distributed in the hope that it will be useful, | 11 | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | |||
# GNU General Public License for more details. | 14 | |||
# | 15 | |||
# You should have received a copy of the GNU General Public License | 16 | |||
# along with this program; if not, write to the Free Software | 17 | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | |||
--> | 19 | |||
<block> | 20 | |||
<name>add_const_set_offset</name> | 21 | |||
<key>add_const_set_offset</key> | 22 | |||
<category>Red Pitaya</category> | 23 | |||
<import>import redpitaya_gnuradio</import> | 24 | |||
<make>redpitaya_gnuradio.add_const_set_offset( | 25 | |||
addr=$addr, | 26 | |||
port=$port, | 27 | |||
device=$device, | 28 | |||
const=$const, | 29 | |||
) | 30 | |||
</make> | 31 | |||
<callback>set_const(device=$device, const=$const)</callback> | 32 | |||
<param> | 33 | |||
<name>Address</name> | 34 | |||
<key>addr</key> | 35 | |||
<value>192.168.0.201</value> | 36 | |||
<type>string</type> | 37 | |||
</param> | 38 | |||
<param> | 39 | |||
<name>Port</name> | 40 | |||
<key>port</key> | 41 | |||
<value>1001</value> | 42 | |||
<type>int</type> | 43 | |||
</param> | 44 | |||
<param> | 45 | |||
<name>Device</name> | 46 | |||
<key>device</key> | 47 | |||
<value>/dev/add_const_0</value> | 48 | |||
<type>string</type> | 49 | |||
</param> | 50 | |||
<param> | 51 | |||
<name>Constant</name> | 52 | |||
<key>const</key> | 53 | |||
<value>0</value> | 54 | |||
<type>int</type> | 55 | |||
</param> | 56 | |||
</block> | 57 |
redpitaya/client/gr_nco_counter_send_conf.xml
<?xml version="1.0"?> | 1 | File was deleted | ||
<!-- | 2 | |||
# GNU Radio blocks for the Red Pitaya transceiver | 3 | |||
# Copyright (C) 2015 Renzo Davoli | 4 | |||
# | 5 | |||
# This program is free software; you can redistribute it and/or | 6 | |||
# modify it under the terms of the GNU General Public License | 7 | |||
# as published by the Free Software Foundation; either version 2 | 8 | |||
# of the License, or (at your option) any later version. | 9 | |||
# | 10 | |||
# This program is distributed in the hope that it will be useful, | 11 | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | |||
# GNU General Public License for more details. | 14 | |||
# | 15 | |||
# You should have received a copy of the GNU General Public License | 16 | |||
# along with this program; if not, write to the Free Software | 17 | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | |||
--> | 19 | |||
<block> | 20 | |||
<name>nco_counter_send_conf</name> | 21 | |||
<key>nco_counter_send_conf</key> | 22 | |||
<category>Red Pitaya</category> | 23 | |||
<import>import redpitaya_gnuradio</import> | 24 | |||
<make>redpitaya_gnuradio.nco_counter_send_conf( | 25 | |||
addr=$addr, | 26 | |||
port=$port, | 27 | |||
device=$device, | 28 | |||
freq_ref=$freq_ref, | 29 | |||
freq_dds=$freq_dds, | 30 | |||
acc_size=$acc_size, | 31 | |||
offset=$offset, | 32 | |||
pinc_sw=$pinc_sw, | 33 | |||
poff_sw=$poff_sw, | 34 | |||
) | 35 | |||
</make> | 36 | |||
<callback>set_nco(device=$device, freq_ref=$freq_ref, freq_dds=$freq_dds, acc_size=$acc_size, offset=$offset, pinc_sw=$pinc_sw, poff_sw=$poff_sw)</callback> | 37 | |||
<param> | 38 | |||
<name>Address</name> | 39 | |||
<key>addr</key> | 40 | |||
<value>192.168.0.201</value> | 41 | |||
<type>string</type> | 42 | |||
</param> | 43 | |||
<param> | 44 | |||
<name>Port</name> | 45 | |||
<key>port</key> | 46 | |||
<value>1001</value> | 47 | |||
<type>int</type> | 48 | |||
</param> | 49 | |||
<param> | 50 | |||
<name>Device</name> | 51 | |||
<key>device</key> | 52 | |||
<value>/dev/dds1</value> | 53 | |||
<type>string</type> | 54 | |||
</param> | 55 | |||
<param> | 56 | |||
<name>Frequency ref</name> | 57 | |||
<key>freq_ref</key> | 58 | |||
<value>125000000</value> | 59 | |||
<type>int</type> | 60 | |||
</param> | 61 | |||
<param> | 62 | |||
<name>Frequency DDS</name> | 63 | |||
<key>freq_dds</key> | 64 | |||
<value>0</value> | 65 | |||
<type>int</type> | 66 | |||
</param> | 67 | |||
<param> | 68 | |||
<name>Accumulator size</name> | 69 | |||
<key>acc_size</key> | 70 | |||
<value>32</value> | 71 | |||
<type>int</type> | 72 | |||
</param> | 73 | |||
<param> | 74 | |||
<name>Offset</name> | 75 | |||
<key>offset</key> | 76 | |||
<value>0</value> | 77 | |||
<type>int</type> | 78 | |||
</param> | 79 | |||
<param> | 80 | |||
<name>Pinc SW</name> | 81 | |||
<key>pinc_sw</key> | 82 | |||
<value>1</value> | 83 | |||
<type>int</type> | 84 | |||
</param> | 85 | |||
<param> | 86 | |||
<name>Poff SW</name> | 87 | |||
<key>poff_sw</key> | 88 | |||
<value>1</value> | 89 | |||
<type>int</type> | 90 | |||
</param> | 91 | |||
</block> | 92 |
redpitaya/client/gr_rp_blocks/gr_add_const_set_offset.xml
File was created | 1 | <?xml version="1.0"?> | ||
2 | <!-- | |||
3 | # GNU Radio blocks for the Red Pitaya transceiver | |||
4 | # Copyright (C) 2015 Renzo Davoli | |||
5 | # | |||
6 | # This program is free software; you can redistribute it and/or | |||
7 | # modify it under the terms of the GNU General Public License | |||
8 | # as published by the Free Software Foundation; either version 2 | |||
9 | # of the License, or (at your option) any later version. | |||
10 | # | |||
11 | # This program is distributed in the hope that it will be useful, | |||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
14 | # GNU General Public License for more details. | |||
15 | # | |||
16 | # You should have received a copy of the GNU General Public License | |||
17 | # along with this program; if not, write to the Free Software | |||
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
19 | --> | |||
20 | <block> | |||
21 | <name>add_const_set_offset</name> | |||
22 | <key>add_const_set_offset</key> | |||
23 | <category>Red Pitaya</category> | |||
24 | <import>import redpitaya_gnuradio</import> | |||
25 | <make>redpitaya_gnuradio.add_const_set_offset( | |||
26 | addr=$addr, | |||
27 | port=$port, | |||
28 | device=$device, | |||
29 | const=$const, | |||
30 | ) | |||
31 | </make> | |||
32 | <callback>set_const(device=$device, const=$const)</callback> | |||
33 | <param> | |||
34 | <name>Address</name> | |||
35 | <key>addr</key> | |||
36 | <value>192.168.0.201</value> | |||
37 | <type>string</type> | |||
38 | </param> | |||
39 | <param> | |||
40 | <name>Port</name> | |||
41 | <key>port</key> | |||
42 | <value>1001</value> | |||
43 | <type>int</type> | |||
44 | </param> | |||
45 | <param> | |||
46 | <name>Device</name> | |||
47 | <key>device</key> | |||
48 | <value>/dev/add_const_0</value> | |||
49 | <type>string</type> | |||
50 | </param> | |||
51 | <param> | |||
52 | <name>Constant</name> | |||
53 | <key>const</key> | |||
54 | <value>0</value> | |||
55 | <type>int</type> | |||
56 | </param> | |||
57 | </block> |
redpitaya/client/gr_rp_blocks/gr_nco_counter_send_conf.xml
File was created | 1 | <?xml version="1.0"?> | ||
2 | <!-- | |||
3 | # GNU Radio blocks for the Red Pitaya transceiver | |||
4 | # Copyright (C) 2015 Renzo Davoli | |||
5 | # | |||
6 | # This program is free software; you can redistribute it and/or | |||
7 | # modify it under the terms of the GNU General Public License | |||
8 | # as published by the Free Software Foundation; either version 2 | |||
9 | # of the License, or (at your option) any later version. | |||
10 | # | |||
11 | # This program is distributed in the hope that it will be useful, | |||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
14 | # GNU General Public License for more details. | |||
15 | # | |||
16 | # You should have received a copy of the GNU General Public License | |||
17 | # along with this program; if not, write to the Free Software | |||
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
19 | --> | |||
20 | <block> | |||
21 | <name>nco_counter_send_conf</name> | |||
22 | <key>nco_counter_send_conf</key> | |||
23 | <category>Red Pitaya</category> | |||
24 | <import>import redpitaya_gnuradio</import> | |||
25 | <make>redpitaya_gnuradio.nco_counter_send_conf( | |||
26 | addr=$addr, | |||
27 | port=$port, | |||
28 | device=$device, | |||
29 | freq_ref=$freq_ref, | |||
30 | freq_dds=$freq_dds, | |||
31 | acc_size=$acc_size, | |||
32 | offset=$offset, | |||
33 | pinc_sw=$pinc_sw, | |||
34 | poff_sw=$poff_sw, | |||
35 | ) | |||
36 | </make> | |||
37 | <callback>set_nco(device=$device, freq_ref=$freq_ref, freq_dds=$freq_dds, acc_size=$acc_size, offset=$offset, pinc_sw=$pinc_sw, poff_sw=$poff_sw)</callback> | |||
38 | <param> | |||
39 | <name>Address</name> | |||
40 | <key>addr</key> | |||
41 | <value>192.168.0.201</value> | |||
42 | <type>string</type> | |||
43 | </param> | |||
44 | <param> | |||
45 | <name>Port</name> | |||
46 | <key>port</key> | |||
47 | <value>1001</value> | |||
48 | <type>int</type> | |||
49 | </param> | |||
50 | <param> | |||
51 | <name>Device</name> | |||
52 | <key>device</key> | |||
53 | <value>/dev/dds1</value> | |||
54 | <type>string</type> | |||
55 | </param> | |||
56 | <param> | |||
57 | <name>Frequency ref</name> | |||
58 | <key>freq_ref</key> | |||
59 | <value>125000000</value> | |||
60 | <type>int</type> | |||
61 | </param> | |||
62 | <param> | |||
63 | <name>Frequency DDS</name> | |||
64 | <key>freq_dds</key> | |||
65 | <value>0</value> | |||
66 | <type>int</type> | |||
67 | </param> | |||
68 | <param> | |||
69 | <name>Accumulator size</name> | |||
70 | <key>acc_size</key> | |||
71 | <value>32</value> | |||
72 | <type>int</type> | |||
73 | </param> | |||
74 | <param> | |||
75 | <name>Offset</name> | |||
76 | <key>offset</key> | |||
77 | <value>0</value> | |||
78 | <type>int</type> | |||
79 | </param> | |||
80 | <param> | |||
81 | <name>Pinc SW</name> | |||
82 | <key>pinc_sw</key> | |||
83 | <value>1</value> | |||
84 | <type>int</type> | |||
85 | </param> | |||
86 | <param> | |||
87 | <name>Poff SW</name> | |||
88 | <key>poff_sw</key> | |||
89 | <value>1</value> | |||
90 | <type>int</type> | |||
91 | </param> | |||
92 | </block> |
redpitaya/client/gr_rp_blocks/gr_source_test.xml
File was created | 1 | <?xml version="1.0"?> | ||
2 | <!-- | |||
3 | # GNU Radio blocks for the Red Pitaya transceiver | |||
4 | # Copyright (C) 2015 Renzo Davoli | |||
5 | # | |||
6 | # This program is free software; you can redistribute it and/or | |||
7 | # modify it under the terms of the GNU General Public License | |||
8 | # as published by the Free Software Foundation; either version 2 | |||
9 | # of the License, or (at your option) any later version. | |||
10 | # | |||
11 | # This program is distributed in the hope that it will be useful, | |||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
14 | # GNU General Public License for more details. | |||
15 | # | |||
16 | # You should have received a copy of the GNU General Public License | |||
17 | # along with this program; if not, write to the Free Software | |||
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
19 | --> | |||
20 | <block> | |||
21 | <name>source_test</name> | |||
22 | <key>source_test</key> | |||
23 | <category>Red Pitaya</category> | |||
24 | <import>import redpitaya_gnuradio</import> | |||
25 | <make>redpitaya_gnuradio.source_test()</make> | |||
26 | <source> | |||
27 | <name>out</name> | |||
28 | <type>complex</type> | |||
29 | </source> | |||
30 | </block> |
redpitaya/client/gr_rp_blocks/gr_source_test.xml.old
File was created | 1 | <?xml version="1.0"?> | ||
2 | <!-- | |||
3 | # GNU Radio blocks for the Red Pitaya transceiver | |||
4 | # Copyright (C) 2015 Renzo Davoli | |||
5 | # | |||
6 | # This program is free software; you can redistribute it and/or | |||
7 | # modify it under the terms of the GNU General Public License | |||
8 | # as published by the Free Software Foundation; either version 2 | |||
9 | # of the License, or (at your option) any later version. | |||
10 | # | |||
11 | # This program is distributed in the hope that it will be useful, | |||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
14 | # GNU General Public License for more details. | |||
15 | # | |||
16 | # You should have received a copy of the GNU General Public License | |||
17 | # along with this program; if not, write to the Free Software | |||
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
19 | --> | |||
20 | <block> | |||
21 | <name>source_test</name> | |||
22 | <key>source_test</key> | |||
23 | <category>Red Pitaya</category> | |||
24 | <import>import redpitaya_gnuradio</import> | |||
25 | <make>redpitaya_gnuradio.source_test()</make> | |||
26 | <source> | |||
27 | <name>out</name> | |||
28 | <type>complex</type> | |||
29 | </source> | |||
30 | </block> |
redpitaya/client/gr_rp_blocks/redpitaya_gnuradio.py
File was created | 1 | #!/usr/bin/env python | ||
2 | ||||
3 | # GNU Radio blocks for the Red Pitaya transceiver | |||
4 | # Copyright (C) 2015 Renzo Davoli | |||
5 | # | |||
6 | # This program is free software; you can redistribute it and/or | |||
7 | # modify it under the terms of the GNU General Public License | |||
8 | # as published by the Free Software Foundation; either version 2 | |||
9 | # of the License, or (at your option) any later version. | |||
10 | # | |||
11 | # This program is distributed in the hope that it will be useful, | |||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
14 | # GNU General Public License for more details. | |||
15 | # | |||
16 | # You should have received a copy of the GNU General Public License | |||
17 | # along with this program; if not, write to the Free Software | |||
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
19 | ||||
20 | import socket, os | |||
21 | from gnuradio import gr, blocks | |||
22 | ||||
23 | class add_const_set_offset(gr.hier_block2): | |||
24 | def __init__(self, addr, port, device, const): | |||
25 | self.name = "add_const_set_offset" | |||
26 | gr.hier_block2.__init__( | |||
27 | self, | |||
28 | name = self.name, | |||
29 | input_signature = gr.io_signature(0, 0, 0), | |||
30 | output_signature = gr.io_signature(0, 0, 0) | |||
31 | ) | |||
32 | self.ctrl_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |||
33 | self.ctrl_sock.connect((addr, port)) | |||
34 | self.set_const(device, const) | |||
35 | ||||
36 | def set_const(self, device, const): | |||
37 | self.ctrl_sock.send('%s;%s;%i\n'%(self.name, device, const)) | |||
38 | ||||
39 | ||||
40 | class nco_counter_send_conf(gr.hier_block2): | |||
41 | def __init__(self, addr, port, device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw): | |||
42 | self.name = "nco_counter_send_conf" | |||
43 | gr.hier_block2.__init__( | |||
44 | self, | |||
45 | name = self.name, | |||
46 | input_signature = gr.io_signature(0, 0, 0), | |||
47 | output_signature = gr.io_signature(0, 0, 0) | |||
48 | ) | |||
49 | self.ctrl_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |||
50 | self.ctrl_sock.connect((addr, port)) | |||
51 | self.set_nco(device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw) | |||
52 | ||||
53 | def set_nco(self, device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw): | |||
54 | self.ctrl_sock.send('%s;%s;%i;%i;%i;%i;%i;%i\n'%(self.name, device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw)) | |||
55 | ||||
56 | '''~ | |||
57 | class source_test(gr.hier_block2): | |||
58 | def __init__(self): | |||
59 | self.name = "source_test" | |||
60 | gr.hier_block2.__init__( | |||
61 | self, | |||
62 | name = self.name, | |||
63 | input_signature = gr.io_signature(0, 0, 0), |
redpitaya/client/gr_rp_blocks/redpitaya_gnuradio.pyc
No preview for this file type
redpitaya/client/gr_source_test.xml
<?xml version="1.0"?> | 1 | File was deleted | ||
<!-- | 2 | |||
# GNU Radio blocks for the Red Pitaya transceiver | 3 | |||
# Copyright (C) 2015 Renzo Davoli | 4 | |||
# | 5 | |||
# This program is free software; you can redistribute it and/or | 6 | |||
# modify it under the terms of the GNU General Public License | 7 | |||
# as published by the Free Software Foundation; either version 2 | 8 | |||
# of the License, or (at your option) any later version. | 9 | |||
# | 10 | |||
# This program is distributed in the hope that it will be useful, | 11 | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | |||
# GNU General Public License for more details. | 14 | |||
# | 15 | |||
# You should have received a copy of the GNU General Public License | 16 | |||
# along with this program; if not, write to the Free Software | 17 | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | |||
--> | 19 | |||
<block> | 20 | |||
<name>source_test</name> | 21 | |||
<key>source_test</key> | 22 | |||
<category>Red Pitaya</category> | 23 | |||
<import>import redpitaya_gnuradio</import> | 24 | |||
<make>redpitaya_gnuradio.source_test()</make> | 25 | |||
<source> | 26 | |||
<name>out</name> | 27 | |||
<type>complex</type> | 28 | |||
</source> | 29 | |||
</block> | 30 |
redpitaya/client/gr_source_test.xml.old
<?xml version="1.0"?> | 1 | File was deleted | ||
<!-- | 2 | |||
# GNU Radio blocks for the Red Pitaya transceiver | 3 | |||
# Copyright (C) 2015 Renzo Davoli | 4 | |||
# | 5 | |||
# This program is free software; you can redistribute it and/or | 6 | |||
# modify it under the terms of the GNU General Public License | 7 | |||
# as published by the Free Software Foundation; either version 2 | 8 | |||
# of the License, or (at your option) any later version. | 9 | |||
# | 10 | |||
# This program is distributed in the hope that it will be useful, | 11 | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | |||
# GNU General Public License for more details. | 14 | |||
# | 15 | |||
# You should have received a copy of the GNU General Public License | 16 | |||
# along with this program; if not, write to the Free Software | 17 | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | |||
--> | 19 | |||
<block> | 20 | |||
<name>source_test</name> | 21 | |||
<key>source_test</key> | 22 | |||
<category>Red Pitaya</category> | 23 | |||
<import>import redpitaya_gnuradio</import> | 24 | |||
<make>redpitaya_gnuradio.source_test()</make> | 25 | |||
<source> | 26 | |||
<name>out</name> | 27 | |||
<type>complex</type> | 28 | |||
</source> | 29 | |||
</block> | 30 |
redpitaya/client/redpitaya_gnuradio.py
#!/usr/bin/env python | 1 | File was deleted | ||
2 | ||||
# GNU Radio blocks for the Red Pitaya transceiver | 3 | |||
# Copyright (C) 2015 Renzo Davoli | 4 | |||
# | 5 | |||
# This program is free software; you can redistribute it and/or | 6 | |||
# modify it under the terms of the GNU General Public License | 7 | |||
# as published by the Free Software Foundation; either version 2 | 8 | |||
# of the License, or (at your option) any later version. | 9 | |||
# | 10 | |||
# This program is distributed in the hope that it will be useful, | 11 | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | |||
# GNU General Public License for more details. | 14 | |||
# | 15 | |||
# You should have received a copy of the GNU General Public License | 16 | |||
# along with this program; if not, write to the Free Software | 17 | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | |||
19 | ||||
import socket, os | 20 | |||
from gnuradio import gr, blocks | 21 | |||
22 | ||||
class add_const_set_offset(gr.hier_block2): | 23 | |||
def __init__(self, addr, port, device, const): | 24 | |||
self.name = "add_const_set_offset" | 25 | |||
gr.hier_block2.__init__( | 26 | |||
self, | 27 | |||
name = self.name, | 28 | |||
input_signature = gr.io_signature(0, 0, 0), | 29 | |||
output_signature = gr.io_signature(0, 0, 0) | 30 | |||
) | 31 | |||
self.ctrl_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | 32 | |||
self.ctrl_sock.connect((addr, port)) | 33 | |||
self.set_const(device, const) | 34 | |||
35 | ||||
def set_const(self, device, const): | 36 | |||
self.ctrl_sock.send('%s;%s;%i\n'%(self.name, device, const)) | 37 | |||
38 | ||||
39 | ||||
class nco_counter_send_conf(gr.hier_block2): | 40 | |||
def __init__(self, addr, port, device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw): | 41 | |||
self.name = "nco_counter_send_conf" | 42 | |||
gr.hier_block2.__init__( | 43 | |||
self, | 44 | |||
name = self.name, | 45 | |||
input_signature = gr.io_signature(0, 0, 0), | 46 | |||
output_signature = gr.io_signature(0, 0, 0) | 47 | |||
) | 48 | |||
self.ctrl_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | 49 | |||
self.ctrl_sock.connect((addr, port)) | 50 | |||
self.set_nco(device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw) | 51 | |||
52 | ||||
def set_nco(self, device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw): | 53 | |||
self.ctrl_sock.send('%s;%s;%i;%i;%i;%i;%i;%i\n'%(self.name, device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw)) | 54 | |||
55 | ||||
'''~ | 56 | |||
class source_test(gr.hier_block2): | 57 | |||
def __init__(self): | 58 | |||
self.name = "source_test" | 59 | |||
gr.hier_block2.__init__( | 60 | |||
self, | 61 | |||
name = self.name, | 62 | |||
input_signature = gr.io_signature(0, 0, 0), | 63 |
redpitaya/client/redpitaya_gnuradio.pyc
No preview for this file type
redpitaya/client/sourceme.bma
export GRC_BLOCKS_PATH=. | 1 | File was deleted |