hlibBladeRF-0.1.0.3: Haskell binding to libBladeRF SDR library

Portabilityportable
Stabilityprovisional
Maintainereocallaghan@alterapraxis.com
Safe HaskellNone

LibBladeRF.Sync

Description

This module encapsulates Synchronous data transmission and reception

This group of functions presents synchronous, blocking calls (with optional timeouts) for transmitting and receiving samples.

The synchronous interface is built atop the asynchronous interface, and is generally less complex and easier to work with. It alleviates the need to explicitly spawn threads (it is done under the hood) and manually manage sample buffers.

Under the hood, this interface spawns worker threads to handle an asynchronous stream and perform thread-safe buffer management.

Synopsis

Documentation

bladeRFSyncConfig

Arguments

:: DeviceHandle

Device handle

-> BladeRFModule

Module to use with synchronous interface

-> BladeRFFormat

Format to use in synchronous data transfers

-> Int

The number of buffers to use in the underlying data stream.

-> Int

The size of the underlying stream buffers, in samples. This value must be a multiple of 1024.

-> Int

The number of active USB transfers that may be in-flight at any given time.

-> Int

Timeout (milliseconds) for transfers in the underlying data stream.

-> IO () 

(Re)Configure a device for synchronous transmission or reception

bladeRFSyncTx

Arguments

:: DeviceHandle

Device handle

-> ByteString

Array of samples

-> Int

Number of samples to write

-> Maybe BladeRFMetadata

Sample metadata. This must be provided when using the FORMAT_SC16_Q11_META format, but may be Nothing when the interface is configured for the FORMAT_SC16_Q11 format.

-> Int

Timeout (milliseconds) for this call to complete. Zero implies infinite.

-> IO () 

Transmit IQ samples.

Under the hood, this call starts up an underlying asynchronous stream as needed. This stream can be stopped by disabling the TX module. (See bladeRFEnableModule for more details.)

Samples will only be sent to the FPGA when a buffer have been filled. The number of samples required to fill a buffer corresponds to the buffer_size parameter passed to bladeRFSyncConfig.

bladeRFSyncRx

Arguments

:: DeviceHandle

Device handle

-> Int

Number of samples to read

-> Int

Timeout (milliseconds) for this call to complete. Zero implies infinite.

-> IO (ByteString, BladeRFMetadata) 

Receive IQ samples.

Underthe hood, this call starts up an underlying asynchronous stream as needed. This stream can be stopped by disabling the RX module. (See bladeRFEnableModule for more details.)