GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
fmcomms2_signal_source.h
Go to the documentation of this file.
1 /*!
2  * \file fmcomms2_signal_source.h
3  * \brief Interface to use SDR hardware based in FMCOMMS2 driver from analog
4  * devices, for example FMCOMMS4 and ADALM-PLUTO (PlutoSdr)
5  * \author Rodrigo Muñoz, 2017. rmunozl(at)inacap.cl, rodrigo.munoz(at)proteinlab.cl
6  *
7  *
8  * This class represent a fmcomms2 signal source. It use the gr_iio block
9  * -----------------------------------------------------------------------------
10  *
11  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
12  *
13  * GNSS-SDR is a software defined Global Navigation
14  * Satellite Systems receiver
15  *
16  * This file is part of GNSS-SDR.
17  *
18  * SPDX-License-Identifier: GPL-3.0-or-later
19  *
20  * -----------------------------------------------------------------------------
21  */
22 
23 #ifndef GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H
24 #define GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H
25 
26 #include "gnss_block_interface.h"
27 #include <gnuradio/blocks/file_sink.h>
28 #if GRIIO_INCLUDE_HAS_GNURADIO
29 #include <gnuradio/iio/fmcomms2_source.h>
30 #else
31 #include <iio/fmcomms2_source.h>
32 #endif
33 #include "concurrent_queue.h"
34 #include <pmt/pmt.h>
35 #include <cstdint>
36 #include <memory>
37 #include <string>
38 #if GNURADIO_USES_STD_POINTERS
39 #else
40 #include <boost/shared_ptr.hpp>
41 #endif
42 
44 
46 {
47 public:
48  Fmcomms2SignalSource(const ConfigurationInterface* configuration,
49  const std::string& role, unsigned int in_stream,
50  unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
51 
53 
54  inline std::string role() override
55  {
56  return role_;
57  }
58 
59  /*!
60  * \brief Returns "Fmcomms2_Signal_Source"
61  */
62  inline std::string implementation() override
63  {
64  return "Fmcomms2_Signal_Source";
65  }
66 
67  inline size_t item_size() override
68  {
69  return item_size_;
70  }
71 
72  void connect(gr::top_block_sptr top_block) override;
73  void disconnect(gr::top_block_sptr top_block) override;
74  gr::basic_block_sptr get_left_block() override;
75  gr::basic_block_sptr get_right_block() override;
76 
77 private:
78  gr::iio::fmcomms2_source_f32c::sptr fmcomms2_source_f32c_;
79 
80 #if GNURADIO_USES_STD_POINTERS
81  std::shared_ptr<gr::block> valve_;
82 #else
83  boost::shared_ptr<gr::block> valve_;
84 #endif
85  gr::blocks::file_sink::sptr file_sink_;
86 
87  std::string role_;
88  std::string item_type_;
89  std::string dump_filename_;
90 
91  // Front-end settings
92  std::string uri_; // device direction
93  std::string gain_mode_rx1_;
94  std::string gain_mode_rx2_;
95  std::string rf_port_select_;
96  std::string filter_file_;
97  std::string filter_source_;
98  std::string filter_filename_;
99 
100  int64_t samples_;
101  size_t item_size_;
102 
103  unsigned int in_stream_;
104  unsigned int out_stream_;
105 
106  double rf_gain_rx1_;
107  double rf_gain_rx2_;
108  uint64_t freq_; // frequency of local oscilator
109  uint64_t sample_rate_;
110  uint64_t bandwidth_;
111  uint64_t buffer_size_; // reception buffer
112  float Fpass_;
113  float Fstop_;
114  int RF_channels_;
115 
116  // DDS configuration for LO generation for external mixer
117  double scale_dds_dbfs_;
118  double phase_dds_deg_;
119  double tx_attenuation_db_;
120  uint64_t freq_rf_tx_hz_;
121  uint64_t freq_dds_tx_hz_;
122  uint64_t tx_bandwidth_;
123  bool enable_dds_lo_;
124 
125  bool rx1_en_;
126  bool rx2_en_;
127  bool quadrature_;
128  bool rf_dc_;
129  bool bb_dc_;
130  bool filter_auto_;
131  bool rf_shutdown_;
132  bool dump_;
133 };
134 
135 #endif // GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H
Interface of a thread-safe std::queue.
This interface represents a GNSS block.
This abstract class represents an interface to configuration parameters.
This abstract class represents an interface to GNSS blocks.
std::string implementation() override
Returns "Fmcomms2_Signal_Source".