libbladeRF: Frequency

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

Loading...
Searching...
No Matches
Typedefs | Macros | Functions
Frequency
Channel control

## Description

These functions provide the ability to tune the RX and TX channels.

See this page for more detailed information about how the API performs this tuning, and for example code snippets.

These functions are thread-safe.

## Typedefs
typedef uint64_t | bladerf_frequency

## Macros
#define | BLADERF_PRIuFREQ PRIu64
#define | BLADERF_PRIxFREQ PRIx64
#define | BLADERF_SCNuFREQ SCNu64
#define | BLADERF_SCNxFREQ SCNx64

## Functions
API_EXPORT int CALL_CONV | bladerf_select_band (struct bladerf *dev, bladerf_channel ch, bladerf_frequency frequency)
API_EXPORT int CALL_CONV | bladerf_set_frequency (struct bladerf *dev, bladerf_channel ch, bladerf_frequency frequency)
API_EXPORT int CALL_CONV | bladerf_get_frequency (struct bladerf *dev, bladerf_channel ch, bladerf_frequency *frequency)
API_EXPORT int CALL_CONV | bladerf_get_frequency_range (struct bladerf *dev, bladerf_channel ch, const struct bladerf_range **range)

## Typedef Documentation

## ◆ bladerf_frequency

typedef uint64_t bladerf_frequency

RF center frequency, in hertz (Hz)

See also
  Format macros for fprintf() and fscanf(): BLADERF_PRIuFREQ, BLADERF_PRIxFREQ, BLADERF_SCNuFREQ, BLADERF_SCNxFREQ

Remarks
  Prior to libbladeRF 2.0.0, frequencies were specified as unsigned int.

Definition at line 1229 of file libbladeRF.h.

## Macro Definition Documentation

## ◆ BLADERF_PRIuFREQ

#define BLADERF_PRIuFREQ PRIu64

printf format for frequencies in unsigned decimal

Definition at line 1232 of file libbladeRF.h.

## ◆ BLADERF_PRIxFREQ

#define BLADERF_PRIxFREQ PRIx64

printf format for frequencies in hexadecimal

Definition at line 1234 of file libbladeRF.h.

## ◆ BLADERF_SCNuFREQ

#define BLADERF_SCNuFREQ SCNu64

scanf format for frequencies in unsigned decimal

Definition at line 1236 of file libbladeRF.h.

## ◆ BLADERF_SCNxFREQ

#define BLADERF_SCNxFREQ SCNx64

scanf format for frequencies in hexadecimal

Definition at line 1238 of file libbladeRF.h.

## Function Documentation

## ◆ bladerf_get_frequency()

API_EXPORT int CALL_CONV bladerf_get_frequency | ( | struct bladerf * | dev,
|  | bladerf_channel | ch,
|  | bladerf_frequency * | frequency )

Get channel's current frequency in Hz

Parameters

  | dev | Device handle
  [in] | ch | Channel
  [out] | frequency | Current frequency

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

## ◆ bladerf_get_frequency_range()

API_EXPORT int CALL_CONV bladerf_get_frequency_range | ( | struct bladerf * | dev,
|  | bladerf_channel | ch,
|  | const struct bladerf_range ** | range )

Get the supported range of frequencies for a channel

Parameters

  | dev | Device handle
  [in] | ch | Channel
  [out] | range | Frequency range

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

## ◆ bladerf_select_band()

API_EXPORT int CALL_CONV bladerf_select_band | ( | struct bladerf * | dev,
|  | bladerf_channel | ch,
|  | bladerf_frequency | frequency )

Select the appropriate band path given a frequency in Hz.

Note
  Most API users will not need to use this function, as bladerf_set_frequency() calls this internally after tuning the device.

The high band is used for frequency above 1.5 GHz on bladeRF1 and above 3.0 GHz on bladeRF2. Otherwise, the low band is used.

See also
  bladerf_get_frequency_range() to determine the range of supported frequencies.

Parameters

  | dev | Device handle
  [in] | ch | Channel
  [in] | frequency | Tuned frequency

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

## ◆ bladerf_set_frequency()

API_EXPORT int CALL_CONV bladerf_set_frequency | ( | struct bladerf * | dev,
|  | bladerf_channel | ch,
|  | bladerf_frequency | frequency )

Set channel's frequency in Hz.

Note
  On the bladeRF1 platform, it is recommended to keep the RX and TX frequencies at least 1 MHz apart, and to digitally mix on the RX side if reception closer to the TX frequency is required.
  On the bladeRF2, there is one oscillator for all RX channels and one oscillator for all TX channels. Therefore, changing one channel will change the frequency of all channels in that direction.

This function calls bladerf_select_band() internally, and performs all other tasks required to prepare the channel for the given frequency.

See also
  bladerf_get_frequency_range() to determine the range of supported frequencies.

Parameters

  | dev | Device handle
  [in] | ch | Channel
  [in] | frequency | Desired frequency

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