hlibBladeRF-0.1.0.6: Haskell binding to libBladeRF SDR library

Portabilityportable
Stabilityprovisional
Maintainereocallaghan@alterapraxis.com
Safe HaskellTrustworthy

LibBladeRF.Types

Description

This module encapsulates types libbladeRF library functions.

Synopsis

Documentation

data BladeRFLogLevel Source

Severity levels for logging actions

Constructors

LOG_LEVEL_VERBOSE

Verbose level logging

LOG_LEVEL_DEBUG

Debug level logging

LOG_LEVEL_INFO

Information level logging

LOG_LEVEL_WARNING

Warning level logging

LOG_LEVEL_ERROR

Error level logging

LOG_LEVEL_CRITICAL

Fatal error level logging

LOG_LEVEL_SILENT

No output

data BladeRFVersion Source

Version structure for FPGA, firmware, libbladeRF, and associated utilities.

Constructors

BladeRFVersion 

Fields

major :: Word16

Major version

minor :: Word16

Minor version

patch :: Word16

Patch version

descr :: String

Version string with any additional suffix information.

data BladeRFDeviceInfo Source

Information about a bladeRF attached to the system.

Constructors

BladeRFDeviceInfo 

Fields

backend :: BladeRFBackend

Backend to use when connecting to device

serial :: String

Device serial number string

usbBus :: Word8

Bus number device is attached to

usbAddr :: Word8

Device address on bus

inst :: CUInt

Device instance or ID

data BladeRFFPGASize Source

FPGA device variant (size).

Constructors

FPGA_UNKNOWN

Unable to determine FPGA variant

FPGA_40KLE

40 kLE FPGA

FPGA_115KLE

115 kLE FPGA

data BladeRFBackend Source

Backend by which the host communicates with the device.

Constructors

BACKEND_ANY

Don't Care, use any available backend

BACKEND_LINUX

Linux kernel driver

BACKEND_LIBUSB

libusb

BACKEND_CYPRESS

CyAPI

BACKEND_DUMMY

Dummy used for development purposes

data BladeRFRationalRate Source

Rational sample rate representation.

Constructors

BladeRFRationalRate 

Fields

integer :: Word64

Integer portion

num :: Word64

Numerator in fractional portion

den :: Word64

Denominator in fractional portion. This must be > 0.

data BladeRFModule Source

Module selection for those which have both RX and TX constituents.

Constructors

MODULE_RX

Receive Module

MODULE_TX

Transmit Module

data BladeRFFormat Source

Sample format.

Constructors

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. 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.

FORMAT_SC16_Q11_META

This format is the same as the 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 bladeRFSyncRx and bladeRFSyncTx actions, this detail is transparent to caller. These functions take care of packing/unpacking the metadata into/from the data, via the BladeRFMetadata structure.

Currently, when using the asynchronous data transfer interface, the user is responsible for manually packingunpacking this metadata intofrom their sample data.

data BladeRFLNAGain Source

LNA gain options.

Constructors

LNA_GAIN_UNKNOWN

Invalid LNA gain

LNA_GAIN_BYPASS

LNA bypassed - 0dB gain

LNA_GAIN_MID

LNA Mid Gain (MAX-6dB)

LNA_GAIN_MAX

LNA Max Gain

data BladeRFVGAGainBounds Source

Device control and configuration.

This section provides functions pertaining to accessing, controlling, and configuring various device options and parameters.

Constructors

RXVGA1_GAIN_MIN

Minimum RXVGA1 gain, in dB

RXVGA1_GAIN_MAX

Maximum RXVGA1 gain, in dB

RXVGA2_GAIN_MIN

Minimum RXVGA2 gain, in dB

RXVGA2_GAIN_MAX

Maximum RXVGA2 gain, in dB

TXVGA1_GAIN_MIN

Minimum TXVGA1 gain, in dB

TXVGA1_GAIN_MAX

Maximum TXVGA1 gain, in dB

TXVGA2_GAIN_MIN

Minimum TXVGA2 gain, in dB

TXVGA2_GAIN_MAX

Maximum TXVGA2 gain, in dB

data BladeRFCorrection Source

Correction parameter selection.

These values specify the correction parameter to modify or query when calling bladeRFSetCorrection or bladeRFGetCorrection. Note that the meaning of the value parameter to these functions depends upon the correction parameter.

Constructors

CORR_LMS_DCOFF_I

Adjusts the in-phase DC offset via controls provided by the LMS6002D front end. Valid values are [-2048, 2048], which are scaled to the available control bits in the LMS device.

CORR_LMS_DCOFF_Q

Adjusts the quadrature DC offset via controls provided the LMS6002D front end. Valid values are [-2048, 2048], which are scaled to the available control bits.

CORR_FPGA_PHASE

Adjusts FPGA-based phase correction of [-10, 10] degrees, via a provided count value of [-4096, 4096].

CORR_FPGA_GAIN

Adjusts FPGA-based gain correction of [0.0, 2.0], via provided values in the range of [-4096, 4096], where a value of 0 corresponds to a gain of 1.0.

data BladeRFSpeed Source

This enum describes the USB Speed at which the bladeRF is connected.

Speeds not listed here are not supported.

data BladeRFMetadata Source

Sample metadata.

This structure is used in conjunction with the FORMAT_SC16_Q11_META format to TX scheduled bursts or retrieve timestamp information about received samples.

Constructors

BladeRFMetadata 

Fields

timestamp :: Word64

Free-running FPGA counter that monotonically increases at the sample rate of the associated module.

flags :: Word32

Input bit field to control the behavior of the call that the metadata structure is passed to.

status :: Word32

Output bit field to denoting the status of transmissions/receptions.

count :: Int

This output parameter is updated to reflect the actual number of contiguous samples that have been populated in an RX buffer during a bladeRFSyncRx call.

data BladeRFLoopback Source

Loopback options.

Constructors

LB_FIRMWARE

Firmware loopback inside of the FX3

LB_BB_TXLPF_RXVGA2

Baseband loopback. TXLPF output is connected to the RXVGA2 input.

LB_BB_TXVGA1_RXVGA2

Baseband loopback. TXVGA1 output is connected to the RXVGA2 input.

LB_BB_TXLPF_RXLPF

Baseband loopback. TXLPF output is connected to the RXLPF input.

LB_BB_TXVGA1_RXLPF

Baseband loopback. TXVGA1 output is connected to RXLPF input.

LB_RF_LNA1

RF loopback. The TXMIX output, through the AUX PA, is connected to the output of LNA1.

LB_RF_LNA2

RF loopback. The TXMIX output, through the AUX PA, is connected to the output of LNA2.

LB_RF_LNA3

RF loopback. The TXMIX output, through the AUX PA, is connected to the output of LNA3.

LB_NONE

Disables loopback and returns to normal operation.