libbladeRF: Gain stages (deprecated)

| libbladeRF 2.2.1-git Nuand bladeRF library

Enumerations | Macros | Functions
Gain stages (deprecated)
bladeRF1-specific API

## Description

These functions provide control over the device's RX and TX gain stages.

Deprecated:
  Use bladerf_get_gain_range(), bladerf_set_gain(), and bladerf_get_gain() to control total system gain. For direct control of individual gain stages, use bladerf_get_gain_stages(), bladerf_get_gain_stage_range(), bladerf_set_gain_stage(), and bladerf_get_gain_stage().

## Enumerations
enum | bladerf_lna_gain { BLADERF_LNA_GAIN_UNKNOWN, BLADERF_LNA_GAIN_BYPASS, BLADERF_LNA_GAIN_MID, BLADERF_LNA_GAIN_MAX }

## Macros
#define | BLADERF_RXVGA1_GAIN_MIN 5
#define | BLADERF_RXVGA1_GAIN_MAX 30
#define | BLADERF_RXVGA2_GAIN_MIN 0
#define | BLADERF_RXVGA2_GAIN_MAX 30
#define | BLADERF_TXVGA1_GAIN_MIN (-35)
#define | BLADERF_TXVGA1_GAIN_MAX (-4)
#define | BLADERF_TXVGA2_GAIN_MIN 0
#define | BLADERF_TXVGA2_GAIN_MAX 25
#define | BLADERF_LNA_GAIN_MID_DB 3
#define | BLADERF_LNA_GAIN_MAX_DB 6

## Functions
API_EXPORT int CALL_CONV | bladerf_set_txvga2 (struct bladerf *dev, int gain)
API_EXPORT int CALL_CONV | bladerf_get_txvga2 (struct bladerf *dev, int *gain)
API_EXPORT int CALL_CONV | bladerf_set_txvga1 (struct bladerf *dev, int gain)
API_EXPORT int CALL_CONV | bladerf_get_txvga1 (struct bladerf *dev, int *gain)
API_EXPORT int CALL_CONV | bladerf_set_lna_gain (struct bladerf *dev, bladerf_lna_gain gain)
API_EXPORT int CALL_CONV | bladerf_get_lna_gain (struct bladerf *dev, bladerf_lna_gain *gain)
API_EXPORT int CALL_CONV | bladerf_set_rxvga1 (struct bladerf *dev, int gain)
API_EXPORT int CALL_CONV | bladerf_get_rxvga1 (struct bladerf *dev, int *gain)
API_EXPORT int CALL_CONV | bladerf_set_rxvga2 (struct bladerf *dev, int gain)
API_EXPORT int CALL_CONV | bladerf_get_rxvga2 (struct bladerf *dev, int *gain)

## Enumeration Type Documentation

## ◆ bladerf_lna_gain

enum bladerf_lna_gain

LNA gain options

Deprecated:
  Use bladerf_get_gain_stage_range()

Enumerator
BLADERF_LNA_GAIN_UNKNOWN | Invalid LNA gain
BLADERF_LNA_GAIN_BYPASS | LNA bypassed - 0dB gain
BLADERF_LNA_GAIN_MID | LNA Mid Gain (MAX-6dB)
BLADERF_LNA_GAIN_MAX | LNA Max Gain

Definition at line 203 of file bladeRF1.h.

## Macro Definition Documentation

## ◆ BLADERF_LNA_GAIN_MAX_DB

#define BLADERF_LNA_GAIN_MAX_DB 6

Gain in db of the LNA at max setting

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 222 of file bladeRF1.h.

## ◆ BLADERF_LNA_GAIN_MID_DB

#define BLADERF_LNA_GAIN_MID_DB 3

Gain in dB of the LNA at mid setting

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 215 of file bladeRF1.h.

## ◆ BLADERF_RXVGA1_GAIN_MAX

#define BLADERF_RXVGA1_GAIN_MAX 30

Maximum RXVGA1 gain, in dB

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 160 of file bladeRF1.h.

## ◆ BLADERF_RXVGA1_GAIN_MIN

#define BLADERF_RXVGA1_GAIN_MIN 5

In general, the gains should be incremented in the following order (and decremented in the reverse order).

TX: `TXVGA1`, `TXVGA2`

RX: `LNA`, `RXVGA`, `RXVGA2` Minimum RXVGA1 gain, in dB

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 154 of file bladeRF1.h.

## ◆ BLADERF_RXVGA2_GAIN_MAX

#define BLADERF_RXVGA2_GAIN_MAX 30

Maximum RXVGA2 gain, in dB

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 172 of file bladeRF1.h.

## ◆ BLADERF_RXVGA2_GAIN_MIN

#define BLADERF_RXVGA2_GAIN_MIN 0

Minimum RXVGA2 gain, in dB

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 166 of file bladeRF1.h.

## ◆ BLADERF_TXVGA1_GAIN_MAX

#define BLADERF_TXVGA1_GAIN_MAX (-4)

Maximum TXVGA1 gain, in dB

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 184 of file bladeRF1.h.

## ◆ BLADERF_TXVGA1_GAIN_MIN

#define BLADERF_TXVGA1_GAIN_MIN (-35)

Minimum TXVGA1 gain, in dB

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 178 of file bladeRF1.h.

