2018-12-30 09:13:17 +00: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 04:39:30 +00:00
|
|
|
// (at your option) any later version. //
|
2018-12-30 09:13:17 +00: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_XTRX_DEVICEXTRX_H_
|
|
|
|
#define DEVICES_XTRX_DEVICEXTRX_H_
|
|
|
|
|
2019-09-17 17:54:13 +00:00
|
|
|
#include <QString>
|
2018-12-30 09:13:17 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2019-09-17 17:54:13 +00:00
|
|
|
#include "plugin/plugininterface.h"
|
2018-12-30 09:13:17 +00:00
|
|
|
#include "export.h"
|
|
|
|
|
2018-12-31 00:43:24 +00:00
|
|
|
struct strx_dev;
|
|
|
|
|
2018-12-30 09:13:17 +00:00
|
|
|
class DEVICES_API DeviceXTRX
|
|
|
|
{
|
|
|
|
public:
|
2018-12-31 00:43:24 +00:00
|
|
|
DeviceXTRX();
|
|
|
|
~DeviceXTRX();
|
|
|
|
|
|
|
|
bool open(const char* deviceStr);
|
|
|
|
void close();
|
2019-09-17 17:54:13 +00:00
|
|
|
static void enumOriginDevices(const QString& hardwareId, PluginInterface::OriginDevices& originDevices);
|
2018-12-31 00:43:24 +00:00
|
|
|
struct xtrx_dev *getDevice() { return m_dev; }
|
2020-04-18 17:20:29 +00:00
|
|
|
double setSamplerate(double rate, double master, bool output);
|
2020-11-11 03:06:42 +00:00
|
|
|
bool setSamplerate(double rate, uint32_t log2Decim, uint32_t log2Interp, bool output);
|
2019-01-04 03:45:52 +00:00
|
|
|
double getMasterRate() const { return m_masterRate; }
|
|
|
|
double getClockGen() const { return m_clockGen; }
|
|
|
|
double getActualInputRate() const { return m_actualInputRate; }
|
|
|
|
double getActualOutputRate() const { return m_actualOutputRate; }
|
2018-12-30 09:13:17 +00:00
|
|
|
static void getAutoGains(uint32_t autoGain, uint32_t& lnaGain, uint32_t& tiaGain, uint32_t& pgaGain);
|
2018-12-31 00:43:24 +00:00
|
|
|
|
2018-12-30 09:13:17 +00:00
|
|
|
static const uint32_t m_nbGains = 74;
|
2020-04-12 08:23:36 +00:00
|
|
|
static const unsigned int blockSize = (1<<12);
|
2018-12-30 09:13:17 +00:00
|
|
|
|
|
|
|
private:
|
2018-12-31 00:43:24 +00:00
|
|
|
struct xtrx_dev *m_dev; //!< device handle
|
2019-01-04 03:45:52 +00:00
|
|
|
double m_inputRate;
|
|
|
|
double m_outputRate;
|
|
|
|
double m_masterRate;
|
|
|
|
double m_clockGen;
|
|
|
|
double m_actualInputRate;
|
|
|
|
double m_actualOutputRate;
|
2018-12-31 00:43:24 +00:00
|
|
|
|
2018-12-30 09:13:17 +00:00
|
|
|
static const uint32_t m_lnaTbl[m_nbGains];
|
|
|
|
static const uint32_t m_pgaTbl[m_nbGains];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* DEVICES_XTRX_DEVICEXTRX_H_ */
|