![]() |
libbladeRF
2.5.0
Nuand bladeRF library
|
This section defines the streaming APIs.
Modules | |
Formats | |
Synchronous API | |
Asynchronous API | |
Typedefs | |
typedef uint64_t | bladerf_timestamp |
Macros | |
#define | BLADERF_PRIuTS PRIu64 |
#define | BLADERF_PRIxTS PRIx64 |
#define | BLADERF_SCNuTS SCNu64 |
#define | BLADERF_SCNxTS SCNx64 |
Functions | |
API_EXPORT int CALL_CONV | bladerf_enable_module (struct bladerf *dev, bladerf_channel ch, bool enable) |
API_EXPORT int CALL_CONV | bladerf_get_timestamp (struct bladerf *dev, bladerf_direction dir, bladerf_timestamp *timestamp) |
typedef uint64_t bladerf_timestamp |
Timestamp, in ticks
A channel's timestamp typically increments at the sample rate.
BLADERF_PRIuTS
, BLADERF_PRIxTS
, BLADERF_SCNuTS
, BLADERF_SCNxTS
Definition at line 1818 of file libbladeRF.h.
#define BLADERF_PRIuTS PRIu64 |
printf format for timestamps in unsigned decimal
Definition at line 2045 of file libbladeRF.h.
#define BLADERF_PRIxTS PRIx64 |
printf format for timestamps in hexadecimal
Definition at line 2047 of file libbladeRF.h.
#define BLADERF_SCNuTS SCNu64 |
scanf format for timestamps in unsigned decimal
Definition at line 2049 of file libbladeRF.h.
#define BLADERF_SCNxTS SCNx64 |
scanf format for timestamps in hexadecimal
Definition at line 2051 of file libbladeRF.h.
API_EXPORT int CALL_CONV bladerf_enable_module | ( | struct bladerf * | dev, |
bladerf_channel | ch, | ||
bool | enable | ||
) |
Enable or disable the RF front end of the specified direction.
RF front ends must always be enabled prior to streaming samples on the associated interface.
When a synchronous stream is associated with the specified channel, this will shut down the underlying asynchronous stream when enable
= false.
When transmitting samples, be sure to provide ample time for TX samples reach the RF front-end before calling this function with enable
= false. (This can be achieved easily when using metadata, as shown on this page.)
dev | Device handle | |
[in] | ch | Channel |
[in] | enable | true to enable, false to disable |
API_EXPORT int CALL_CONV bladerf_get_timestamp | ( | struct bladerf * | dev, |
bladerf_direction | dir, | ||
bladerf_timestamp * | timestamp | ||
) |
Retrieve the specified stream's current timestamp counter value from the FPGA.
This function is only intended to be used to retrieve a coarse estimate of the current timestamp when starting up a stream. It should not be used as a means to accurately retrieve the current timestamp of individual samples within a running stream. The reasons for this are:
When actively receiving a sample stream, instead use the bladerf_metadata::timestamp field (provided when using the BLADERF_FORMAT_SC16_Q11_META format) to retrieve the timestamp value associated with a block of samples. See the RX with metadata page for examples of this.
An example use-case of this function is to schedule an initial TX burst in a set of bursts:
Examples of the above are shown on the TX with metadata page.
dev | Device handle | |
[in] | dir | Stream direction |
[out] | timestamp | Coarse timestamp value |