SP API
Macros | Enumerations | Functions
sp_api.h File Reference

API functions for the SP145 spectrum analyzer. More...

Go to the source code of this file.

Macros

#define SP_TRUE   (1)
 
#define SP_FALSE   (0)
 
#define SP_MAX_DEVICES   (9)
 
#define SP_MAX_REF_LEVEL   (20.0)
 
#define SP_AUTO_ATTEN   (-1)
 
#define SP_MAX_ATTEN   (6)
 
#define SP_MIN_FREQ   (9.0e3)
 
#define SP_MAX_FREQ   (15.0e9)
 
#define SP_MIN_SWEEP_TIME   (1.0e-6)
 
#define SP_MAX_SWEEP_TIME   (100.0)
 
#define SP_REAL_TIME_MIN_SPAN   (200.0e3)
 
#define SP_REAL_TIME_MAX_SPAN   (40.0e6)
 
#define SP_REAL_TIME_MIN_RBW   (2.0e3)
 
#define SP_REAL_TIME_MAX_RBW   (1.0e6)
 
#define SP_MAX_IQ_DECIMATION   (8192)
 
#define SP_MAX_IQ_SWEEP_STEPS   (1000)
 
#define SP_MIN_FAN_SET_POINT   (0.0)
 
#define SP_MAX_FAN_SET_POINT   (60.0)
 
#define SP_MAX_SWEEP_QUEUE_SZ   (16)
 

Enumerations

enum  SpStatus {
  spInternalFlashErr = -101 ,
  spInternalFileIOErr = -100 ,
  spAllocationErr = -11 ,
  spMaxDevicesConnectedErr = -10 ,
  spInvalidConfigurationErr = -9 ,
  spSweepAlreadyActiveErr = -8 ,
  spBootErr = -7 ,
  spFramingErr = -6 ,
  spConnectionLostErr = -5 ,
  spInvalidDeviceErr = -4 ,
  spNullPtrErr = -3 ,
  spInvalidParameterErr = -2 ,
  spDeviceNotFoundErr = -1 ,
  spNoError = 0 ,
  spSettingClamped = 1 ,
  spTempDrift = 2 ,
  spADCOverflow = 3 ,
  spUncalData = 4 ,
  spCPULimited = 5 ,
  spInvalidCalData = 6
}
 
enum  SpBool {
  spFalse = 0 ,
  spTrue = 1
}
 
enum  SpPowerState {
  spPowerStateOn = 0 ,
  spPowerStateStandby = 1
}
 
enum  SpMode {
  spModeIdle = 0 ,
  spModeSweeping = 1 ,
  spModeRealTime = 2 ,
  spModeIQStreaming = 3 ,
  spModeIQSweepList = 4 ,
  spModeAudio = 5
}
 
enum  SpDetector {
  spDetectorAverage = 0 ,
  spDetectorMinMax = 1
}
 
enum  SpScale {
  spScaleLog = 0 ,
  spScaleLin = 1 ,
  spScaleFullScale = 2
}
 
enum  SpVideoUnits {
  spVideoLog = 0 ,
  spVideoVoltage = 1 ,
  spVideoPower = 2 ,
  spVideoSample = 3
}
 
enum  SpWindowType {
  spWindowFlatTop = 0 ,
  spWindowNutall = 1 ,
  spWindowBlackman = 2 ,
  spWindowHamming = 3 ,
  spWindowGaussian6dB = 4 ,
  spWindowRect = 5
}
 
enum  SpDataType {
  spDataType32fc = 0 ,
  spDataType16sc = 1
}
 
enum  SpTriggerEdge {
  spTriggerEdgeRising = 0 ,
  spTriggerEdgeFalling = 1
}
 
enum  SpGPSState {
  spGPSStateNotPresent = 0 ,
  spGPSStateLocked = 1 ,
  spGPSStateDisciplined = 2
}
 
enum  SpReference {
  spReferenceUseInternal = 0 ,
  spReferenceUseExternal = 1
}
 
enum  SpGPIOFunction {
  SpGPIOFunctionTrigIn = 0 ,
  SpGPIOFunctionPPSOut = 1 ,
  SpGPIOFunctionLogicOutLow = 2 ,
  SpGPIOFunctionLogicOutHigh = 3 ,
  SpGPIOFunctionUARTDirect = 4 ,
  SpGPIOFunctionUARTSweep = 5 ,
  SpGPIOFunctionUARTDoppler = 6
}
 
enum  SpAudioType {
  spAudioTypeAM = 0 ,
  spAudioTypeFM = 1 ,
  spAudioTypeUSB = 2 ,
  spAudioTypeLSB = 3 ,
  spAudioTypeCW = 4
}
 

Functions

SP_API SpStatus spGetDeviceList (int *serials, int *deviceCount)
 
SP_API SpStatus spOpenDevice (int *device)
 
SP_API SpStatus spOpenDeviceBySerial (int *device, int serialNumber)
 
SP_API SpStatus spCloseDevice (int device)
 
SP_API SpStatus spPresetDevice (int device)
 
SP_API SpStatus spSetPowerState (int device, SpPowerState powerState)
 
SP_API SpStatus spGetPowerState (int device, SpPowerState *powerState)
 
SP_API SpStatus spGetSerialNumber (int device, int *serialNumber)
 
SP_API SpStatus spGetFirmwareVersion (int device, int *major, int *minor, int *revision)
 
SP_API SpStatus spGetDeviceDiagnostics (int device, float *voltage, float *current, float *temperature)
 
SP_API SpStatus spGetCalDate (int device, uint32_t *lastCalDate)
 
SP_API SpStatus spSetReference (int device, SpReference reference)
 
SP_API SpStatus spGetReference (int device, SpReference *reference)
 
SP_API SpStatus spSetGPIOPort (int device, SpGPIOFunction func)
 
SP_API SpStatus spGetGPIOPort (int device, SpGPIOFunction *func)
 
SP_API SpStatus spSetUARTBaudRate (int device, float rate)
 
SP_API SpStatus spGetUARTBaudRate (int device, float *rate)
 
SP_API SpStatus spWriteUARTDirect (int device, uint8_t data)
 
SP_API SpStatus spSetGPSTimebaseUpdate (int device, SpBool enabled)
 
SP_API SpStatus spGetGPSTimebaseUpdate (int device, SpBool *enabled)
 
SP_API SpStatus spGetGPSHoldoverInfo (int device, SpBool *usingGPSHoldover, uint32_t *lastHoldoverTime)
 
SP_API SpStatus spGetGPSState (int device, SpGPSState *GPSState)
 
SP_API SpStatus spSetRefLevel (int device, double refLevel)
 
SP_API SpStatus spGetRefLevel (int device, double *refLevel)
 
SP_API SpStatus spSetAttenuator (int device, int atten)
 
SP_API SpStatus spGetAttenuator (int device, int *atten)
 
SP_API SpStatus spSetSweepCenterSpan (int device, double centerFreqHz, double spanHz)
 
SP_API SpStatus spSetSweepStartStop (int device, double startFreqHz, double stopFreqHz)
 
SP_API SpStatus spSetSweepCoupling (int device, double rbw, double vbw, double sweepTime)
 
SP_API SpStatus spSetSweepDetector (int device, SpDetector detector, SpVideoUnits videoUnits)
 
SP_API SpStatus spSetSweepScale (int device, SpScale scale)
 
SP_API SpStatus spSetSweepWindow (int device, SpWindowType window)
 
