![]() |
libbladeRF
1.1.0
Nuand bladeRF library
|
Data Structures | |
struct | bladerf_rational_rate |
Macros | |
#define | BLADERF_RXVGA1_GAIN_MIN 5 |
#define | BLADERF_RXVGA1_GAIN_MAX 30 |
#define | BLADERF_RXVGA2_GAIN_MIN 0 |
#define | BLADERF_RXVGA2_GAIN_MAX 30 |
#define | BLADERF_TXVGA1_GAIN_MIN (-35) |
#define | BLADERF_TXVGA1_GAIN_MAX (-4) |
#define | BLADERF_TXVGA2_GAIN_MIN 0 |
#define | BLADERF_TXVGA2_GAIN_MAX 25 |
#define | BLADERF_SAMPLERATE_MIN 80000u |
#define | BLADERF_SAMPLERATE_REC_MAX 40000000u |
#define | BLADERF_BANDWIDTH_MIN 1500000u |
#define | BLADERF_BANDWIDTH_MAX 28000000u |
#define | BLADERF_FREQUENCY_MIN 232500000u |
#define | BLADERF_FREQUENCY_MIN_XB200 0u |
#define | BLADERF_FREQUENCY_MAX 3800000000u |
#define | BLADERF_LNA_GAIN_MID_DB 3 |
#define | BLADERF_LNA_GAIN_MAX_DB 6 |
This section provides functions pertaining to accessing, controlling, and configuring various device options and parameters.
#define BLADERF_BANDWIDTH_MAX 28000000u |
Maximum bandwidth, in Hz
Definition at line 388 of file libbladeRF.h.
#define BLADERF_BANDWIDTH_MIN 1500000u |
Minimum bandwidth, in Hz
Definition at line 385 of file libbladeRF.h.
#define BLADERF_FREQUENCY_MAX 3800000000u |
Maximum tunable frequency, in Hz
Definition at line 403 of file libbladeRF.h.
#define BLADERF_FREQUENCY_MIN 232500000u |
Minimum tunable frequency (without an XB-200 attached), in Hz
Definition at line 391 of file libbladeRF.h.
#define BLADERF_FREQUENCY_MIN_XB200 0u |
Minimum tunable frequency (with an XB-200 attached), in HZ.
While this value is the lowest permitted, note that the components on the XB-200 are only rated down to 50 MHz. Be aware that performance will likely degrade as you tune to lower frequencies.
Definition at line 400 of file libbladeRF.h.
#define BLADERF_LNA_GAIN_MAX_DB 6 |
Gain in db of the LNA at max setting
Definition at line 492 of file libbladeRF.h.
#define BLADERF_LNA_GAIN_MID_DB 3 |
Gain in dB of the LNA at mid setting
Definition at line 491 of file libbladeRF.h.
#define BLADERF_RXVGA1_GAIN_MAX 30 |
Maximum RXVGA1 gain, in dB
Definition at line 358 of file libbladeRF.h.
#define BLADERF_RXVGA1_GAIN_MIN 5 |
Minimum RXVGA1 gain, in dB
Definition at line 355 of file libbladeRF.h.
#define BLADERF_RXVGA2_GAIN_MAX 30 |
Maximum RXVGA2 gain, in dB
Definition at line 364 of file libbladeRF.h.
#define BLADERF_RXVGA2_GAIN_MIN 0 |
Minimum RXVGA2 gain, in dB
Definition at line 361 of file libbladeRF.h.
#define BLADERF_SAMPLERATE_MIN 80000u |
Minimum sample rate, in Hz
Definition at line 379 of file libbladeRF.h.
#define BLADERF_SAMPLERATE_REC_MAX 40000000u |
Maximum recommended sample rate, in Hz
Definition at line 382 of file libbladeRF.h.
#define BLADERF_TXVGA1_GAIN_MAX (-4) |
Maximum TXVGA1 gain, in dB
Definition at line 370 of file libbladeRF.h.
#define BLADERF_TXVGA1_GAIN_MIN (-35) |
Minimum TXVGA1 gain, in dB
Definition at line 367 of file libbladeRF.h.
#define BLADERF_TXVGA2_GAIN_MAX 25 |
Maximum TXVGA2 gain, in dB
Definition at line 376 of file libbladeRF.h.
#define BLADERF_TXVGA2_GAIN_MIN 0 |
Minimum TXVGA2 gain, in dB
Definition at line 373 of file libbladeRF.h.
enum bladerf_cal_module |
DC Calibration Modules
Definition at line 584 of file libbladeRF.h.
enum bladerf_correction |
Correction parameter selection
These values specify the correction parameter to modify or query when calling bladerf_set_correction() or bladerf_get_correction(). Note that the meaning of the value
parameter to these functions depends upon the correction parameter.
Definition at line 601 of file libbladeRF.h.
enum bladerf_lna_gain |
LNA gain options
Enumerator | |
---|---|
BLADERF_LNA_GAIN_UNKNOWN |
Invalid LNA gain |
BLADERF_LNA_GAIN_BYPASS |
LNA bypassed - 0dB gain |
BLADERF_LNA_GAIN_MID |
LNA Mid Gain (MAX-6dB) |
BLADERF_LNA_GAIN_MAX |
LNA Max Gain |
Definition at line 484 of file libbladeRF.h.
enum bladerf_loopback |
Loopback options
Definition at line 408 of file libbladeRF.h.
enum bladerf_lpf_mode |
LPF mode
Enumerator | |
---|---|
BLADERF_LPF_NORMAL |
LPF connected and enabled |
BLADERF_LPF_BYPASSED |
LPF bypassed |
BLADERF_LPF_DISABLED |
LPF disabled |
Definition at line 497 of file libbladeRF.h.
enum bladerf_module |
Module selection for those which have both RX and TX constituents
Enumerator | |
---|---|
BLADERF_MODULE_RX |
Receive Module |
BLADERF_MODULE_TX |
Transmit Module |
Definition at line 506 of file libbladeRF.h.
enum bladerf_sampling |
Sampling connection
Enumerator | |
---|---|
BLADERF_SAMPLING_UNKNOWN |
Unable to determine connection type |
BLADERF_SAMPLING_INTERNAL |
Sample from RX/TX connector |
BLADERF_SAMPLING_EXTERNAL |
Sample from J60 or J61 |
Definition at line 475 of file libbladeRF.h.
enum bladerf_xb |
Expansion boards
Definition at line 515 of file libbladeRF.h.
enum bladerf_xb200_filter |
XB-200 filter selection options
Definition at line 527 of file libbladeRF.h.
enum bladerf_xb200_path |
XB-200 signal paths
Enumerator | |
---|---|
BLADERF_XB200_BYPASS |
Bypass the XB-200 mixer |
BLADERF_XB200_MIX |
Pass signals through the XB-200 mixer |
Definition at line 576 of file libbladeRF.h.
API_EXPORT int CALL_CONV bladerf_enable_module | ( | struct bladerf * | dev, |
bladerf_module | m, | ||
bool | enable | ||
) |
Enable or disable the specified RX/TX module.
When a synchronous stream is associated with the specified module, this will shut down the underlying asynchronous stream when enable
= false.
When transmitting samples with the sync interface, be sure to provide ample time for TX samples reach the FPGA and be transmitted before calling this function with enable
= false.
dev | Device handle |
m | Device module |
enable | true to enable, false to disable |
API_EXPORT int CALL_CONV bladerf_expansion_attach | ( | struct bladerf * | dev, |
bladerf_xb | xb | ||
) |
Attach and enable an expansion board's features
dev | Device handle |
xb | Expansion board |
API_EXPORT int CALL_CONV bladerf_expansion_get_attached | ( | struct bladerf * | dev, |
bladerf_xb * | xb | ||
) |
Determine which expansion board is attached
dev | Device handle |
xb | Expansion board |
API_EXPORT int CALL_CONV bladerf_get_bandwidth | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
unsigned int * | bandwidth | ||
) |
Get the bandwidth of the LMS LPF
dev | Device Handle |
module | Module for bandwidth request |
bandwidth | Actual bandwidth in Hz |
API_EXPORT int CALL_CONV bladerf_get_correction | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
bladerf_correction | corr, | ||
int16_t * | value | ||
) |
Obtain the current value of the specified configuration parameter
[in] | dev | Device handle |
[in] | module | Module to retrieve correction information from |
[in] | corr | Correction type |
[out] | value | Current value |
API_EXPORT int CALL_CONV bladerf_get_frequency | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
unsigned int * | frequency | ||
) |
Get module's current frequency in Hz
dev | Device handle |
module | Module to configure |
frequency | Pointer to the returned frequency |
API_EXPORT int CALL_CONV bladerf_get_lna_gain | ( | struct bladerf * | dev, |
bladerf_lna_gain * | gain | ||
) |
Get the LNA gain
dev | Device handle |
gain | Pointer to the set gain level |
API_EXPORT int CALL_CONV bladerf_get_loopback | ( | struct bladerf * | dev, |
bladerf_loopback * | l | ||
) |
Get current loopback mode
[in] | dev | Device handle |
[out] | l | Current loopback mode |
API_EXPORT int CALL_CONV bladerf_get_lpf_mode | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
bladerf_lpf_mode * | mode | ||
) |
Get the current mode of the LMS LPF
dev | Device handle |
module | Module for mode request |
mode | Current mode of the LPF |
API_EXPORT int CALL_CONV bladerf_get_rational_sample_rate | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
struct bladerf_rational_rate * | rate | ||
) |
Read the device's sample rate in rational Hz
[in] | dev | Device handle |
[in] | module | Module to query |
[out] | rate | Pointer to returned rational sample rate |
API_EXPORT int CALL_CONV bladerf_get_rxvga1 | ( | struct bladerf * | dev, |
int * | gain | ||
) |
Get the pre-LPF VGA gain
dev | Device handle |
gain | Pointer to the set gain level |
API_EXPORT int CALL_CONV bladerf_get_rxvga2 | ( | struct bladerf * | dev, |
int * | gain | ||
) |
Get the post-LPF VGA gain
dev | Device handle |
gain | Pointer to the set gain level |
API_EXPORT int CALL_CONV bladerf_get_sample_rate | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
unsigned int * | rate | ||
) |
Read the device's sample rate in Hz
[in] | dev | Device handle |
[in] | module | Module to query |
[out] | rate | Pointer to returned sample rate |
API_EXPORT int CALL_CONV bladerf_get_sampling | ( | struct bladerf * | dev, |
bladerf_sampling * | sampling | ||
) |
Read the device's current state of RXVGA2 and ADC pin connection to figure out which sampling mode it is currently configured in.
[in] | dev | Device handle |
[out] | sampling | Sampling connection |
API_EXPORT int CALL_CONV bladerf_get_txvga1 | ( | struct bladerf * | dev, |
int * | gain | ||
) |
Get the post-LPF gain in dB
dev | Device handle |
gain | Pointer to returned gain |
API_EXPORT int CALL_CONV bladerf_get_txvga2 | ( | struct bladerf * | dev, |
int * | gain | ||
) |
Get the PA gain in dB
dev | Device handle |
gain | Pointer to returned gain |
API_EXPORT int CALL_CONV bladerf_select_band | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
unsigned int | frequency | ||
) |
Select the appropriate band path given a frequency in Hz.
The high band (LNA2 and PA2) is used for frequency
>= 1.5 GHz. Otherwise, The low band (LNA1 and PA1) is used.
Frequency values outside the range of [ BLADERF_FREQUENCY_MIN, BLADERF_FREQUENCY_MAX ] will be clamped.
dev | Device handle |
module | Module to configure |
frequency | Tuned frequency |
API_EXPORT int CALL_CONV bladerf_set_bandwidth | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
unsigned int | bandwidth, | ||
unsigned int * | actual | ||
) |
Set the bandwidth of the LMS LPF to specified value in Hz
The underlying device is capable of a discrete set of bandwidth values. The caller should check the actual
parameter to determine which of these discrete bandwidth values is actually used for the requested bandwidth.
Values outside the range of [ BLADERF_BANDWIDTH_MIN, BLADERF_BANDWIDTH_MAX ] will be clamped.
[in] | dev | Device handle |
[in] | module | Module for bandwidth request |
[in] | bandwidth | Desired bandwidth |
[out] | actual | If non-NULL, written with the actual bandwidth that the device was able to achieve. |
API_EXPORT int CALL_CONV bladerf_set_correction | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
bladerf_correction | corr, | ||
int16_t | value | ||
) |
Set the value of the specified configuration parameter
See the bladerf_correction description for the valid ranges of the value
parameter.
dev | Device handle |
module | Module to apply correction to |
corr | Correction type |
value | Value to apply |
API_EXPORT int CALL_CONV bladerf_set_frequency | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
unsigned int | frequency | ||
) |
Set module's frequency in Hz.
Values outside the range of [ BLADERF_FREQUENCY_MIN, BLADERF_FREQUENCY_MAX ] will be clamped.
This calls bladerf_select_band() internally.
dev | Device handle |
module | Module to configure |
frequency | Desired frequency |
API_EXPORT int CALL_CONV bladerf_set_gain | ( | struct bladerf * | dev, |
bladerf_module | mod, | ||
int | gain | ||
) |
Set a combined pre and post LPF RX gain
This function computes the optimal LNA, RXVGA1, and RVGA2 gains for a requested amount of RX gain, and computes the optimal TXVGA1 and TXVGA2 gains for a requested amount of TX gain
dev | Device handle |
mod | Module |
gain | Desired gain |
API_EXPORT int CALL_CONV bladerf_set_lna_gain | ( | struct bladerf * | dev, |
bladerf_lna_gain | gain | ||
) |
Set the LNA gain
dev | Device handle |
gain | Desired gain level |
API_EXPORT int CALL_CONV bladerf_set_loopback | ( | struct bladerf * | dev, |
bladerf_loopback | l | ||
) |
Apply specified loopback mode
dev | Device handle |
l | Loopback mode. Note that BLADERF_LB_NONE disables the use of loopback functionality. |
API_EXPORT int CALL_CONV bladerf_set_lpf_mode | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
bladerf_lpf_mode | mode | ||
) |
Set the LMS LPF mode to bypass or disable it
dev | Device handle |
module | Module for mode request |
mode | Mode to be set |
API_EXPORT int CALL_CONV bladerf_set_rational_sample_rate | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
struct bladerf_rational_rate * | rate, | ||
struct bladerf_rational_rate * | actual | ||
) |
Configure the device's sample rate as a rational fraction of Hz. Sample rates are in the form of integer + num/denom.
[in] | dev | Device handle |
[in] | module | Module to change |
[in] | rate | Rational sample rate |
[out] | actual | If non-NULL, this is written with the actual rational sample rate achieved. |
The sample rate must be greater than or equal to BLADERF_SAMPLERATE_MIN. Values above BLADERF_SAMPLERATE_REC_MAX are allowed, but not recommended. Setting the sample rates higher than recommended max may yield errors and unexpected results.
API_EXPORT int CALL_CONV bladerf_set_rxvga1 | ( | struct bladerf * | dev, |
int | gain | ||
) |
Set the pre-LPF VGA gain
Values outside the range of [ BLADERF_RXVGA1_GAIN_MIN, BLADERF_RXVGA1_GAIN_MAX ] will be clamped.
dev | Device handle |
gain | Desired gain |
API_EXPORT int CALL_CONV bladerf_set_rxvga2 | ( | struct bladerf * | dev, |
int | gain | ||
) |
Set the post-LPF VGA gain
Values outside the range of [ BLADERF_RXVGA2_GAIN_MIN, BLADERF_RXVGA2_GAIN_MAX ] will be clamped.
dev | Device handle |
gain | Desired gain |
API_EXPORT int CALL_CONV bladerf_set_sample_rate | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
unsigned int | rate, | ||
unsigned int * | actual | ||
) |
Configure the device's sample rate, in Hz. Note this requires the sample rate is an integer value of Hz. Use bladerf_set_rational_sample_rate() for more arbitrary values.
The sample rate must be greater than or equal to BLADERF_SAMPLERATE_MIN. Values above BLADERF_SAMPLERATE_REC_MAX are allowed, but not recommended. Setting the sample rates higher than recommended max may yield errors and unexpected results.
[in] | dev | Device handle |
[in] | module | Module to change |
[in] | rate | Sample rate |
[out] | actual | If non-NULL. this is written with the actual sample rate achieved. |
API_EXPORT int CALL_CONV bladerf_set_sampling | ( | struct bladerf * | dev, |
bladerf_sampling | sampling | ||
) |
Configure the sampling of the LMS6002D to be either internal or external. Internal sampling will read from the RXVGA2 driver internal to the chip. External sampling will connect the ADC inputs to the external inputs for direct sampling.
[in] | dev | Device handle |
[in] | sampling | Sampling connection |
API_EXPORT int CALL_CONV bladerf_set_tx_gain | ( | struct bladerf * | dev, |
int | gain | ||
) |
Set a combined VGA TX gain
This function computes the optimal TXVGA1 and TXVGA2 gains for a requested amount of gain
dev | Device handle |
gain | Desired gain |
API_EXPORT int CALL_CONV bladerf_set_txvga1 | ( | struct bladerf * | dev, |
int | gain | ||
) |
Set the post-LPF gain in dB
Values outside the range of [ BLADERF_TXVGA1_GAIN_MIN, BLADERF_TXVGA1_GAIN_MAX ] will be clamped.
dev | Device handle |
gain | Desired gain |
API_EXPORT int CALL_CONV bladerf_set_txvga2 | ( | struct bladerf * | dev, |
int | gain | ||
) |
Set the PA gain in dB
Values outside the range of [ BLADERF_TXVGA2_GAIN_MIN, BLADERF_TXVGA2_GAIN_MAX ] will be clamped.
dev | Device handle |
gain | Desired gain |
API_EXPORT int CALL_CONV bladerf_xb200_get_filterbank | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
bladerf_xb200_filter * | filter | ||
) |
Get current XB-200 filterbank
[in] | dev | Device handle |
[in] | module | Module to query |
[out] | filter | Pointer to filterbank, only updated if return value is 0. |
API_EXPORT int CALL_CONV bladerf_xb200_get_path | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
bladerf_xb200_path * | path | ||
) |
Get current XB-200 signal path
dev | Device handle |
module | Module to query |
path | Pointer to XB200 signal path |
API_EXPORT int CALL_CONV bladerf_xb200_set_filterbank | ( | struct bladerf * | dev, |
bladerf_module | mod, | ||
bladerf_xb200_filter | filter | ||
) |
Set XB-200 filterbank
dev | Device handle |
mod | Module |
filter | XB200 filterbank |
API_EXPORT int CALL_CONV bladerf_xb200_set_path | ( | struct bladerf * | dev, |
bladerf_module | module, | ||
bladerf_xb200_path | path | ||
) |
Set XB-200 signal path
dev | Device handle |
module | Module to configure |
path | Desired XB-200 signal path |