S2-LP Low Level API  v. 1.3.0
Functions
Radio Exported Functions

Functions

uint8_t S2LPRadioInit (SRadioInit *pxSRadioInitStruct)
 Initializes the S2LP analog and digital radio part according to the specified parameters in the pxSRadioInitStruct. More...
 
void S2LPRadioGetInfo (SRadioInit *pxSRadioInitStruct)
 Returns the S2LP analog and digital radio structure according to the registers value. More...
 
void S2LPRadioSetSynthWord (uint32_t lSynthWord)
 Sets the SYNTH registers. More...
 
uint32_t S2LPRadioGetSynthWord (void)
 Returns the synth word. More...
 
void S2LPRadioSetChannel (uint8_t cChannel)
 Sets the channel number. More...
 
uint8_t S2LPRadioGetChannel (void)
 Returns the actual channel number. More...
 
void S2LPRadioSetRefDiv (SFunctionalState xNewState)
 Set the reference divider value. More...
 
SFunctionalState S2LPRadioGetRefDiv (void)
 To know if the reference deivider is enabled or disabled. More...
 
void S2LPRadioSetDigDiv (SFunctionalState xNewState)
 Set the digital divider . More...
 
SFunctionalState S2LPRadioGetDigDiv (void)
 Get the digital divider . More...
 
void S2LPRadioSetChannelSpace (uint32_t lChannelSpace)
 Set the channel space factor in channel space register. The channel spacing step is computed as F_Xo/32768. More...
 
uint32_t S2LPRadioGetChannelSpace (void)
 Return the channel space register. More...
 
uint8_t S2LPRadioSetFrequencyBase (uint32_t lFBase)
 Set the Synth word and the Band Select register according to desired base carrier frequency. In this API the Xtal configuration is read out from the corresponding register. The user shall fix it before call this API. More...
 
uint32_t S2LPRadioGetFrequencyBase (void)
 Return the base carrier frequency. More...
 
void S2LPRadioSetDatarate (uint32_t lDatarate)
 Set the datarate. More...
 
uint32_t S2LPRadioGetDatarate (void)
 Return the datarate. More...
 
void S2LPRadioSetFrequencyDev (uint32_t lFDev)
 Set the frequency deviation. More...
 
uint32_t S2LPRadioGetFrequencyDev (void)
 Return the frequency deviation. More...
 
void S2LPRadioSetChannelBW (uint32_t lBandwidth)
 Set the channel filter bandwidth. More...
 
uint32_t S2LPRadioGetChannelBW (void)
 Return the channel filter bandwidth. More...
 
void S2LPRadioSetModulation (ModulationSelect xModulation)
 Set the modulation type. More...
 
ModulationSelect S2LPRadioGetModulation (void)
 Return the modulation type used. More...
 
void S2LPRadioSetXtalFrequency (uint32_t lXtalFrequency)
 Set the XTAL frequency. More...
 
uint32_t S2LPRadioGetXtalFrequency (void)
 Return the XTAL frequency. More...
 
void S2LPRadioSetIsiEqualizationMode (SIsiEqu xSIsiMode)
 Set the ISI equalizer. More...
 
SIsiEqu S2LPRadioGetIsiEqualizationMode (void)
 Returnthe ISI equalization. More...
 
void S2LPRadioCalibrationVco (SFunctionalState xAmplitudeCalibration, SFunctionalState xFrequencyCalibration)
 Enable the calibration of the VCO frequency and amplitude. More...
 
void S2LPRadioSetTxCalibVcoAmpWord (uint8_t value)
 Set calibration word of the aplitude in TX. More...
 
void S2LPRadioSetRxCalibVcoAmpWord (uint8_t value)
 Set calibration word of the aplitude in RX. More...
 
void S2LPRadioSetTxCalibVcoFreqWord (uint8_t value)
 Set calibration word of the frequency in TX. More...
 
void S2LPRadioSetRxCalibVcoFreqWord (uint8_t value)
 Set calibration word of the frequency in RX. More...
 
void S2LPRadioSetMaxPALevel (SFunctionalState xNewState)
 Set the MAX_DBM bit. This will allow to transmit at the maximum power. More...
 
