libbladeRF  2.5.0
Nuand bladeRF library
Data Structures | Macros | Functions
Scheduled Tuning

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 1824 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
devDevice handle
[in]chChannel
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
devDevice handle
[in]chChannel
[out]quick_tuneQuick 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
devDevice handle
[in]chChannel
[in]timestampChannel'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]frequencyDesired frequency, in Hz.
[in]quick_tuneIf 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.