libbladeRF  2.5.0
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
 
 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)   (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
// RX Channel 1
// TX Channel 0
// TX Channel 1
#define BLADERF_CHANNEL_RX(ch)
Definition: libbladeRF.h:664
#define BLADERF_CHANNEL_TX(ch)
Definition: libbladeRF.h:679
int bladerf_channel
Definition: libbladeRF.h:649

Definition at line 649 of file libbladeRF.h.

Enumeration Type Documentation

◆ 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

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)    (ch & BLADERF_TX)

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)    (bladerf_channel)(((ch) << 1) | 0x0)

RX Channel Macro

Example usage:

// RX Channel 0
// RX Channel 1

Definition at line 664 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
// TX Channel 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
devDevice handle
[in]dirStream direction
Returns
Number of channels