gr::limesdr::source_impl Class Reference

`#include <source_impl.h>`

Inheritance diagram for gr::limesdr::source_impl:

## Public Member Functions

| source_impl (std::string serial, int channel_mode, const std::string &filename, bool align_ch_phase)
| ~source_impl ()
bool | start (void)
bool | stop (void)
int | work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
gr::io_signature::sptr | args_to_io_signature (int channel_mode)
void | init_stream (int device_number, int channel)
void | release_stream (int device_number, lms_stream_t *stream)
double | set_center_freq (double freq, size_t chan=0)
void | set_antenna (int antenna, int channel=0)
void | set_nco (float nco_freq, int channel=0)
double | set_bandwidth (double analog_bandw, int channel=0)
void | set_digital_filter (double digital_bandw, int channel=0)
unsigned | set_gain (unsigned gain_dB, int channel=0)
double | set_sample_rate (double rate)
void | set_oversampling (int oversample)
void | set_buffer_size (uint32_t size)
void | calibrate (double bandw, int channel=0)
void | set_tcxo_dac (uint16_t dacVal=125)
void | write_lms_reg (uint32_t address, uint16_t val)
void | set_gpio_dir (uint8_t dir)
void | write_gpio (uint8_t out)
uint8_t | read_gpio ()

## Additional Inherited Members

Public Types inherited from gr::limesdr::source
typedef std::shared_ptr< source > | sptr
Static Public Member Functions inherited from gr::limesdr::source
static sptr | make (std::string serial, int channel_mode, const std::string &filename, bool align_ch_phase)
| Return a shared_ptr to a new instance of limesdr::source.

## Constructor & Destructor Documentation

## source_impl()

gr::limesdr::source_impl::source_impl | ( | std::string | serial,
|  | int | channel_mode,
|  | const std::string & | filename,
|  | bool | align_ch_phase )

## ~source_impl()

gr::limesdr::source_impl::~source_impl | ( |  | ) |

## Member Function Documentation

## args_to_io_signature()

gr::io_signature::sptr gr::limesdr::source_impl::args_to_io_signature | ( | int | channel_mode | ) |

inline

## calibrate()

void gr::limesdr::source_impl::calibrate | ( | double | bandw,
|  | int | channel = 0 )

virtual

Perform device calibration.

Parameters

  bandw | Set calibration bandwidth in Hz.
  channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1).

Implements gr::limesdr::source.

## init_stream()

void gr::limesdr::source_impl::init_stream | ( | int | device_number,
|  | int | channel )

## read_gpio()

uint8_t gr::limesdr::source_impl::read_gpio | ( |  | ) |

virtual

Read GPIO inputs

Read GPIO inputs by calling LMS_GPIORead()

Returns
  input level bitmap (eight bits, one for each pin)

Implements gr::limesdr::source.

## release_stream()

void gr::limesdr::source_impl::release_stream | ( | int | device_number,
|  | lms_stream_t * | stream )

## set_antenna()

void gr::limesdr::source_impl::set_antenna | ( | int | antenna,
|  | int | channel = 0 )

virtual

Set which antenna is used

Parameters

  antenna | Antenna to set: None(0), LNAH(1), LNAL(2), LNAW(3), AUTO(255)
  channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1).

Implements gr::limesdr::source.

## set_bandwidth()

double gr::limesdr::source_impl::set_bandwidth | ( | double | analog_bandw,
|  | int | channel = 0 )

virtual

Set analog filters.

Parameters

  analog_bandw | Channel filter bandwidth in Hz.
  channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1).

Returns
  actual filter bandwidth in Hz

Implements gr::limesdr::source.

## set_buffer_size()

void gr::limesdr::source_impl::set_buffer_size | ( | uint32_t | size | ) |

virtual

Set stream buffer size

Parameters

  size | FIFO buffer size in samples

Implements gr::limesdr::source.

## set_center_freq()

