libbladeRF: Scheduled Tuning

| libbladeRF 2.2.1-git Nuand bladeRF library

Data Structures | Macros | Functions
Scheduled Tuning
Channel control

## Description

These functions are thread-safe.

## Data Structures
struct | bladerf_quick_tune

## Macros
#define | BLADERF_RETUNE_NOW (bladerf_timestamp)0

## Functions
API_EXPORT int CALL_CONV | bladerf_schedule_retune (struct bladerf *dev, bladerf_channel ch, bladerf_timestamp timestamp, bladerf_frequency frequency, struct bladerf_quick_tune *quick_tune)
API_EXPORT int CALL_CONV | bladerf_cancel_scheduled_retunes (struct bladerf *dev, bladerf_channel ch)
API_EXPORT int CALL_CONV | bladerf_get_quick_tune (struct bladerf *dev, bladerf_channel ch, struct bladerf_quick_tune *quick_tune)

## Macro Definition Documentation

## ◆ BLADERF_RETUNE_NOW

#define BLADERF_RETUNE_NOW (bladerf_timestamp)0

Specifies that scheduled retune should occur immediately when using bladerf_schedule_retune().

Definition at line 1799 of file libbladeRF.h.

## Function Documentation

## ◆ bladerf_cancel_scheduled_retunes()

API_EXPORT int CALL_CONV bladerf_cancel_scheduled_retunes | ( | struct bladerf * | dev,
|  | bladerf_channel | ch
| ) |  |

Cancel all pending scheduled retune operations for the specified channel.

This will be done automatically during bladerf_close() to ensure that previously queued retunes do not continue to occur after closing and then later re-opening a device.

Parameters

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

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

## ◆ bladerf_get_quick_tune()

API_EXPORT int CALL_CONV bladerf_get_quick_tune | ( | struct bladerf * | dev,
|  | bladerf_channel | ch,
|  | struct bladerf_quick_tune * | quick_tune
| ) |  |

Fetch parameters used to tune the transceiver to the current frequency for use with bladerf_schedule_retune() to perform a "quick retune."

This allows for a faster retune, with a potential trade off of increased phase noise.

Note
  These parameters are sensitive to changes in the operating environment, and should be "refreshed" if planning to use the "quick retune" functionality over a long period of time.

Precondition
  bladerf_set_frequency() or bladerf_schedule_retune() have previously been used to retune to the desired frequency.

Parameters

  | dev | Device handle
  [in] | ch | Channel
  [out] | quick_tune | Quick retune parameters

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

## ◆ bladerf_schedule_retune()

API_EXPORT int CALL_CONV bladerf_schedule_retune | ( | struct bladerf * | dev,
|  | bladerf_channel | ch,
|  | bladerf_timestamp | timestamp,
|  | bladerf_frequency | frequency,
|  | struct bladerf_quick_tune * | quick_tune
| ) |  |

Schedule a frequency retune to occur at specified sample timestamp value.

Precondition
  bladerf_sync_config() must have been called with the BLADERF_FORMAT_SC16_Q11_META format for the associated channel in order to enable timestamps. (The timestamped metadata format must be enabled in order to use this function.)

Parameters

  | dev | Device handle
  [in] | ch | Channel
  [in] | timestamp | Channel's sample timestamp to perform the retune operation. If this value is in the past, the retune will occur immediately. To perform the retune immediately, specify BLADERF_RETUNE_NOW.
  [in] | frequency | Desired frequency, in Hz.
  [in] | quick_tune | If NULL, the `frequency` parameter will be used. If non-NULL, the provided "quick retune" values will be applied to the transceiver to tune it according to a previous state retrieved via bladerf_get_quick_tune().

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

Note
  If the underlying queue of scheduled retune requests becomes full, BLADERF_ERR_QUEUE_FULL will be returned. In this case, it should be possible to schedule a retune after the timestamp of one of the earlier requests occurs.