## ◆ BLADERF_TXVGA2_GAIN_MAX

#define BLADERF_TXVGA2_GAIN_MAX 25

Maximum TXVGA2 gain, in dB

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 196 of file bladeRF1.h.

## ◆ BLADERF_TXVGA2_GAIN_MIN

#define BLADERF_TXVGA2_GAIN_MIN 0

Minimum TXVGA2 gain, in dB

Deprecated:
  Use bladerf_get_gain_stage_range()

Definition at line 190 of file bladeRF1.h.

## Function Documentation

## ◆ bladerf_get_lna_gain()

API_EXPORT int CALL_CONV bladerf_get_lna_gain | ( | struct bladerf * | dev,
|  | bladerf_lna_gain * | gain
| ) |  |

Get the LNA gain

Deprecated:
  Use either bladerf_get_gain() or bladerf_get_gain_stage().

Parameters

  | dev | Device handle
  [out] | gain | Pointer to the set gain level

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

## ◆ bladerf_get_rxvga1()

API_EXPORT int CALL_CONV bladerf_get_rxvga1 | ( | struct bladerf * | dev,
|  | int * | gain
| ) |  |

Get the pre-LPF VGA gain

Deprecated:
  Use either bladerf_get_gain() or bladerf_get_gain_stage().

Parameters

  | dev | Device handle
  [out] | gain | Pointer to the set gain level

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

## ◆ bladerf_get_rxvga2()

API_EXPORT int CALL_CONV bladerf_get_rxvga2 | ( | struct bladerf * | dev,
|  | int * | gain
| ) |  |

Get the post-LPF VGA gain

Deprecated:
  Use either bladerf_get_gain() or bladerf_get_gain_stage().

Parameters

  | dev | Device handle
  [out] | gain | Pointer to the set gain level

## ◆ bladerf_get_txvga1()

API_EXPORT int CALL_CONV bladerf_get_txvga1 | ( | struct bladerf * | dev,
|  | int * | gain
| ) |  |

Get the post-LPF gain in dB

Deprecated:
  Use either bladerf_get_gain() or bladerf_get_gain_stage().

Parameters

  | dev | Device handle
  [out] | gain | Pointer to returned gain

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

## ◆ bladerf_get_txvga2()

API_EXPORT int CALL_CONV bladerf_get_txvga2 | ( | struct bladerf * | dev,
|  | int * | gain
| ) |  |

Get the PA gain in dB

Deprecated:
  Use either bladerf_get_gain() or bladerf_get_gain_stage().

Parameters

  | dev | Device handle
  [out] | gain | Pointer to returned gain

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

## ◆ bladerf_set_lna_gain()

API_EXPORT int CALL_CONV bladerf_set_lna_gain | ( | struct bladerf * | dev,
|  | bladerf_lna_gain | gain
| ) |  |

Set the LNA gain

Deprecated:
  Use either bladerf_set_gain() or bladerf_set_gain_stage().

Parameters

  | dev | Device handle
  [in] | gain | Desired gain level

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

## ◆ bladerf_set_rxvga1()

API_EXPORT int CALL_CONV bladerf_set_rxvga1 | ( | struct bladerf * | dev,
|  | int | gain
| ) |  |

Set the pre-LPF VGA gain

Deprecated:
  Use either bladerf_set_gain() or bladerf_set_gain_stage().

Values outside the range of [ BLADERF_RXVGA1_GAIN_MIN, BLADERF_RXVGA1_GAIN_MAX ] will be clamped.

Parameters

  | dev | Device handle
  [in] | gain | Desired gain

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

## ◆ bladerf_set_rxvga2()

API_EXPORT int CALL_CONV bladerf_set_rxvga2 | ( | struct bladerf * | dev,
|  | int | gain
| ) |  |

Set the post-LPF VGA gain

Deprecated:
  Use either bladerf_set_gain() or bladerf_set_gain_stage().

Values outside the range of [ BLADERF_RXVGA2_GAIN_MIN, BLADERF_RXVGA2_GAIN_MAX ] will be clamped.

Parameters

  | dev | Device handle
  [in] | gain | Desired gain

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

## ◆ bladerf_set_txvga1()

API_EXPORT int CALL_CONV bladerf_set_txvga1 | ( | struct bladerf * | dev,
|  | int | gain
| ) |  |

Set the post-LPF gain in dB

Deprecated:
  Use either bladerf_set_gain() or bladerf_set_gain_stage().

Values outside the range of [ BLADERF_TXVGA1_GAIN_MIN, BLADERF_TXVGA1_GAIN_MAX ] will be clamped.

Parameters

  | dev | Device handle
  [in] | gain | Desired gain

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

## ◆ bladerf_set_txvga2()

API_EXPORT int CALL_CONV bladerf_set_txvga2 | ( | struct bladerf * | dev,
|  | int | gain
| ) |  |

Set the PA gain in dB

Deprecated:
  Use either bladerf_set_gain() or bladerf_set_gain_stage().

Values outside the range of [ BLADERF_TXVGA2_GAIN_MIN, BLADERF_TXVGA2_GAIN_MAX ] will be clamped.

Parameters

  | dev | Device handle
  [in] | gain | Desired gain

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