SP_API SpStatus spSetSweepGPIOSwitching (int device, double *freqs, uint8_t *data, int count)
 
SP_API SpStatus spSetSweepGPIOSwitchingDisabled (int device)
 
SP_API SpStatus spSetRealTimeCenterSpan (int device, double centerFreqHz, double spanHz)
 
SP_API SpStatus spSetRealTimeRBW (int device, double rbw)
 
SP_API SpStatus spSetRealTimeDetector (int device, SpDetector detector)
 
SP_API SpStatus spSetRealTimeScale (int device, SpScale scale, double frameRef, double frameScale)
 
SP_API SpStatus spSetRealTimeWindow (int device, SpWindowType window)
 
SP_API SpStatus spSetIQDataType (int device, SpDataType dataType)
 
SP_API SpStatus spSetIQCenterFreq (int device, double centerFreqHz)
 
SP_API SpStatus spGetIQCenterFreq (int device, double *centerFreqHz)
 
SP_API SpStatus spSetIQSampleRate (int device, int decimation)
 
SP_API SpStatus spSetIQSoftwareFilter (int device, SpBool enabled)
 
SP_API SpStatus spSetIQBandwidth (int device, double bandwidth)
 
SP_API SpStatus spSetIQExtTriggerEdge (int device, SpTriggerEdge edge)
 
SP_API SpStatus spSetIQTriggerSentinel (double sentinelValue)
 
SP_API SpStatus spSetIQQueueSize (int device, int units)
 
SP_API SpStatus spSetIQSweepListDataType (int device, SpDataType dataType)
 
SP_API SpStatus spSetIQSweepListCorrected (int device, SpBool corrected)
 
SP_API SpStatus spSetIQSweepListSteps (int device, int steps)
 
SP_API SpStatus spGetIQSweepListSteps (int device, int *steps)
 
SP_API SpStatus spSetIQSweepListFreq (int device, int step, double freq)
 
SP_API SpStatus spSetIQSweepListRef (int device, int step, double level)
 
SP_API SpStatus spSetIQSweepListAtten (int device, int step, int atten)
 
SP_API SpStatus spSetIQSweepListSampleCount (int device, int step, uint32_t samples)
 
SP_API SpStatus spSetAudioCenterFreq (int device, double centerFreqHz)
 
SP_API SpStatus spSetAudioType (int device, SpAudioType audioType)
 
SP_API SpStatus spSetAudioFilters (int device, double ifBandwidth, double audioLpf, double audioHpf)
 
SP_API SpStatus spSetAudioFMDeemphasis (int device, double deemphasis)
 
SP_API SpStatus spConfigure (int device, SpMode mode)
 
SP_API SpStatus spGetCurrentMode (int device, SpMode *mode)
 
SP_API SpStatus spAbort (int device)
 
SP_API SpStatus spGetSweepParameters (int device, double *actualRBW, double *actualVBW, double *actualStartFreq, double *binSize, int *sweepSize)
 
SP_API SpStatus spGetRealTimeParameters (int device, double *actualRBW, int *sweepSize, double *actualStartFreq, double *binSize, int *frameWidth, int *frameHeight, double *poi)
 
SP_API SpStatus spGetIQParameters (int device, double *sampleRate, double *bandwidth)
 
SP_API SpStatus spGetIQCorrection (int device, float *scale)
 
SP_API SpStatus spIQSweepListGetCorrections (int device, float *corrections)
 
SP_API SpStatus spGetSweep (int device, float *sweepMin, float *sweepMax, int64_t *nsSinceEpoch)
 
SP_API SpStatus spGetRealTimeFrame (int device, float *colorFrame, float *alphaFrame, float *sweepMin, float *sweepMax, int *frameCount, int64_t *nsSinceEpoch)
 
SP_API SpStatus spGetIQ (int device, void *iqBuf, int iqBufSize, double *triggers, int triggerBufSize, int64_t *nsSinceEpoch, SpBool purge, int *sampleLoss, int *samplesRemaining)
 
SP_API SpStatus spIQSweepListGetSweep (int device, void *dst, int64_t *timestamps)
 
SP_API SpStatus spIQSweepListStartSweep (int device, int pos, void *dst, int64_t *timestamps)
 
SP_API SpStatus spIQSweepListFinishSweep (int device, int pos)
 
SP_API SpStatus spGetAudio (int device, float *audio)
 
SP_API SpStatus spGetGPSInfo (int device, SpBool refresh, SpBool *updated, int64_t *secSinceEpoch, double *latitude, double *longitude, double *altitude, char *nmea, int *nmeaLen)
 
SP_API SpStatus spWriteToGPS (int device, const uint8_t *mem, int len)
 
SP_API SpStatus spSetFanSetPoint (int device, float setPoint)
 
SP_API SpStatus spGetFanSettings (int device, float *setPoint, float *voltage)
 
SP_API const char * spGetErrorString (SpStatus status)
 
SP_API const char * spGetAPIVersion ()
 

Detailed Description

API functions for the SP145 spectrum analyzer.

This is the main file for user-accessible functions for controlling the SP145 spectrum analyzer.

Macro Definition Documentation

◆ SP_TRUE

#define SP_TRUE   (1)

Used for boolean true when integer parameters are being used. Also see SpBool.

◆ SP_FALSE

#define SP_FALSE   (0)

Used for boolean false when integer parameters are being used. Also see SpBool.

◆ SP_MAX_DEVICES

#define SP_MAX_DEVICES   (9)

Max number of devices that can be interfaced in the API.

◆ SP_MAX_REF_LEVEL

#define SP_MAX_REF_LEVEL   (20.0)

Maximum reference level in dBm

◆ SP_AUTO_ATTEN

#define SP_AUTO_ATTEN   (-1)

Tells the API to automatically choose attenuation based on reference level.

◆ SP_MAX_ATTEN

#define SP_MAX_ATTEN   (6)

Valid atten values [0,6] or -1 for auto

◆ SP_MIN_FREQ

#define SP_MIN_FREQ   (9.0e3)

Min frequency for sweeps, and min center frequency for I/Q measurements.

◆ SP_MAX_FREQ

#define SP_MAX_FREQ   (15.0e9)

Max frequency for sweeps, and max center frequency for I/Q measurements.

◆ SP_MIN_SWEEP_TIME

#define SP_MIN_SWEEP_TIME   (1.0e-6)

Min sweep time in seconds. See spSetSweepCoupling.

◆ SP_MAX_SWEEP_TIME

#define SP_MAX_SWEEP_TIME   (100.0)

Max sweep time in seconds. See spSetSweepCoupling.

◆ SP_REAL_TIME_MIN_SPAN

#define SP_REAL_TIME_MIN_SPAN   (200.0e3)

Min span for device configured in real-time measurement mode

◆ SP_REAL_TIME_MAX_SPAN

#define SP_REAL_TIME_MAX_SPAN   (40.0e6)

Max span for device configured in real-time measurement mode

◆ SP_REAL_TIME_MIN_RBW

#define SP_REAL_TIME_MIN_RBW   (2.0e3)

Min RBW for device configured in real-time measurement mode

◆ SP_REAL_TIME_MAX_RBW

#define SP_REAL_TIME_MAX_RBW   (1.0e6)

Max RBW for device configured in real-time measurement mode

◆ SP_MAX_IQ_DECIMATION

#define SP_MAX_IQ_DECIMATION   (8192)

Max decimation for I/Q streaming.

◆ SP_MAX_IQ_SWEEP_STEPS

