GNU Radio's LIMESDR Package
|
#include <device_handler.h>
Public Member Functions | |
~device_handler () | |
void | error (int device_number) |
lms_device_t * | get_device (int device_number) |
int | open_device (std::string &serial) |
void | close_device (int device_number, int block_type) |
void | close_all_devices () |
void | check_blocks (int device_number, int block_type, int channel_mode, const std::string &filename) |
void | settings_from_file (int device_number, const std::string &filename, int *antenna_tx) |
void | enable_channels (int device_number, int channel_mode, bool direction) |
void | set_samp_rate (int device_number, double &rate) |
void | set_oversampling (int device_number, int oversample) |
double | set_rf_freq (int device_number, bool direction, int channel, float rf_freq) |
void | calibrate (int device_number, int direction, int channel, double bandwidth) |
void | set_antenna (int device_number, int channel, int direction, int antenna) |
double | set_analog_filter (int device_number, bool direction, int channel, double analog_bandw) |
double | set_digital_filter (int device_number, bool direction, int channel, double digital_bandw) |
unsigned | set_gain (int device_number, bool direction, int channel, unsigned gain_dB) |
void | set_nco (int device_number, bool direction, int channel, float nco_freq) |
void | disable_DC_corrections (int device_number) |
void | set_tcxo_dac (int device_number, uint16_t dacVal) |
void | set_rfe_device (rfe_dev_t *rfe_dev) |
void | update_rfe_channels () |
void | write_lms_reg (int device_number, uint32_t address, uint16_t val) |
void | set_gpio_dir (int device_number, uint8_t dir) |
void | write_gpio (int device_number, uint8_t out) |
uint8_t | read_gpio (int device_number) |
Static Public Member Functions | |
static device_handler & | getInstance () |
Public Attributes | |
std::recursive_mutex | block_mutex |
device_handler::~device_handler | ( | ) |
void device_handler::calibrate | ( | int | device_number, |
int | direction, | ||
int | channel, | ||
double | bandwidth | ||
) |
Perform device calibration.
device_number | Device number from the list of LMS_GetDeviceList. |
direction | Direction of samples: RX(LMS_CH_RX),TX(LMS_CH_RX). |
channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1). |
bandwidth | Set calibration bandwidth in Hz. |
void device_handler::check_blocks | ( | int | device_number, |
int | block_type, | ||
int | channel_mode, | ||
const std::string & | filename | ||
) |
Check what blocks are used for single device.
device_number | Device number from the list of LMS_GetDeviceList. |
block_type | Source block(1), Sink block(2). |
channel_mode | Channel A(0), Channel B(1), MIMO(2) |
filename | Path to file if file switch is turned on. |
void device_handler::close_all_devices | ( | ) |
Disconnect from all devices.
void device_handler::close_device | ( | int | device_number, |
int | block_type | ||
) |
Disconnect from the device.
device_number | Device number from the list of LMS_GetDeviceList. |
block_type | Source block(1), Sink block(2). |
void device_handler::disable_DC_corrections | ( | int | device_number | ) |
Disables LimeSDR boards DC corrections
void device_handler::enable_channels | ( | int | device_number, |
int | channel_mode, | ||
bool | direction | ||
) |
Set used channels
device_number | Device number from the list of LMS_GetDeviceList. |
channel_mode | Channel A(0), Channel B(1), MIMO(2) |
direction | Direction of samples RX(LMS_CH_RX), TX(LMS_CH_RX). |
void device_handler::error | ( | int | device_number | ) |
Print device error and close all devices.
device_number | Device number from the list of LMS_GetDeviceList. |
lms_device_t * device_handler::get_device | ( | int | device_number | ) |
Get device connection handler in order to configure it.
device_number | Device number from the list of LMS_GetDeviceList. |
|
inlinestatic |
int device_handler::open_device | ( | std::string & | serial | ) |
Connect to the device and create singletone.
serial | Device serial from the list of LMS_GetDeviceList. |
uint8_t device_handler::read_gpio | ( | int | device_number | ) |
double device_handler::set_analog_filter | ( | int | device_number, |
bool | direction, | ||
int | channel, | ||
double | analog_bandw | ||
) |
Set analog filters.
device_number | Device number from the list of LMS_GetDeviceList. |
direction | Direction of samples: RX(LMS_CH_RX),TX(LMS_CH_TX). |
channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1). |
analog_bandw | Channel filter bandwidth in Hz. |
void device_handler::set_antenna | ( | int | device_number, |
int | channel, | ||
int | direction, | ||
int | antenna | ||
) |
Set which antenna is used
device_number | Device number from the list of LMS_GetDeviceList. |
channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1). |
direction | Direction of samples: RX(LMS_CH_RX),TX(LMS_CH_RX). |
antenna | Antenna to set: None(0), LNAH(1), LNAL(2), LNAW(3) for RX None(0), BAND1(1), BAND(2), NONE(3) for TX |
double device_handler::set_digital_filter | ( | int | device_number, |
bool | direction, | ||
int | channel, | ||
double | digital_bandw | ||
) |
Set digital filters (GFIR).
device_number | Device number from the list of LMS_GetDeviceList. |
direction | Direction of samples: RX(LMS_CH_RX),TX(LMS_CH_TX). |
channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1). |
digital_bandw | Channel filter bandwidth in Hz. |
unsigned device_handler::set_gain | ( | int | device_number, |
bool | direction, | ||
int | channel, | ||
unsigned | gain_dB | ||
) |
Set the combined gain value in dB This function computes and sets the optimal gain values of various amplifiers that are present in the device based on desired gain value in dB.
device_number | Device number from the list of LMS_GetDeviceList. |
direction | Select RX or TX. |
channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1). |
gain_dB | Desired gain: [0,73] dB |
void device_handler::set_gpio_dir | ( | int | device_number, |
uint8_t | dir | ||
) |
void device_handler::set_nco | ( | int | device_number, |
bool | direction, | ||
int | channel, | ||
float | nco_freq | ||
) |
Set NCO (numerically controlled oscillator). By selecting NCO frequency configure NCO. When NCO frequency is 0, NCO is off.
device_number | Device number from the list of LMS_GetDeviceList. |
direction | Select RX or TX. |
channel | Channel index. |
nco_freq | NCO frequency in Hz. |
void device_handler::set_oversampling | ( | int | device_number, |
int | oversample | ||
) |
Set oversampling value for both channels
device_number | Device number from the list of LMS_GetDeviceList. |
oversample | Oversampling value (0 (default),1,2,4,8,16,32). |
double device_handler::set_rf_freq | ( | int | device_number, |
bool | direction, | ||
int | channel, | ||
float | rf_freq | ||
) |
Set RF frequency of both channels (RX and TX separately).
device_number | Device number from the list of LMS_GetDeviceList. |
direction | Direction of samples RX(LMS_CH_RX), TX(LMS_CH_TX). |
channel | selection: A(LMS_CH_0),B(LMS_CH_1). |
rf_freq | RF frequency in Hz. |
void device_handler::set_rfe_device | ( | rfe_dev_t * | rfe_dev | ) |
Sets up LimeRFE device pointer so that automatic channel configuration could be made
rfe_dev | Pointer to LimeRFE device descriptor |
void device_handler::set_samp_rate | ( | int | device_number, |
double & | rate | ||
) |
Set the same sample rate for both channels.
device_number | Device number from the list of LMS_GetDeviceList. |
rate | Sample rate in S/s. |
void device_handler::set_tcxo_dac | ( | int | device_number, |
uint16_t | dacVal | ||
) |
Set TCXO DAC.
device_number | Device number from the list of LMS_GetDeviceList. |
dacVal | DAC value (0-65535) |
void device_handler::settings_from_file | ( | int | device_number, |
const std::string & | filename, | ||
int * | antenna_tx | ||
) |
Load settings from .ini file.
device_number | Device number from the list of LMS_GetDeviceList. |
filename | Path to file if file switch is turned on. |
antenna_tx | Pointer to TX antenna, so PA path would be updated in sink block |
void device_handler::update_rfe_channels | ( | ) |
Assigns configured LimeSDR channels to LimeRFE for automatic channel switching
void device_handler::write_gpio | ( | int | device_number, |
uint8_t | out | ||
) |
void device_handler::write_lms_reg | ( | int | device_number, |
uint32_t | address, | ||
uint16_t | val | ||
) |
Writes an LMS register by calling LMS_WriteLMSReg()
|
mutable |