libbladeRF: Channel control

| libbladeRF 2.2.1-git Nuand bladeRF library

Modules | Typedefs | Enumerations | Macros | Functions
Channel control

## Description

The RX and TX channels are independently configurable. As such, many libbladeRF functions require a bladerf_channel parameter to specify the desired channel.

These functions are thread-safe.

## Modules
| Gain
| These functions provide control over the device's RX and TX gain stages.
| Sample rate
| This section presents functionality pertaining to configuring the sample rate and mode of the device's RX and TX channels.
| Bandwidth
| This section defines functionality for configuring a channel's bandwidth. In most cases, one should define the bandwidth to be less than the sample rate to minimize the impact of aliasing.
| Frequency
| These functions provide the ability to tune the RX and TX channels.
| Internal loopback
| The bladeRF provides a variety of loopback modes to aid in development and testing.
| Triggers
| Trigger functionality introduced in bladeRF FPGA v0.6.0 allows TX and/or RX samples to be gated via a trigger signal. This allows multiple devices to synchronize their TX/RX operations upon the reception of a trigger event.
| Receive Mux
| These functions are thread-safe.
| Scheduled Tuning
| These functions are thread-safe.
| Correction
| This group provides routines for applying manual offset, gain, and phase corrections.

## Typedefs
typedef int | bladerf_channel

## Enumerations
enum | bladerf_direction { BLADERF_RX = 0, BLADERF_TX = 1 }
enum | bladerf_channel_layout { BLADERF_RX_X1 = 0, BLADERF_TX_X1 = 1, BLADERF_RX_X2 = 2, BLADERF_TX_X2 = 3 }

## Macros
#define | BLADERF_CHANNEL_RX(ch) (bladerf_channel)(((ch) << 1) | 0x0)
#define | BLADERF_CHANNEL_TX(ch) (bladerf_channel)(((ch) << 1) | 0x1)
#define | BLADERF_CHANNEL_INVALID (bladerf_channel)(-1)
#define | BLADERF_CHANNEL_IS_TX(ch) (ch & BLADERF_TX)

## Functions
API_EXPORT size_t CALL_CONV | bladerf_get_channel_count (struct bladerf *dev, bladerf_direction dir)

## Typedef Documentation

## ◆ bladerf_channel

typedef int bladerf_channel

Channel type

Example usage:

// RX Channel 0
bladerf_channel ch = BLADERF_CHANNEL_RX(0);
// RX Channel 1
bladerf_channel ch = BLADERF_CHANNEL_RX(1);
// TX Channel 0
bladerf_channel ch = BLADERF_CHANNEL_TX(0);
// TX Channel 1
bladerf_channel ch = BLADERF_CHANNEL_TX(1);

Definition at line 624 of file libbladeRF.h.

## Enumeration Type Documentation

## ◆ bladerf_channel_layout

enum bladerf_channel_layout

Stream channel layout

Enumerator
BLADERF_RX_X1 | x1 RX (SISO)
BLADERF_TX_X1 | x1 TX (SISO)
BLADERF_RX_X2 | x2 RX (MIMO)
BLADERF_TX_X2 | x2 TX (MIMO)

Definition at line 689 of file libbladeRF.h.

## ◆ bladerf_direction

enum bladerf_direction

Stream direction

Enumerator
BLADERF_RX | Receive direction
BLADERF_TX | Transmit direction

Definition at line 681 of file libbladeRF.h.

## Macro Definition Documentation

## ◆ BLADERF_CHANNEL_INVALID

#define BLADERF_CHANNEL_INVALID (bladerf_channel)(-1)

Invalid channel

Definition at line 659 of file libbladeRF.h.

## ◆ BLADERF_CHANNEL_IS_TX

#define BLADERF_CHANNEL_IS_TX | ( |  | ch | ) | (ch & BLADERF_TX)

Convenience macro: true if argument is a TX channel

Definition at line 676 of file libbladeRF.h.

## ◆ BLADERF_CHANNEL_RX

#define BLADERF_CHANNEL_RX | ( |  | ch | ) | (bladerf_channel)(((ch) << 1) | 0x0)

RX Channel Macro

Example usage:

// RX Channel 0
bladerf_channel ch = BLADERF_CHANNEL_RX(0);
// RX Channel 1
bladerf_channel ch = BLADERF_CHANNEL_RX(1);

Definition at line 639 of file libbladeRF.h.

## ◆ BLADERF_CHANNEL_TX

#define BLADERF_CHANNEL_TX | ( |  | ch | ) | (bladerf_channel)(((ch) << 1) | 0x1)

TX Channel Macro

Example usage:

// TX Channel 0
bladerf_channel ch = BLADERF_CHANNEL_TX(0);
// TX Channel 1
bladerf_channel ch = BLADERF_CHANNEL_TX(1);

Definition at line 654 of file libbladeRF.h.

## Function Documentation

## ◆ bladerf_get_channel_count()

API_EXPORT size_t CALL_CONV bladerf_get_channel_count | ( | struct bladerf * | dev,
|  | bladerf_direction | dir
| ) |  |

Get the number of RX or TX channels supported by the given device

Parameters

  | dev | Device handle
  [in] | dir | Stream direction

Returns
  Number of channels

bladerf_channel
int bladerf_channel
Definition: libbladeRF.h:624
BLADERF_CHANNEL_TX
#define BLADERF_CHANNEL_TX(ch)
Definition: libbladeRF.h:654
BLADERF_CHANNEL_RX
#define BLADERF_CHANNEL_RX(ch)
Definition: libbladeRF.h:639