![]() |
libbladeRF
1.7.2
Nuand bladeRF library
|
This section presents functionality pertaining to configuring the sample rate and mode of the device's RX and TX modules.
These functions are thread-safe.
Data Structures | |
struct | bladerf_rational_rate |
Macros | |
#define | BLADERF_SAMPLERATE_MIN 80000u |
#define | BLADERF_SAMPLERATE_REC_MAX 40000000u |
Enumerations | |
enum | bladerf_rx_mux { BLADERF_RX_MUX_INVALID = -1, BLADERF_RX_MUX_BASEBAND_LMS = 0x0, BLADERF_RX_MUX_12BIT_COUNTER = 0x1, BLADERF_RX_MUX_32BIT_COUNTER = 0x2, BLADERF_RX_MUX_DIGITAL_LOOPBACK = 0x4 } |
enum | bladerf_sampling { BLADERF_SAMPLING_UNKNOWN, BLADERF_SAMPLING_INTERNAL, BLADERF_SAMPLING_EXTERNAL } |
Functions | |
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_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_sampling (struct bladerf *dev, bladerf_sampling sampling) |
API_EXPORT int CALL_CONV | bladerf_set_rx_mux (struct bladerf *dev, bladerf_rx_mux mux) |
API_EXPORT int CALL_CONV | bladerf_get_rx_mux (struct bladerf *dev, bladerf_rx_mux *mode) |
API_EXPORT int CALL_CONV | bladerf_get_sampling (struct bladerf *dev, bladerf_sampling *sampling) |
#define BLADERF_SAMPLERATE_MIN 80000u |
Minimum sample rate, in Hz
Definition at line 721 of file libbladeRF.h.
#define BLADERF_SAMPLERATE_REC_MAX 40000000u |
Maximum recommended sample rate, in Hz.
The max sample rate of the LMS6002D is 40 MHz, but this API allows for larger values to allow users to leverage FPGA customizations (e.g., to generate test samples or mux other data into the sample stream).
If you are not performing such customizations, treat this as the max allowed values.
Definition at line 733 of file libbladeRF.h.
enum bladerf_rx_mux |
RX Mux modes
These values describe the source of samples to the RX FIFOs in the FPGA. They map directly to rx_mux_mode_t inside the FPGA's source code.
Definition at line 741 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 789 of file libbladeRF.h.
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_rx_mux | ( | struct bladerf * | dev, |
bladerf_rx_mux * | mode | ||
) |
Gets the current RX Mux mode
[in] | dev | Device handle |
[out] | mode | Current RX Mux mode |
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_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_rx_mux | ( | struct bladerf * | dev, |
bladerf_rx_mux | mux | ||
) |
Set the current RX Mux mode
dev | Device handle |
mux | Mux mode. |
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 |