GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
fpga_dynamic_bit_selection.h
Go to the documentation of this file.
1 /*!
2  * \file fpga_dynamic_bit_selection.h
3  * \brief Dynamic bit selection in the received signal.
4  * \authors <ul>
5  * <li> Marc Majoral, 2020. mmajoral(at)cttc.es
6  * </ul>
7  *
8  * Class that controls the Dynamic Bit Selection in the FPGA.
9  *
10  *
11  * -----------------------------------------------------------------------------
12  *
13  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
14  *
15  * GNSS-SDR is a software defined Global Navigation
16  * Satellite Systems receiver
17  *
18  * This file is part of GNSS-SDR.
19  *
20  * SPDX-License-Identifier: GPL-3.0-or-later
21  *
22  * -----------------------------------------------------------------------------
23  */
24 
25 #ifndef GNSS_SDR_FPGA_DYNAMIC_BIT_SELECTION_H
26 #define GNSS_SDR_FPGA_DYNAMIC_BIT_SELECTION_H
27 
28 #include <cstddef>
29 #include <cstdint>
30 #include <string>
31 
32 /*!
33  * \brief Class that controls the switch in the FPGA, which connects the FPGA acquisition and multicorrelator modules to
34  * either the DMA or the Analog Front-End.
35  */
37 {
38 public:
39  /*!
40  * \brief Constructor
41  */
42  explicit Fpga_dynamic_bit_selection(const std::string& device_name1, const std::string& device_name2);
43 
44  /*!
45  * \brief Destructor
46  */
48 
49  /*!
50  * \brief This function configures the switch in th eFPGA
51  */
52  // void set_switch_position(int32_t switch_position);
53  void bit_selection(void);
54 
55 private:
56  static const size_t FPGA_PAGE_SIZE = 0x10000;
57 
58  static const uint32_t Num_bits_ADC = 12; // Number of bits in the ADC
59  static const uint32_t Num_bits_FPGA = 4; // Number of bits after the bit selection
60  static const uint32_t shift_out_bits_default = Num_bits_ADC - Num_bits_FPGA; // take the most significant bits by default
61  static const uint32_t shift_out_bits_min = 0; // minimum possible value for the bit selection
62  static const uint32_t shift_out_bit_max = Num_bits_ADC - Num_bits_FPGA; // maximum possible value for the bit selection
63  // received signal power thresholds for the bit selection
64  // the received signal power is estimated as the averaged squared absolute value of the received signal samples
65  static const uint32_t Power_Threshold_High = 15000;
66  static const uint32_t Power_Threshold_Low = 6000;
67 
68  void close_devices(void);
69 
70  uint32_t shift_out_bits_band1; // number of bits to shift for frequency band 1
71  uint32_t shift_out_bits_band2; // number of bits to shift for frequency band 2
72 
73  volatile unsigned* d_map_base1; // driver memory map corresponding to frequency band 1
74  int d_device_descriptor1; // driver descriptor corresponding to frequency band 1
75 
76  volatile unsigned* d_map_base2; // driver memory map corresponding to frequency band 2
77  int d_device_descriptor2; // driver descriptor corresponding to frequency band 2
78 };
79 
80 #endif // GNSS_SDR_FPGA_DYNAMIC_BIT_SELECTION_H
Fpga_dynamic_bit_selection(const std::string &device_name1, const std::string &device_name2)
Constructor.
void bit_selection(void)
This function configures the switch in th eFPGA.
Class that controls the switch in the FPGA, which connects the FPGA acquisition and multicorrelator m...
~Fpga_dynamic_bit_selection()
Destructor.