SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
devicebladerf2.h
Go to the documentation of this file.
1 // Copyright (C) 2018 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef DEVICES_BLADERF2_DEVICEBLADERF2_H_
19 #define DEVICES_BLADERF2_DEVICEBLADERF2_H_
20 
21 #include <stdint.h>
22 #include <libbladeRF.h>
23 
24 #include "export.h"
25 
27 {
28 public:
30  ~DeviceBladeRF2();
31 
32  bool open(const char *serial);
33  void close();
34 
35  bladerf *getDev() { return m_dev; }
36 
37  bool openRx(int channel);
38  bool openTx(int channel);
39  void closeRx(int channel);
40  void closeTx(int channel);
41 
42  void getFrequencyRangeRx(uint64_t& min, uint64_t& max, int& step);
43  void getFrequencyRangeTx(uint64_t& min, uint64_t& max, int& step);
44  void getSampleRateRangeRx(int& min, int& max, int& step);
45  void getSampleRateRangeTx(int& min, int& max, int& step);
46  void getBandwidthRangeRx(int& min, int& max, int& step);
47  void getBandwidthRangeTx(int& min, int& max, int& step);
48  void getGlobalGainRangeRx(int& min, int& max, int& step);
49  void getGlobalGainRangeTx(int& min, int& max, int& step);
50  int getGainModesRx(const bladerf_gain_modes**);
51  void setBiasTeeRx(bool enable);
52  void setBiasTeeTx(bool enable);
53 
54  static const unsigned int blockSize = (1<<14);
55 
56 private:
57  bladerf *m_dev;
60  bool *m_rxOpen;
61  bool *m_txOpen;
62 
63  static struct bladerf *open_bladerf_from_serial(const char *serial);
64 };
65 
66 
67 
68 #endif /* DEVICES_BLADERF2_DEVICEBLADERF2_H_ */
#define DEVICES_API
Definition: export.h:76
bladerf * m_dev
bladerf * getDev()
T max(const T &x, const T &y)
Definition: framework.h:446
T min(const T &x, const T &y)
Definition: framework.h:440
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48