libbladeRF  1.1.0
Nuand bladeRF library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Macros | Enumerations | Functions
Device control and configuration

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
 

Enumerations

enum  bladerf_loopback {
  BLADERF_LB_FIRMWARE = 1, BLADERF_LB_BB_TXLPF_RXVGA2, BLADERF_LB_BB_TXVGA1_RXVGA2, BLADERF_LB_BB_TXLPF_RXLPF,
  BLADERF_LB_BB_TXVGA1_RXLPF, BLADERF_LB_RF_LNA1, BLADERF_LB_RF_LNA2, BLADERF_LB_RF_LNA3,
  BLADERF_LB_NONE
}
 
enum  bladerf_sampling { BLADERF_SAMPLING_UNKNOWN, BLADERF_SAMPLING_INTERNAL, BLADERF_SAMPLING_EXTERNAL }
 
enum  bladerf_lna_gain { BLADERF_LNA_GAIN_UNKNOWN, BLADERF_LNA_GAIN_BYPASS, BLADERF_LNA_GAIN_MID, BLADERF_LNA_GAIN_MAX }
 
enum  bladerf_lpf_mode { BLADERF_LPF_NORMAL, BLADERF_LPF_BYPASSED, BLADERF_LPF_DISABLED }
 
enum  bladerf_module { BLADERF_MODULE_RX, BLADERF_MODULE_TX }
 
enum  bladerf_xb { BLADERF_XB_NONE = 0, BLADERF_XB_100, BLADERF_XB_200 }
 
enum  bladerf_xb200_filter {
  BLADERF_XB200_50M = 0, BLADERF_XB200_144M, BLADERF_XB200_222M, BLADERF_XB200_CUSTOM,
  BLADERF_XB200_AUTO_1DB, BLADERF_XB200_AUTO_3DB
}
 
enum  bladerf_xb200_path { BLADERF_XB200_BYPASS = 0, BLADERF_XB200_MIX }
 
enum  bladerf_cal_module { BLADERF_DC_CAL_LPF_TUNING, BLADERF_DC_CAL_TX_LPF, BLADERF_DC_CAL_RX_LPF, BLADERF_DC_CAL_RXVGA2 }
 
enum  bladerf_correction { BLADERF_CORR_LMS_DCOFF_I, BLADERF_CORR_LMS_DCOFF_Q, BLADERF_CORR_FPGA_PHASE, BLADERF_CORR_FPGA_GAIN }
 

Functions

API_EXPORT int CALL_CONV bladerf_enable_module (struct bladerf *dev, bladerf_module m, bool enable)
 
API_EXPORT int CALL_CONV bladerf_set_loopback (struct bladerf *dev, bladerf_loopback l)
 
API_EXPORT int CALL_CONV bladerf_get_loopback (struct bladerf *dev, bladerf_loopback *l)
 
API_EXPORT int CALL_CONV bladerf_set_sample_rate (struct bladerf *dev, bladerf_module module, unsigned int rate, unsigned int *actual)
 
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)
 
API_EXPORT int CALL_CONV bladerf_set_sampling (struct bladerf *dev, bladerf_sampling sampling)
 
API_EXPORT int CALL_CONV bladerf_get_sampling (struct bladerf *dev, bladerf_sampling *sampling)
 
API_EXPORT int CALL_CONV bladerf_get_sample_rate (struct bladerf *dev, bladerf_module module, unsigned int *rate)
 
API_EXPORT int CALL_CONV bladerf_get_rational_sample_rate (struct bladerf *dev, bladerf_module module, struct bladerf_rational_rate *rate)
 
API_EXPORT int CALL_CONV bladerf_set_correction (struct bladerf *dev, bladerf_module module, bladerf_correction corr, int16_t value)
 
API_EXPORT int CALL_CONV bladerf_get_correction (struct bladerf *dev, bladerf_module module, bladerf_correction corr, int16_t *value)
 
API_EXPORT int CALL_CONV bladerf_set_txvga2 (struct bladerf *dev, int gain)
 
API_EXPORT int CALL_CONV bladerf_get_txvga2 (struct bladerf *dev, int *gain)
 
API_EXPORT int CALL_CONV bladerf_set_txvga1 (struct bladerf *dev, int gain)
 
API_EXPORT int CALL_CONV bladerf_get_txvga1 (struct bladerf *dev, int *gain)
 
API_EXPORT int CALL_CONV bladerf_set_tx_gain (struct bladerf *dev, int gain)
 
API_EXPORT int CALL_CONV bladerf_set_lna_gain (struct bladerf *dev, bladerf_lna_gain gain)
 
