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