#define SP_MAX_IQ_SWEEP_STEPS   (1000)

Maximum number of definable steps in a I/Q sweep

◆ SP_MIN_FAN_SET_POINT

#define SP_MIN_FAN_SET_POINT   (0.0)

Minimum fan set point in Celcius

◆ SP_MAX_FAN_SET_POINT

#define SP_MAX_FAN_SET_POINT   (60.0)

Maximum fan set point in Celcius

◆ SP_MAX_SWEEP_QUEUE_SZ

#define SP_MAX_SWEEP_QUEUE_SZ   (16)

Maximum number of I/Q sweeps that can be queued up. Valid sweep indices between [0,15]. See I/Q Sweep List / Frequency Hopping

Enumeration Type Documentation

◆ SpStatus

enum SpStatus

Status code returned from all SP API functions.

Enumerator
spInternalFlashErr 

Internal use only.

spInternalFileIOErr 

Internal use only.

spAllocationErr 

Unable to allocate memory for the measurement. Out of system memory.

spMaxDevicesConnectedErr 

At maximum number of devices that can be interfaced.

spInvalidConfigurationErr 

Often the result of trying to perform an action while the device is currently making a measurement or not in an idle state, or performing an action that is not supported by the current mode of operation. For instance, requesting a sweep while the device is configured for I/Q streaming.

spSweepAlreadyActiveErr 

For standard sweeps, this error indicates another sweep is already being performed. You might encounter this in a multi-threaded application. For queued sweep lists, this indicates the sweep at the given position is already active. Finish this sweep before starting again.

spBootErr 

Boot error

spFramingErr 

Indicates USB data framing issues. Data may be corrupt. If error persists, reconfiguration/cycling might be required.

spConnectionLostErr 

Device disconnected. Will require the device to be closed and reopened to continue. Most likely cause is large USB data loss or cable connectivity issues.

spInvalidDeviceErr 

Invalid device handle specified.

spNullPtrErr 

One or more required pointer parameters are null.

spInvalidParameterErr 

One or more required parameters found to have an invalid value.

spDeviceNotFoundErr 

Unable to open device. Verify the device is connected and the LED is solid green.

spNoError 

Function returned successfully.

spSettingClamped 

One or more of the provided parameters were clamped to a valid range.

spTempDrift 

Temperature drift occured since last configuration. Measurements might be uncalibrated. Reconfiguring the device when possible will eliminate this warning.

spADCOverflow 

Measurement includes data which caused an ADC overload (clipping/compression)

spUncalData 

Measurement is uncalibrated, overrides ADC overflow

spCPULimited 

Returned when the API was unable to keep up with the necessary processing

spInvalidCalData 

This warning is returned when recoverable USB data loss occurred. The measurement may be uncalibrated due to the data loss and may need to be ignored. The device can continue to be used without any action/intervention. This warning can appear in periods of high CPU or USB load.

◆ SpBool

enum SpBool

Boolean type. Used in public facing functions instead of bool to improve API use from different programming languages.

Enumerator
spFalse 

False

spTrue 

True

◆ SpPowerState

Specifies device power state. See Power States for more information.

Enumerator
spPowerStateOn 

On

spPowerStateStandby 

Standby

◆ SpMode

enum SpMode

Measurement mode

Enumerator
spModeIdle 

Idle, no measurement active

spModeSweeping 

Swept spectrum analysis

spModeRealTime 

Real-time spectrum analysis

spModeIQStreaming 

I/Q streaming

spModeIQSweepList 

I/Q sweep list / frequency hopping

spModeAudio 

Audio demod

◆ SpDetector

enum SpDetector

Detector used for sweep and real-time spectrum analysis.

Enumerator
spDetectorAverage 

Average

spDetectorMinMax 

Min/Max

◆ SpScale

enum SpScale

Specifies units of sweep and real-time spectrum analysis measurements.

Enumerator
spScaleLog 

dBm

spScaleLin 

mV

spScaleFullScale 

Log scale, no corrections

◆ SpVideoUnits

Specifies units in which VBW processing occurs for swept analysis.

Enumerator
spVideoLog 

dBm

spVideoVoltage 

Linear voltage

spVideoPower 

Linear power

spVideoSample 

No VBW processing

◆ SpWindowType

Specifies the window used for sweep and real-time analysis.

Enumerator
spWindowFlatTop 

SRS flattop

spWindowNutall 

Nutall

spWindowBlackman 

Blackman

spWindowHamming 

Hamming

spWindowGaussian6dB 

Gaussian 6dB BW window for EMC measurements and CISPR compatibility

spWindowRect 

Rectangular (no) window

◆ SpDataType

enum SpDataType

Specifies the data type of I/Q data returned from the API. For I/Q streaming and I/Q sweep lists. See I/Q Data Types

Enumerator
spDataType32fc 

32-bit complex floats

spDataType16sc 

16-bit complex shorts

◆ SpTriggerEdge

External trigger edge polarity for I/Q streaming.

Enumerator
spTriggerEdgeRising 

Rising edge

spTriggerEdgeFalling 

Falling edge

◆ SpGPSState

enum SpGPSState

Internal GPS state

Enumerator
spGPSStateNotPresent 

GPS is not locked

spGPSStateLocked 

GPS is locked, NMEA data is valid, but the timebase is not being disciplined by the GPS

spGPSStateDisciplined 

GPS is locked, NMEA data is valid, timebase is being disciplined by the GPS

◆ SpReference

Used to indicate the source of the timebase reference for the device.

Enumerator
spReferenceUseInternal 

Use the internal 10MHz timebase.

spReferenceUseExternal 

Use an external 10MHz timebase on the 10 MHz In port.

◆ SpGPIOFunction

Used to specify the function of the GPIO port. See spSetGPIOPort.

Enumerator
SpGPIOFunctionTrigIn 

The port will be used for trigger detection while I/Q streaming. The port is not configured until the next I/Q stream is started. This is the default GPIO function.

SpGPIOFunctionPPSOut 

The internal PPS signal is routed to the GPIO port.

SpGPIOFunctionLogicOutLow 

Set to logic low.

SpGPIOFunctionLogicOutHigh 

Set to logic high.

SpGPIOFunctionUARTDirect 

The port can be used to manually write UART messages.

SpGPIOFunctionUARTSweep 

The port will be used for frequency switching during sweep.

SpGPIOFunctionUARTDoppler 

(Not implemented) The port will be used for switching while I/Q streaming.

◆ SpAudioType

Audio demodulation type.

Enumerator
spAudioTypeAM 

AM

spAudioTypeFM 

FM

spAudioTypeUSB 

Upper side band

spAudioTypeLSB 

Lower side band

spAudioTypeCW 

CW

Function Documentation

◆ spGetDeviceList()

SP_API SpStatus spGetDeviceList ( int *  serials,
int *  deviceCount 
)

This function is used to retrieve the serial numbers of all unopened SP devices connected to the PC. The maximum number of serial numbers that can be returned is equal to the value deviceCount points to. The serial numbers returned can then be used to open specific devices with the spOpenDeviceBySerial function. When the function returns successfully, the serials array will contain deviceCount number of unique SP serial numbers. Only deviceCount values will be modified. Note that this function will only report devices that are not opened in the current process. If a device is opened in another application/process, it will be returned by this function. See Multiple Devices and Multiple Processes.