API_EXPORT int CALL_CONV bladerf_get_lna_gain (struct bladerf *dev, bladerf_lna_gain *gain)
 
API_EXPORT int CALL_CONV bladerf_set_rxvga1 (struct bladerf *dev, int gain)
 
API_EXPORT int CALL_CONV bladerf_get_rxvga1 (struct bladerf *dev, int *gain)
 
API_EXPORT int CALL_CONV bladerf_set_rxvga2 (struct bladerf *dev, int gain)
 
API_EXPORT int CALL_CONV bladerf_get_rxvga2 (struct bladerf *dev, int *gain)
 
API_EXPORT int CALL_CONV bladerf_set_gain (struct bladerf *dev, bladerf_module mod, int gain)
 
API_EXPORT int CALL_CONV bladerf_set_bandwidth (struct bladerf *dev, bladerf_module module, unsigned int bandwidth, unsigned int *actual)
 
API_EXPORT int CALL_CONV bladerf_get_bandwidth (struct bladerf *dev, bladerf_module module, unsigned int *bandwidth)
 
API_EXPORT int CALL_CONV bladerf_set_lpf_mode (struct bladerf *dev, bladerf_module module, bladerf_lpf_mode mode)
 
API_EXPORT int CALL_CONV bladerf_get_lpf_mode (struct bladerf *dev, bladerf_module module, bladerf_lpf_mode *mode)
 
API_EXPORT int CALL_CONV bladerf_select_band (struct bladerf *dev, bladerf_module module, unsigned int frequency)
 
API_EXPORT int CALL_CONV bladerf_set_frequency (struct bladerf *dev, bladerf_module module, unsigned int frequency)
 
API_EXPORT int CALL_CONV bladerf_get_frequency (struct bladerf *dev, bladerf_module module, unsigned int *frequency)
 
API_EXPORT int CALL_CONV bladerf_expansion_attach (struct bladerf *dev, bladerf_xb xb)
 
API_EXPORT int CALL_CONV bladerf_expansion_get_attached (struct bladerf *dev, bladerf_xb *xb)
 
API_EXPORT int CALL_CONV bladerf_xb200_set_filterbank (struct bladerf *dev, bladerf_module mod, bladerf_xb200_filter filter)
 
API_EXPORT int CALL_CONV bladerf_xb200_get_filterbank (struct bladerf *dev, bladerf_module module, bladerf_xb200_filter *filter)
 
API_EXPORT int CALL_CONV bladerf_xb200_set_path (struct bladerf *dev, bladerf_module module, bladerf_xb200_path path)
 
API_EXPORT int CALL_CONV bladerf_xb200_get_path (struct bladerf *dev, bladerf_module module, bladerf_xb200_path *path)
 

Detailed Description

This section provides functions pertaining to accessing, controlling, and configuring various device options and parameters.

Macro Definition Documentation

#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.

Enumeration Type Documentation

DC Calibration Modules

Definition at line 584 of file libbladeRF.h.

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.

Enumerator
BLADERF_CORR_LMS_DCOFF_I 

Adjusts the in-phase DC offset via controls provided by the LMS6002D front end. Valid values are [-2048, 2048], which are scaled to the available control bits in the LMS device.

BLADERF_CORR_LMS_DCOFF_Q 

Adjusts the quadrature DC offset via controls provided the LMS6002D front end. Valid values are [-2048, 2048], which are scaled to the available control bits.

BLADERF_CORR_FPGA_PHASE 

Adjusts FPGA-based phase correction of [-10, 10] degrees, via a provided count value of [-4096, 4096].

BLADERF_CORR_FPGA_GAIN 

Adjusts FPGA-based gain correction of [0.0, 2.0], via provided values in the range of [-4096, 4096], where a value of 0 corresponds to a gain of 1.0.

Definition at line 601 of file libbladeRF.h.

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.

Loopback options

Enumerator
BLADERF_LB_FIRMWARE 

Firmware loopback inside of the FX3

BLADERF_LB_BB_TXLPF_RXVGA2 

Baseband loopback. TXLPF output is connected to the RXVGA2 input.

BLADERF_LB_BB_TXVGA1_RXVGA2 

Baseband loopback. TXVGA1 output is connected to the RXVGA2 input.

BLADERF_LB_BB_TXLPF_RXLPF 

Baseband loopback. TXLPF output is connected to the RXLPF input.

BLADERF_LB_BB_TXVGA1_RXLPF 

Baseband loopback. TXVGA1 output is connected to RXLPF input.

