GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
fpga_switch.h
Go to the documentation of this file.
1 /*!
2  * \file fpga_switch.h
3  * \brief Switch that connects the HW accelerator queues to the analog front end or the DMA.
4  * \authors <ul>
5  * <li> Marc Majoral, 2019. mmajoral(at)cttc.cat
6  * <li> Javier Arribas, 2016. jarribas(at)cttc.es
7  * </ul>
8  *
9  * Class that controls a switch in the FPGA
10  *
11  *
12  * -----------------------------------------------------------------------------
13  *
14  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
15  *
16  * GNSS-SDR is a software defined Global Navigation
17  * Satellite Systems receiver
18  *
19  * This file is part of GNSS-SDR.
20  *
21  * SPDX-License-Identifier: GPL-3.0-or-later
22  *
23  * -----------------------------------------------------------------------------
24  */
25 
26 #ifndef GNSS_SDR_FPGA_SWITCH_H
27 #define GNSS_SDR_FPGA_SWITCH_H
28 
29 #include <string>
30 
31 /*!
32  * \brief Class that controls the switch in the FPGA, which connects the FPGA acquisition and multicorrelator modules to
33  * either the DMA or the Analog Front-End.
34  */
36 {
37 public:
38  /*!
39  * \brief Constructor
40  */
41  explicit Fpga_Switch(const std::string& device_name);
42 
43  /*!
44  * \brief Destructor
45  */
46  ~Fpga_Switch();
47 
48  /*!
49  * \brief This function configures the switch in th eFPGA
50  */
51  void set_switch_position(int32_t switch_position);
52 
53 private:
54  static const size_t FPGA_PAGE_SIZE = 0x10000;
55  static const uint32_t TEST_REGISTER_TRACK_WRITEVAL = 0x55AA;
56  static const uint32_t MAX_LENGTH_DEVICEIO_NAME = 50;
57 
58  // private functions
59  unsigned fpga_switch_test_register(unsigned writeval);
60  void close_device(void);
61 
62  volatile unsigned* d_map_base; // driver memory map
63  int d_device_descriptor; // driver descriptor
64 };
65 
66 #endif // GNSS_SDR_FPGA_SWITCH_H
void set_switch_position(int32_t switch_position)
This function configures the switch in th eFPGA.
Class that controls the switch in the FPGA, which connects the FPGA acquisition and multicorrelator m...
Definition: fpga_switch.h:35
Fpga_Switch(const std::string &device_name)
Constructor.
~Fpga_Switch()
Destructor.