Parameters
[out]serialsPointer to an array of integers. The array must be larger than the number of SP devices connected to the PC.
[out]deviceCountInitially the value pointed to by deviceCount should be equal to or less than the size of the serials array. If the function returns successfully the value will be set to the number of serial numbers returned int the serials array.
Returns

◆ spOpenDevice()

SP_API SpStatus spOpenDevice ( int *  device)

Claim the first unopened SP device detected on the system. If the device is opened successfully, a handle to the function will be returned through the device pointer. This handle can then be used to refer to this device for all future API calls. This function has the same effect as calling spGetDeviceList and using the first device found to call spOpenDeviceBySerial.

Parameters
[out]deviceReturns handle that can be used to interface the device. If this function returns an error, the handle will be invalid.
Returns

◆ spOpenDeviceBySerial()

SP_API SpStatus spOpenDeviceBySerial ( int *  device,
int  serialNumber 
)

This function is similar to spOpenDevice except it allows you to specify the device you wish to open. This function is often used in conjunction with spGetDeviceList when managing several SP devices on one PC.

Parameters
[out]deviceReturns handle that can be used to interface the device. If this function returns an error, the handle will be invalid.
[in]serialNumberSerial number of the device you wish to open.
Returns

◆ spCloseDevice()

SP_API SpStatus spCloseDevice ( int  device)

This function should be called when you want to release the resources for a device. All resources (memory, etc.) will be released, and the device will become available again for use in the current process. The device handle specified will no longer point to a valid device and the device must be re-opened again to be used. This function should be called before the process exits, but it is not strictly required.

Parameters
[in]deviceDevice handle.
Returns

◆ spPresetDevice()

SP_API SpStatus spPresetDevice ( int  device)

Performs a full device preset. When this function returns, the hardware will have performed a full reset, the device handle will no longer be valid, the spCloseDevice function will have been called for the device handle, and the device will need to be re-opened again. This function can be used to recover from an undesirable device state.

Parameters
[in]deviceDevice handle.
Returns

◆ spSetPowerState()

SP_API SpStatus spSetPowerState ( int  device,
SpPowerState  powerState 
)

Change the power state of the device. The power state controls the power consumption of the device. See Power States for more information.

Parameters
[in]deviceDevice handle.
[in]powerStateNew power state.
Returns

◆ spGetPowerState()

SP_API SpStatus spGetPowerState ( int  device,
SpPowerState powerState 
)

Retrieves the current power state. See Power States for more information.

Parameters
[in]deviceDevice handle.
[out]powerStatePointer to SpPowerState.
Returns

◆ spGetSerialNumber()

SP_API SpStatus spGetSerialNumber ( int  device,
int *  serialNumber 
)

This function returns the serial number of an open device.

Parameters
[in]deviceDevice handle.
[out]serialNumberReturns device serial number.
Returns

◆ spGetFirmwareVersion()

SP_API SpStatus spGetFirmwareVersion ( int  device,
int *  major,
int *  minor,
int *  revision 
)

Get the firmware version of the device. The firmware version is of the form major.minor.revision.

Parameters
[in]deviceDevice handle.
[out]majorPointer to int.
[out]minorPointer to int.
[out]revisionPointer to int.
Returns

◆ spGetDeviceDiagnostics()

SP_API SpStatus spGetDeviceDiagnostics ( int  device,
float *  voltage,
float *  current,
float *  temperature 
)

Return operational information of a device.

Parameters
[in]deviceDevice handle.
[out]voltagePointer to float, to contain device voltage. Reported in Voltas. Can be NULL.
[out]currentPointer to float, to contain device current. Can be NULL.
[out]temperaturePointer to float, to contain device temperature. Reported in Celcius. Can be NULL.
Returns

◆ spGetCalDate()

SP_API SpStatus spGetCalDate ( int  device,
uint32_t *  lastCalDate 
)

Return the last device adjustment date. This is the date in which the current device adjustments were made.

Parameters
[in]deviceDevice handle.
[out]lastCalDateLast adjustment data as seconds since epoch.
Returns

◆ spSetReference()

SP_API SpStatus spSetReference ( int  device,
SpReference  reference 
)

Configure the receiver to use either the internal 10MHz reference or use a 10MHz reference present on the 10MHz in port. The device must be in the idle state. For high precision frequency measurements allow adequate settling time after setting the device to use an external reference. The device defaults to using the internal reference after opening the device.

Parameters
[in]deviceDevice handle.
[in]referenceNew reference state.
Returns

◆ spGetReference()

SP_API SpStatus spGetReference ( int  device,
SpReference reference 
)

Get the current reference state.

Parameters
[in]deviceDevice handle.
[out]referenceReturns the last set reference state.
Returns

◆ spSetGPIOPort()

SP_API SpStatus spSetGPIOPort ( int  device,
SpGPIOFunction  func 
)

Configure the GPIO port function. The device should be idle when calling this function. See SpGPIOFunction descriptions of each function. Also see GPIO.

Parameters
[in]deviceDevice handle.
[in]funcSet the function of the GPIO port.
Returns

◆ spGetGPIOPort()

SP_API SpStatus spGetGPIOPort ( int  device,
SpGPIOFunction func 
)

Retrieve the current function of the GPIO port.

Parameters
[in]deviceDevice handle.
[out]funcGet the function of the GPIO port.
Returns

◆ spSetUARTBaudRate()

SP_API SpStatus spSetUARTBaudRate ( int  device,
float  rate 
)

Set the UART baud rate for the GPIO port. If the GPIO port is configured for UART writes, the baud rate is updated immediately. The requested baud rate may not be able to be achieved exactly, request the actual baud rate with spGetUARTBaudRate.

Parameters
[in]deviceDevice handle.
[in]rateDesired baud rate in Hz.
Returns

◆ spGetUARTBaudRate()

SP_API SpStatus spGetUARTBaudRate ( int  device,
float *  rate 
)

Retrieve the current configured UART baud rate.

Parameters
[in]deviceDevice handle.
[out]rateCurrent baud rate in Hz.
Returns

◆ spWriteUARTDirect()

SP_API SpStatus spWriteUARTDirect ( int  device,
uint8_t  data 
)

Write a single byte to the UART on the GPIO port. The port must be configured for direct writes using the spSetGPIOPort function. The baud rate of the write is specified using the spSetUARTBaudRate function.

Parameters
[in]deviceDevice handle.
[in]dataByte to write.
Returns

◆ spSetGPSTimebaseUpdate()

SP_API SpStatus spSetGPSTimebaseUpdate ( int  device,
SpBool  enabled 
)

Enable whether or not the API automatically updates the timebase calibration value when a valid GPS lock is acquired. This function must be called in an idle state. For accurate timestamping using GPS timestamps, this should be enabled. See Automatic GPS Timebase Discipline for more information.

Parameters
[in]deviceDevice handle.
[in]enabledSend spTrue to enable.
Returns

◆ spGetGPSTimebaseUpdate()

SP_API SpStatus spGetGPSTimebaseUpdate ( int  device,
SpBool enabled 
)

Get GPS timebase update enabled. See Automatic GPS Timebase Discipline for more information.

Parameters
[in]deviceDevice handle.
[out]enabledReturns spTrue if auto GPS timebase update is enabled.
Returns

◆ spGetGPSHoldoverInfo()

SP_API SpStatus spGetGPSHoldoverInfo ( int  device,
SpBool usingGPSHoldover,
uint32_t *  lastHoldoverTime 
)

Return information about the GPS holdover correction. Determine if a correction exists and when it was generated.

