| 
									
										
										
										
											2018-09-22 02:55:40 +02:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2018 Edouard Griffiths, F4EXB                                   //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is free software; you can redistribute it and/or modify          //
 | 
					
						
							|  |  |  | // it under the terms of the GNU General Public License as published by          //
 | 
					
						
							|  |  |  | // the Free Software Foundation as version 3 of the License, or                  //
 | 
					
						
							| 
									
										
										
										
											2019-04-11 06:39:30 +02:00
										 |  |  | // (at your option) any later version.                                           //
 | 
					
						
							| 
									
										
										
										
											2018-09-22 02:55:40 +02:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful,               //
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of                //
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                  //
 | 
					
						
							|  |  |  | // GNU General Public License V3 for more details.                               //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU General Public License             //
 | 
					
						
							|  |  |  | // along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef DEVICES_BLADERF2_DEVICEBLADERF2_H_
 | 
					
						
							|  |  |  | #define DEVICES_BLADERF2_DEVICEBLADERF2_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-22 10:39:09 +02:00
										 |  |  | #include <stdint.h>
 | 
					
						
							| 
									
										
										
										
											2018-09-22 02:55:40 +02:00
										 |  |  | #include <libbladeRF.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-17 19:54:13 +02:00
										 |  |  | #include "plugin/plugininterface.h"
 | 
					
						
							| 
									
										
										
										
											2018-09-22 02:55:40 +02:00
										 |  |  | #include "export.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DEVICES_API DeviceBladeRF2 | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2018-09-22 10:39:09 +02:00
										 |  |  |     DeviceBladeRF2(); | 
					
						
							|  |  |  |     ~DeviceBladeRF2(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-17 19:54:13 +02:00
										 |  |  |     static void enumOriginDevices(const QString& hardwareId, PluginInterface::OriginDevices& originDevices); | 
					
						
							| 
									
										
										
										
											2018-09-22 10:39:09 +02:00
										 |  |  |     bool open(const char *serial); | 
					
						
							|  |  |  |     void close(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-24 02:01:10 +02:00
										 |  |  |     bladerf *getDev() { return m_dev; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-23 19:56:24 +02:00
										 |  |  |     bool openRx(int channel); | 
					
						
							|  |  |  |     bool openTx(int channel); | 
					
						
							|  |  |  |     void closeRx(int channel); | 
					
						
							|  |  |  |     void closeTx(int channel); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-14 23:19:05 +02:00
										 |  |  |     void getFrequencyRangeRx(uint64_t& min, uint64_t& max, int& step, float& scale); | 
					
						
							|  |  |  |     void getFrequencyRangeTx(uint64_t& min, uint64_t& max, int& step, float& scale); | 
					
						
							|  |  |  |     void getSampleRateRangeRx(int& min, int& max, int& step, float& scale); | 
					
						
							|  |  |  |     void getSampleRateRangeTx(int& min, int& max, int& step, float& scale); | 
					
						
							|  |  |  |     void getBandwidthRangeRx(int& min, int& max, int& step, float& scale); | 
					
						
							|  |  |  |     void getBandwidthRangeTx(int& min, int& max, int& step, float& scale); | 
					
						
							| 
									
										
										
										
											2020-09-14 23:04:35 +02:00
										 |  |  |     void getGlobalGainRangeRx(int& min, int& max, int& step, float& scale); | 
					
						
							|  |  |  |     void getGlobalGainRangeTx(int& min, int& max, int& step, float& scale); | 
					
						
							| 
									
										
										
										
											2018-09-25 17:03:34 +02:00
										 |  |  |     int  getGainModesRx(const bladerf_gain_modes**); | 
					
						
							| 
									
										
										
										
											2018-09-23 19:56:24 +02:00
										 |  |  |     void setBiasTeeRx(bool enable); | 
					
						
							|  |  |  |     void setBiasTeeTx(bool enable); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     static const unsigned int blockSize = (1<<14); | 
					
						
							| 
									
										
										
										
											2018-09-22 02:55:40 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2018-09-22 10:39:09 +02:00
										 |  |  |     bladerf *m_dev; | 
					
						
							| 
									
										
										
										
											2018-09-23 19:56:24 +02:00
										 |  |  |     int m_nbRxChannels; | 
					
						
							|  |  |  |     int m_nbTxChannels; | 
					
						
							|  |  |  |     bool *m_rxOpen; | 
					
						
							|  |  |  |     bool *m_txOpen; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-22 02:55:40 +02:00
										 |  |  |     static struct bladerf *open_bladerf_from_serial(const char *serial); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* DEVICES_BLADERF2_DEVICEBLADERF2_H_ */
 |