GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
limesdr_signal_source.h
1 /*!
2  * \file limesdr_signal_source.cc
3  * \brief Signal source for LimeSDR front-end
4  * \author Javier Arribas, 2021. jarribas(at)cttc.es
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
9  * This file is part of GNSS-SDR.
10  *
11  * Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
12  * SPDX-License-Identifier: GPL-3.0-or-later
13  *
14  * -----------------------------------------------------------------------------
15  */
16 
17 #ifndef GNSS_SDR_LIMESDR_SIGNAL_SOURCE_H
18 #define GNSS_SDR_LIMESDR_SIGNAL_SOURCE_H
19 
20 #include "concurrent_queue.h"
21 #include "signal_source_base.h"
22 #include <gnuradio/blocks/file_sink.h>
23 #include <pmt/pmt.h>
24 #include <cstdint>
25 #include <limesdr/source.h>
26 #include <memory>
27 #include <stdexcept>
28 #include <string>
29 
30 /** \addtogroup Signal_Source
31  * \{ */
32 /** \addtogroup Signal_Source_adapters
33  * \{ */
34 
35 
37 
38 /*!
39  * \brief This class instantiates the LimeSDR gnuradio signal source.
40  * It has support also for a customized LimeSDR firmware and signal source to support PPS samplestamp reading.
41  */
43 {
44 public:
45  LimesdrSignalSource(const ConfigurationInterface* configuration,
46  const std::string& role, unsigned int in_stream,
47  unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
48 
49  ~LimesdrSignalSource() = default;
50 
51  inline size_t item_size() override
52  {
53  return item_size_;
54  }
55 
56  void connect(gr::top_block_sptr top_block) override;
57  void disconnect(gr::top_block_sptr top_block) override;
58  gr::basic_block_sptr get_left_block() override;
59  gr::basic_block_sptr get_right_block() override;
60 
61 private:
62  gr::limesdr::source::sptr limesdr_source_;
63  gnss_shared_ptr<gr::block> valve_;
64  gr::blocks::file_sink::sptr file_sink_;
65 
66  std::string item_type_;
67  std::string dump_filename_;
68  std::string limesdr_serial_;
69  std::string limesdr_file_;
70 
71  // Front-end settings
72  double sample_rate_;
73  double freq_;
74  double gain_;
75  double analog_bw_hz_;
76  double digital_bw_hz_;
77  double ext_clock_MHz_;
78  size_t item_size_;
79  int64_t samples_;
80 
81  unsigned int in_stream_;
82  unsigned int out_stream_;
83 
84  int limechannel_mode_;
85  int antenna_;
86  int channel_;
87 
88  bool PPS_mode_;
89  bool dump_;
90 };
91 
92 
93 /** \} */
94 /** \} */
95 #endif // GNSS_SDR_LIMESDR_SIGNAL_SOURCE_H
Interface of a thread-safe std::queue.
Header file of the base class to signal_source GNSS blocks.
This abstract class represents an interface to configuration parameters.
This class instantiates the LimeSDR gnuradio signal source. It has support also for a customized Lime...