Parameters
[in]deviceDevice handle.
[out]usingGPSHoldoverReturns whether the GPS holdover value is newer than the factory calibration value. To determine whether the holdover value is actively in use, you will need to use this function in combination with spGetGPSState. This parameter can be NULL.
[out]lastHoldoverTimeIf a GPS holdover value exists on the system, return the timestamp of the value. Value is seconds since epoch. This parameter can be NULL.
Returns

◆ spGetGPSState()

SP_API SpStatus spGetGPSState ( int  device,
SpGPSState GPSState 
)

Determine the lock and discipline status of the GPS. See the Acquiring GPS Lock section for more information. The GPS state is updated after every measurement, or if no measurement is active, it is updated at most once per second.

Parameters
[in]deviceDevice handle.
[out]GPSStatePointer to SpGPSState.
Returns

◆ spSetRefLevel()

SP_API SpStatus spSetRefLevel ( int  device,
double  refLevel 
)

The reference level controls the sensitivity of the receiver by setting the attenuation of the receiver to optimize measurements for signals at or below the reference level. See Reference Level and Sensitivity for more information. Attenuation must be set to automatic (-1) to set reference level. This setting is used by all measurements except I/Q sweep lists/frequency hopping.

Parameters
[in]deviceDevice handle.
[in]refLevelSet the reference level of the receiver in dBm.
Returns

◆ spGetRefLevel()

SP_API SpStatus spGetRefLevel ( int  device,
double *  refLevel 
)

Retrieve the current device reference level.

Parameters
[in]deviceDevice handle.
[out]refLevelReference level returned in dBm.
Returns

◆ spSetAttenuator()

SP_API SpStatus spSetAttenuator ( int  device,
int  atten 
)

Set the device attenuation. See Reference Level and Sensitivity for more information. Valid values for attenuation are between [0,6] representing between [0,30] dB of attenuation (5dB steps). Setting the attenuation to SP_AUTO_ATTEN(-1) tells the receiver to automatically choose the best attenuation value for the specified reference level selected. Setting attenuation to a non-auto value overrides the reference level selection.

Parameters
[in]deviceDevice handle.
[in]attenAttenuation value between [-1,6].
Returns

◆ spGetAttenuator()

SP_API SpStatus spGetAttenuator ( int  device,
int *  atten 
)

Get the device attenuation. See Reference Level and Sensitivity for more information.

Parameters
[in]deviceDevice handle.
[out]attenReturns current attenuation value.
Returns

◆ spSetSweepCenterSpan()

SP_API SpStatus spSetSweepCenterSpan ( int  device,
double  centerFreqHz,
double  spanHz 
)

Set sweep center/span.

Parameters
[in]deviceDevice handle.
[in]centerFreqHzNew center frequency in Hz.
[in]spanHzNew span in Hz.
Returns

◆ spSetSweepStartStop()

SP_API SpStatus spSetSweepStartStop ( int  device,
double  startFreqHz,
double  stopFreqHz 
)

Set sweep start/stop frequency.

Parameters
[in]deviceDevice handle.
[in]startFreqHzStart frequency in Hz.
[in]stopFreqHzStop frequency in Hz.
Returns

◆ spSetSweepCoupling()

SP_API SpStatus spSetSweepCoupling ( int  device,
double  rbw,
double  vbw,
double  sweepTime 
)

Set sweep RBW/VBW parameters.

Parameters
[in]deviceDevice handle.
[in]rbwResolution bandwidth in Hz.
[in]vbwVideo bandwidth in Hz. Cannot be greater than RBW.
[in]sweepTimeSuggest the total acquisition time of the sweep. Specified in seconds. This parameter is a suggestion and will ensure RBW and VBW are first met before increasing sweep time.
Returns

◆ spSetSweepDetector()

SP_API SpStatus spSetSweepDetector ( int  device,
SpDetector  detector,
SpVideoUnits  videoUnits 
)

Set sweep detector.

Parameters
[in]deviceDevice handle.
[in]detectorNew sweep detector.
[in]videoUnitsNew video processing units.
Returns

◆ spSetSweepScale()

SP_API SpStatus spSetSweepScale ( int  device,
SpScale  scale 
)

Set the sweep mode output unit type.

Parameters
[in]deviceDevice handle.
[in]scaleNew sweep mode units.
Returns

◆ spSetSweepWindow()

SP_API SpStatus spSetSweepWindow ( int  device,
SpWindowType  window 
)

Set sweep mode window function.

Parameters
[in]deviceDevice handle.
[in]windowNew window function.
Returns

◆ spSetSweepGPIOSwitching()

SP_API SpStatus spSetSweepGPIOSwitching ( int  device,
double *  freqs,
uint8_t *  data,
int  count 
)

This function is used to set the frequency cross over points for the GPIO sweep functionality and the associated GPIO output logic levels for each frequency. See GPIO for more information.

Parameters
[in]deviceDevice handle.
[in]freqsArray of frequencies at which the associated data will be written to the UART. Array must be 'count' length.
[in]dataArray of bytes. Corresponds to values in freqs array. Array must be 'count' length.
[in]countLength of freqs and data arrays. Set to zero to disable sweep GPIO switching.
Returns

◆ spSetSweepGPIOSwitchingDisabled()

SP_API SpStatus spSetSweepGPIOSwitchingDisabled ( int  device)

Disables and clears the current GPIO sweep setup. The effect of this function will be seen the next time the device is configured. See the GPIO section for more information.

Parameters
[in]deviceDevice handle.
Returns

◆ spSetRealTimeCenterSpan()

SP_API SpStatus spSetRealTimeCenterSpan ( int  device,
double  centerFreqHz,
double  spanHz 
)

Set the center frequency and span for real-time spectrum analysis.

Parameters
[in]deviceDevice handle.
[in]centerFreqHzCenter frequency in Hz.
[in]spanHzSpan in Hz.
Returns

◆ spSetRealTimeRBW()

SP_API SpStatus spSetRealTimeRBW ( int  device,
double  rbw 
)

Set the resolution bandwidth for real-time spectrum analysis.

Parameters
[in]deviceDevice handle.
[in]rbwResolution bandwidth in Hz.
Returns

◆ spSetRealTimeDetector()

SP_API SpStatus spSetRealTimeDetector ( int  device,
SpDetector  detector 
)

Set the detector for real-time spectrum analysis.

Parameters
[in]deviceDevice handle.
[in]detectorNew detector.
Returns

◆ spSetRealTimeScale()

SP_API SpStatus spSetRealTimeScale ( int  device,
SpScale  scale,
double  frameRef,
double  frameScale 
)

Set the sweep and frame units used in real-time spectrum analysis.

Parameters
[in]deviceDevice handle.
[in]scaleScale for the returned sweeps.
[in]frameRefSets the reference level of the real-time frame, or, the amplitude of the highest pixel in the frame.
[in]frameScaleSpecify the height of the frame in dB. A common value is 100dB.
Returns

◆ spSetRealTimeWindow()

SP_API SpStatus spSetRealTimeWindow ( int  device,
SpWindowType  window 
)

Specify the window function used for real-time spectrum analysis.

Parameters
[in]deviceDevice handle.
[in]windowNew window function.
Returns

◆ spSetIQDataType()

SP_API SpStatus spSetIQDataType ( int  device,
SpDataType  dataType 
)

Set the I/Q data type of the samples returned for I/Q streaming.

Parameters
[in]deviceDevice handle.
[in]dataTypeData type. See I/Q Data Types for more information.
Returns

