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) |
void | open_device (int device_number, int device_type) |
void | close_device (int device_number) |
void | close_all_devices () |
void | check_blocks (int device_number, int block_type, int device_type, int chip_mode, double sample_rate, size_t oversample, int file_switch, const char *filename) |
void | settings_from_file (int device_number, const char *filename) |
void | set_chip_mode (int device_number, int device_type, int chip_mode, int channel, bool direction) |
void | set_samp_rate (int device_number, const double rate, size_t oversample) |
void | set_samp_rate_dir (int device_number, const int direction, const double rate, size_t oversample) |
void | set_rf_freq (int device_number, int device_type, bool direction, int channel, float rf_freq) |
void | calibrate (int device_number, int device_type, int calibration, int direction, int channel, double bandwidth, float rf_freq, int path) |
void | mini_switch_workaround (int device_number) |
void | set_lna_path_mini (int device_number, int lna_path_mini) |
void | set_lna_path (int device_number, int channel, int lna_path) |
void | set_pa_path_mini (int device_number, int pa_path_mini) |
void | set_pa_path (int device_number, int channel, int pa_path) |
void | set_analog_filter (int device_number, bool direction, int channel, int analog_filter, float analog_bandw) |
void | set_digital_filter (int device_number, bool direction, int channel, int digital_filter, float digital_bandw) |
void | set_gain (int device_number, bool direction, int channel, unsigned int gain_dB) |
Static Public Member Functions | |
static device_handler & | getInstance () |
device_handler::~device_handler | ( | ) |
Referenced by getInstance().
void device_handler::calibrate | ( | int | device_number, |
int | device_type, | ||
int | calibration, | ||
int | direction, | ||
int | channel, | ||
double | bandwidth, | ||
float | rf_freq, | ||
int | path | ||
) |
Perform device calibration.
device_number | Device number from the list of LMS_GetDeviceList. |
device_type | LimeSDR-Mini(1), LimeSDR-USB(2). |
calibration | Turn calibration: OFF(0),ON(1). |
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. |
rf_freq | Pass RF frequency in Hz for calibration. |
path | Pass path for calibration. |
Referenced by getInstance().
void device_handler::check_blocks | ( | int | device_number, |
int | block_type, | ||
int | device_type, | ||
int | chip_mode, | ||
double | sample_rate, | ||
size_t | oversample, | ||
int | file_switch, | ||
const char * | filename | ||
) |
Check what blocks are used for single device.
device_number | Device number from the list of LMS_GetDeviceList. |
device_type | LimeSDR-Mini(1), LimeSDR-USB(2). |
chip_mode | SISO(1), MIMO(2). |
samp_rate | Sample rate in Hz. |
oversample | Oversampling value (0 (default),1,2,4,8,16,32). |
file_switch | Load settings from file: NO(0),YES(1). |
filename | Path to file if file switch is turned on. |
Referenced by getInstance().
void device_handler::close_all_devices | ( | ) |
Disconnect from all devices.
Referenced by getInstance().
void device_handler::close_device | ( | int | device_number | ) |
Disconnect from the device.
device_number | Device number from the list of LMS_GetDeviceList. |
Referenced by getInstance().
void device_handler::error | ( | int | device_number | ) |
Print device error and close all devices.
device_number | Device number from the list of LMS_GetDeviceList. |
Referenced by getInstance().
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. |
Referenced by getInstance().
|
inlinestatic |
References calibrate(), check_blocks(), close_all_devices(), close_device(), error(), get_device(), mini_switch_workaround(), open_device(), set_analog_filter(), set_chip_mode(), set_digital_filter(), set_gain(), set_lna_path(), set_lna_path_mini(), set_pa_path(), set_pa_path_mini(), set_rf_freq(), set_samp_rate(), set_samp_rate_dir(), settings_from_file(), and ~device_handler().
void device_handler::mini_switch_workaround | ( | int | device_number | ) |
Workaround for LimeSDR-Mini switch bug. Call upon implementation.
device_number | Device number from the list of LMS_GetDeviceList. |
Referenced by getInstance().
void device_handler::open_device | ( | int | device_number, |
int | device_type | ||
) |
Connect to the device and create singletone.
device_number | Device number from the list of LMS_GetDeviceList. |
device_type | LimeSDR-Mini(1), LimeSDR-USB(2). |
Referenced by getInstance().
void device_handler::set_analog_filter | ( | int | device_number, |
bool | direction, | ||
int | channel, | ||
int | analog_filter, | ||
float | 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_filter | Turn analog filter: OFF(0),ON(1). |
analog_bandw | Channel filter bandwidth in Hz. |
Referenced by getInstance().
void device_handler::set_chip_mode | ( | int | device_number, |
int | device_type, | ||
int | chip_mode, | ||
int | channel, | ||
bool | direction | ||
) |
Set chip mode (single-input single-output/multiple-input multiple-output) and check if the device supports it.
device_number | Device number from the list of LMS_GetDeviceList. |
device_type | LimeSDR-Mini(1), LimeSDR-USB(2). |
chip_mode | SISO(1), MIMO(2). |
Referenced by getInstance().
void device_handler::set_digital_filter | ( | int | device_number, |
bool | direction, | ||
int | channel, | ||
int | digital_filter, | ||
float | 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_filter | Turn digital filter: OFF(0),ON(1). |
digital_bandw | Channel filter bandwidth in Hz. |
Referenced by getInstance().
void device_handler::set_gain | ( | int | device_number, |
bool | direction, | ||
int | channel, | ||
unsigned int | 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 index. |
gain_dB | Desired gain: [0,70] RX, [0,60] TX. |
Referenced by getInstance().
void device_handler::set_lna_path | ( | int | device_number, |
int | channel, | ||
int | lna_path | ||
) |
Set LNA path.
device_number | Device number from the list of LMS_GetDeviceList. |
channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1). |
lna_path | LNA path: no path(0),LNAH(1),LNAL(2),LNAW(3). |
Referenced by getInstance().
void device_handler::set_lna_path_mini | ( | int | device_number, |
int | lna_path_mini | ||
) |
LNA switch for LimeSDR-Mini.
device_number | Device number from the list of LMS_GetDeviceList. |
lna_path_mini | LNA switch: LNAH(1),LNAW(3). |
Referenced by getInstance().
void device_handler::set_pa_path | ( | int | device_number, |
int | channel, | ||
int | pa_path | ||
) |
Set PA path.
device_number | Device number from the list of LMS_GetDeviceList. |
channel | Channel selection: A(LMS_CH_0),B(LMS_CH_1). |
pa_path | PA path: BAND1(1),BAND2(2). |
Referenced by getInstance().
void device_handler::set_pa_path_mini | ( | int | device_number, |
int | pa_path_mini | ||
) |
PA switch for LimeSDR-Mini.
device_number | Device number from the list of LMS_GetDeviceList. |
pa_path_mini | PA path: BAND1(1),BAND2(2). |
Referenced by getInstance().
void device_handler::set_rf_freq | ( | int | device_number, |
int | device_type, | ||
bool | direction, | ||
int | channel, | ||
float | rf_freq | ||
) |
Set RF frequency of both channels (RX and TX seperately).
device_number | Device number from the list of LMS_GetDeviceList. |
device_type | LimeSDR-Mini(1), LimeSDR-USB(2). |
direction | Direction of samples RX(LMS_CH_RX), TX(LMS_CH_TX). |
rf_freq | RF frequency in Hz. |
Referenced by getInstance().
void device_handler::set_samp_rate | ( | int | device_number, |
const double | rate, | ||
size_t | oversample | ||
) |
Set the same sample rate for both channels.
device_number | Device number from the list of LMS_GetDeviceList. |
samp_rate | Sample rate in S/s. |
oversample | Oversampling value (0 (default),1,2,4,8,16,32). |
Referenced by getInstance().
void device_handler::set_samp_rate_dir | ( | int | device_number, |
const int | direction, | ||
const double | rate, | ||
size_t | oversample | ||
) |
Set sample rate for both channels (RX and TX seperately).
device_number | Device number from the list of LMS_GetDeviceList. |
direction | Direction of samples RX(LMS_CH_RX), TX(LMS_CH_RX). |
samp_rate | Sample rate in S/s. |
oversample | Oversampling value (0 (default),1,2,4,8,16,32). |
Referenced by getInstance().
void device_handler::settings_from_file | ( | int | device_number, |
const char * | filename | ||
) |
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. |
Referenced by getInstance().