libbladeRF: Metadata structure and flags

| libbladeRF 2.4.0-git Nuand bladeRF library

Data Structures | Macros
Metadata structure and flags
Streaming » Formats

## Description

## 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_TX_UPDATE_TIMESTAMP (1 << 3)
#define | BLADERF_META_FLAG_RX_NOW (1 << 31)
#define | BLADERF_META_FLAG_RX_HW_UNDERFLOW (1 << 0)
#define | BLADERF_META_FLAG_RX_HW_MINIEXP1 (1 << 16)
#define | BLADERF_META_FLAG_RX_HW_MINIEXP2 (1 << 17)

## Macro Definition Documentation

## ◆ BLADERF_META_FLAG_RX_HW_MINIEXP1

#define BLADERF_META_FLAG_RX_HW_MINIEXP1 (1 << 16)

This flag is asserted in bladerf_metadata.status by the hardware if mini expansion IO pin 1 is asserted.

Definition at line 2333 of file libbladeRF.h.

## ◆ BLADERF_META_FLAG_RX_HW_MINIEXP2

#define BLADERF_META_FLAG_RX_HW_MINIEXP2 (1 << 17)

This flag is asserted in bladerf_metadata.status by the hardware if mini expansion IO pin 2 is asserted.

Definition at line 2339 of file libbladeRF.h.

## ◆ BLADERF_META_FLAG_RX_HW_UNDERFLOW

#define BLADERF_META_FLAG_RX_HW_UNDERFLOW (1 << 0)

This flag is asserted in bladerf_metadata.status by the hardware when an underflow is detected in the sample buffering system on the device.

Definition at line 2327 of file libbladeRF.h.

## ◆ BLADERF_META_FLAG_RX_NOW

#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 2321 of file libbladeRF.h.

## ◆ BLADERF_META_FLAG_TX_BURST_END

#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 interface's current working buffer and enqueue samples into the hardware's transmit FIFO.

As of libbladeRF v1.3.0, it is no longer necessary for the API user to ensure that the final 3 samples of a burst are \(0 + 0 j\). libbladeRF now ensures this hardware requirement is upheld.

Specifying this flag and flushing the sync interface's working buffer implies that 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 using the BLADERF_META_FLAG_TX_UPDATE_TIMESTAMP flag.

Note
  This is only used for the bladerf_sync_tx() call. It is ignored by the bladerf_sync_rx() call.

Definition at line 2284 of file libbladeRF.h.

## ◆ BLADERF_META_FLAG_TX_BURST_START

#define BLADERF_META_FLAG_TX_BURST_START (1 << 0)

Mark the associated buffer as the start of a burst transmission.

Note
  This is only used for the bladerf_sync_tx() call.

When using this flag, the bladerf_metadata::timestamp field should contain the timestamp at which samples should be sent.

Between specifying the BLADERF_META_FLAG_TX_BURST_START and BLADERF_META_FLAG_TX_BURST_END flags, there is no need for the user to the bladerf_metadata::timestamp field because the library will ensure the correct value is used, based upon the timestamp initially provided and the number of samples that have been sent.

Definition at line 2256 of file libbladeRF.h.

## ◆ BLADERF_META_FLAG_TX_NOW

#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 2294 of file libbladeRF.h.

## ◆ BLADERF_META_FLAG_TX_UPDATE_TIMESTAMP

#define BLADERF_META_FLAG_TX_UPDATE_TIMESTAMP (1 << 3)

Use this flag within a burst (i.e., between the use of BLADERF_META_FLAG_TX_BURST_START and BLADERF_META_FLAG_TX_BURST_END) to specify that bladerf_sync_tx() should read the bladerf_metadata::timestamp field and zero-pad samples up to the specified timestamp. The provided samples will then be transmitted at that timestamp.

Use this flag when potentially flushing an entire buffer via the BLADERF_META_FLAG_TX_BURST_END would yield an unacceptably large gap in the transmitted samples.

In some applications where a transmitter is constantly transmitting with extremely small gaps (less than a buffer), users may end up using a single BLADERF_META_FLAG_TX_BURST_START, and then numerous calls to bladerf_sync_tx() with the BLADERF_META_FLAG_TX_UPDATE_TIMESTAMP flag set. The BLADERF_META_FLAG_TX_BURST_END would only be used to end the stream when shutting down.

Definition at line 2314 of file libbladeRF.h.

## ◆ BLADERF_META_STATUS_OVERRUN

#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 2223 of file libbladeRF.h.

## ◆ BLADERF_META_STATUS_UNDERRUN

#define BLADERF_META_STATUS_UNDERRUN (1 << 1)

A sample underrun has occurred.

This generally only occurs on the TX channel when the FPGA is starved of samples.

Note
  libbladeRF does not report this status. It is here for future use.

Definition at line 2233 of file libbladeRF.h.