◆ spSetIQCenterFreq()

SP_API SpStatus spSetIQCenterFreq ( int  device,
double  centerFreqHz 
)

Set the center frequency for I/Q streaming.

Parameters
[in]deviceDevice handle.
[in]centerFreqHzCenter frequency in Hz.
Returns

◆ spGetIQCenterFreq()

SP_API SpStatus spGetIQCenterFreq ( int  device,
double *  centerFreqHz 
)

Get the I/Q streaming center frequency.

Parameters
[in]deviceDevice handle.
[in]centerFreqHzPointer to double.
Returns

◆ spSetIQSampleRate()

SP_API SpStatus spSetIQSampleRate ( int  device,
int  decimation 
)

Set sample rate for I/Q streaming.

Parameters
[in]deviceDevice handle.
[in]decimationDecimation of the I/Q data as a power of 2. See I/Q Sample Rates for more information.
Returns

◆ spSetIQSoftwareFilter()

SP_API SpStatus spSetIQSoftwareFilter ( int  device,
SpBool  enabled 
)

Enable/disable software filtering.

Parameters
[in]deviceDevice handle.
[in]enabledSet to spTrue to enable software filtering.
Returns

◆ spSetIQBandwidth()

SP_API SpStatus spSetIQBandwidth ( int  device,
double  bandwidth 
)

Specify the software filter bandwidth in I/Q streaming. See I/Q Sample Rates for more information.

Parameters
[in]deviceDevice handle.
[in]bandwidthThe bandwidth in Hz.
Returns

◆ spSetIQExtTriggerEdge()

SP_API SpStatus spSetIQExtTriggerEdge ( int  device,
SpTriggerEdge  edge 
)

Configure the external trigger edge detect in I/Q streaming.

Parameters
[in]deviceDevice handle.
[in]edgeSet the external trigger edge.
Returns

◆ spSetIQTriggerSentinel()

SP_API SpStatus spSetIQTriggerSentinel ( double  sentinelValue)

Configure how external triggers are reported for I/Q streaming.

Parameters
[in]sentinelValueValue used to fill the remainder of the trigger buffer when the trigger buffer provided is larger than the number of triggers returned. The default sentinel value is zero. See the I/Q Streaming section for more information on triggering.
Returns

◆ spSetIQQueueSize()

SP_API SpStatus spSetIQQueueSize ( int  device,
int  units 
)

Controls the USB queue size of I/Q data that is being actively requested by the API. For example, a queue size of 21ms means the API keeps 21ms of data requests active. A larger queue size means a greater tolerance to data loss in the event of an interruption. Because once data is requested, its transfer must be completed, a smaller queue size can give you faster reconfiguration times. For instance, if you wanted to change frequencies quickly, a smaller queue size would allow this. A default (16) is chosen for the best resistance to data loss for both Linux and Windows. If you are on Linux and you are using multiple devices, please see Linux Notes. This setting applies to I/Q streaming only.

Parameters
[in]deviceDevice handle
[in]unitsShould be a value between [2,16]. Each unit represent 2.1ms. For example, 4 units = 4 * 2.1 = 8.4ms queue size.
Returns

◆ spSetIQSweepListDataType()

SP_API SpStatus spSetIQSweepListDataType ( int  device,
SpDataType  dataType 
)

Set the data type for data returned for I/Q sweep list measurements.

Parameters
[in]deviceDevice handle.
[in]dataTypeSee I/Q Data Types for more information.
Returns

◆ spSetIQSweepListCorrected()

SP_API SpStatus spSetIQSweepListCorrected ( int  device,
SpBool  corrected 
)

Set whether the data returns for I/Q sweep list meausurements is full-scale or corrected.

Parameters
[in]deviceDevice handle.
[in]correctedSet to spFalse for the data to be returned as full scale, and spTrue to be returned amplitude corrected. See I/Q Data Types for more information on how to perform these conversions.
Returns

◆ spSetIQSweepListSteps()

SP_API SpStatus spSetIQSweepListSteps ( int  device,
int  steps 
)

Set the number of frequency steps for I/Q sweep list measurements.

Parameters
[in]deviceDevice handle.
[in]stepsNumber of frequency steps in I/Q sweep.
Returns

◆ spGetIQSweepListSteps()

SP_API SpStatus spGetIQSweepListSteps ( int  device,
int *  steps 
)

Get the number steps in the I/Q sweep list measurement.

Parameters
[in]deviceDevice handle.
[out]stepsPointer to int.
Returns

◆ spSetIQSweepListFreq()

SP_API SpStatus spSetIQSweepListFreq ( int  device,
int  step,
double  freq 
)

Set the center frequency of the acquisition at a given step for the I/Q sweep list measurement.

Parameters
[in]deviceDevice handle.
[in]stepStep at which to configure the center frequency. Should be between [0, steps-1] where steps is set in the spSetIQSweepListSteps function.
[in]freqCenter frequency in Hz.
Returns

◆ spSetIQSweepListRef()

SP_API SpStatus spSetIQSweepListRef ( int  device,
int  step,
double  level 
)

Set the reference level for a step for the I/Q sweep list measurement.

Parameters
[in]deviceDevice handle.
[in]stepStep at which to configure the reference level. Should be between [0, steps-1] where steps is set in the spSetIQSweepListSteps function.
[in]levelReference level in dBm. If this is set, attenuation is set to automatic for this step.
Returns

◆ spSetIQSweepListAtten()

SP_API SpStatus spSetIQSweepListAtten ( int  device,
int  step,
int  atten 
)

Set the attenuation for a step for the I/Q sweep list measurement.

Parameters
[in]deviceDevice handle.
[in]stepStep at which to configure the attenuation. Should be between [0, steps-1] where steps is set in the spSetIQSweepListSteps function.
[in]attenAttenuation value between [0,6] representing [0,30] dB of attenuation (5dB steps). Setting the attenuation to -1 forces the attenuation to auto, at which time the reference level is used to control the attenuator instead.
Returns

◆ spSetIQSweepListSampleCount()

SP_API SpStatus spSetIQSweepListSampleCount ( int  device,
int  step,
uint32_t  samples 
)

Set the number of I/Q samples to be collected at a step.

Parameters
[in]deviceDevice handle.
[in]stepStep at which to configure the sample count. Should be between [0, steps-1] where steps is set in the spSetIQSweepListSteps function.
[in]samplesNumber of samples. Must be greater than 0. There is no upper limit, but keep in mind contiguous memory must be allocated for the capture. Memory allocation for the capture is the responsibility of the user program.
Returns

◆ spSetAudioCenterFreq()

SP_API SpStatus spSetAudioCenterFreq ( int  device,
double  centerFreqHz 
)

Set the center frequency for audio demodulation.

Parameters
[in]deviceDevice handle.
[in]centerFreqHzCenter frequency in Hz.
Returns

◆ spSetAudioType()

SP_API SpStatus spSetAudioType ( int  device,
SpAudioType  audioType 
)

Set the audio demodulator for audio demodulation.

Parameters
[in]deviceDevice handle.
[in]audioTypeDemodulator.
Returns

◆ spSetAudioFilters()

SP_API SpStatus spSetAudioFilters ( int  device,
double  ifBandwidth,
double  audioLpf,
double  audioHpf 
)

Set the audio demodulation filters for audio demodulation.

