Loading...
Searching...
No Matches
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.

## Topics

| Gain
| Sample rate
| Bandwidth
| Frequency
| Internal loopback
| Triggers
| Receive Mux
| Scheduled Tuning
| Correction

## 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)
#define | BLADERF_CHANNEL_TX(ch)
#define | BLADERF_CHANNEL_INVALID (bladerf_channel)(-1)
#define | BLADERF_CHANNEL_IS_TX(ch)

## 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);
BLADERF_CHANNEL_RX
#define BLADERF_CHANNEL_RX(ch)
Definition libbladeRF.h:664
BLADERF_CHANNEL_TX
#define BLADERF_CHANNEL_TX(ch)
Definition libbladeRF.h:679
bladerf_channel
int bladerf_channel
Definition libbladeRF.h:649

Definition at line 649 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 714 of file libbladeRF.h.

## bladerf_direction

enum bladerf_direction

Stream direction

Enumerator
BLADERF_RX | Receive direction
BLADERF_TX | Transmit direction

Definition at line 706 of file libbladeRF.h.

## Macro Definition Documentation

## BLADERF_CHANNEL_INVALID

#define BLADERF_CHANNEL_INVALID (bladerf_channel)(-1)

Invalid channel

Definition at line 684 of file libbladeRF.h.

## BLADERF_CHANNEL_IS_TX

#define BLADERF_CHANNEL_IS_TX | ( |  | ch | ) |

Value:
(ch & BLADERF_TX)
BLADERF_TX
@ BLADERF_TX
Definition libbladeRF.h:708

Convenience macro: true if argument is a TX channel

Definition at line 701 of file libbladeRF.h.

## BLADERF_CHANNEL_RX

#define BLADERF_CHANNEL_RX | ( |  | ch | ) |

Value:
(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 664 of file libbladeRF.h.

## BLADERF_CHANNEL_TX

#define BLADERF_CHANNEL_TX | ( |  | ch | ) |

Value:
(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 679 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