diff options
author | Josh Morman <jmorman@perspectalabs.com> | 2021-06-01 10:07:28 -0400 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-06-04 06:21:34 -0400 |
commit | 11bce8acc14d38e78220cad984df8d12bfd6ebcb (patch) | |
tree | 53dc344732bdf92764c29a7d23cfdf79622174a6 /gr-iio/include/gnuradio | |
parent | iio: remove boost::to_string usage (diff) | |
download | gnuradio-11bce8acc14d38e78220cad984df8d12bfd6ebcb.tar.xz gnuradio-11bce8acc14d38e78220cad984df8d12bfd6ebcb.zip |
iio: clean up fmcomms2 public headers
Signed-off-by: Josh Morman <jmorman@perspectalabs.com>
Diffstat (limited to 'gr-iio/include/gnuradio')
-rw-r--r-- | gr-iio/include/gnuradio/iio/fmcomms2_sink.h | 57 | ||||
-rw-r--r-- | gr-iio/include/gnuradio/iio/fmcomms2_sink_fc32.h | 61 | ||||
-rw-r--r-- | gr-iio/include/gnuradio/iio/fmcomms2_source.h | 61 | ||||
-rw-r--r-- | gr-iio/include/gnuradio/iio/fmcomms2_source_fc32.h | 62 |
4 files changed, 123 insertions, 118 deletions
diff --git a/gr-iio/include/gnuradio/iio/fmcomms2_sink.h b/gr-iio/include/gnuradio/iio/fmcomms2_sink.h index 92900b8f4..cf65e9e92 100644 --- a/gr-iio/include/gnuradio/iio/fmcomms2_sink.h +++ b/gr-iio/include/gnuradio/iio/fmcomms2_sink.h @@ -50,63 +50,6 @@ public: float fstop = 0.0) = 0; }; -/*! - * \brief Device specific sink for FMComms evaluation cards - * \ingroup iio - * - * \details - * This block is a sink specifically designed for FMComms2/3/4 evaluation - * cards. However, it should support any AD936x based device using an IIO - * driver. - */ -class IIO_API fmcomms2_sink_f32c : virtual public gr::hier_block2 -{ -public: - typedef std::shared_ptr<fmcomms2_sink_f32c> sptr; - - static sptr make(const std::string& uri, - const std::vector<bool>& ch_en, - unsigned long buffer_size, - bool cyclic) - { - fmcomms2_sink::sptr block = fmcomms2_sink::make(uri, ch_en, buffer_size, cyclic); - - return gnuradio::get_initial_sptr(new fmcomms2_sink_f32c( - (ch_en.size() > 0 && ch_en[0]), (ch_en.size() > 1 && ch_en[1]), block)); - } - - virtual void set_bandwidth(unsigned long bandwidth) - { - fmcomms2_block->set_bandwidth(bandwidth); - } - virtual void set_frequency(unsigned long long frequency) - { - fmcomms2_block->set_frequency(frequency); - } - virtual void set_samplerate(unsigned long samplerate) - { - fmcomms2_block->set_samplerate(samplerate); - } - virtual void set_attenuation(size_t chan, double attenuation) - { - fmcomms2_block->set_attenuation(chan, attenuation); - } - virtual void set_filter_params(const std::string& filter_source, - const std::string& filter_filename = "", - float fpass = 0.0, - float fstop = 0.0) - { - fmcomms2_block->set_filter_params(filter_source, filter_filename, fpass, fstop); - } - - -private: - fmcomms2_sink::sptr fmcomms2_block; - -protected: - explicit fmcomms2_sink_f32c(bool tx1_en, bool tx2_en, fmcomms2_sink::sptr block); -}; - } // namespace iio } // namespace gr diff --git a/gr-iio/include/gnuradio/iio/fmcomms2_sink_fc32.h b/gr-iio/include/gnuradio/iio/fmcomms2_sink_fc32.h new file mode 100644 index 000000000..ff2aebe78 --- /dev/null +++ b/gr-iio/include/gnuradio/iio/fmcomms2_sink_fc32.h @@ -0,0 +1,61 @@ +/* -*- c++ -*- */ +/* + * Copyright 2014 Analog Devices Inc. + * Author: Paul Cercueil <paul.cercueil@analog.com> + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + + +#ifndef INCLUDED_IIO_FMCOMMS2_SINK_FC32_H +#define INCLUDED_IIO_FMCOMMS2_SINK_FC32_H + +#include <gnuradio/hier_block2.h> +#include <gnuradio/iio/api.h> +#include <gnuradio/sync_block.h> +#include <gnuradio/iio/fmcomms2_sink.h> + +#include "device_sink.h" + +namespace gr { +namespace iio { + +/*! + * \brief Device specific sink for FMComms evaluation cards + * \ingroup iio + * + * \details + * This block is a sink specifically designed for FMComms2/3/4 evaluation + * cards. However, it should support any AD936x based device using an IIO + * driver. + */ +class IIO_API fmcomms2_sink_f32c : virtual public gr::hier_block2 +{ +public: + typedef std::shared_ptr<fmcomms2_sink_f32c> sptr; + + static sptr make(const std::string& uri, + const std::vector<bool>& ch_en, + unsigned long buffer_size, + bool cyclic); + virtual void set_bandwidth(unsigned long bandwidth); + virtual void set_frequency(unsigned long long frequency); + virtual void set_samplerate(unsigned long samplerate); + virtual void set_attenuation(size_t chan, double attenuation); + virtual void set_filter_params(const std::string& filter_source, + const std::string& filter_filename = "", + float fpass = 0.0, + float fstop = 0.0); + +private: + fmcomms2_sink::sptr fmcomms2_block; + +protected: + explicit fmcomms2_sink_f32c(bool tx1_en, bool tx2_en, fmcomms2_sink::sptr block); +}; + +} // namespace iio +} // namespace gr + +#endif /* INCLUDED_IIO_FMCOMMS2_SINK_FC32_H */ diff --git a/gr-iio/include/gnuradio/iio/fmcomms2_source.h b/gr-iio/include/gnuradio/iio/fmcomms2_source.h index 1329064fa..6f53510b3 100644 --- a/gr-iio/include/gnuradio/iio/fmcomms2_source.h +++ b/gr-iio/include/gnuradio/iio/fmcomms2_source.h @@ -51,67 +51,6 @@ public: float fstop = 0.0) = 0; }; -/*! - * \brief Device specific source for FMComms evaluation cards - * \ingroup iio - * - * \details - * This block is a source specifically designed for FMComms2/3/4 evaluation - * cards. However, it should support any AD936x based device using an IIO - * driver. - */ -class IIO_API fmcomms2_source_f32c : virtual public gr::hier_block2 -{ -public: - typedef std::shared_ptr<fmcomms2_source_f32c> sptr; - - static sptr make(const std::string& uri, - const std::vector<bool>& ch_en, - unsigned long buffer_size) - { - fmcomms2_source::sptr block = fmcomms2_source::make(uri, ch_en, buffer_size); - - return gnuradio::get_initial_sptr(new fmcomms2_source_f32c( - (ch_en.size() > 0 && ch_en[0]), (ch_en.size() > 1 && ch_en[1]), block)); - } - - virtual void set_frequency(unsigned long long frequency) - { - fmcomms2_block->set_frequency(frequency); - } - virtual void set_samplerate(unsigned long samplerate) - { - fmcomms2_block->set_samplerate(samplerate); - } - virtual void set_gain_mode(size_t chan, const std::string& mode) - { - fmcomms2_block->set_gain_mode(chan, mode); - } - virtual void set_gain(size_t chan, double gain) - { - fmcomms2_block->set_gain(chan, gain); - } - virtual void set_quadrature(bool quadrature) - { - fmcomms2_block->set_quadrature(quadrature); - } - virtual void set_rfdc(bool rfdc) { fmcomms2_block->set_rfdc(rfdc); } - virtual void set_bbdc(bool bbdc) { fmcomms2_block->set_bbdc(bbdc); } - virtual void set_filter_params(const std::string& filter_source, - const std::string& filter_filename = "", - float fpass = 0.0, - float fstop = 0.0) - { - fmcomms2_block->set_filter_params(filter_source, filter_filename, fpass, fstop); - } - -private: - fmcomms2_source::sptr fmcomms2_block; - -protected: - explicit fmcomms2_source_f32c(bool rx1_en, bool rx2_en, fmcomms2_source::sptr block); -}; - } // namespace iio } // namespace gr diff --git a/gr-iio/include/gnuradio/iio/fmcomms2_source_fc32.h b/gr-iio/include/gnuradio/iio/fmcomms2_source_fc32.h new file mode 100644 index 000000000..2954ba223 --- /dev/null +++ b/gr-iio/include/gnuradio/iio/fmcomms2_source_fc32.h @@ -0,0 +1,62 @@ +/* -*- c++ -*- */ +/* + * Copyright 2014 Analog Devices Inc. + * Author: Paul Cercueil <paul.cercueil@analog.com> + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + + +#ifndef INCLUDED_IIO_FMCOMMS2_SOURCE_FC32_H +#define INCLUDED_IIO_FMCOMMS2_SOURCE_FC32_H + +#include <gnuradio/hier_block2.h> +#include <gnuradio/iio/api.h> +#include <gnuradio/sync_block.h> +#include <gnuradio/iio/fmcomms2_source.h> + +#include "device_source.h" + +namespace gr { +namespace iio { + +/*! + * \brief Device specific source for FMComms evaluation cards + * \ingroup iio + * + * \details + * This block is a source specifically designed for FMComms2/3/4 evaluation + * cards. However, it should support any AD936x based device using an IIO + * driver. + */ +class IIO_API fmcomms2_source_f32c : virtual public gr::hier_block2 +{ +public: + typedef std::shared_ptr<fmcomms2_source_f32c> sptr; + + static sptr make(const std::string& uri, + const std::vector<bool>& ch_en, + unsigned long buffer_size); + virtual void set_frequency(unsigned long long frequency); + virtual void set_samplerate(unsigned long samplerate); + virtual void set_gain_mode(size_t chan, const std::string& mode); + virtual void set_gain(size_t chan, double gain); + virtual void set_quadrature(bool quadrature); + virtual void set_rfdc(bool rfdc); + virtual void set_bbdc(bool bbdc); + virtual void set_filter_params(const std::string& filter_source, + const std::string& filter_filename = "", + float fpass = 0.0, + float fstop = 0.0); +private: + fmcomms2_source::sptr fmcomms2_block; + +protected: + explicit fmcomms2_source_f32c(bool rx1_en, bool rx2_en, fmcomms2_source::sptr block); +}; + +} // namespace iio +} // namespace gr + +#endif /* INCLUDED_IIO_FMCOMMS2_SOURCE_FC32_H */ |