hlibBladeRF-0.1.0.6: Haskell binding to libBladeRF SDR library

Portabilityportable
Stabilityprovisional
Maintainereocallaghan@alterapraxis.com
Safe HaskellNone

LibBladeRF.LibBladeRF

Description

This module encapsulates the foundational libbladeRF functions commonly used into a Monadic style. This Monadic style avoids passing around references of indirection to the device type and so on.

Synopsis

Documentation

withBladeRF :: (DeviceHandle -> IO c) -> IO cSource

Essential wrapper

newtype DeviceHandle Source

DeviceHandle wrapper around C device descriptor pointer

Constructors

DeviceHandle 

Fields

unDeviceHandle :: Ptr C'bladerf
 

data BladeRFError Source

Error codes returned by internal libbladeRF functions.

Constructors

BLADERF_ERR_UNEXPECTED

An unexpected failure occurred

BLADERF_ERR_RANGE

Provided parameter is out of range

BLADERF_ERR_INVAL

Invalid operation/parameter

BLADERF_ERR_MEM

Memory allocation error

BLADERF_ERR_IO

FileDevice IO error

BLADERF_ERR_TIMEOUT

Operation timed out

BLADERF_ERR_NODEV

No device(s) available

BLADERF_ERR_UNSUPPORTED

Operation not supported

BLADERF_ERR_MISALIGNED

Misaligned flash access

BLADERF_ERR_CHECKSUM

Invalid checksum

BLADERF_ERR_NO_FILE

File not found

BLADERF_ERR_UPDATE_FPGA

An FPGA update is required

BLADERF_ERR_UPDATE_FW

A firmware update is requied

BLADERF_ERR_TIME_PAST

Requested timestamp is in the past

Instances

Enum BladeRFError

Returned C Error codes

bladeRF library routines return negative values to indicate errors. Values >= 0 are used to indicate success.

Eq BladeRFError 
Show BladeRFError 
Typeable BladeRFError 
Exception BladeRFError 

type BladeRFReturnType a = Either BladeRFError aSource

Short-hand type for brevity and clarity.

bladeRFErrorValue :: CInt -> BladeRFReturnType IntSource

(For internal use) Obtain a BladeRFError type of a C value from the Error codes list.

bladeRFErrorTy :: CInt -> BladeRFReturnType ()Source

(For internal use) Obtain a BladeRFError type of a C value from the Error codes list.