LMS API Documentation: /build/limesuite/src/LimeSuite-22.09.1/src/lime/LimeSuite.h File Reference

LMS API Documentation v22.09.1

Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
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 | BOARD_PARAM_DAC 0
| Runtime VCTCXO DAC trim value. Does not persist over power-cycle.
#define | BOARD_PARAM_TEMP 1
| The value of board temperature sensor (if present), read-only.
#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 (read-only)
#define | LMS_CLOCK_TXTSP 0x0005
| TXTSP reference clock (read-only)
#define | LMS_CLOCK_EXTREF 0x0006
| External reference clock (write-only)
#define | LMS_ALIGN_CH_PHASE (1<<16)
| Attempt to align channel phases in MIMO mode (supported only for Rx channels)
#define | LMS_LOG_CRITICAL 0
| A critical error. The application might not be able to continue running successfully.
#define | LMS_LOG_ERROR 1
| An error message . An operation did not complete successfully.
#define | LMS_LOG_WARNING 2
| A warning message. An operation completed with an unexpected result.
#define | LMS_LOG_INFO 3
| An informational message, usually denoting the successful completion of an operation.
#define | LMS_LOG_DEBUG 4
| A debugging message.

## 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)
typedef void(* | LMS_LogHandler) (int lvl, const char *msg)

## 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_PATH_NONE = 0 , LMS_PATH_LNAH = 1 , LMS_PATH_LNAL = 2 , LMS_PATH_LNAW = 3 , LMS_PATH_TX1 = 1 , LMS_PATH_TX2 = 2 , LMS_PATH_AUTO = 255 }
| Enumeration of RF ports. More...
enum | lms_gfir_t { LMS_GFIR1 = 0 , LMS_GFIR2 , LMS_GFIR3 }
| Enumeration of LMS7 GFIRS. More...

## 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_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_GetChipTemperature (lms_device_t *dev, size_t ind, float_type *temp)
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_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_EnableCache (lms_device_t *dev, bool enable)
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_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_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_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_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_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_GetProgramModes (lms_device_t *device, lms_name_t *list)
API_EXPORT int CALL_CONV | LMS_Program (lms_device_t *device, const char *data, size_t size, const lms_name_t mode, 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 (void)
| Returns API library version.
API_EXPORT const char *CALL_CONV | LMS_GetLastErrorMessage (void)
API_EXPORT void | LMS_RegisterLogHandler (LMS_LogHandler handler)

## 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.

## Macro Definition Documentation

## ◆ API_EXPORT

#define API_EXPORT __attribute__ ((visibility ("default")))

Definition at line 56 of file LimeSuite.h.

## ◆ CALL_CONV

#define CALL_CONV

Definition at line 57 of file LimeSuite.h.

## Typedef Documentation

## ◆ float_type

typedef double float_type

Floating point data type.

Definition at line 61 of file LimeSuite.h.

## Variable Documentation

## ◆ LMS_SUCCESS

const int LMS_SUCCESS = 0
| static

convenience constant for good return code

Definition at line 64 of file LimeSuite.h.