18 #ifndef DEVICES_PLUTOSDR_DEVICEPLUTOSDRBOX_H_ 19 #define DEVICES_PLUTOSDR_DEVICEPLUTOSDRBOX_H_ 23 #include <sys/types.h> 30 typedef SSIZE_T ssize_t;
74 static bool probeURI(
const std::string& uri);
76 void set_params(DeviceType devType,
const std::vector<std::string> ¶ms);
77 bool get_param(DeviceType devType,
const std::string ¶m, std::string &value);
82 struct iio_buffer *createRxBuffer(
unsigned int size,
bool cyclic);
83 struct iio_buffer *createTxBuffer(
unsigned int size,
bool cyclic);
84 void deleteRxBuffer();
85 void deleteTxBuffer();
86 ssize_t getRxSampleSize();
87 ssize_t getTxSampleSize();
91 ssize_t rxBufferRefill();
92 ssize_t txBufferPush();
93 std::ptrdiff_t rxBufferStep();
95 char* rxBufferFirst();
96 std::ptrdiff_t txBufferStep();
98 char* txBufferFirst();
102 void setSampleRate(
uint32_t sampleRate);
104 void setFIREnable(
bool enable);
105 void setLOPPMTenths(
int ppmTenths);
106 bool getRxGain(
int& gaindB,
unsigned int chan);
107 bool getRxRSSI(std::string& rssiStr,
unsigned int chan);
108 bool getTxRSSI(std::string& rssiStr,
unsigned int chan);
115 bool getRateGovernors(std::string& rateGovernors);
131 bool parseSampleRates(
const std::string& rateStr,
SampleRates& sampleRates);
132 void setFilter(
const std::string& filterConfigStr);
133 void formatFIRHeader(std::ostringstream& str,
uint32_t intdec);
134 void formatFIRCoefficients(std::ostringstream& str,
uint32_t nbTaps,
double normalizedBW);
struct iio_device * m_devTx
uint32_t m_lpfFIRlog2Decim
digital lowpass FIR filter log2 of decimation factor (0..2)
float m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
struct iio_channel * m_chnTx0i
uint32_t m_hb3Rate
Rate of the HB3/(DEC3 or INT3) filter (Rx: out, Tx: in) - this is the HB2 working sample rate...
struct iio_buffer * m_txBuf
bool m_lpfFIREnable
enable digital lowpass FIR filter
struct iio_channel * getRxChannel0()
struct iio_context * m_ctx
struct iio_channel * getTxChannel0I()
class DEVICES_API DevicePlutoSDRBox
uint64_t m_devSampleRate
Host interface sample rate.
struct iio_device * m_devPhy
struct iio_buffer * m_rxBuf
uint32_t m_firRate
Rate of FIR filter (Rx: out, Tx: in) - this is the host/device communication sample rate...
uint32_t m_hb2Rate
Rate of the HB2 filter (Rx: out, Tx: in) - this is the HB1 working sample rate.
int32_t m_LOppmTenths
XO correction.
struct iio_device * m_devRx
int m_lpfFIRRxGain
digital lowpass FIR filter gain Rx side (dB)
struct iio_channel * m_chnTx0q
uint32_t m_hb1Rate
Rate of the HB1 filter (Rx: out, Tx: in) - this is the FIR working sample rate.
uint32_t m_bbRateHz
Baseband PLL rate (Hz) - used internally.
struct iio_channel * m_chnRx0
uint32_t m_addaConnvRate
A/D or D/A converter rat - this is the HB3 working sample rate.
int m_lpfFIRTxGain
digital lowpass FIR filter gain Tx side (dB)
struct iio_channel * getTxChannel0Q()
unsigned __int64 uint64_t