Parameters
[in]deviceDevice handle.
[in]ifBandwidthIF bandwidth (RBW) in Hz.
[in]audioLpfAudio low pass frequency in Hz.
[in]audioHpfAudio high pass frequency in Hz.
Returns

◆ spSetAudioFMDeemphasis()

SP_API SpStatus spSetAudioFMDeemphasis ( int  device,
double  deemphasis 
)

Set the FM deemphasis for audio demodulation.

Parameters
[in]deviceDevice handle.
[in]deemphasisDeemphasis in us.
Returns

◆ spConfigure()

SP_API SpStatus spConfigure ( int  device,
SpMode  mode 
)

This function configures the receiver into a state determined by the mode parameter. All relevant configuration routines must have already been called. This function calls spAbort to end the previous measurement mode before attempting to configure the receiver. If any error occurs attempting to configure the new measurement state, the previous measurement mode will no longer be active.

Parameters
[in]deviceDevice handle.
[in]modeNew measurement mode.
Returns

◆ spGetCurrentMode()

SP_API SpStatus spGetCurrentMode ( int  device,
SpMode mode 
)

Retrieve the current device measurement mode.

Parameters
[in]deviceDevice handle.
[in]modePointer to SpMode.
Returns

◆ spAbort()

SP_API SpStatus spAbort ( int  device)

This function ends the current measurement mode and puts the device into the idle state. Any current measurements are completed and discarded and will not be accessible after this function returns.

Parameters
[in]deviceDevice handle.
Returns

◆ spGetSweepParameters()

SP_API SpStatus spGetSweepParameters ( int  device,
double *  actualRBW,
double *  actualVBW,
double *  actualStartFreq,
double *  binSize,
int *  sweepSize 
)

Retrieves the sweep parameters for an active sweep measurement mode. This function should be called after a successful device configuration to retrieve the sweep characteristics.

Parameters
[in]deviceDevice handle.
[out]actualRBWReturns the RBW being used in Hz. Can be NULL.
[out]actualVBWReturns the VBW being used in Hz. Can be NULL.
[out]actualStartFreqReturns the frequency of the first bin in Hz. Can be NULL.
[out]binSizeReturns the frequency spacing between each frequency bin in the sweep in Hz. Can be NULL.
[out]sweepSizeReturns the length of the sweep (number of frequency bins). Can be NULL.
Returns

◆ spGetRealTimeParameters()

SP_API SpStatus spGetRealTimeParameters ( int  device,
double *  actualRBW,
int *  sweepSize,
double *  actualStartFreq,
double *  binSize,
int *  frameWidth,
int *  frameHeight,
double *  poi 
)

Retrieve the real-time measurement mode parameters for an active real-time configuration. This function is typically called after a successful device configuration to retrieve the real-time sweep and frame characteristics.

Parameters
[in]deviceDevice handle.
[out]actualRBWReturns the RBW used in Hz. Can be NULL.
[out]sweepSizeReturns the number of frequency bins in the sweep. Can be NULL.
[out]actualStartFreqReturns the frequency of the first bin in the sweep in Hz. Can be NULL.
[out]binSizeFrequency bin spacing in Hz. Can be NULL.
[out]frameWidthThe width of the real-time frame. Can be NULL.
[out]frameHeightThe height of the real-time frame. Can be NULL.
[out]poi100% probability of intercept of a signal given the current configuration. Can be NULL.
Returns

◆ spGetIQParameters()

SP_API SpStatus spGetIQParameters ( int  device,
double *  sampleRate,
double *  bandwidth 
)

Retrieve the I/Q measurement mode parameters for an active I/Q stream. This function is called after a successful device configuration.

Parameters
[in]deviceDevice handle.
[out]sampleRateThe sample rate in Hz. Can be NULL.
bandwidthThe bandwidth of the I/Q capture in Hz. Can be NULL.
Returns

◆ spGetIQCorrection()

SP_API SpStatus spGetIQCorrection ( int  device,
float *  scale 
)

Retrieve the I/Q correction factor for an active I/Q stream. This function is called after a successful device configuration.

Parameters
[in]deviceDevice handle.
[out]scaleAmplitude correction used by the API to convert from full scale I/Q to amplitude corrected I/Q. The formulas for these conversions are in the I/Q Data Types section.
Returns

◆ spIQSweepListGetCorrections()

SP_API SpStatus spIQSweepListGetCorrections ( int  device,
float *  corrections 
)

Retrieve the corrections used to convert full scale I/Q values to amplitude corrected I/Q values for the I/Q sweep list measurement. A correction is returned for each step configured. The device must be configured for I/Q sweep list measurements before calling this function.

Parameters
[in]deviceDevice handle.
[out]correctionsPointer to an array. Array should have length >= number of steps configured for the I/Q sweep list measurement. A correction value will be returned for each step configured.
Returns

◆ spGetSweep()

SP_API SpStatus spGetSweep ( int  device,
float *  sweepMin,
float *  sweepMax,
int64_t *  nsSinceEpoch 
)

Perform a single sweep. Block until the sweep completes.

Parameters
[in]deviceDevice handle.
[out]sweepMinCan be NULL.
[out]sweepMaxCan be NULL.
[out]nsSinceEpochNanoseconds since epoch. Timestamp representing the end of the sweep. Can be NULL.
Returns

◆ spGetRealTimeFrame()

SP_API SpStatus spGetRealTimeFrame ( int  device,
float *  colorFrame,
float *  alphaFrame,
float *  sweepMin,
float *  sweepMax,
int *  frameCount,
int64_t *  nsSinceEpoch 
)

Retrieve a single real-time frame. See Real-Time Spectrum Analysis for more information.

Parameters
[in]deviceDevice handle.
[out]colorFramePointer to memory for the frame. Must be (frameWidth * frameHeight) floats in size. Can be NULL.
[out]alphaFramePointer to memory for the frame. Must be (frameWidth * frameHeight) floats in size. Can be NULL.
[out]sweepMinCan be NULL.
[out]sweepMaxCan be NULL.
[out]frameCountUnique integer which refers to a real-time frame and sweep. The frame count starts at zero following a device reconfigure and increments by one for each frame.
[out]nsSinceEpochNanoseconds since epoch for the returned frame. For real-time mode, this value represents the time at the end of the real-time acquisition and processing of this given frame. It is approximate. Can be NULL.
Returns

◆ spGetIQ()

SP_API SpStatus spGetIQ ( int  device,
void *  iqBuf,
int  iqBufSize,
double *  triggers,
int  triggerBufSize,
int64_t *  nsSinceEpoch,
SpBool  purge,
int *  sampleLoss,
int *  samplesRemaining 
)

Retrieve one block of I/Q data as specified by the user. This function blocks until the data requested is available.

Parameters
[in]deviceDevice handle.
[out]iqBufPointer to user allocated buffer of complex values. The buffer size must be at least (iqBufSize * 2 * sizeof(dataTypeSelected)). Cannot be NULL. Data is returned as interleaved contiguous complex samples. For more information on the data returned and the selectable data types, see I/Q Data Types.
[in]iqBufSizeSpecifies the number of I/Q samples to be retrieved. Must be greater than zero.
[out]triggersPointer to user-allocated array of doubles. The buffer must be at least triggerBufSize contiguous doubles. The pointer can also be NULL to indicate you do not wish to receive external trigger information. See I/Q Streaming section for more information on triggers.
[in]triggerBufSizeSpecifies the size of the triggers array. If the triggers array is NULL, this value should be zero.
[out]nsSinceEpochNanoseconds since epoch. The time of the first I/Q sample returned. Can be NULL. See GPS and Timestamps for more information.
[in]purgeWhen set to spTrue, any buffered I/Q data in the API is purged before returned beginning the I/Q block acquisition.
[out]sampleLossSet by the API when a sample loss condition occurs. If enough I/Q data has accumulated in the internal API circular buffer, the buffer is cleared and the sample loss flag is set. If purge is set to true, the sample flag will always be set to SP_FALSE. Can be NULL.
[out]samplesRemainingSet by the API, returns the number of samples remaining in the I/Q circular buffer. Can be NULL.
Returns

