Commit 4cbe368ff53524066bdbb36c5c005a18810bdbe9
1 parent
21598fce16
Exists in
master
move gr_rp_blocks
Showing 13 changed files with 0 additions and 1 deletions Side-by-side 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
| 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_nco_counter_send_conf.xml
| 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_add_const_set_offset.xml
| 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
| 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
| 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
| 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
| 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), | |
| 64 | + output_signature = gr.io_signature(1, 1, gr.sizeof_gr_complex) | |
| 65 | + ) | |
| 66 | + self.data_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| 67 | + self.data_sock.connect((addr, port)) | |
| 68 | + self.data_sock.send('%s'%self.name) | |
| 69 | + fd = os.dup(self.data_sock.fileno()) | |
| 70 | + self.connect(blocks.file_descriptor_source(gr.sizeof_gr_complex, fd), self) | |
| 71 | +''' |
redpitaya/client/gr_rp_blocks/redpitaya_gnuradio.pyc
No preview for this file type
redpitaya/client/gr_source_test.xml
| 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_source_test.xml.old
| 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/redpitaya_gnuradio.py
| 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), | |
| 64 | - output_signature = gr.io_signature(1, 1, gr.sizeof_gr_complex) | |
| 65 | - ) | |
| 66 | - self.data_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| 67 | - self.data_sock.connect((addr, port)) | |
| 68 | - self.data_sock.send('%s'%self.name) | |
| 69 | - fd = os.dup(self.data_sock.fileno()) | |
| 70 | - self.connect(blocks.file_descriptor_source(gr.sizeof_gr_complex, fd), self) | |
| 71 | -''' |
redpitaya/client/redpitaya_gnuradio.pyc
No preview for this file type
redpitaya/client/sourceme.bma
| 1 | -export GRC_BLOCKS_PATH=. |