BLADERF_LB_RF_LNA1 

RF loopback. The TXMIX output, through the AUX PA, is connected to the output of LNA1.

BLADERF_LB_RF_LNA2 

RF loopback. The TXMIX output, through the AUX PA, is connected to the output of LNA2.

BLADERF_LB_RF_LNA3 

RF loopback. The TXMIX output, through the AUX PA, is connected to the output of LNA3.

BLADERF_LB_NONE 

Disables loopback and returns to normal operation.

Definition at line 408 of file libbladeRF.h.

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.

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.

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

Enumerator
BLADERF_XB_NONE 

No expansion boards attached

BLADERF_XB_100 

XB-100 GPIO expansion board. This device is not yet supported in libbladeRF, and is here as a placeholder for future support.

BLADERF_XB_200 

XB-200 Transverter board

Definition at line 515 of file libbladeRF.h.

XB-200 filter selection options

Enumerator
BLADERF_XB200_50M 

50-54 MHz (6 meter band) filterbank

BLADERF_XB200_144M 

144-148 MHz (2 meter band) filterbank

BLADERF_XB200_222M 

222-225 MHz (1.25 meter band) filterbank.

Note that this filter option is technically wider, covering 206-235 MHz.

BLADERF_XB200_CUSTOM 

This option enables the RX/TX module's custom filter bank path across the associated FILT and FILT-ANT SMA connectors on the XB-200 board.

For reception, it is often possible to simply connect the RXFILT and RXFILT-ANT connectors with an SMA cable (effectively, "no filter"). This allows for reception of signals outside of the frequency range of the on-board filters, with some potential trade-off in signal quality.

For transmission, always use an appropriate filter on the custom filter path to avoid spurious emissions.

BLADERF_XB200_AUTO_1DB 

When this option is selected, the other filter options are automatically selected depending on the RX or TX module's current frequency, based upon the 1dB points of the on-board filters. For frequencies outside the range of the on-board filters, the custom path is selected.

BLADERF_XB200_AUTO_3DB 

When this option is selected, the other filter options are automatically selected depending on the RX or TX module's current frequency, based upon the 3dB points of the on-board filters. For frequencies outside the range of the on-board filters, the custom path is selected.

Definition at line 527 of file libbladeRF.h.

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.

Function Documentation

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.

Parameters
devDevice handle
mDevice module
enabletrue to enable, false to disable
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_expansion_attach ( struct bladerf *  dev,
bladerf_xb  xb 
)

Attach and enable an expansion board's features

Parameters
devDevice handle
xbExpansion board
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_expansion_get_attached ( struct bladerf *  dev,
bladerf_xb xb 
)

Determine which expansion board is attached

Parameters
devDevice handle
xbExpansion board
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_get_bandwidth ( struct bladerf *  dev,
bladerf_module  module,
unsigned int *  bandwidth 
)

Get the bandwidth of the LMS LPF

Parameters
devDevice Handle
moduleModule for bandwidth request
bandwidthActual bandwidth in Hz
Returns
0 on success, value from Error codes list on failure
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

Parameters
[in]devDevice handle
[in]moduleModule to retrieve correction information from
[in]corrCorrection type
[out]valueCurrent value
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_get_frequency ( struct bladerf *  dev,
bladerf_module  module,
unsigned int *  frequency 
)

Get module's current frequency in Hz

Parameters
devDevice handle
moduleModule to configure
frequencyPointer to the returned frequency
API_EXPORT int CALL_CONV bladerf_get_lna_gain ( struct bladerf *  dev,
bladerf_lna_gain gain 
)

Get the LNA gain

Parameters
devDevice handle
gainPointer to the set gain level
API_EXPORT int CALL_CONV bladerf_get_loopback ( struct bladerf *  dev,
bladerf_loopback l 
)

Get current loopback mode

Parameters
[in]devDevice handle
[out]lCurrent loopback mode
Returns
0 on success, value from Error codes list on failure
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

Parameters
devDevice handle
moduleModule for mode request
modeCurrent mode of the LPF
Returns
0 on success, value from Error codes list on failure
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

Parameters
[in]devDevice handle
[in]moduleModule to query
[out]ratePointer to returned rational sample rate
Returns
0 on success, value from Error codes list upon failure
API_EXPORT int CALL_CONV bladerf_get_rxvga1 ( struct bladerf *  dev,
int *  gain 
)

Get the pre-LPF VGA gain

Parameters
devDevice handle
gainPointer to the set gain level
API_EXPORT int CALL_CONV bladerf_get_rxvga2 ( struct bladerf *  dev,
int *  gain 
)

