Portability | portable |
---|---|
Stability | provisional |
Maintainer | eocallaghan@alterapraxis.com |
Safe Haskell | None |
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.
- bladeRFSyncConfig :: DeviceHandle -> BladeRFModule -> BladeRFFormat -> Int -> Int -> Int -> Int -> IO (BladeRFReturnType ())
- bladeRFSyncTx :: DeviceHandle -> ByteString -> Maybe BladeRFMetadata -> Int -> IO (BladeRFReturnType ())
- bladeRFSyncRx :: DeviceHandle -> Int -> Int -> IO (BladeRFReturnType (ByteString, BladeRFMetadata))
Documentation
:: 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 (BladeRFReturnType ()) |
(Re)Configure a device for synchronous transmission or reception
:: DeviceHandle | Device handle |
-> ByteString | Array of samples |
-> Maybe BladeRFMetadata | Sample metadata. This must be provided when using
the |
-> Int | Timeout (milliseconds) for this call to complete. Zero implies infinite. |
-> IO (BladeRFReturnType ()) |
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
.
Precondition:
- A
bladeRFSyncConfig
call has been to configure the device for synchronous data transfer. - A call to
bladeRFEnableModule
should be made before attempting to transmit samples. Failing to do this may result in timeouts and other errors.
:: DeviceHandle | Device handle |
-> Int | Number of samples to read |
-> Int | Timeout (milliseconds) for this call to complete. Zero implies infinite. |
-> IO (BladeRFReturnType (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.)
Precondition:
- A
bladeRFSyncConfig
call has been to configure the device for synchronous data transfer. - A call to
bladeRFEnableModule
should be made before attempting to transmit samples. Failing to do this may result in timeouts and other errors.