void S2LPRadioSetPALeveldBm (uint8_t cIndex, int32_t wPowerdBm)
 Sets a specific PA_LEVEL register, with a value given in dBm. More...
 
int32_t S2LPRadioGetPALeveldBm (uint8_t cIndex)
 Returns a specific PA_LEVEL register, returning a value in dBm. More...
 
uint8_t S2LPRadioGetPALevelMaxIndex (void)
 Returns the actual PA_LEVEL_MAX_INDEX. More...
 
void S2LPRadioSetPALevelMaxIndex (uint8_t cIndex)
 Sets a specific PA_LEVEL_MAX_INDEX. More...
 
void S2LPRadioSetManualRampingMode (SFunctionalState xNewState)
 Set the manual ramping mode. More...
 
void S2LPRadioSetAutoRampingMode (SFunctionalState xNewState)
 Set the autoramping mode. If enabled: More...
 
void S2LPRadioAfcInit (SAfcInit *xSAfcInit)
 Initialize the AFC block according to the passed parameters. More...
 
void S2LPRadioGetAfcInfo (SAfcInit *xSAfcInit)
 Return the AFC struct that corresponds to the AFC block parameters set on the chip. More...
 
void S2LPRadioSymClkRecoverInit (SSymClkRecInit *xSSymClkRecInit)
 Clock recovery configuration. More...
 
void S2LPRadioGetSymClkRecoverInfo (SSymClkRecInit *xSSymClkRecInit)
 Return the clock recovery configuration. More...
 

Detailed Description

Function Documentation

◆ S2LPRadioAfcInit()

void S2LPRadioAfcInit ( SAfcInit xSAfcInit)

Initialize the AFC block according to the passed parameters.

Parameters
xSAfcInitpointer to the AFC struct that contains the parameters value to be set.
Return values
None.

Definition at line 1412 of file S2LP_Radio.c.

◆ S2LPRadioCalibrationVco()

void S2LPRadioCalibrationVco ( SFunctionalState  xAmplitudeCalibration,
SFunctionalState  xFrequencyCalibration 
)

Enable the calibration of the VCO frequency and amplitude.

Parameters
xAmplitudeCalibrationEnables or Disables the calibration of the VCO Amplitude .
xFrequencyCalibrationEnables or Disables the calibration of the VCO Frequency .
Return values
None.

Definition at line 1342 of file S2LP_Radio.c.

◆ S2LPRadioGetAfcInfo()

void S2LPRadioGetAfcInfo ( SAfcInit xSAfcInit)

Return the AFC struct that corresponds to the AFC block parameters set on the chip.

Parameters
xSAfcInitpointer to the AFC struct that must be filled with the parameters.
Return values
None.

Definition at line 1460 of file S2LP_Radio.c.

◆ S2LPRadioGetChannel()

uint8_t S2LPRadioGetChannel ( void  )

Returns the actual channel number.

Parameters
None.
Return values
uint8_tActual channel number.

Definition at line 780 of file S2LP_Radio.c.

◆ S2LPRadioGetChannelBW()

uint32_t S2LPRadioGetChannelBW ( void  )

Return the channel filter bandwidth.

Parameters
None.
Return values
uint32_tChannel filter bandwidth expressed in Hz.

Definition at line 1107 of file S2LP_Radio.c.

◆ S2LPRadioGetChannelSpace()

uint32_t S2LPRadioGetChannelSpace ( void  )

Return the channel space register.

Parameters
None.
Return values
uint32_tChannel space. The channel space is: CS = channel_space_factor x XtalFrequency/2^15 where channel_space_factor is the CHSPACE register value.

Definition at line 889 of file S2LP_Radio.c.

◆ S2LPRadioGetDatarate()

uint32_t S2LPRadioGetDatarate ( void  )

Return the datarate.

Parameters
None.
Return values
uint32_tSettled datarate expressed in bps.

Definition at line 1011 of file S2LP_Radio.c.

◆ S2LPRadioGetDigDiv()

SFunctionalState S2LPRadioGetDigDiv ( void  )

Get the digital divider .

Return values
SFunctionalStateS_DISABLE to disable the digital divider and S_ENABLE to enable it.

Definition at line 855 of file S2LP_Radio.c.

◆ S2LPRadioGetFrequencyBase()