Get the post-LPF VGA gain

Parameters
devDevice handle
gainPointer 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

Parameters
[in]devDevice handle
[in]moduleModule to query
[out]ratePointer to returned sample rate
Returns
0 on success, value from Error codes list upon failure
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.

Parameters
[in]devDevice handle
[out]samplingSampling connection
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_get_txvga1 ( struct bladerf *  dev,
int *  gain 
)

Get the post-LPF gain in dB

Parameters
devDevice handle
gainPointer to returned gain
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_get_txvga2 ( struct bladerf *  dev,
int *  gain 
)

Get the PA gain in dB

Parameters
devDevice handle
gainPointer to returned gain
Returns
0 on success, value from Error codes list on failure
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.

Parameters
devDevice handle
moduleModule to configure
frequencyTuned frequency
Returns
0 on success, value from Error codes list on failure
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.

Parameters
[in]devDevice handle
[in]moduleModule for bandwidth request
[in]bandwidthDesired bandwidth
[out]actualIf non-NULL, written with the actual bandwidth that the device was able to achieve.
Returns
0 on success, value from Error codes list on failure
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.

Parameters
devDevice handle
moduleModule to apply correction to
corrCorrection type
valueValue to apply
Returns
0 on success, value from Error codes list on failure
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.

Parameters
devDevice handle
moduleModule to configure
frequencyDesired frequency
Returns
0 on success, value from Error codes list on failure
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

Parameters
devDevice handle
modModule
gainDesired gain
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_set_lna_gain ( struct bladerf *  dev,
bladerf_lna_gain  gain 
)

Set the LNA gain

Parameters
devDevice handle
gainDesired gain level
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_set_loopback ( struct bladerf *  dev,
bladerf_loopback  l 
)

Apply specified loopback mode

Parameters
devDevice handle
lLoopback mode. Note that BLADERF_LB_NONE disables the use of loopback functionality.
Note
Loopback modes should only be enabled or disabled while the RX and TX modules are both disabled (and therefore, when no samples are being actively streamed). Otherwise, unexpected behavior may occur.
Returns
0 on success, value from Error codes list on failure
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

Parameters
devDevice handle
moduleModule for mode request
modeMode to be set
Returns
0 on success, value from Error codes list on failure
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.

Parameters
[in]devDevice handle
[in]moduleModule to change
[in]rateRational sample rate
[out]actualIf 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.

Returns
0 on success, BLADERF_ERR_INVAL for an invalid sample rate, or a value from Error codes list on other failures
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.

Parameters
devDevice handle
gainDesired gain
Returns
0 on success, value from Error codes list on failure
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.

Parameters
devDevice handle
gainDesired gain
Returns
0 on success, value from Error codes list on failure
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.

Parameters
[in]devDevice handle
[in]moduleModule to change
[in]rateSample rate
[out]actualIf non-NULL. this is written with the actual sample rate achieved.
Returns
0 on success, BLADERF_ERR_INVAL for an invalid sample rate, or a value from Error codes list on other failures
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.

Parameters
[in]devDevice handle
[in]samplingSampling connection
Returns
0 on success, value from Error codes list on failure
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

Parameters
devDevice handle
gainDesired gain
Returns
0 on success, value from Error codes list on failure
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.

Parameters
devDevice handle
gainDesired gain
Returns
0 on success, value from Error codes list on failure
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.

Parameters
devDevice handle
gainDesired gain
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_xb200_get_filterbank ( struct bladerf *  dev,
bladerf_module  module,
bladerf_xb200_filter filter 
)

Get current XB-200 filterbank

Parameters
[in]devDevice handle
[in]moduleModule to query
[out]filterPointer to filterbank, only updated if return value is 0.
Returns
0 on success, value from Error codes list on failure
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

Parameters
devDevice handle
moduleModule to query
pathPointer to XB200 signal path
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_xb200_set_filterbank ( struct bladerf *  dev,
bladerf_module  mod,
bladerf_xb200_filter  filter 
)

Set XB-200 filterbank

Parameters
devDevice handle
modModule
filterXB200 filterbank
Returns
0 on success, value from Error codes list on failure
API_EXPORT int CALL_CONV bladerf_xb200_set_path ( struct bladerf *  dev,
bladerf_module  module,
bladerf_xb200_path  path 
)

Set XB-200 signal path

Parameters
devDevice handle
moduleModule to configure
pathDesired XB-200 signal path
Returns
0 on success, value from Error codes list on failure