GNSS-SDR  0.0.14
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  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
12  * This file is part of GNSS-SDR.
13  *
14  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
15  * SPDX-License-Identifier: GPL-3.0-or-later
16  *
17  * -----------------------------------------------------------------------------
18  */
19 
20 #ifndef GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H
21 #define GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H
22 
23 #include "gnss_block_interface.h"
24 #include <gnuradio/blocks/file_sink.h>
25 #if GRIIO_INCLUDE_HAS_GNURADIO
26 #include <gnuradio/iio/fmcomms2_source.h>
27 #else
28 #include <iio/fmcomms2_source.h>
29 #endif
30 #include "concurrent_queue.h"
31 #include <pmt/pmt.h>
32 #include <cstdint>
33 #include <string>
34 
35 
36 /** \addtogroup Signal_Source
37  * \{ */
38 /** \addtogroup Signal_Source_adapters
39  * \{ */
40 
41 
43 
45 {
46 public:
47  Fmcomms2SignalSource(const ConfigurationInterface* configuration,
48  const std::string& role, unsigned int in_stream,
49  unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
50 
52 
53  inline std::string role() override
54  {
55  return role_;
56  }
57 
58  /*!
59  * \brief Returns "Fmcomms2_Signal_Source"
60  */
61  inline std::string implementation() override
62  {
63  return "Fmcomms2_Signal_Source";
64  }
65 
66  inline size_t item_size() override
67  {
68  return item_size_;
69  }
70 
71  void connect(gr::top_block_sptr top_block) override;
72  void disconnect(gr::top_block_sptr top_block) override;
73  gr::basic_block_sptr get_left_block() override;
74  gr::basic_block_sptr get_right_block() override;
75 
76 private:
77  gr::iio::fmcomms2_source_f32c::sptr fmcomms2_source_f32c_;
78  gnss_shared_ptr<gr::block> valve_;
79  gr::blocks::file_sink::sptr file_sink_;
80 
81  std::string role_;
82  std::string item_type_;
83  std::string dump_filename_;
84 
85  // Front-end settings
86  std::string uri_; // device direction
87  std::string gain_mode_rx1_;
88  std::string gain_mode_rx2_;
89  std::string rf_port_select_;
90  std::string filter_file_;
91  std::string filter_source_;
92  std::string filter_filename_;
93 
94  int64_t samples_;
95  size_t item_size_;
96 
97  unsigned int in_stream_;
98  unsigned int out_stream_;
99 
100  double rf_gain_rx1_;
101  double rf_gain_rx2_;
102  uint64_t freq_; // frequency of local oscilator
103  uint64_t sample_rate_;
104  uint64_t bandwidth_;
105  uint64_t buffer_size_; // reception buffer
106  float Fpass_;
107  float Fstop_;
108  int RF_channels_;
109 
110  // DDS configuration for LO generation for external mixer
111  double scale_dds_dbfs_;
112  double phase_dds_deg_;
113  double tx_attenuation_db_;
114  uint64_t freq_rf_tx_hz_;
115  uint64_t freq_dds_tx_hz_;
116  uint64_t tx_bandwidth_;
117  bool enable_dds_lo_;
118 
119  bool rx1_en_;
120  bool rx2_en_;
121  bool quadrature_;
122  bool rf_dc_;
123  bool bb_dc_;
124  bool filter_auto_;
125  bool rf_shutdown_;
126  bool dump_;
127 };
128 
129 
130 /** \} */
131 /** \} */
132 #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".