![]() |
libbladeRF
1.1.0
Nuand bladeRF library
|
Data Structures | |
struct | bladerf_metadata |
Macros | |
#define | BLADERF_META_STATUS_OVERRUN (1 << 0) |
#define | BLADERF_META_STATUS_UNDERRUN (1 << 1) |
#define | BLADERF_META_FLAG_TX_BURST_START (1 << 0) |
#define | BLADERF_META_FLAG_TX_BURST_END (1 << 1) |
#define | BLADERF_META_FLAG_TX_NOW (1 << 2) |
#define | BLADERF_META_FLAG_RX_NOW (1 << 31) |
Enumerations | |
enum | bladerf_format { BLADERF_FORMAT_SC16_Q11, BLADERF_FORMAT_SC16_Q11_META } |
This section defines the available sample formats and metadata flags.
#define BLADERF_META_FLAG_RX_NOW (1 << 31) |
This flag indicates that calls to bladerf_sync_rx should return any available samples, rather than wait until the timestamp indicated in the bladerf_metadata timestamp field.
Definition at line 1308 of file libbladeRF.h.
#define BLADERF_META_FLAG_TX_BURST_END (1 << 1) |
Mark the associated buffer as the end of a burst transmission. This will flush the remainder of the sync interfaces' current working buffer and enqueue samples into the transmit FIFO.
When specifying this flag to bladerf_sync_tx(), the final two samples in the synchronous interface's internal working buffer must be zero. Unexpected results may occur if this is not the case. To ensure this requirement is met, API users should ensure the last two samples provided to bladerf_sync_tx() are zero when using BLADERF_META_FLAG_TX_BURST_END. One way to do this is to end bursts with a call of bladerf_sync_tx() with this flag set and a buffer of 2 or more zero samples.
Flushing the sync interface's working buffer implies that after specifying this flag, the next timestamp that can be transmitted is the current timestamp plus the duration of the burst that this flag is ending and the remaining length of the remaining buffer that is flushed. (The buffer size, in this case, is the buffer_size
value passed to the previous bladerf_sync_config() call.)
Rather than attempting to keep track of the number of samples sent with respect to buffer sizes, it is easiest to always assume 1 buffer's worth of time is required between bursts. In this case "buffer" refers to the buffer_size
parameter provided to bladerf_sync_config().) If this is too much time, consider combining multiple bursts and manually zero-padding samples between them.
This is only used for the bladerf_sync_tx() call. It is ignored by the bladerf_sync_rx() call.
Definition at line 1291 of file libbladeRF.h.
#define BLADERF_META_FLAG_TX_BURST_START (1 << 0) |
Mark the associated buffer as the start of a burst transmission. This is only used for the bladerf_sync_tx() call.
Definition at line 1258 of file libbladeRF.h.
#define BLADERF_META_FLAG_TX_NOW (1 << 2) |
Use this flag in conjunction with BLADERF_META_FLAG_TX_BURST_START to indicate that the burst should be transmitted as soon as possible, as opposed to waiting for a specific timestamp.
When this flag is used, there is no need to set the bladerf_metadata::timestamp field.
Definition at line 1301 of file libbladeRF.h.
#define BLADERF_META_STATUS_OVERRUN (1 << 0) |
A sample overrun has occurred. This indicates that either the host (more likely) or the FPGA is not keeping up with the incoming samples
Definition at line 1235 of file libbladeRF.h.
#define BLADERF_META_STATUS_UNDERRUN (1 << 1) |
A sample underrun has occurred. This generally only occurrs on the TX module when the FPGA is starved of samples.
Definition at line 1243 of file libbladeRF.h.
enum bladerf_format |
Sample format
Enumerator | |
---|---|
BLADERF_FORMAT_SC16_Q11 |
Signed, Complex 16-bit Q11. This is the native format of the DAC data. Values in the range [-2048, 2048) are used to represent [-1.0, 1.0). Note that the lower bound here is inclusive, and the upper bound is exclusive. Ensure that provided samples stay within [-2048, 2047]. Samples consist of interleaved IQ value pairs, with I being the first value in the pair. Each value in the pair is a right-aligned, little-endian int16_t. The FPGA ensures that these values are sign-extended. When using this format the minimum required buffer size, in bytes, is: buffer_size_min = [ 2 * num_samples * sizeof(int16_t) ] For example, to hold 2048 samples, a buffer must be at least 8192 bytes large. |
BLADERF_FORMAT_SC16_Q11_META |
This format is the same as the BLADERF_FORMAT_SC16_Q11 format, except the first 4 samples (16 bytes) in every block of 1024 samples are replaced with metadata, organized as follows, with all fields being little endian byte order: 0x00 [uint32_t: Reserved] 0x04 [uint64_t: 64-bit Timestamp] 0x0c [uint32_t: BLADERF_META_FLAG_* flags] When using the bladerf_sync_rx() and bladerf_sync_tx() functions, this detail is transparent to caller. These functions take care of packing/unpacking the metadata into/from the data, via the bladerf_metadata structure. Currently, when using the asynchronous data transfer interface, the user is responsible for manually packing/unpacking this metadata into/from their sample data. |
Definition at line 1177 of file libbladeRF.h.