LMS API Documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
Advanced control functions

Enumerations

enum  lms_gfir_t { LMS_GFIR1 = 0, LMS_GFIR2, LMS_GFIR3 }
 Enumeration of LMS7 GFIRS.
 

Functions

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)
 

Variables

static const int LMS_NCO_VAL_COUNT = 16
 Number of NCO frequency/phase offset values.
 

Detailed Description

The functions in this section provides some additional control compared to High-Level functions. They are labeled advanced because they require better understanding of hardware and provide functionality that may conflict with certain High-Level functions.

Function Documentation

API_EXPORT int CALL_CONV LMS_GetGFIRCoeff ( lms_device_t device,
bool  dir_tx,
size_t  chan,
lms_gfir_t  filt,
float_type coef 
)

Get currently set GFIR coefficients.

Parameters
deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
chanChannel index
filtGFIR to configure
[out]coefCurrent GFIR coefficients. Array must be big enough to hold 40 (GFIR1, GFIR2) or 120 (GFIR3) values.
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_GetNCOFrequency ( lms_device_t device,
bool  dir_tx,
size_t  chan,
float_type freq,
float_type pho 
)

Get the current NCO FCW mode configuration.

Parameters
deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
chanChannel index
[out]freqList of NCO frequencies. Must be at least LMS_NCO_VAL_COUNT length;
[out]phoPhase offset in deg
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_GetNCOIndex ( lms_device_t device,
bool  dir_tx,
size_t  chan 
)

Get the currently active NCO frequency/phase offset index

Parameters
deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
chanChannel index
Returns
Current NCO frequency/phase index on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_GetNCOPhase ( lms_device_t device,
bool  dir_tx,
size_t  chan,
float_type phases,
float_type fcw 
)

Get the current NCO PHO mode configuration.

Parameters
deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
chanchannel index
[out]phasesList of configured NCO phases Must be at least LMS_NCO_VAL_COUNT length;
[out]fcwCurrent NCO frequency
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_ReadParam ( lms_device_t device,
struct LMS7Parameter  param,
uint16_t *  val 
)

Read device parameter. Parameter defines specific bits in device register.

Parameters
deviceDevice handle previously obtained by LMS_Open().
paramParameter.
valCurrent parameter value.
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_SetGFIR ( lms_device_t device,
bool  dir_tx,
size_t  chan,
lms_gfir_t  filt,
bool  enabled 
)

Enables or disables specified GFIR.

Parameters
deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
chanChannel index
filtGFIR to configure
enabledtrue(1) enable, false(0) disable.
Returns
0 on success, (-1) on failure
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 
)

Configure LMS GFIR using specified filter coefficients. Maximum number of coefficients is 40 for GFIR1 and GFIR2, and 120 for GFIR3.

Parameters
deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
chanChannel index
filtGFIR to configure
[in]coefArray of filter coefficients. Coeff range [-1.0, 1.0].
countnumber of filter coefficients.
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_SetNCOFrequency ( lms_device_t device,
bool  dir_tx,
size_t  chan,
const float_type freq,
float_type  pho 
)

Configure NCO to operate in FCW mode. Configures NCO with up to 16 frequencies that can be quickly switched between. Automatically starts NCO with frequency at index 0 Use LMS_SetNCOindex() to switch between NCO frequencies.

Parameters
deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
chanChannel index
[in]freqList of NCO frequencies. Values cannot be negative. Must be at least LMS_NCO_VAL_COUNT length;
phoNCO phase offset in deg
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_SetNCOIndex ( lms_device_t device,
bool  dir_tx,
size_t  chan,
int  index,
bool  downconv 
)

Switches between configured list of NCO frequencies/phase offsets. Also Allows to switch CMIX mode to either downconvert or upconvert.

Parameters
deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
chanchannel index
indexNCO frequency/phase index to activate or (-1) to disable NCO
downconvtrue(1) CMIX downconvert, false(0) CMIX upconvert
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_SetNCOPhase ( lms_device_t device,
bool  dir_tx,
size_t  chan,
const float_type phases,
float_type  fcw 
)

Configure NCO to operate in PHO mode. Configures NCO with up to 16 phase offsets that can be quickly switched between. Automatically starts NCO with phase at index 0 Use LMS_SetNCOindex() to switch between NCO phases.

Parameters
deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
chanChannel index
[in]phasesList of NCO phases. Values cannot be negative. Must be at least LMS_NCO_VAL_COUNT length;
fcwNCO frequency in Hz
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_SetSampleRateDir ( lms_device_t device,
bool  dir_tx,
float_type  rate,
size_t  oversample 
)

Set sampling rate for all RX or TX channels. Sample rate is in complex samples (1 sample = I + Q). The function sets sampling rate that is used for data exchange with the host. It also allows to specify higher sampling rate to be used in RF by setting oversampling ratio. Valid oversampling values are 1, 2, 4, 8, 16, 32 or 0 (use device default oversampling value).

Note
RX and TX rates sampling are closely tied in LMS7 chip. Changing RX or TX will often result in change of both (RX and TX). RX/TX ratio can only be power of 2 and is also limited by other factors. Use LMS_GetSampleRate() to obtain actual sample rate values. The function returns success if it is able to achieve desired sample rate and oversampling for the specified direction (RX or TX) ignoring possible value changes in other direction channels.
Parameters
[in]deviceDevice handle previously obtained by LMS_Open().
dir_txSelect RX or TX
rateSampling rate in Hz to set
oversampleRF oversampling ratio.
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_VCTCXORead ( lms_device_t dev,
uint16_t *  val 
)

Read value from VCTCXO trim DAC.

Parameters
[in]devDevice handle previously obtained by LMS_Open().
[out]valValue to read from VCTCXO trim DAC
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_VCTCXOWrite ( lms_device_t dev,
uint16_t  val 
)

Write value to VCTCXO trim DAC. Used to adjust/calibrate reference clock generated by voltage controlled oscillator.

Note
calling this functions switches clock source to VCTCXO
Parameters
devDevice handle previously obtained by LMS_Open().
valValue to write to VCTCXO trim DAC, range 0-255
Returns
0 on success, (-1) on failure
API_EXPORT int CALL_CONV LMS_WriteParam ( lms_device_t device,
struct LMS7Parameter  param,
uint16_t  val 
)

Write device parameter. Parameter defines specific bits in device register.

Parameters
deviceDevice handle previously obtained by LMS_Open().
paramParameter.
valParameter value to write
Returns
0 on success, (-1) on failure