GNU Radio C++ API Reference: fmcomms2_sink.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
fmcomms2_sink.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2014 Analog Devices Inc.
4 * Author: Paul Cercueil <paul.cercueil@analog.com>
5 *
6 * SPDX-License-Identifier: GPL-3.0-or-later
7 *
8 */
9
10
11#ifndef INCLUDED_IIO_FMCOMMS2_SINK_H
12#define INCLUDED_IIO_FMCOMMS2_SINK_H
13
14#include <gnuradio/hier_block2.h>
15#include <gnuradio/iio/api.h>
16#include <gnuradio/sync_block.h>
17
18#include "device_sink.h"
19
20namespace gr {
21namespace iio {
22
23/*!
24 * \brief Device specific sink for FMComms evaluation cards
25 * \ingroup iio
26 *
27 * \details
28 * This block is a sink specifically designed for FMComms2/3/4 evaluation
29 * cards. However, it should support any AD936x based device using an IIO
30 * driver.
31 */
32
33template <typename T>
34 class IIO_API fmcomms2_sink : virtual public gr::sync_block
35{
36public:
37 typedef std::shared_ptr<fmcomms2_sink<T>> sptr;
38
39 static sptr make(const std::string& uri,
40 const std::vector<bool>& ch_en,
41 unsigned long buffer_size,
42 bool cyclic);
43
44 /*!
45 * The key of the tag that indicates packet length.
46 * When not empty, samples are expected as "packets" and
47 * must be tagged as such, i.e. the first sample of a packet needs to be
48 * tagged with the corresponding length of that packet.
49 * Note, packet size MUST be equal to buffer_size / (1+interpolation),
50 * otherwise a runtime_error will be thrown. This is a deliberate design
51 * choice, because all other options would result in potentially unexpected
52 * behavior.
53 */
54 virtual void set_len_tag_key(const std::string& val = "") = 0;
55
56 virtual void set_bandwidth(unsigned long bandwidth) = 0;
57 virtual void set_rf_port_select(const std::string& rf_port_select) = 0;
58 virtual void set_frequency(double frequency) = 0;
59 virtual void set_samplerate(unsigned long samplerate) = 0;
60 virtual void set_attenuation(size_t chan, double gain) = 0;
61 virtual void set_filter_params(const std::string& filter_source,
62 const std::string& filter_filename = "",
63 float fpass = 0.0,
64 float fstop = 0.0) = 0;
65};
66
67 typedef fmcomms2_sink<int16_t> fmcomms2_sink_s;
68 typedef fmcomms2_sink<std::complex<int16_t>> fmcomms2_sink_sc16;
69 typedef fmcomms2_sink<gr_complex> fmcomms2_sink_fc32;
70
71} // namespace iio
72} // namespace gr
73
74#endif /* INCLUDED_IIO_FMCOMMS2_SINK_H */
gr::iio::fmcomms2_sink
Device specific sink for FMComms evaluation cards.
Definition fmcomms2_sink.h:35
gr::iio::fmcomms2_sink::set_len_tag_key
virtual void set_len_tag_key(const std::string &val="")=0
gr::iio::fmcomms2_sink::set_rf_port_select
virtual void set_rf_port_select(const std::string &rf_port_select)=0
gr::iio::fmcomms2_sink::sptr
std::shared_ptr< fmcomms2_sink< T > > sptr
Definition fmcomms2_sink.h:37
gr::iio::fmcomms2_sink::set_filter_params
virtual void set_filter_params(const std::string &filter_source, const std::string &filter_filename="", float fpass=0.0, float fstop=0.0)=0
gr::iio::fmcomms2_sink::set_samplerate
virtual void set_samplerate(unsigned long samplerate)=0
gr::iio::fmcomms2_sink::set_bandwidth
virtual void set_bandwidth(unsigned long bandwidth)=0
gr::iio::fmcomms2_sink::set_frequency
virtual void set_frequency(double frequency)=0
gr::iio::fmcomms2_sink::set_attenuation
virtual void set_attenuation(size_t chan, double gain)=0
gr::iio::fmcomms2_sink::make
static sptr make(const std::string &uri, const std::vector< bool > &ch_en, unsigned long buffer_size, bool cyclic)
gr::sync_block
synchronous 1:1 input to output with history
Definition sync_block.h:26
device_sink.h
api.h
IIO_API
#define IIO_API
Definition gr-iio/include/gnuradio/iio/api.h:18
hier_block2.h
gr::iio
Definition attr_sink.h:19
gr::iio::fmcomms2_sink_fc32
fmcomms2_sink< gr_complex > fmcomms2_sink_fc32
Definition fmcomms2_sink.h:69
gr::iio::fmcomms2_sink_s
fmcomms2_sink< int16_t > fmcomms2_sink_s
Definition fmcomms2_sink.h:67
gr::iio::fmcomms2_sink_sc16
fmcomms2_sink< std::complex< int16_t > > fmcomms2_sink_sc16
Definition fmcomms2_sink.h:68
gr
GNU Radio logging wrapper.
Definition basic_block.h:29
sync_block.h