uint32_t S2LPRadioGetFrequencyBase ( void  )

Return the base carrier frequency.

Parameters
None.
Return values
uint32_tBase carrier frequency expressed in Hz as unsigned word.

Definition at line 944 of file S2LP_Radio.c.

◆ S2LPRadioGetFrequencyDev()

uint32_t S2LPRadioGetFrequencyDev ( void  )

Return the frequency deviation.

Parameters
None.
Return values
uint32_tFrequency deviation value expressed in Hz. This value will be in the range [F_Xo*8/2^18, F_Xo*7680/2^18] Hz.

Definition at line 1053 of file S2LP_Radio.c.

◆ S2LPRadioGetInfo()

void S2LPRadioGetInfo ( SRadioInit pxSRadioInitStruct)

Returns the S2LP analog and digital radio structure according to the registers value.

Parameters
pxSRadioInitStructpointer to a SRadioInit structure that contains the configuration information for the analog radio part of S2LP.
Return values
None.

Definition at line 673 of file S2LP_Radio.c.

◆ S2LPRadioGetIsiEqualizationMode()

SIsiEqu S2LPRadioGetIsiEqualizationMode ( void  )

Returnthe ISI equalization.

Parameters
None.
Return values
xSIsiModeIt can be one of the values of SIsiEqu.

Definition at line 1499 of file S2LP_Radio.c.

◆ S2LPRadioGetModulation()

ModulationSelect S2LPRadioGetModulation ( void  )

Return the modulation type used.

Parameters
None.
Return values
ModulationSelectSettled modulation type.

Definition at line 1144 of file S2LP_Radio.c.

◆ S2LPRadioGetPALeveldBm()

int32_t S2LPRadioGetPALeveldBm ( uint8_t  cIndex)

Returns a specific PA_LEVEL register, returning a value in dBm.

Parameters
cIndexPA_LEVEL to read. This parameter shall be in the range [0:7]
Return values
int32_tSettled power level expressed in dBm. A value higher than PA_UPPER_LIMIT dBm implies no output power (output stage is in high impedance).
Note
This function makes use of the S2LPRadioGetReg2dBm fcn to interpolate the power value.

Definition at line 1236 of file S2LP_Radio.c.

◆ S2LPRadioGetPALevelMaxIndex()

uint8_t S2LPRadioGetPALevelMaxIndex ( void  )

Returns the actual PA_LEVEL_MAX_INDEX.

Parameters
None.
Return values
uint8_tActual PA_LEVEL_MAX_INDEX. This parameter will be in the range [0:7].

Definition at line 1271 of file S2LP_Radio.c.

◆ S2LPRadioGetRefDiv()

SFunctionalState S2LPRadioGetRefDiv ( void  )

To know if the reference deivider is enabled or disabled.

Parameters
None.
Return values
SFunctionalStateSET (enabled) or RESET (disabled).

Definition at line 815 of file S2LP_Radio.c.

◆ S2LPRadioGetSymClkRecoverInfo()

void S2LPRadioGetSymClkRecoverInfo ( SSymClkRecInit xSSymClkRecInit)

Return the clock recovery configuration.

Parameters
xSSymClkRecInitpointer to the clock recovery struct to be filled with the clock recovery settings of the chip.
Return values
None.

Definition at line 1547 of file S2LP_Radio.c.

◆ S2LPRadioGetSynthWord()

uint32_t S2LPRadioGetSynthWord ( void  )

Returns the synth word.

Parameters
None.
Return values
uint32_tSynth word.

Definition at line 756 of file S2LP_Radio.c.

◆ S2LPRadioGetXtalFrequency()

uint32_t S2LPRadioGetXtalFrequency ( void  )

Return the XTAL frequency.

Parameters
void.
Return values
uint32_tXTAL frequency.

Definition at line 1171 of file S2LP_Radio.c.

◆ S2LPRadioInit()

uint8_t S2LPRadioInit ( SRadioInit pxSRadioInitStruct)

Initializes the S2LP analog and digital radio part according to the specified parameters in the pxSRadioInitStruct.

Parameters
pxSRadioInitStructpointer to a SRadioInit structure that contains the configuration information for the analog radio part of S2LP.
Return values
Errorcode: 0=no error, 1=error during calibration of VCO.

