| libbladeRF 2.6.0-git-fcf94233-dirty Nuand bladeRF library

Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
Internal loopback
Channel control

## Description

The bladeRF provides a variety of loopback modes to aid in development and testing.

In general, the digital or baseband loopback modes provide the most "ideal" operating conditions, while the internal RF loopback modes introduce more of the typical nonidealities of analog systems.

These functions are thread-safe.

## Data Structures
struct | bladerf_loopback_modes

## Enumerations
enum | bladerf_loopback { BLADERF_LB_NONE = 0 , BLADERF_LB_FIRMWARE , 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_RFIC_BIST }

## Functions
API_EXPORT int CALL_CONV | bladerf_get_loopback_modes (struct bladerf *dev, const struct bladerf_loopback_modes **modes)
API_EXPORT bool CALL_CONV | bladerf_is_loopback_mode_supported (struct bladerf *dev, bladerf_loopback mode)
API_EXPORT int CALL_CONV | bladerf_set_loopback (struct bladerf *dev, bladerf_loopback lb)
API_EXPORT int CALL_CONV | bladerf_get_loopback (struct bladerf *dev, bladerf_loopback *lb)

## Enumeration Type Documentation

## ◆ bladerf_loopback

enum bladerf_loopback

Loopback options

Enumerator
BLADERF_LB_NONE | Disables loopback and returns to normal operation.
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_RFIC_BIST | RFIC digital loopback (built-in self-test)

Definition at line 1338 of file libbladeRF.h.

## Function Documentation

## ◆ bladerf_get_loopback()

API_EXPORT int CALL_CONV bladerf_get_loopback | ( | struct bladerf * | dev,
|  | bladerf_loopback * | lb )

Get current loopback mode

Parameters

  | dev | Device handle
  [out] | lb | Current loopback mode

Returns
  0 on success, value from Error codes list on failure

## ◆ bladerf_get_loopback_modes()

API_EXPORT int CALL_CONV bladerf_get_loopback_modes | ( | struct bladerf * | dev,
|  | const struct bladerf_loopback_modes ** | modes )

Get loopback modes

Populates modes with a pointer to an array of structs containing the supported loopback modes.

This function may be called with NULL for modes to determine the number of loopback modes supported.

Parameters

  | dev | Device handle
  [out] | modes | Supported loopback modes

Returns
  Number of loopback modes on success, value from Error codes list on failure

## ◆ bladerf_is_loopback_mode_supported()

API_EXPORT bool CALL_CONV bladerf_is_loopback_mode_supported | ( | struct bladerf * | dev,
|  | bladerf_loopback | mode )

Test if a given loopback mode is supported on this device.

Parameters

  | dev | Device handle
  [in] | mode | bladerf_loopback enum to check

Returns
  true if supported, false if not (or on error)

## ◆ bladerf_set_loopback()

API_EXPORT int CALL_CONV bladerf_set_loopback | ( | struct bladerf * | dev,
|  | bladerf_loopback | lb )

Apply specified loopback mode

Note
  Loopback modes should only be enabled or disabled while the RX and TX channels are both disabled (and therefore, when no samples are being actively streamed). Otherwise, unexpected behavior may occur.

Parameters

  | dev | Device handle
  [in] | lb | Loopback mode. Note that BLADERF_LB_NONE disables the use of loopback functionality.

Returns
  0 on success, value from Error codes list on failure