◆ spIQSweepListGetSweep()

SP_API SpStatus spIQSweepListGetSweep ( int  device,
void *  dst,
int64_t *  timestamps 
)

Perform an I/Q sweep. Blocks until the sweep is complete. Can only be called if no other I/Q sweeps are queued.

Parameters
[in]deviceDevice handle.
[out]dstPointer to memory allocated for sweep. The user must allocate this memory before calling this function. Must be large enough to contain all samples for all steps in a sweep. The memory must be contiguous. The samples in the sweep are placed contiguously into the array (step 1 samples follow step 0, step 2 follows step 1, etc). Samples are tightly packed. It is the responsibility of the user to properly index the arrays when finished. The array will be cast to the user-selected data type internally in the API.
[out]timestampsPointer to memory allocated for timestamps. The user must allocate this memory before calling these functions. Must be an array of steps int64_ts, where steps is the number of frequency steps in the sweep. When the sweep completes each timestamp in the array represents the time of the first sample at that frequency in the sweep. Can be NULL if you do not want timestamps.
Returns

◆ spIQSweepListStartSweep()

SP_API SpStatus spIQSweepListStartSweep ( int  device,
int  pos,
void *  dst,
int64_t *  timestamps 
)

Start an I/Q sweep at the given queue position. Up to 16 sweeps can be in queue.

Parameters
[in]deviceDevice handle.
[in]posSweep queue position. Must be between [0,15].
[out]dstPointer to memory allocated for sweep. The user must allocate this memory before calling this function. Must be large enough to contain all samples for all steps in a sweep. The memory must be contiguous. The samples in the sweep are placed contiguously into the array (step 1 samples follow step 0, step 2 follows step 1, etc). Samples are tightly packed. It is the responsibility of the user to properly index the arrays when finished. The array will be cast to the user-selected data type internally in the API.
[out]timestampsPointer to memory allocated for timestamps. The user must allocate this memory before calling these functions. Must be an array of steps int64_ts, where steps is the number of frequency steps in the sweep. When the sweep completes each timestamp in the array represents the time of the first sample at that frequency in the sweep. Can be NULL.
Returns

◆ spIQSweepListFinishSweep()

SP_API SpStatus spIQSweepListFinishSweep ( int  device,
int  pos 
)

Finish an I/Q sweep at the given queue position. Blocks until the sweep is finished.

Parameters
[in]deviceDevice handle.
[in]posSweep queue position. Must be between [0,15].
Returns

◆ spGetAudio()

SP_API SpStatus spGetAudio ( int  device,
float *  audio 
)

If the device is configured to audio demodulation, use this function to retrieve the next 1000 audio samples. This function will block until the data is ready. Minor buffering of audio data is performed in the API, so it is necessary this function is called repeatedly if contiguous audio data is required. The values returned range between [-1.0, 1.0] representing full-scale audio. In FM mode, the audio values will scale with a change in IF bandwidth.

Parameters
[in]deviceDevice handle.
[out]audioPointer to array of 1000 32-bit floats.
Returns

◆ spGetGPSInfo()

SP_API SpStatus spGetGPSInfo ( int  device,
SpBool  refresh,
SpBool updated,
int64_t *  secSinceEpoch,
double *  latitude,
double *  longitude,
double *  altitude,
char *  nmea,
int *  nmeaLen 
)

Acquire the latest GPS information which includes a time stamp, location information, and NMEA sentences. The GPS info is updated once per second at the PPS interval. This function can be called while measurements are active. NMEA data can contain null values. When parsing, do not use the null delimiter to mark the end of the message, use the returned nmeaLen.

Parameters
[in]deviceDevice handle.
[in]refreshWhen set to true and the device is not in a streaming mode, the API will request the latest GPS information. Otherwise the last retrieved data is returned.
[out]updatedWill be set to true if the NMEA data has been updated since the last time the user called this function. Can be set to NULL.
[out]secSinceEpochNumber of seconds since epoch as reported by the GPS NMEA sentences. Last reported value by the GPS. If the GPS is not locked, this value will be set to zero. Can be NULL.
[out]latitudeLatitude in decimal degrees. If the GPS is not locked, this value will be set to zero. Can be NULL.
[out]longitudeLongitude in decimal degrees. If the GPS is not locked, this value will be set to zero. Can be NULL.
[out]altitudeAltitude in meters. If the GPS is not locked, this value will be set to zero. Can be NULL.
[out]nmeaPointer to user-allocated array of char. The length of this array is specified by the nmeaLen parameter. Can be set to NULL.
[in,out]nmeaLenPointer to an integer. The integer will initially specify the length of the nmea buffer. If the nmea buffer is shorter than the NMEA sentences to be returned, the API will only copy over nmeaLen characters, including the null terminator. After the function returns, nmeaLen will be the length of the copied nmea data, including the null terminator. Can be set to NULL. If NULL, the nmea parameter is ignored.
Returns

◆ spWriteToGPS()

SP_API SpStatus spWriteToGPS ( int  device,
const uint8_t *  mem,
int  len 
)

See Writing Messages to the GPS. Use this function to send messages to the internal u-blox M8 GPS. Messages provided are rounded/padded up to the next multiple of 4 bytes. The padded bytes are set to zero.

Parameters
[in]deviceDevice handle.
[in]memThe message to send to the GPS.
[in]lenThe length of the message in bytes.
Returns

◆ spSetFanSetPoint()

SP_API SpStatus spSetFanSetPoint ( int  device,
float  setPoint 
)

Specify the temperature of the device at which the internal fan attempts to maintain. The available temperature range is between [0-60] degrees. The fan uses a closed loop algorithm to reach the target temperature. Set to the maximum or minimum set point to force 0 or 100% fan speed.

This function must be called when the device is idle (no measurement mode active).

Parameters
[in]deviceDevice handle.
[in]setPointTemperature set point in Celcius.
Returns

◆ spGetFanSettings()

SP_API SpStatus spGetFanSettings ( int  device,
float *  setPoint,
float *  voltage 
)

Get current fan temperature threshold and voltage.

Parameters
[in]deviceDevice handle.
[out]setPointTemperature set point in Celcius. Can be NULL.
[out]voltageVoltage in V. Can be NULL.
Returns

◆ spGetErrorString()

SP_API const char * spGetErrorString ( SpStatus  status)

Retrieve a descriptive string of an SpStatus enumeration. Useful for debugging and diagnostic purposes.

Parameters
[in]statusStatus code returned from any API function.
Returns

◆ spGetAPIVersion()

SP_API const char * spGetAPIVersion ( )

Get the API version.

Returns
The returned string is of the form

major.minor.revision

Ascii periods ('.') separate positive integers. Major/minor/revision are not guaranteed to be a single decimal digit. The string is null terminated. The string should not be modified or freed by the user. An example string is below?

['3' | '.' | '0' | '.' | '1' | '1' | '\0'] = "3.0.11"