26 #include "LMS7002M_parameters.h" 41 #if defined _WIN32 || defined __CYGWIN__ 43 # define CALL_CONV __cdecl 45 # define API_EXPORT __attribute__ ((dllexport)) 47 # define API_EXPORT __declspec(dllexport) 49 #elif defined _DOXYGEN_ONLY_ 57 # define API_EXPORT __attribute__ ((visibility ("default"))) 104 API_EXPORT
int CALL_CONV
LMS_Open(lms_device_t **device,
const lms_info_str_t info,
116 API_EXPORT
int CALL_CONV
LMS_Close(lms_device_t *device);
135 API_EXPORT
bool CALL_CONV
LMS_IsOpen(lms_device_t *device,
int port);
184 API_EXPORT
int CALL_CONV
LMS_Init(lms_device_t *device);
209 size_t chan,
bool enabled);
224 API_EXPORT
int CALL_CONV
LMS_SetSampleRate(lms_device_t *device, float_type rate,
241 size_t chan, float_type *host_Hz, float_type *rf_Hz);
269 size_t chan, float_type frequency);
282 size_t chan, float_type *frequency);
319 size_t chan, lms_name_t *list);
331 API_EXPORT
int CALL_CONV
LMS_SetAntenna(lms_device_t *dev,
bool dir_tx,
332 size_t chan,
size_t index);
343 API_EXPORT
int CALL_CONV
LMS_GetAntenna(lms_device_t *dev,
bool dir_tx,
377 size_t chan,float_type gain);
393 API_EXPORT
int CALL_CONV
LMS_SetGaindB(lms_device_t *device,
bool dir_tx,
394 size_t chan,
unsigned gain);
410 size_t chan, float_type *gain);
423 API_EXPORT
int CALL_CONV
LMS_GetGaindB(lms_device_t *device,
bool dir_tx,
424 size_t chan,
unsigned *gain);
437 API_EXPORT
int CALL_CONV
LMS_SetLPFBW(lms_device_t *device,
bool dir_tx,
438 size_t chan, float_type bandwidth);
452 API_EXPORT
int CALL_CONV
LMS_GetLPFBW(lms_device_t *device,
bool dir_tx,
453 size_t chan, float_type *bandwidth);
477 API_EXPORT
int CALL_CONV
LMS_SetLPF(lms_device_t *device,
bool dir_tx,
478 size_t chan,
bool enable);
494 API_EXPORT
int CALL_CONV
LMS_SetGFIRLPF(lms_device_t *device,
bool dir_tx,
495 size_t chan,
bool enabled, float_type bandwidth);
512 API_EXPORT
int CALL_CONV
LMS_Calibrate(lms_device_t *device,
bool dir_tx,
513 size_t chan,
double bw,
unsigned flags);
527 API_EXPORT
int CALL_CONV
LMS_LoadConfig(lms_device_t *device,
const char *filename);
537 API_EXPORT
int CALL_CONV
LMS_SaveConfig(lms_device_t *device,
const char *filename);
552 size_t chan, lms_testsig_t sig, int16_t dc_i, int16_t dc_q);
564 size_t chan, lms_testsig_t *sig);
611 float_type rate,
size_t oversample);
629 size_t chan,
const float_type *freq, float_type pho);
644 size_t chan, float_type *freq, float_type *pho);
661 API_EXPORT
int CALL_CONV
LMS_SetNCOPhase(lms_device_t *device,
bool dir_tx,
662 size_t chan,
const float_type *phases, float_type fcw);
676 API_EXPORT
int CALL_CONV
LMS_GetNCOPhase(lms_device_t *device,
bool dir_tx,
677 size_t chan, float_type *phases, float_type *fcw);
691 API_EXPORT
int CALL_CONV
LMS_SetNCOIndex(lms_device_t *device,
bool dir_tx,
692 size_t chan,
int index,
bool downconv);
703 API_EXPORT
int CALL_CONV
LMS_GetNCOIndex(lms_device_t *device,
bool dir_tx,
716 struct LMS7Parameter param, uint16_t *val);
728 struct LMS7Parameter param, uint16_t val);
743 API_EXPORT
int CALL_CONV
LMS_SetGFIRCoeff(lms_device_t * device,
bool dir_tx,
744 size_t chan, lms_gfir_t filt,
const float_type* coef,
size_t count);
758 API_EXPORT
int CALL_CONV
LMS_GetGFIRCoeff(lms_device_t * device,
bool dir_tx,
759 size_t chan, lms_gfir_t filt, float_type* coef);
772 API_EXPORT
int CALL_CONV
LMS_SetGFIR(lms_device_t * device,
bool dir_tx,
773 size_t chan, lms_gfir_t filt,
bool enabled);
785 API_EXPORT
int CALL_CONV
LMS_VCTCXOWrite(lms_device_t * dev, uint16_t val);
795 API_EXPORT
int CALL_CONV
LMS_VCTCXORead(lms_device_t * dev, uint16_t *val);
812 API_EXPORT
int CALL_CONV
LMS_Reset(lms_device_t *device);
823 API_EXPORT
int CALL_CONV
LMS_ReadLMSReg(lms_device_t *device, uint32_t address,
835 API_EXPORT
int CALL_CONV
LMS_WriteLMSReg(lms_device_t *device, uint32_t address,
847 API_EXPORT
int CALL_CONV
LMS_ReadFPGAReg(lms_device_t *device, uint32_t address,
859 API_EXPORT
int CALL_CONV
LMS_WriteFPGAReg(lms_device_t *device, uint32_t address,
873 uint8_t
id, float_type *val, lms_name_t units);
886 uint8_t
id, float_type val,
const lms_name_t units);
894 #define LMS_CLOCK_REF 0x0000 895 #define LMS_CLOCK_SXR 0x0001 896 #define LMS_CLOCK_SXT 0x0002 897 #define LMS_CLOCK_CGEN 0x0003 898 #define LMS_CLOCK_RXTSP 0x0004 899 #define LMS_CLOCK_TXTSP 0x0005 900 #define LMS_CLOCK_EXTREF 0x0006 940 API_EXPORT
int CALL_CONV
LMS_Synchronize(lms_device_t *dev,
bool toChip);
949 API_EXPORT
int CALL_CONV
LMS_GPIORead(lms_device_t *dev, uint8_t* buffer,
size_t len);
958 API_EXPORT
int CALL_CONV
LMS_GPIOWrite(lms_device_t *dev,
const uint8_t* buffer,
size_t len);
967 API_EXPORT
int CALL_CONV
LMS_GPIODirRead(lms_device_t *dev, uint8_t* buffer,
size_t len);
976 API_EXPORT
int CALL_CONV
LMS_GPIODirWrite(lms_device_t *dev,
const uint8_t* buffer,
size_t len);
1167 const void *samples,
size_t sample_count,
1179 API_EXPORT
int CALL_CONV
LMS_UploadWFM(lms_device_t *device,
const void **samples,
1180 uint8_t chCount,
size_t sample_count,
int format);
1189 API_EXPORT
int CALL_CONV
LMS_EnableTxWFM(lms_device_t *device,
unsigned chan,
bool active);
1239 API_EXPORT
int CALL_CONV
LMS_Program(lms_device_t *device,
const char *data,
size_t size,
1257 char deviceName[32];
1258 char expansionName[32];
1259 char firmwareVersion[16];
1260 char hardwareVersion[16];
1261 char protocolVersion[16];
1263 char gatewareVersion[16];
1264 char gatewareRevision[16];
1265 char gatewareTargetBoard[32];
1299 #endif //LMS_SDR_INTERFACE_H
API_EXPORT int CALL_CONV LMS_Disconnect(lms_device_t *device)
API_EXPORT int CALL_CONV LMS_Program(lms_device_t *device, const char *data, size_t size, lms_prog_trg_t target, lms_prog_md_t mode, lms_prog_callback_t callback)
uint32_t boardSerialNumber
A unique board serial number.
API_EXPORT int CALL_CONV LMS_SaveConfig(lms_device_t *device, const char *filename)
float_type linkRate
Combined data rate of all stream of the same direction (TX or RX)
API_EXPORT int CALL_CONV LMS_UploadWFM(lms_device_t *device, const void **samples, uint8_t chCount, size_t sample_count, int format)
uint32_t overrun
FIFO overrun count.
API_EXPORT int CALL_CONV LMS_SetSampleRateDir(lms_device_t *device, bool dir_tx, float_type rate, size_t oversample)
static const bool LMS_CH_TX
Convenience constants for TX selection.
uint32_t underrun
FIFO underrun count.
uint32_t channel
Channel number. Starts at 0.
API_EXPORT int CALL_CONV LMS_SetupStream(lms_device_t *device, lms_stream_t *stream)
API_EXPORT int CALL_CONV LMS_GetTestSignal(lms_device_t *device, bool dir_tx, size_t chan, lms_testsig_t *sig)
API_EXPORT int CALL_CONV LMS_SetClockFreq(lms_device_t *dev, size_t clk_id, float_type freq)
API_EXPORT int CALL_CONV LMS_GetNCOPhase(lms_device_t *device, bool dir_tx, size_t chan, float_type *phases, float_type *fcw)
API_EXPORT int CALL_CONV LMS_LoadConfig(lms_device_t *device, const char *filename)
API_EXPORT int CALL_CONV LMS_GPIORead(lms_device_t *dev, uint8_t *buffer, size_t len)
Test signal from NCO half scale.
float_type step
Minimum value step.
float_type min
Minimum allowed value.
API_EXPORT int CALL_CONV LMS_SetNCOPhase(lms_device_t *device, bool dir_tx, size_t chan, const float_type *phases, float_type fcw)
uint32_t fifoSize
FIFO size (in samples) used by stream.
API_EXPORT int CALL_CONV LMS_SetGaindB(lms_device_t *device, bool dir_tx, size_t chan, unsigned gain)
API_EXPORT int CALL_CONV LMS_WriteCustomBoardParam(lms_device_t *device, uint8_t id, float_type val, const lms_name_t units)
No active path (RX or TX)
API_EXPORT int CALL_CONV LMS_GetNCOFrequency(lms_device_t *device, bool dir_tx, size_t chan, float_type *freq, float_type *pho)
API_EXPORT int CALL_CONV LMS_ProgramUpdate(lms_device_t *dev, bool download, lms_prog_callback_t callback)
API_EXPORT int CALL_CONV LMS_Close(lms_device_t *device)
Test signal from NCO half scale.
uint32_t fifoFilledCount
Number of samples in FIFO buffer.
API_EXPORT int CALL_CONV LMS_SetGFIR(lms_device_t *device, bool dir_tx, size_t chan, lms_gfir_t filt, bool enabled)
API_EXPORT int CALL_CONV LMS_VCTCXOWrite(lms_device_t *dev, uint16_t val)
API_EXPORT int CALL_CONV LMS_EnableChannel(lms_device_t *device, bool dir_tx, size_t chan, bool enabled)
API_EXPORT int CALL_CONV LMS_WriteParam(lms_device_t *device, struct LMS7Parameter param, uint16_t val)
API_EXPORT int CALL_CONV LMS_StartStream(lms_stream_t *stream)
API_EXPORT int CALL_CONV LMS_SetNCOFrequency(lms_device_t *device, bool dir_tx, size_t chan, const float_type *freq, float_type pho)
API_EXPORT int CALL_CONV LMS_GetNumChannels(lms_device_t *device, bool dir_tx)
Test signal from NCO full scale.
uint64_t timestamp
Current HW timestamp.
char lms_info_str_t[256]
Convenience type for fixed length LMS Device information string.
API_EXPORT int CALL_CONV LMS_GetAntennaList(lms_device_t *dev, bool dir_tx, size_t chan, lms_name_t *list)
load firmware/bitstream to volatile storage
API_EXPORT int CALL_CONV LMS_ReadLMSReg(lms_device_t *device, uint32_t address, uint16_t *val)
API_EXPORT int CALL_CONV LMS_EnableTxWFM(lms_device_t *device, unsigned chan, bool active)
API_EXPORT int CALL_CONV LMS_SetAntenna(lms_device_t *dev, bool dir_tx, size_t chan, size_t index)
API_EXPORT int CALL_CONV LMS_WriteFPGAReg(lms_device_t *device, uint32_t address, uint16_t val)
API_EXPORT int CALL_CONV LMS_Init(lms_device_t *device)
API_EXPORT int CALL_CONV LMS_GetChipTemperature(lms_device_t *dev, size_t ind, float_type *temp)
API_EXPORT int CALL_CONV LMS_GetLOFrequencyRange(lms_device_t *device, bool dir_tx, lms_range_t *range)
double float_type
Floating point data type.
API_EXPORT bool CALL_CONV LMS_IsOpen(lms_device_t *device, int port)
API_EXPORT int CALL_CONV LMS_GetLPFBW(lms_device_t *device, bool dir_tx, size_t chan, float_type *bandwidth)
API_EXPORT int CALL_CONV LMS_SetSampleRate(lms_device_t *device, float_type rate, size_t oversample)
API_EXPORT int CALL_CONV LMS_GetClockFreq(lms_device_t *dev, size_t clk_id, float_type *freq)
API_EXPORT int CALL_CONV LMS_GetGFIRCoeff(lms_device_t *device, bool dir_tx, size_t chan, lms_gfir_t filt, float_type *coef)
API_EXPORT int CALL_CONV LMS_GetDeviceList(lms_info_str_t *dev_list)
API_EXPORT const lms_dev_info_t *CALL_CONV LMS_GetDeviceInfo(lms_device_t *device)
API_EXPORT int CALL_CONV LMS_GetAntenna(lms_device_t *dev, bool dir_tx, size_t chan)
Disable test signals. Return to normal operation.
float_type max
Minimum allowed value.
API_EXPORT int CALL_CONV LMS_ReadFPGAReg(lms_device_t *device, uint32_t address, uint16_t *val)
API_EXPORT int CALL_CONV LMS_Reset(lms_device_t *device)
API_EXPORT int CALL_CONV LMS_SetNormalizedGain(lms_device_t *device, bool dir_tx, size_t chan, float_type gain)
API_EXPORT int CALL_CONV LMS_SetLPFBW(lms_device_t *device, bool dir_tx, size_t chan, float_type bandwidth)
uint32_t fifoSize
Size of FIFO buffer.
API_EXPORT int CALL_CONV LMS_GetLOFrequency(lms_device_t *device, bool dir_tx, size_t chan, float_type *frequency)
uint32_t droppedPackets
Number of dropped packets by HW.
API_EXPORT int CALL_CONV LMS_EnableCalibCache(lms_device_t *dev, bool enable)
API_EXPORT int CALL_CONV LMS_WriteLMSReg(lms_device_t *device, uint32_t address, uint16_t val)
float_type sampleRate
Sampling rate of the stream.
API_EXPORT int CALL_CONV LMS_GPIODirWrite(lms_device_t *dev, const uint8_t *buffer, size_t len)
reset and boot from flash
API_EXPORT int CALL_CONV LMS_SetLPF(lms_device_t *device, bool dir_tx, size_t chan, bool enable)
API_EXPORT int CALL_CONV LMS_GetAntennaBW(lms_device_t *dev, bool dir_tx, size_t chan, size_t index, lms_range_t *range)
API_EXPORT int CALL_CONV LMS_GetNormalizedGain(lms_device_t *device, bool dir_tx, size_t chan, float_type *gain)
API_EXPORT int CALL_CONV LMS_GetNCOIndex(lms_device_t *device, bool dir_tx, size_t chan)
API_EXPORT int CALL_CONV LMS_GetSampleRateRange(lms_device_t *device, bool dir_tx, lms_range_t *range)
program LMS7 MCU firmware
static const int LMS_NCO_VAL_COUNT
Number of NCO frequency/phase offset values.
API_EXPORT int CALL_CONV LMS_GetSampleRate(lms_device_t *device, bool dir_tx, size_t chan, float_type *host_Hz, float_type *rf_Hz)
bool isTx
Indicates whether stream is TX (true) or RX (false)
float throughputVsLatency
API_EXPORT int CALL_CONV LMS_SetLOFrequency(lms_device_t *device, bool dir_tx, size_t chan, float_type frequency)
API_EXPORT int CALL_CONV LMS_GPIOWrite(lms_device_t *dev, const uint8_t *buffer, size_t len)
API_EXPORT int CALL_CONV LMS_GetLPFBWRange(lms_device_t *device, bool dir_tx, lms_range_t *range)
lms_gfir_t
Enumeration of LMS7 GFIRS.
API_EXPORT int CALL_CONV LMS_StopStream(lms_stream_t *stream)
bool(* lms_prog_callback_t)(int bsent, int btotal, const char *progressMsg)
API_EXPORT int CALL_CONV LMS_Synchronize(lms_device_t *dev, bool toChip)
API_EXPORT int CALL_CONV LMS_SetGFIRCoeff(lms_device_t *device, bool dir_tx, size_t chan, lms_gfir_t filt, const float_type *coef, size_t count)
API_EXPORT int CALL_CONV LMS_Calibrate(lms_device_t *device, bool dir_tx, size_t chan, double bw, unsigned flags)
Test signal from NCO full scale.
API_EXPORT int CALL_CONV LMS_GetGaindB(lms_device_t *device, bool dir_tx, size_t chan, unsigned *gain)
static const int LMS_SUCCESS
convenience constant for good return code
API_EXPORT int CALL_CONV LMS_VCTCXORead(lms_device_t *dev, uint16_t *val)
API_EXPORT const char * LMS_GetLibraryVersion()
Returns API library version.
API_EXPORT int CALL_CONV LMS_ReadCustomBoardParam(lms_device_t *device, uint8_t id, float_type *val, lms_name_t units)
API_EXPORT int CALL_CONV LMS_GPIODirRead(lms_device_t *dev, uint8_t *buffer, size_t len)
bool active
Indicates whether the stream is currently active.
API_EXPORT int CALL_CONV LMS_SetNCOIndex(lms_device_t *device, bool dir_tx, size_t chan, int index, bool downconv)
API_EXPORT const char *CALL_CONV LMS_GetLastErrorMessage(void)
load firmware/bitstream to non-volatile storage
API_EXPORT int CALL_CONV LMS_SendStream(lms_stream_t *stream, const void *samples, size_t sample_count, const lms_stream_meta_t *meta, unsigned timeout_ms)
API_EXPORT int CALL_CONV LMS_RecvStream(lms_stream_t *stream, void *samples, size_t sample_count, lms_stream_meta_t *meta, unsigned timeout_ms)
API_EXPORT int CALL_CONV LMS_Open(lms_device_t **device, const lms_info_str_t info, void *args)
API_EXPORT int CALL_CONV LMS_SetGFIRLPF(lms_device_t *device, bool dir_tx, size_t chan, bool enabled, float_type bandwidth)
API_EXPORT int CALL_CONV LMS_SetTestSignal(lms_device_t *device, bool dir_tx, size_t chan, lms_testsig_t sig, int16_t dc_i, int16_t dc_q)
void lms_device_t
LMS Device handle.
static const bool LMS_CH_RX
Convenience constants for RX selection.
API_EXPORT int CALL_CONV LMS_DestroyStream(lms_device_t *dev, lms_stream_t *stream)
API_EXPORT int CALL_CONV LMS_GetStreamStatus(lms_stream_t *stream, lms_stream_status_t *status)
API_EXPORT int CALL_CONV LMS_ReadParam(lms_device_t *device, struct LMS7Parameter param, uint16_t *val)