double gr::limesdr::source_impl::set_center_freq | ( | double | freq,
|  | size_t | chan = 0 )

virtual

Set center frequency

Parameters

  freq | Frequency to set in Hz
  chan | Channel (not used)

Returns
  actual center frequency in Hz

Implements gr::limesdr::source.

## set_digital_filter()

void gr::limesdr::source_impl::set_digital_filter | ( | double | digital_bandw,
|  | int | channel = 0 )

virtual

Set digital filters (GFIR).

Parameters

  digital_bandw | Channel filter bandwidth in Hz.
  channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1).

Implements gr::limesdr::source.

## set_gain()

unsigned gr::limesdr::source_impl::set_gain | ( | unsigned | gain_dB,
|  | int | channel = 0 )

virtual

Set the combined gain value in dB

Note
  actual gain depends on LO frequency and analog LPF configuration and resulting output signal level may be different when those values are changed

Parameters

  gain_dB | Desired gain: [0,73] dB
  channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1).

Returns
  actual gain in dB

Implements gr::limesdr::source.

## set_gpio_dir()

void gr::limesdr::source_impl::set_gpio_dir | ( | uint8_t | dir | ) |

virtual

Set GPIO direction

Set GPIO direction by calling LMS_GPIODirWrite()

Parameters

  dir | Direction bitmap (eight bits, one for each pin, 1 = output, 0 = input)

Implements gr::limesdr::source.

## set_nco()

void gr::limesdr::source_impl::set_nco | ( | float | nco_freq,
|  | int | channel = 0 )

virtual

Set NCO (numerically controlled oscillator). By selecting NCO frequency configure NCO. When NCO frequency is 0, NCO is off.

Parameters

  nco_freq | NCO frequency in Hz.
  channel | Channel index.

Implements gr::limesdr::source.

## set_oversampling()

void gr::limesdr::source_impl::set_oversampling | ( | int | oversample | ) |

virtual

Set oversampling for both channels.

Parameters

  oversample | Oversampling value (0 (default),1,2,4,8,16,32).

Implements gr::limesdr::source.

## set_sample_rate()

double gr::limesdr::source_impl::set_sample_rate | ( | double | rate | ) |

virtual

Set the same sample rate for both channels.

Parameters

  rate | Sample rate in S/s.

Returns
  actual sample rate in S/s

Implements gr::limesdr::source.

## set_tcxo_dac()

void gr::limesdr::source_impl::set_tcxo_dac | ( | uint16_t | dacVal = 125 | ) |

virtual

Set TCXO DAC.

Note
  Care must be taken as this parameter is returned to default value only after power off.
  LimeSDR-Mini default value is 180 range is [0,255] LimeSDR-USB default value is 125 range is [0,255] LimeSDR-PCIe default value is 134 range is [0,255] LimeNET-Micro default value is 30714 range is [0,65535]

Parameters

  dacVal | DAC value (0-65535)

Implements gr::limesdr::source.

## start()

bool gr::limesdr::source_impl::start | ( | void |  | ) |

## stop()

bool gr::limesdr::source_impl::stop | ( | void |  | ) |

## work()

int gr::limesdr::source_impl::work | ( | int | noutput_items,
|  | gr_vector_const_void_star & | input_items,
|  | gr_vector_void_star & | output_items )

## write_gpio()

void gr::limesdr::source_impl::write_gpio | ( | uint8_t | out | ) |

virtual

Write GPIO outputs

Write GPIO outputs by calling LMS_GPIOWrite()

Parameters

  out | Level bitmap (eight bits, one for each pin)

Implements gr::limesdr::source.

## write_lms_reg()

void gr::limesdr::source_impl::write_lms_reg | ( | uint32_t | address,
|  | uint16_t | val )

virtual

Write LMS register

Writes a parameter by calling LMS_WriteLMSReg()

Parameters

  address | Address
  val | Value

Implements gr::limesdr::source.

The documentation for this class was generated from the following file:

- source_impl.h