SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
DeviceLimeSDRParams Struct Reference

#include <devicelimesdrparam.h>

Public Types

enum  LimeType { LimeSPI, LimeMini, LimeUSB, LimeUndefined }
 

Public Member Functions

 DeviceLimeSDRParams ()
 
bool open (lms_info_str_t deviceStr)
 
void close ()
 
lms_device_t * getDevice ()
 
 ~DeviceLimeSDRParams ()
 

Public Attributes

lms_device_t * m_dev
 device handle More...
 
uint32_t m_nbRxChannels
 number of Rx channels (normally 2, we'll see if we really use it...) More...
 
uint32_t m_nbTxChannels
 number of Tx channels (normally 2, we'll see if we really use it...) More...
 
lms_range_t m_lpfRangeRx
 Low pass filter range information (Rx side) More...
 
lms_range_t m_lpfRangeTx
 Low pass filter range information (Tx side) More...
 
lms_range_t m_loRangeRx
 LO range for Rx. More...
 
lms_range_t m_loRangeTx
 LO range for Tx. More...
 
lms_range_t m_srRangeRx
 ADC sample rate range. More...
 
lms_range_t m_srRangeTx
 DAC sample rate range. More...
 
float m_sampleRate
 ADC/DAC sample rate. More...
 
int m_log2OvSRRx
 log2 of Rx oversampling (0..5) More...
 
int m_log2OvSRTx
 log2 of Tx oversampling (0..5) More...
 
float m_rxFrequency
 Rx frequency. More...
 
float m_txFrequency
 Tx frequency. More...
 
LimeType m_type
 Hardware type. More...
 

Private Member Functions

void getHardwareType (const char *device_str)
 

Detailed Description

This structure refers to one physical device shared among parties (logical devices represented by the DeviceAPI with single Rx or Tx stream type). 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).

Definition at line 32 of file devicelimesdrparam.h.

Member Enumeration Documentation

◆ LimeType

Enumerator
LimeSPI 
LimeMini 
LimeUSB 
LimeUndefined 

Definition at line 34 of file devicelimesdrparam.h.

Constructor & Destructor Documentation

◆ DeviceLimeSDRParams()

DeviceLimeSDRParams::DeviceLimeSDRParams ( )
inline

Definition at line 58 of file devicelimesdrparam.h.

58  :
59  m_dev(0),
60  m_nbRxChannels(0),
61  m_nbTxChannels(0),
62  m_sampleRate(1e6),
63  m_log2OvSRRx(0),
64  m_log2OvSRTx(0),
65  m_rxFrequency(1e6),
66  m_txFrequency(1e6),
68  {
69  m_lpfRangeRx.max = 0.0f;
70  m_lpfRangeRx.min = 0.0f;
71  m_lpfRangeRx.step = 0.0f;
72 
73  m_lpfRangeTx.max = 0.0f;
74  m_lpfRangeTx.min = 0.0f;
75  m_lpfRangeTx.step = 0.0f;
76 
77  m_loRangeRx.max = 0.0f;
78  m_loRangeRx.min = 0.0f;
79  m_loRangeRx.step = 0.0f;
80 
81  m_loRangeTx.max = 0.0f;
82  m_loRangeTx.min = 0.0f;
83  m_loRangeTx.step = 0.0f;
84 
85  m_srRangeRx.max = 0.0f;
86  m_srRangeRx.min = 0.0f;
87  m_srRangeRx.step = 0.0f;
88 
89  m_srRangeTx.max = 0.0f;
90  m_srRangeTx.min = 0.0f;
91  m_srRangeTx.step = 0.0f;
92  }
int m_log2OvSRRx
log2 of Rx oversampling (0..5)
lms_range_t m_lpfRangeRx
Low pass filter range information (Rx side)
float m_rxFrequency
Rx frequency.
lms_range_t m_srRangeTx
DAC sample rate range.
uint32_t m_nbTxChannels
number of Tx channels (normally 2, we&#39;ll see if we really use it...)
lms_range_t m_srRangeRx
ADC sample rate range.
uint32_t m_nbRxChannels
number of Rx channels (normally 2, we&#39;ll see if we really use it...)
lms_device_t * m_dev
device handle
int m_log2OvSRTx
log2 of Tx oversampling (0..5)
float m_txFrequency
Tx frequency.
float m_sampleRate
ADC/DAC sample rate.
lms_range_t m_lpfRangeTx
Low pass filter range information (Tx side)
LimeType m_type
Hardware type.
lms_range_t m_loRangeTx
LO range for Tx.
lms_range_t m_loRangeRx
LO range for Rx.

◆ ~DeviceLimeSDRParams()

DeviceLimeSDRParams::~DeviceLimeSDRParams ( )
inline

Definition at line 101 of file devicelimesdrparam.h.

102  {
103  }

Member Function Documentation

◆ close()

void DeviceLimeSDRParams::close ( )

Definition at line 102 of file devicelimesdrparam.cpp.

References m_dev.

Referenced by LimeSDROutput::closeDevice(), LimeSDRInput::closeDevice(), LimeSDROutputPlugin::enumSampleSinks(), and LimeSDRInputPlugin::enumSampleSources().

103 {
104  if (m_dev)
105  {
106  LMS_Close(m_dev);
107  m_dev = 0;
108  }
109 }
lms_device_t * m_dev
device handle
+ Here is the caller graph for this function:

◆ getDevice()

lms_device_t* DeviceLimeSDRParams::getDevice ( )
inline

◆ getHardwareType()

void DeviceLimeSDRParams::getHardwareType ( const char *  device_str)
private

Definition at line 111 of file devicelimesdrparam.cpp.

References LimeMini, LimeSPI, LimeUndefined, LimeUSB, and m_type.

Referenced by open().

112 {
113  QString deviceStr(device_str);
114 
115  if (deviceStr.contains(QString("LimeSDR Mini"))) {
116  m_type = LimeMini;
117  } else if (deviceStr.contains(QString("LimeSDR-USB"))) {
118  m_type = LimeUSB;
119  } else if (deviceStr.contains(QString("media=SPI"))) {
120  m_type = LimeSPI;
121  } else {
123  }
124 }
LimeType m_type
Hardware type.
+ Here is the caller graph for this function:

◆ open()

bool DeviceLimeSDRParams::open ( lms_info_str_t  deviceStr)

Opens and initialize the device and obtain information (# channels, ranges, ...)

Definition at line 21 of file devicelimesdrparam.cpp.

References getHardwareType(), m_dev, m_loRangeRx, m_loRangeTx, m_lpfRangeRx, m_lpfRangeTx, m_nbRxChannels, m_nbTxChannels, m_srRangeRx, m_srRangeTx, and m_type.

Referenced by LimeSDROutputPlugin::enumSampleSinks(), LimeSDRInputPlugin::enumSampleSources(), LimeSDROutput::openDevice(), and LimeSDRInput::openDevice().

22 {
23  getHardwareType((const char *) deviceStr);
24 
25  qDebug("DeviceLimeSDRParams::open: serial: %s type: %d", (const char *) deviceStr, (int) m_type);
26 
27  if (LMS_Open(&m_dev, deviceStr, 0) < 0)
28  {
29  qCritical() << "DeviceLimeSDRParams::open: cannot open device " << deviceStr;
30  return false;
31  }
32 
33  if (LMS_Init(m_dev) < 0)
34  {
35  qCritical() << "DeviceLimeSDRParams::open: cannot init device " << deviceStr;
36  return false;
37  }
38 
39  int n;
40 
41  if ((n = LMS_GetNumChannels(m_dev, LMS_CH_RX)) < 0)
42  {
43  qCritical() << "DeviceLimeSDRParams::open: cannot get the number of Rx channels for device " << deviceStr;
44  return false;
45  }
46  else
47  {
48  m_nbRxChannels = n;
49  qDebug() << "DeviceLimeSDRParams::open: " << n << " Rx channels for device " << deviceStr;
50  }
51 
52  if ((n = LMS_GetNumChannels(m_dev, LMS_CH_TX)) < 0)
53  {
54  qCritical() << "DeviceLimeSDRParams::open: cannot get the number of Tx channels for device " << deviceStr;
55  return false;
56  }
57  else
58  {
59  m_nbTxChannels = n;
60  qDebug() << "DeviceLimeSDRParams::open: " << n << " Tx channels for device " << deviceStr;
61  }
62 
63  if (LMS_GetLPFBWRange(m_dev, LMS_CH_RX, &m_lpfRangeRx) < 0)
64  {
65  qCritical() << "DeviceLimeSDRParams::open: cannot get the Rx LPF range for device " << deviceStr;
66  return false;
67  }
68 
69  if (LMS_GetLPFBWRange(m_dev, LMS_CH_TX, &m_lpfRangeTx) < 0)
70  {
71  qCritical() << "DeviceLimeSDRParams::open: cannot get the Tx LPF range for device " << deviceStr;
72  return false;
73  }
74 
75  if (LMS_GetLOFrequencyRange(m_dev, LMS_CH_RX, &m_loRangeRx) < 0)
76  {
77  qDebug() << "DeviceLimeSDRParams::open: cannot get the Rx LO range for device " << deviceStr;
78  return false;
79  }
80 
81  if (LMS_GetLOFrequencyRange(m_dev, LMS_CH_TX, &m_loRangeTx) < 0)
82  {
83  qCritical() << "DeviceLimeSDRParams::open: cannot get the Tx LO range for device " << deviceStr;
84  return false;
85  }
86 
87  if (LMS_GetSampleRateRange(m_dev, LMS_CH_RX, &m_srRangeRx) < 0)
88  {
89  qCritical() << "DeviceLimeSDRParams::open: cannot get the Rx sample rate range for device " << deviceStr;
90  return false;
91  }
92 
93  if (LMS_GetSampleRateRange(m_dev, LMS_CH_TX, &m_srRangeTx) < 0)
94  {
95  qCritical() << "DeviceLimeSDRParams::open: cannot get the Tx sample rate range for device " << deviceStr;
96  return false;
97  }
98 
99  return true;
100 }
lms_range_t m_lpfRangeRx
Low pass filter range information (Rx side)
lms_range_t m_srRangeTx
DAC sample rate range.
uint32_t m_nbTxChannels
number of Tx channels (normally 2, we&#39;ll see if we really use it...)
lms_range_t m_srRangeRx
ADC sample rate range.
uint32_t m_nbRxChannels
number of Rx channels (normally 2, we&#39;ll see if we really use it...)
lms_device_t * m_dev
device handle
lms_range_t m_lpfRangeTx
Low pass filter range information (Tx side)
LimeType m_type
Hardware type.
void getHardwareType(const char *device_str)
lms_range_t m_loRangeTx
LO range for Tx.
lms_range_t m_loRangeRx
LO range for Rx.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_dev

lms_device_t* DeviceLimeSDRParams::m_dev

device handle

Definition at line 42 of file devicelimesdrparam.h.

Referenced by close(), and open().

◆ m_log2OvSRRx

int DeviceLimeSDRParams::m_log2OvSRRx

log2 of Rx oversampling (0..5)

Definition at line 52 of file devicelimesdrparam.h.

Referenced by LimeSDRInput::applySettings(), and LimeSDRInput::getHWLog2Decim().

◆ m_log2OvSRTx

int DeviceLimeSDRParams::m_log2OvSRTx

log2 of Tx oversampling (0..5)

Definition at line 53 of file devicelimesdrparam.h.

Referenced by LimeSDROutput::applySettings(), and LimeSDROutput::getHWLog2Interp().

◆ m_loRangeRx

lms_range_t DeviceLimeSDRParams::m_loRangeRx

LO range for Rx.

Definition at line 47 of file devicelimesdrparam.h.

Referenced by LimeSDRInput::getLORange(), and open().

◆ m_loRangeTx

lms_range_t DeviceLimeSDRParams::m_loRangeTx

LO range for Tx.

Definition at line 48 of file devicelimesdrparam.h.

Referenced by LimeSDROutput::getLORange(), and open().

◆ m_lpfRangeRx

lms_range_t DeviceLimeSDRParams::m_lpfRangeRx

Low pass filter range information (Rx side)

Definition at line 45 of file devicelimesdrparam.h.

Referenced by LimeSDRInput::getLPRange(), and open().

◆ m_lpfRangeTx

lms_range_t DeviceLimeSDRParams::m_lpfRangeTx

Low pass filter range information (Tx side)

Definition at line 46 of file devicelimesdrparam.h.

Referenced by LimeSDROutput::getLPRange(), and open().

◆ m_nbRxChannels

uint32_t DeviceLimeSDRParams::m_nbRxChannels

number of Rx channels (normally 2, we'll see if we really use it...)

Definition at line 43 of file devicelimesdrparam.h.

Referenced by LimeSDRInputPlugin::enumSampleSources(), open(), and LimeSDRInput::openDevice().

◆ m_nbTxChannels

uint32_t DeviceLimeSDRParams::m_nbTxChannels

number of Tx channels (normally 2, we'll see if we really use it...)

Definition at line 44 of file devicelimesdrparam.h.

Referenced by LimeSDROutputPlugin::enumSampleSinks(), open(), and LimeSDROutput::openDevice().

◆ m_rxFrequency

float DeviceLimeSDRParams::m_rxFrequency

Rx frequency.

Definition at line 54 of file devicelimesdrparam.h.

◆ m_sampleRate

float DeviceLimeSDRParams::m_sampleRate

ADC/DAC sample rate.

Definition at line 51 of file devicelimesdrparam.h.

Referenced by LimeSDROutput::applySettings(), and LimeSDRInput::applySettings().

◆ m_srRangeRx

lms_range_t DeviceLimeSDRParams::m_srRangeRx

ADC sample rate range.

Definition at line 49 of file devicelimesdrparam.h.

Referenced by LimeSDRInput::getSRRange(), and open().

◆ m_srRangeTx

lms_range_t DeviceLimeSDRParams::m_srRangeTx

DAC sample rate range.

Definition at line 50 of file devicelimesdrparam.h.

Referenced by LimeSDROutput::getSRRange(), and open().

◆ m_txFrequency

float DeviceLimeSDRParams::m_txFrequency

Tx frequency.

Definition at line 55 of file devicelimesdrparam.h.

◆ m_type

LimeType DeviceLimeSDRParams::m_type

The documentation for this struct was generated from the following files: