LMS API Documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
LimeSuite.h File Reference

LMS API library. More...

#include <stdint.h>
#include <stdlib.h>
#include "LMS7002M_parameters.h"
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  lms_range_t
 
struct  lms_stream_meta_t
 
struct  lms_stream_t
 
struct  lms_stream_status_t
 
struct  lms_dev_info_t
 

Macros

#define API_EXPORT   __attribute__ ((visibility ("default")))
 
#define CALL_CONV
 
#define LMS_CLOCK_REF   0x0000
 Chip reference clock.
 
#define LMS_CLOCK_SXR   0x0001
 RX LO clock.
 
#define LMS_CLOCK_SXT   0x0002
 TX LO clock.
 
#define LMS_CLOCK_CGEN   0x0003
 CGEN clock.
 
#define LMS_CLOCK_RXTSP   0x0004
 RXTSP reference clock.
 
#define LMS_CLOCK_TXTSP   0x0005
 TXTSP reference clock.
 
#define LMS_CLOCK_EXTREF   0x0006
 External reference clock.
 

Typedefs

typedef double float_type
 Floating point data type.
 
typedef void lms_device_t
 LMS Device handle.
 
typedef char lms_info_str_t [256]
 Convenience type for fixed length LMS Device information string.
 
typedef char lms_name_t [16]
 
typedef bool(* lms_prog_callback_t )(int bsent, int btotal, const char *progressMsg)
 

Enumerations

enum  lms_testsig_t {
  LMS_TESTSIG_NONE =0, LMS_TESTSIG_NCODIV8, LMS_TESTSIG_NCODIV4, LMS_TESTSIG_NCODIV8F,
  LMS_TESTSIG_NCODIV4F, LMS_TESTSIG_DC
}
 
enum  lms_gfir_t { LMS_GFIR1 = 0, LMS_GFIR2, LMS_GFIR3 }
 Enumeration of LMS7 GFIRS.
 
enum  lms_prog_md_t { LMS_PROG_MD_RAM = 0, LMS_PROG_MD_FLASH = 1, LMS_PROG_MD_RST = 2 }
 
enum  lms_prog_trg_t { LMS_PROG_TRG_FX3 = 0, LMS_PROG_TRG_FPGA, LMS_PROG_TRG_MCU, LMS_PROG_TRG_HPM7 }
 

Functions

API_EXPORT int CALL_CONV LMS_GetDeviceList (lms_info_str_t *dev_list)
 
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_Close (lms_device_t *device)
 
API_EXPORT int CALL_CONV LMS_Disconnect (lms_device_t *device)
 
API_EXPORT bool CALL_CONV LMS_IsOpen (lms_device_t *device, int port)
 
API_EXPORT int CALL_CONV LMS_Init (lms_device_t *device)
 
API_EXPORT int CALL_CONV LMS_GetNumChannels (lms_device_t *device, bool dir_tx)
 
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_SetSampleRate (lms_device_t *device, float_type rate, size_t oversample)
 
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)
 
API_EXPORT int CALL_CONV LMS_GetSampleRateRange (lms_device_t *device, bool dir_tx, lms_range_t *range)
 
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_GetLOFrequency (lms_device_t *device, bool dir_tx, size_t chan, float_type *frequency)
 
API_EXPORT int CALL_CONV LMS_GetLOFrequencyRange (lms_device_t *device, bool dir_tx, lms_range_t *range)
 
API_EXPORT int CALL_CONV LMS_GetAntennaList (lms_device_t *dev, bool dir_tx, size_t chan, lms_name_t *list)
 
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_GetAntenna (lms_device_t *dev, bool dir_tx, size_t chan)
 
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_SetNormalizedGain (lms_device_t *device, bool dir_tx, size_t chan, float_type gain)
 
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_GetNormalizedGain (lms_device_t *device, bool dir_tx, size_t chan, float_type *gain)
 
API_EXPORT int CALL_CONV LMS_GetGaindB (lms_device_t *device, bool dir_tx, size_t chan, unsigned *gain)
 
API_EXPORT int CALL_CONV LMS_SetLPFBW (lms_device_t *device, bool dir_tx, size_t chan, float_type bandwidth)
 
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_GetLPFBWRange (lms_device_t *device, bool dir_tx, lms_range_t *range)
 
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_SetGFIRLPF (lms_device_t *device, bool dir_tx, size_t chan, bool enabled, float_type bandwidth)
 
API_EXPORT int CALL_CONV LMS_Calibrate (lms_device_t *device, bool dir_tx, size_t chan, double bw, unsigned flags)
 
API_EXPORT int CALL_CONV LMS_LoadConfig (lms_device_t *device, const char *filename)
 
API_EXPORT int CALL_CONV LMS_SaveConfig (lms_device_t *device, const char *filename)
 
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)
 
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_SetSampleRateDir (lms_device_t *device, bool dir_tx, float_type rate, size_t oversample)
 
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_GetNCOFrequency (lms_device_t *device, bool dir_tx, size_t chan, float_type *freq, float_type *pho)
 
API_EXPORT int CALL_CONV LMS_SetNCOPhase (lms_device_t *device, bool dir_tx, size_t chan, const float_type *phases, float_type fcw)
 
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_SetNCOIndex (lms_device_t *device, bool dir_tx, size_t chan, int index, bool downconv)
 
API_EXPORT int CALL_CONV LMS_GetNCOIndex (lms_device_t *device, bool dir_tx, size_t chan)
 
API_EXPORT int CALL_CONV LMS_ReadParam (lms_device_t *device, struct LMS7Parameter param, uint16_t *val)
 
API_EXPORT int CALL_CONV LMS_WriteParam (lms_device_t *device, struct LMS7Parameter param, uint16_t val)
 
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_GetGFIRCoeff (lms_device_t *device, bool dir_tx, size_t chan, lms_gfir_t filt, float_type *coef)
 
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_VCTCXORead (lms_device_t *dev, uint16_t *val)
 
API_EXPORT int CALL_CONV LMS_Reset (lms_device_t *device)
 
API_EXPORT int CALL_CONV LMS_ReadLMSReg (lms_device_t *device, uint32_t address, uint16_t *val)
 
API_EXPORT int CALL_CONV LMS_WriteLMSReg (lms_device_t *device, uint32_t address, uint16_t val)
 
API_EXPORT int CALL_CONV LMS_ReadFPGAReg (lms_device_t *device, uint32_t address, uint16_t *val)
 
API_EXPORT int CALL_CONV LMS_WriteFPGAReg (lms_device_t *device, uint32_t address, uint16_t val)
 
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_WriteCustomBoardParam (lms_device_t *device, uint8_t id, float_type val, const lms_name_t units)
 
API_EXPORT int CALL_CONV LMS_GetClockFreq (lms_device_t *dev, size_t clk_id, float_type *freq)
 
API_EXPORT int CALL_CONV LMS_SetClockFreq (lms_device_t *dev, size_t clk_id, float_type freq)
 
API_EXPORT int CALL_CONV LMS_Synchronize (lms_device_t *dev, bool toChip)
 
API_EXPORT int CALL_CONV LMS_GPIORead (lms_device_t *dev, uint8_t *buffer, size_t len)
 
API_EXPORT int CALL_CONV LMS_GPIOWrite (lms_device_t *dev, const uint8_t *buffer, size_t len)
 
API_EXPORT int CALL_CONV LMS_GPIODirRead (lms_device_t *dev, uint8_t *buffer, size_t len)
 
API_EXPORT int CALL_CONV LMS_GPIODirWrite (lms_device_t *dev, const uint8_t *buffer, size_t len)
 
API_EXPORT int CALL_CONV LMS_EnableCalibCache (lms_device_t *dev, bool enable)
 
API_EXPORT int CALL_CONV LMS_GetChipTemperature (lms_device_t *dev, size_t ind, float_type *temp)
 
API_EXPORT int CALL_CONV LMS_SetupStream (lms_device_t *device, lms_stream_t *stream)
 
API_EXPORT int CALL_CONV LMS_DestroyStream (lms_device_t *dev, lms_stream_t *stream)
 
API_EXPORT int CALL_CONV LMS_StartStream (lms_stream_t *stream)
 
API_EXPORT int CALL_CONV LMS_StopStream (lms_stream_t *stream)
 
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_GetStreamStatus (lms_stream_t *stream, lms_stream_status_t *status)
 
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_UploadWFM (lms_device_t *device, const void **samples, uint8_t chCount, size_t sample_count, int format)
 
API_EXPORT int CALL_CONV LMS_EnableTxWFM (lms_device_t *device, unsigned chan, bool active)
 
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)
 
API_EXPORT int CALL_CONV LMS_ProgramUpdate (lms_device_t *dev, bool download, lms_prog_callback_t callback)
 
API_EXPORT const
lms_dev_info_t *CALL_CONV 
LMS_GetDeviceInfo (lms_device_t *device)
 
API_EXPORT const char * LMS_GetLibraryVersion ()
 Returns API library version.
 
API_EXPORT const char *CALL_CONV LMS_GetLastErrorMessage (void)
 

Variables

static const int LMS_SUCCESS = 0
 convenience constant for good return code
 
static const bool LMS_CH_TX = true
 Convenience constants for TX selection.
 
static const bool LMS_CH_RX = false
 Convenience constants for RX selection.
 
static const int LMS_NCO_VAL_COUNT = 16
 Number of NCO frequency/phase offset values.
 

Detailed Description

LMS API library.

Copyright (C) 2016 Lime Microsystems

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file LimeSuite.h.