Definition at line 559 of file S2LP_Radio.c.

◆ S2LPRadioSetAutoRampingMode()

void S2LPRadioSetAutoRampingMode ( SFunctionalState  xNewState)

Set the autoramping mode. If enabled:

  • Disable the MAXDBM
  • Disable the PA_RAMPING
  • Enable the FIR_EN
Parameters
xNewStateSet the autoramping mode.
Return values
None.

Definition at line 1290 of file S2LP_Radio.c.

◆ S2LPRadioSetChannel()

void S2LPRadioSetChannel ( uint8_t  cChannel)

Sets the channel number.

Parameters
cChannelthe channel number.
Return values
None.

Definition at line 769 of file S2LP_Radio.c.

◆ S2LPRadioSetChannelBW()

void S2LPRadioSetChannelBW ( uint32_t  lBandwidth)

Set the channel filter bandwidth.

Parameters
lBandwidthchannel filter bandwidth expressed in Hz. This parameter shall be in the range [1100 800100] Even if it is possible to pass as parameter any value in the above mentioned range, the API will search the most closer value according to a fixed table of channel bandwidth values (s_vectnBandwidth), as defined in the datasheet. To verify the settled channel bandwidth it is possible to use the S2LPRadioGetChannelBW() API.
Return values
None.

Definition at line 1081 of file S2LP_Radio.c.

◆ S2LPRadioSetChannelSpace()

void S2LPRadioSetChannelSpace ( uint32_t  lChannelSpace)

Set the channel space factor in channel space register. The channel spacing step is computed as F_Xo/32768.

Parameters
fChannelSpacethe channel space expressed in Hz.
Return values
None.

Definition at line 875 of file S2LP_Radio.c.

◆ S2LPRadioSetDatarate()

void S2LPRadioSetDatarate ( uint32_t  lDatarate)

Set the datarate.

Parameters
fDataratedatarate expressed in bps. This value shall be in the range [100 500000].
Return values
None.

Definition at line 976 of file S2LP_Radio.c.

◆ S2LPRadioSetDigDiv()

void S2LPRadioSetDigDiv ( SFunctionalState  xNewState)

Set the digital divider .

Parameters
xNewStateS_DISABLE to disable the digital divider and S_ENABLE to enable it.
Return values
None.

Definition at line 834 of file S2LP_Radio.c.

◆ S2LPRadioSetFrequencyBase()

uint8_t S2LPRadioSetFrequencyBase ( uint32_t  lFBase)

Set the Synth word and the Band Select register according to desired base carrier frequency. In this API the Xtal configuration is read out from the corresponding register. The user shall fix it before call this API.

Parameters
lFBasethe base carrier frequency expressed in Hz as unsigned word.
Return values
Errorcode: 0=no error, 1=error during calibration of VCO.

Definition at line 904 of file S2LP_Radio.c.

◆ S2LPRadioSetFrequencyDev()

void S2LPRadioSetFrequencyDev ( uint32_t  lFDev)

Set the frequency deviation.

Parameters
fFDevfrequency deviation expressed in Hz. Be sure that this value is in the correct range [F_Xo*8/2^18, F_Xo*7680/2^18] Hz.
Return values
None.

Definition at line 1030 of file S2LP_Radio.c.

◆ S2LPRadioSetIsiEqualizationMode()

void S2LPRadioSetIsiEqualizationMode ( SIsiEqu  xSIsiMode)

Set the ISI equalizer.

Parameters
xSIsiModeIt can be one of the values of SIsiEqu.
Return values
None.

Definition at line 1482 of file S2LP_Radio.c.

◆ S2LPRadioSetManualRampingMode()

void S2LPRadioSetManualRampingMode ( SFunctionalState  xNewState)

Set the manual ramping mode.

  • Disable the MAXDBM
  • Enable the PA_RAMPING
  • Disable the FIR_EN
Parameters
xNewStateSet the manual ramping mode.
Return values
None.

Definition at line 1318 of file S2LP_Radio.c.

◆ S2LPRadioSetMaxPALevel()

void S2LPRadioSetMaxPALevel ( SFunctionalState  xNewState)

Set the MAX_DBM bit. This will allow to transmit at the maximum power.

