1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00
sdrangel/devices/limesdr/devicelimesdrparam.h

112 lines
4.4 KiB
C
Raw Normal View History

2017-10-03 20:00:55 -04:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
// written by Christian Daniel //
// Copyright (C) 2015-2019 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
2017-10-03 20:00:55 -04:00
// //
// 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. //
2017-10-03 20:00:55 -04: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_LIMESDR_DEVICELIMESDRPARAM_H_
#define DEVICES_LIMESDR_DEVICELIMESDRPARAM_H_
#include "lime/LimeSuite.h"
#include "export.h"
2018-03-03 14:23:38 -05:00
2017-10-03 20:00:55 -04:00
/**
* This structure refers to one physical device shared among parties (logical devices represented by
2019-05-08 16:11:53 -04:00
* the DeviceAPI with single Rx or Tx stream type).
2017-10-03 20:00:55 -04:00
* It allows storing information on the common resources in one place and is shared among participants.
* There is only one copy that is constructed by the first participant and destroyed by the last.
* A participant knows it is the first or last by checking the lists of buddies (Rx + Tx).
*/
2018-03-03 14:23:38 -05:00
struct DEVICES_API DeviceLimeSDRParams
2017-10-03 20:00:55 -04:00
{
enum LimeType
{
LimeSPI,
LimeMini,
LimeUSB,
LimeUndefined
};
2017-10-03 20:00:55 -04:00
lms_device_t *m_dev; //!< device handle
uint32_t m_nbRxChannels; //!< number of Rx channels (normally 2, we'll see if we really use it...)
uint32_t m_nbTxChannels; //!< number of Tx channels (normally 2, we'll see if we really use it...)
lms_range_t m_lpfRangeRx; //!< Low pass filter range information (Rx side)
lms_range_t m_lpfRangeTx; //!< Low pass filter range information (Tx side)
lms_range_t m_loRangeRx; //!< LO range for Rx
lms_range_t m_loRangeTx; //!< LO range for Tx
lms_range_t m_srRangeRx; //!< ADC sample rate range
lms_range_t m_srRangeTx; //!< DAC sample rate range
float m_sampleRate; //!< ADC/DAC sample rate
int m_log2OvSRRx; //!< log2 of Rx oversampling (0..5)
int m_log2OvSRTx; //!< log2 of Tx oversampling (0..5)
float m_rxFrequency; //!< Rx frequency
float m_txFrequency; //!< Tx frequency
LimeType m_type; //!< Hardware type
2017-10-03 20:00:55 -04:00
DeviceLimeSDRParams() :
m_dev(0),
m_nbRxChannels(0),
m_nbTxChannels(0),
m_sampleRate(1e6),
m_log2OvSRRx(0),
m_log2OvSRTx(0),
m_rxFrequency(1e6),
m_txFrequency(1e6),
m_type(LimeUndefined)
2017-10-03 20:00:55 -04:00
{
m_lpfRangeRx.max = 0.0f;
m_lpfRangeRx.min = 0.0f;
m_lpfRangeRx.step = 0.0f;
m_lpfRangeTx.max = 0.0f;
m_lpfRangeTx.min = 0.0f;
m_lpfRangeTx.step = 0.0f;
m_loRangeRx.max = 0.0f;
m_loRangeRx.min = 0.0f;
m_loRangeRx.step = 0.0f;
m_loRangeTx.max = 0.0f;
m_loRangeTx.min = 0.0f;
m_loRangeTx.step = 0.0f;
m_srRangeRx.max = 0.0f;
m_srRangeRx.min = 0.0f;
m_srRangeRx.step = 0.0f;
m_srRangeTx.max = 0.0f;
m_srRangeTx.min = 0.0f;
m_srRangeTx.step = 0.0f;
2017-10-03 20:00:55 -04:00
}
/**
* Opens and initialize the device and obtain information (# channels, ranges, ...)
*/
bool open(lms_info_str_t deviceStr, bool init = true);
2017-10-03 20:00:55 -04:00
void close();
lms_device_t *getDevice() { return m_dev; }
~DeviceLimeSDRParams()
{
}
private:
void getHardwareType(const char *device_str);
2017-10-03 20:00:55 -04:00
};
#endif /* DEVICES_LIMESDR_DEVICELIMESDRPARAM_H_ */