Parameters
xNewStateenable (S_ENABLE) to enable or disable (S_DISABLE) the max dBm.
Return values
None.

Definition at line 1182 of file S2LP_Radio.c.

◆ S2LPRadioSetModulation()

void S2LPRadioSetModulation ( ModulationSelect  xModulation)

Set the modulation type.

Parameters
xModulationmodulation to set. This parameter shall be of type ModulationSelect .
Return values
None.

Definition at line 1127 of file S2LP_Radio.c.

◆ S2LPRadioSetPALeveldBm()

void S2LPRadioSetPALeveldBm ( uint8_t  cIndex,
int32_t  lPowerdBm 
)

Sets a specific PA_LEVEL register, with a value given in dBm.

Parameters
cIndexPA_LEVEL to set. This parameter shall be in the range [0:7].
lPowerdBmPA value to write expressed in dBm . Be sure that this values is in the correct range [-PA_LOWER_LIMIT: PA_UPPER_LIMIT] dBm.
Return values
None.
Note
This function makes use of the S2LPRadioGetdBm2Reg fcn to interpolate the power value.

Definition at line 1207 of file S2LP_Radio.c.

◆ S2LPRadioSetPALevelMaxIndex()

void S2LPRadioSetPALevelMaxIndex ( uint8_t  cIndex)

Sets a specific PA_LEVEL_MAX_INDEX.

Parameters
cIndexPA_LEVEL_MAX_INDEX to set. This parameter shall be in the range [0:7].
Return values
None

Definition at line 1254 of file S2LP_Radio.c.

◆ S2LPRadioSetRefDiv()

void S2LPRadioSetRefDiv ( SFunctionalState  xNewState)

Set the reference divider value.

Parameters
xNewState: S_DISABLE to disable the reference divider and S_ENABLE to enable it.
Return values
None.

Definition at line 793 of file S2LP_Radio.c.

◆ S2LPRadioSetRxCalibVcoAmpWord()

void S2LPRadioSetRxCalibVcoAmpWord ( uint8_t  value)

Set calibration word of the aplitude in RX.

Parameters
valueValue of the amplitude calibration word.
Return values
None.

Definition at line 1380 of file S2LP_Radio.c.

◆ S2LPRadioSetRxCalibVcoFreqWord()

void S2LPRadioSetRxCalibVcoFreqWord ( uint8_t  value)

Set calibration word of the frequency in RX.

Parameters
valueValue of the frequency calibration word.
Return values
None.

Definition at line 1401 of file S2LP_Radio.c.

◆ S2LPRadioSetSynthWord()

void S2LPRadioSetSynthWord ( uint32_t  lSynthWord)

Sets the SYNTH registers.

Parameters
lSynthWordthe synth word to write in the SYNTH[3:0] registers.
Return values
None.

Definition at line 733 of file S2LP_Radio.c.

◆ S2LPRadioSetTxCalibVcoAmpWord()

void S2LPRadioSetTxCalibVcoAmpWord ( uint8_t  value)

Set calibration word of the aplitude in TX.

Parameters
valueValue of the amplitude calibration word.
Return values
None.

Definition at line 1369 of file S2LP_Radio.c.

◆ S2LPRadioSetTxCalibVcoFreqWord()

void S2LPRadioSetTxCalibVcoFreqWord ( uint8_t  value)

Set calibration word of the frequency in TX.

Parameters
valueValue of the frequency calibration word.
Return values
None.

Definition at line 1391 of file S2LP_Radio.c.

◆ S2LPRadioSetXtalFrequency()

void S2LPRadioSetXtalFrequency ( uint32_t  lXtalFrequency)

Set the XTAL frequency.

Note
this function must be called before any Radio setting.
Parameters
uint32_tXTAL frequency.
Return values
void.

Definition at line 1160 of file S2LP_Radio.c.

◆ S2LPRadioSymClkRecoverInit()

void S2LPRadioSymClkRecoverInit ( SSymClkRecInit xSSymClkRecInit)

Clock recovery configuration.

Parameters
xSSymClkRecInitpointer to the clock recovery struct to be used to configure the algorithm.
Return values
None.

Definition at line 1514 of file S2LP_Radio.c.