Added support for the WNC M14A2A Cellular LTE Data Module.

Dependencies:   WNC14A2AInterface

Embed: (wiki syntax)

« Back to documentation index

Radio Private Functions

Radio Private Functions
[Radio]

Functions

uint8_t SpiritRadioInit (SRadioInit *pxSRadioInitStruct)
 Initializes the SPIRIT analog and digital radio part according to the specified parameters in the pxSRadioInitStruct.
void SpiritRadioGetInfo (SRadioInit *pxSRadioInitStruct)
 Returns the SPIRIT analog and digital radio structure according to the registers value.
void SpiritRadioSetXtalFlag (XtalFlag xXtal)
 Sets the Xtal configuration in the ANA_FUNC_CONF0 register.
XtalFlag SpiritRadioGetXtalFlag (void)
 Returns the Xtal configuration in the ANA_FUNC_CONF0 register.
uint8_t SpiritRadioSearchWCP (uint32_t lFc)
 Returns the charge pump word for a given VCO frequency.
uint32_t SpiritRadioGetSynthWord (void)
 Returns the synth word.
void SpiritRadioSetSynthWord (uint32_t lSynthWord)
 Sets the SYNTH registers.
void SpiritRadioSetBand (BandSelect xBand)
 Sets the operating band.
BandSelect SpiritRadioGetBand (void)
 Returns the operating band.
void SpiritRadioSetChannel (uint8_t cChannel)
 Sets the channel number.
uint8_t SpiritRadioGetChannel (void)
 Returns the actual channel number.
void SpiritRadioSetChannelSpace (uint32_t fChannelSpace)
 Sets the channel space factor in channel space register.
uint32_t SpiritRadioGetChannelSpace (void)
 Returns the channel space register.
void SpiritRadioSetFrequencyOffsetPpm (int16_t nXtalPpm)
 Sets the FC OFFSET register starting from xtal ppm value.
void SpiritRadioSetFrequencyOffset (int32_t lFOffset)
 Sets the FC OFFSET register starting from frequency offset expressed in Hz.
int32_t SpiritRadioGetFrequencyOffset (void)
 Returns the actual frequency offset.
uint8_t SpiritRadioSetFrequencyBase (uint32_t lFBase)
 Sets the Synth word and the Band Select register according to desired base carrier frequency.
void SpiritRadioVcoCalibrationWAFB (SpiritFunctionalState xNewstate)
 To say to the set frequency base if do or not the VCO calibration WA.
uint32_t SpiritRadioGetFrequencyBase (void)
 Returns the base carrier frequency.
uint32_t SpiritRadioGetCenterFrequency (void)
 Returns the actual channel center frequency.
void SpiritRadioSearchDatarateME (uint32_t lDatarate, uint8_t *pcM, uint8_t *pcE)
 Returns the mantissa and exponent, whose value used in the datarate formula will give the datarate value closer to the given datarate.
void SpiritRadioSearchChannelBwME (uint32_t lBandwidth, uint8_t *pcM, uint8_t *pcE)
 Returns the mantissa and exponent for a given bandwidth.
void SpiritRadioSearchFreqDevME (uint32_t lFDev, uint8_t *pcM, uint8_t *pcE)
 Returns the mantissa and exponent, whose value used in the frequency deviation formula will give a frequency deviation value most closer to the given frequency deviation.
void SpiritRadioSetDatarate (uint32_t lDatarate)
 Sets the datarate.
uint32_t SpiritRadioGetDatarate (void)
 Returns the datarate.
void SpiritRadioSetFrequencyDev (uint32_t lFDev)
 Sets the frequency deviation.
uint32_t SpiritRadioGetFrequencyDev (void)
 Returns the frequency deviation.
void SpiritRadioSetChannelBW (uint32_t lBandwidth)
 Sets the channel filter bandwidth.
uint32_t SpiritRadioGetChannelBW (void)
 Returns the channel filter bandwidth.
void SpiritRadioSetModulation (ModulationSelect xModulation)
 Sets the modulation type.
ModulationSelect SpiritRadioGetModulation (void)
 Returns the modulation type used.
void SpiritRadioCWTransmitMode (SpiritFunctionalState xNewState)
 Enables or Disables the Continuous Wave transmit mode.
void SpiritRadioSetOokPeakDecay (OokPeakDecay xOokDecay)
 Sets the OOK Peak Decay.
OokPeakDecay SpiritRadioGetOokPeakDecay (void)
 Returns the OOK Peak Decay.
uint8_t SpiritRadioGetdBm2Reg (uint32_t lFBase, float fPowerdBm)
 Returns the PA register value that corresponds to the passed dBm power.
float SpiritRadioGetReg2dBm (uint32_t lFBase, uint8_t cPowerReg)
 Returns the dBm power that corresponds to the value of PA register.
void SpiritRadioSetPATabledBm (uint8_t cPALevelMaxIndex, uint8_t cWidth, PALoadCapacitor xCLoad, float *pfPAtabledBm)
 Configures the Power Amplifier Table and registers with value expressed in dBm.
void SpiritRadioGetPATabledBm (uint8_t *pcPALevelMaxIndex, float *pfPAtabledBm)
 Returns the Power Amplifier Table and registers, returning values in dBm.
void SpiritRadioSetPALeveldBm (uint8_t cIndex, float fPowerdBm)
 Sets a specific PA_LEVEL register, with a value given in dBm.
float SpiritRadioGetPALeveldBm (uint8_t cIndex)
 Returns a specific PA_LEVEL register, returning a value in dBm.
void SpiritRadioSetPATable (uint8_t cPALevelMaxIndex, uint8_t cWidth, PALoadCapacitor xCLoad, uint8_t *pcPAtable)
 Configures the Power Amplifier Table and registers.
void SpiritRadioGetPATable (uint8_t *pcPALevelMaxIndex, uint8_t *pcPAtable)
 Returns the Power Amplifier Table and registers.
void SpiritRadioSetPALevel (uint8_t cIndex, uint8_t cPower)
 Sets a specific PA_LEVEL register.
uint8_t SpiritRadioGetPALevel (uint8_t cIndex)
 Returns a specific PA_LEVEL register.
void SpiritRadioSetPACwc (PALoadCapacitor xCLoad)
 Sets the output stage additional load capacitor bank.
PALoadCapacitor SpiritRadioGetPACwc (void)
 Returns the output stage additional load capacitor bank.
void SpiritRadioSetPALevelMaxIndex (uint8_t cIndex)
 Sets a specific PA_LEVEL_MAX_INDEX.
uint8_t SpiritRadioGetPALevelMaxIndex (void)
 Returns the actual PA_LEVEL_MAX_INDEX.
void SpiritRadioSetPAStepWidth (uint8_t cWidth)
 Sets a specific PA_RAMP_STEP_WIDTH.
uint8_t SpiritRadioGetPAStepWidth (void)
 Returns the actual PA_RAMP_STEP_WIDTH.
void SpiritRadioPARamping (SpiritFunctionalState xNewState)
 Enables or Disables the Power Ramping.
SpiritFunctionalState SpiritRadioGetPARamping (void)
 Returns the Power Ramping enable bit.
void SpiritRadioAFC (SpiritFunctionalState xNewState)
 Enables or Disables the AFC.
void SpiritRadioAFCFreezeOnSync (SpiritFunctionalState xNewState)
 Enables or Disables the AFC freeze on sync word detection.
void SpiritRadioSetAFCMode (AFCMode xMode)
 Sets the AFC working mode.
AFCMode SpiritRadioGetAFCMode (void)
 Returns the AFC working mode.
void SpiritRadioSetAFCPDLeakage (uint8_t cLeakage)
 Sets the AFC peak detector leakage.
uint8_t SpiritRadioGetAFCPDLeakage (void)
 Returns the AFC peak detector leakage.
void SpiritRadioSetAFCFastPeriod (uint8_t cLength)
 Sets the length of the AFC fast period expressed as number of samples.
uint8_t SpiritRadioGetAFCFastPeriod (void)
 Returns the AFC fast period expressed as number of samples.
void SpiritRadioSetAFCFastGain (uint8_t cGain)
 Sets the AFC loop gain in fast mode.
uint8_t SpiritRadioGetAFCFastGain (void)
 Returns the AFC loop gain in fast mode.
void SpiritRadioSetAFCSlowGain (uint8_t cGain)
 Sets the AFC loop gain in slow mode.
uint8_t SpiritRadioGetAFCSlowGain (void)
 Returns the AFC loop gain in slow mode.
int8_t SpiritRadioGetAFCCorrectionReg (void)
 Returns the AFC correction from the corresponding register.
int32_t SpiritRadioGetAFCCorrectionHz (void)
 Returns the AFC correction expressed in Hz.
void SpiritRadioAGC (SpiritFunctionalState xNewState)
 Enables or Disables the AGC.
void SpiritRadioSetAGCMode (AGCMode xMode)
 Sets the AGC working mode.
AGCMode SpiritRadioGetAGCMode (void)
 Returns the AGC working mode.
void SpiritRadioAGCFreezeOnSteady (SpiritFunctionalState xNewState)
 Enables or Disables the AGC freeze on steady state.
void SpiritRadioAGCFreezeOnSync (SpiritFunctionalState xNewState)
 Enable or Disable the AGC freeze on sync detection.
void SpiritRadioAGCStartMaxAttenuation (SpiritFunctionalState xNewState)
 Enable or Disable the AGC to start with max attenuation.
void SpiritRadioSetAGCMeasureTimeUs (uint16_t nTime)
 Sets the AGC measure time.
uint16_t SpiritRadioGetAGCMeasureTimeUs (void)
 Returns the AGC measure time.
void SpiritRadioSetAGCMeasureTime (uint8_t cTime)
 Sets the AGC measure time.
uint8_t SpiritRadioGetAGCMeasureTime (void)
 Returns the AGC measure time.
void SpiritRadioSetAGCHoldTimeUs (uint8_t cTime)
 Sets the AGC hold time.
uint8_t SpiritRadioGetAGCHoldTimeUs (void)
 Returns the AGC hold time.
void SpiritRadioSetAGCHoldTime (uint8_t cTime)
 Sets the AGC hold time.
uint8_t SpiritRadioGetAGCHoldTime (void)
 Returns the AGC hold time.
void SpiritRadioSetAGCHighThreshold (uint8_t cHighThreshold)
 Sets the AGC high threshold.
uint8_t SpiritRadioGetAGCHighThreshold (void)
 Returns the AGC high threshold.
void SpiritRadioSetAGCLowThreshold (uint8_t cLowThreshold)
 Sets the AGC low threshold.
uint8_t SpiritRadioGetAGCLowThreshold (void)
 Returns the AGC low threshold.
void SpiritRadioSetClkRecMode (ClkRecMode xMode)
 Sets the clock recovery algorithm.
ClkRecMode SpiritRadioGetClkRecMode (void)
 Returns the Clock Recovery working mode.
void SpiritRadioSetClkRecPGain (uint8_t cPGain)
 Sets the clock recovery proportional gain.
uint8_t SpiritRadioGetClkRecPGain (void)
 Returns the log2 of the clock recovery proportional gain.
void SpiritRadioSetClkRecIGain (uint8_t cIGain)
 Sets the clock recovery integral gain.
uint8_t SpiritRadioGetClkRecIGain (void)
 Returns the clock recovery integral gain.
void SpiritRadioSetClkRecPstFltLength (PstFltLength xLength)
 Sets the postfilter length for clock recovery algorithm.
PstFltLength SpiritRadioGetClkRecPstFltLength (void)
 Returns the postfilter length for clock recovery algorithm.
void SpiritRadioCsBlanking (SpiritFunctionalState xNewState)
 Enables or Disables the received data blanking when the CS is under the threshold.
void SpiritRadioPersistenRx (SpiritFunctionalState xNewState)
 Enables or Disables the persistent RX mode.
void SpiritRadioSetRefDiv (SpiritFunctionalState xNewState)
 Enables or Disables the synthesizer reference divider.
SpiritFunctionalState SpiritRadioGetRefDiv (void)
 Get the the synthesizer reference divider state.
void SpiritRadioSetDigDiv (SpiritFunctionalState xNewState)
 Enables or Disables the synthesizer reference divider.
SpiritFunctionalState SpiritRadioGetDigDiv (void)
 Get the the synthesizer reference divider state.
uint32_t SpiritRadioGetXtalFrequency (void)
 Returns the XTAL frequency.
void SpiritRadioSetXtalFrequency (uint32_t lXtalFrequency)
 Sets the XTAL frequency.

Function Documentation

void SpiritRadioAFC ( SpiritFunctionalState  xNewState )

Enables or Disables the AFC.

Parameters:
xNewStatenew state for AFC. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 2005 of file SPIRIT_Radio.c.

void SpiritRadioAFCFreezeOnSync ( SpiritFunctionalState  xNewState )

Enables or Disables the AFC freeze on sync word detection.

Parameters:
xNewStatenew state for AFC freeze on sync word detection. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 2035 of file SPIRIT_Radio.c.

void SpiritRadioAGC ( SpiritFunctionalState  xNewState )

Enables or Disables the AGC.

Parameters:
xNewStatenew state for AGC. This parameter can be: S_ENABLE or S_DISABLE
Return values:
None.

Definition at line 2318 of file SPIRIT_Radio.c.

void SpiritRadioAGCFreezeOnSteady ( SpiritFunctionalState  xNewState )

Enables or Disables the AGC freeze on steady state.

Parameters:
xNewStatenew state for AGC freeze on steady state. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 2398 of file SPIRIT_Radio.c.

void SpiritRadioAGCFreezeOnSync ( SpiritFunctionalState  xNewState )

Enable or Disable the AGC freeze on sync detection.

Parameters:
xNewStatenew state for AGC freeze on sync detection. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 2428 of file SPIRIT_Radio.c.

void SpiritRadioAGCStartMaxAttenuation ( SpiritFunctionalState  xNewState )

Enable or Disable the AGC to start with max attenuation.

Parameters:
xNewStatenew state for AGC start with max attenuation mode. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 2458 of file SPIRIT_Radio.c.

void SpiritRadioCsBlanking ( SpiritFunctionalState  xNewState )

Enables or Disables the received data blanking when the CS is under the threshold.

Parameters:
xNewStatenew state of this mode. This parameter can be: S_ENABLE or S_DISABLE .
Return values:
None.

Definition at line 2947 of file SPIRIT_Radio.c.

void SpiritRadioCWTransmitMode ( SpiritFunctionalState  xNewState )

Enables or Disables the Continuous Wave transmit mode.

Parameters:
xNewStatenew state for power ramping. This parameter can be: S_ENABLE or S_DISABLE .
Return values:
None.

Definition at line 1391 of file SPIRIT_Radio.c.

int32_t SpiritRadioGetAFCCorrectionHz ( void   )

Returns the AFC correction expressed in Hz.

Parameters:
None.
Return values:
int32_tAFC correction expressed in Hz according to the following formula:

  • Fafc[Hz]= (Fdig/(12*2^10))*AFC_CORR where
  • AFC_CORR is the value read in the AFC_CORR register

Definition at line 2293 of file SPIRIT_Radio.c.

int8_t SpiritRadioGetAFCCorrectionReg ( void   )

Returns the AFC correction from the corresponding register.

Parameters:
None.
Return values:
int8_tAFC correction, read from the corresponding register. This parameter will be in the range [-128:127].

Definition at line 2273 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetAFCFastGain ( void   )

Returns the AFC loop gain in fast mode.

Parameters:
None.
Return values:
uint8_tAFC loop gain in fast mode. This parameter will be in the range: [0:15].

Definition at line 2213 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetAFCFastPeriod ( void   )

Returns the AFC fast period expressed as number of samples.

Parameters:
None.
Return values:
uint8_tLength of the fast period in number of samples.

Definition at line 2171 of file SPIRIT_Radio.c.

AFCMode SpiritRadioGetAFCMode ( void   )

Returns the AFC working mode.

Parameters:
None.
Return values:
AFCModeSettled AFC mode. This parameter will be one of the values defined in AFCMode :

  • AFC_SLICER_CORRECTION AFC loop closed on slicer
  • AFC_2ND_IF_CORRECTION AFC loop closed on 2nd conversion stage

Definition at line 2097 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetAFCPDLeakage ( void   )

Returns the AFC peak detector leakage.

Parameters:
None.
Return values:
uint8_tPeak detector leakage value. This parameter will be in the range: [0:31].

Definition at line 2140 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetAFCSlowGain ( void   )

Returns the AFC loop gain in slow mode.

Parameters:
None.
Return values:
uint8_tAFC loop gain in slow mode. This parameter will be in the range: [0:15].

Definition at line 2255 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetAGCHighThreshold ( void   )

Returns the AGC high threshold.

Parameters:
None.
Return values:
uint8_tAGC high threshold read from the THRESHOLD_HIGH field of AGCCTRL_1 register. This parameter will be in the range [0:15].

Definition at line 2703 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetAGCHoldTime ( void   )

Returns the AGC hold time.

Parameters:
None.
Return values:
uint8_tAGC hold time read from the HOLD_TIME field of AGCCTRL_0 register. This parameter will be in the range [0:63].

Definition at line 2659 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetAGCHoldTimeUs ( void   )

Returns the AGC hold time.

Parameters:
None.
Return values:
uint8_tAGC hold time expressed in us. This parameter will be in the range: [0, 756/F_Xo].

Definition at line 2611 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetAGCLowThreshold ( void   )

Returns the AGC low threshold.

Parameters:
None.
Return values:
uint8_tAGC low threshold read from the THRESHOLD_LOW field of AGCCTRL_1 register. This parameter will be in the range [0:15].

Definition at line 2747 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetAGCMeasureTime ( void   )

Returns the AGC measure time.

Parameters:
None.
Return values:
uint8_tAGC measure time read from the MEAS_TIME field of AGCCTRL_2 register. This parameter will be in the range [0:15].

Definition at line 2564 of file SPIRIT_Radio.c.

uint16_t SpiritRadioGetAGCMeasureTimeUs ( void   )

Returns the AGC measure time.

Parameters:
None.
Return values:
uint16_tAGC measure time expressed in us. This parameter will be in the range [0, 393216/F_Xo].

Definition at line 2516 of file SPIRIT_Radio.c.

AGCMode SpiritRadioGetAGCMode ( void   )

Returns the AGC working mode.

Parameters:
None.
Return values:
AGCModeSettled AGC mode. This parameter can be one of the values defined in AGCMode :

  • AGC_LINEAR_MODE AGC works in linear mode
  • AGC_BINARY_MODE AGC works in binary mode

Definition at line 2380 of file SPIRIT_Radio.c.

BandSelect SpiritRadioGetBand ( void   )

Returns the operating band.

Parameters:
None.
Return values:
BandSelectSettled band. This returned value can be one of the following parameters:

  • HIGH_BAND High_Band selected: from 779 MHz to 915 MHz
  • MIDDLE_BAND: Middle Band selected: from 387 MHz to 470 MHz
  • LOW_BAND: Low Band selected: from 300 MHz to 348 MHz
  • VERY_LOW_BAND: Very low Band selected: from 150 MHz to 174 MHz

Definition at line 648 of file SPIRIT_Radio.c.

uint32_t SpiritRadioGetCenterFrequency ( void   )

Returns the actual channel center frequency.

Parameters:
None.
Return values:
uint32_tActual channel center frequency expressed in Hz.

Definition at line 994 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetChannel ( void   )

Returns the actual channel number.

Parameters:
None.
Return values:
uint8_tActual channel number.

Definition at line 694 of file SPIRIT_Radio.c.

uint32_t SpiritRadioGetChannelBW ( void   )

Returns the channel filter bandwidth.

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

Definition at line 1326 of file SPIRIT_Radio.c.

uint32_t SpiritRadioGetChannelSpace ( void   )

Returns 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 731 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetClkRecIGain ( void   )

Returns the clock recovery integral gain.

Parameters:
None.
Return values:
uint8_tClock Recovery integral gain read from the CLK_REC_I_GAIN field of CLOCKREC register. This parameter will be in the range [0:15].

Definition at line 2883 of file SPIRIT_Radio.c.

ClkRecMode SpiritRadioGetClkRecMode ( void   )

Returns the Clock Recovery working mode.

Parameters:
None.
Return values:
ClkRecModeClock Recovery mode. This parameter can be one of the values defined in ClkRecMode :

  • CLK_REC_PLL PLL alogrithm for clock recovery
  • CLK_REC_DLL DLL alogrithm for clock recovery

Definition at line 2793 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetClkRecPGain ( void   )

Returns the log2 of the clock recovery proportional gain.

Parameters:
None.
Return values:
uint8_tClock Recovery proportional gain read from the CLK_REC_P_GAIN field of CLOCKREC register. This parameter will be in the range [0:7].

Definition at line 2838 of file SPIRIT_Radio.c.

PstFltLength SpiritRadioGetClkRecPstFltLength ( void   )

Returns the postfilter length for clock recovery algorithm.

Parameters:
None.
Return values:
PstFltLengthPostfilter length in symbols. This parameter can be one of the values defined in PstFltLength :

  • PSTFLT_LENGTH_8 Postfilter length is 8 symbols
  • PSTFLT_LENGTH_16 Postfilter length is 16 symbols

Definition at line 2929 of file SPIRIT_Radio.c.

uint32_t SpiritRadioGetDatarate ( void   )

Returns the datarate.

Parameters:
None.
Return values:
uint32_tSettled datarate expressed in bps.

Definition at line 1221 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetdBm2Reg ( uint32_t  lFBase,
float  fPowerdBm 
)

Returns the PA register value that corresponds to the passed dBm power.

Parameters:
lFbaseFrequency base expressed in Hz.
fPowerdBmDesired power in dBm.
Return values:
Registervalue as byte.
Note:
The power interpolation curves used by this function have been extracted by measurements done on the divisional evaluation boards.

Definition at line 1466 of file SPIRIT_Radio.c.

SpiritFunctionalState SpiritRadioGetDigDiv ( void   )

Get the the synthesizer reference divider state.

Parameters:
void.
Return values:
None.

Definition at line 3090 of file SPIRIT_Radio.c.

uint32_t SpiritRadioGetFrequencyBase ( void   )

Returns the base carrier frequency.

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

Definition at line 971 of file SPIRIT_Radio.c.

uint32_t SpiritRadioGetFrequencyDev ( void   )

Returns 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 1271 of file SPIRIT_Radio.c.

int32_t SpiritRadioGetFrequencyOffset ( void   )

Returns the actual frequency offset.

Parameters:
None.
Return values:
int32_tFrequency offset expressed in Hz as signed word.

Definition at line 817 of file SPIRIT_Radio.c.

void SpiritRadioGetInfo ( SRadioInit pxSRadioInitStruct )

Returns the SPIRIT 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 SPIRIT.
Return values:
None.

Definition at line 356 of file SPIRIT_Radio.c.

ModulationSelect SpiritRadioGetModulation ( void   )

Returns the modulation type used.

Parameters:
None.
Return values:
ModulationSelectSettled modulation type.

Definition at line 1372 of file SPIRIT_Radio.c.

OokPeakDecay SpiritRadioGetOokPeakDecay ( void   )

Returns the OOK Peak Decay.

Parameters:
None
Return values:
OokPeakDecayOok peak decay value.

Definition at line 1446 of file SPIRIT_Radio.c.

PALoadCapacitor SpiritRadioGetPACwc ( void   )

Returns the output stage additional load capacitor bank.

Parameters:
None.
Return values:
PALoadCapacitorOutput stage additional load capacitor bank. This parameter can be:

  • LOAD_0_PF No additional PA load capacitor
  • LOAD_1_2_PF 1.2pF additional PA load capacitor
  • LOAD_2_4_PF 2.4pF additional PA load capacitor
  • LOAD_3_6_PF 3.6pF additional PA load capacitor

Definition at line 1849 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetPALevel ( uint8_t  cIndex )

Returns a specific PA_LEVEL register.

Parameters:
cIndexPA_LEVEL to read. This parameter shall be in the range [0:7].
Return values:
uint8_tPA_LEVEL value. A value equal to zero implies no output power (output stage is in high impedance).

Definition at line 1793 of file SPIRIT_Radio.c.

float SpiritRadioGetPALeveldBm ( 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:
floatSettled 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 SpiritRadioGetReg2dBm fcn to interpolate the power value.

Definition at line 1671 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetPALevelMaxIndex ( 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 1892 of file SPIRIT_Radio.c.

SpiritFunctionalState SpiritRadioGetPARamping ( void   )

Returns the Power Ramping enable bit.

Parameters:
xNewStatenew state for power ramping. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 1986 of file SPIRIT_Radio.c.

uint8_t SpiritRadioGetPAStepWidth ( void   )

Returns the actual PA_RAMP_STEP_WIDTH.

Parameters:
None.
Return values:
uint8_tStep width value expressed in terms of bit period units Tb/8. This parameter will be in the range [1:4].

Definition at line 1937 of file SPIRIT_Radio.c.

void SpiritRadioGetPATable ( uint8_t *  pcPALevelMaxIndex,
uint8_t *  pcPAtable 
)

Returns the Power Amplifier Table and registers.

Parameters:
pcPALevelMaxIndexpointer to the number of levels settled. This parameter shall be in the range [0:7].
pcPAtablepointer to an array of 8 elements containing the PA value. The first element will be the PA_LEVEL_0 and the last element will be PA_LEVEL_7. Any value equals to 0 implies that level has no output power (output stage is in high impedance).
Return values:
None

Definition at line 1743 of file SPIRIT_Radio.c.

void SpiritRadioGetPATabledBm ( uint8_t *  pcPALevelMaxIndex,
float *  pfPAtabledBm 
)

Returns the Power Amplifier Table and registers, returning values in dBm.

Parameters:
pcPALevelMaxIndexpointer to the number of levels settled. This parameter will be in the range [0:7].
pfPAtabledBmpointer to an array of 8 elements containing the PA value in dbm. The first element will be the PA_LEVEL_0 and the last element will be PA_LEVEL_7. Any value higher than PA_UPPER_LIMIT implies no output power (output stage is in high impedance).
Return values:
None.

Definition at line 1608 of file SPIRIT_Radio.c.

SpiritFunctionalState SpiritRadioGetRefDiv ( void   )

Get the the synthesizer reference divider state.

Parameters:
void.
Return values:
None.

Definition at line 3037 of file SPIRIT_Radio.c.

float SpiritRadioGetReg2dBm ( uint32_t  lFBase,
uint8_t  cPowerReg 
)

Returns the dBm power that corresponds to the value of PA register.

Parameters:
lFbaseFrequency base expressed in Hz.
cPowerRegRegister value of the PA.
Return values:
Powerin dBm as float.
Note:
The power interpolation curves used by this function have been extracted by measurements done on the divisional evaluation boards.

Definition at line 1515 of file SPIRIT_Radio.c.

uint32_t SpiritRadioGetSynthWord ( void   )

Returns the synth word.

Parameters:
None.
Return values:
uint32_tSynth word.

Definition at line 568 of file SPIRIT_Radio.c.

XtalFlag SpiritRadioGetXtalFlag ( void   )

Returns the Xtal configuration in the ANA_FUNC_CONF0 register.

Parameters:
None.
Return values:
XtalFrequencySettled Xtal configuration.

Definition at line 491 of file SPIRIT_Radio.c.

uint32_t SpiritRadioGetXtalFrequency ( void   )

Returns the XTAL frequency.

Parameters:
void.
Return values:
uint32_tXTAL frequency.

Definition at line 3112 of file SPIRIT_Radio.c.

uint8_t SpiritRadioInit ( SRadioInit pxSRadioInitStruct )

Initializes the SPIRIT 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 SPIRIT.
Return values:
Errorcode: 0=no error, 1=error during calibration of VCO.

Definition at line 188 of file SPIRIT_Radio.c.

void SpiritRadioPARamping ( SpiritFunctionalState  xNewState )

Enables or Disables the Power Ramping.

Parameters:
xNewStatenew state for power ramping. This parameter can be: S_ENABLE or S_DISABLE.
Return values:
None.

Definition at line 1957 of file SPIRIT_Radio.c.

void SpiritRadioPersistenRx ( SpiritFunctionalState  xNewState )

Enables or Disables the persistent RX mode.

Parameters:
xNewStatenew state of this mode. This parameter can be: S_ENABLE or S_DISABLE .
Return values:
None.

Definition at line 2978 of file SPIRIT_Radio.c.

void SpiritRadioSearchChannelBwME ( uint32_t  lBandwidth,
uint8_t *  pcM,
uint8_t *  pcE 
)

Returns the mantissa and exponent for a given bandwidth.

Even if it is possible to pass as parameter any value in the below mentioned range, the API will search the closer value according to a fixed table of channel bandwidth values (s_vectnBandwidth), as defined in the datasheet, returning the corresponding mantissa and exponent value.

Parameters:
lBandwidthbandwidth expressed in Hz. This parameter ranging between 1100 and 800100.
pcMpointer to the returned mantissa value.
pcEpointer to the returned exponent value.
Return values:
None.

Definition at line 1094 of file SPIRIT_Radio.c.

void SpiritRadioSearchDatarateME ( uint32_t  lDatarate,
uint8_t *  pcM,
uint8_t *  pcE 
)

Returns the mantissa and exponent, whose value used in the datarate formula will give the datarate value closer to the given datarate.

Parameters:
fDataratedatarate expressed in bps. This parameter ranging between 100 and 500000.
pcMpointer to the returned mantissa value.
pcEpointer to the returned exponent value.
Return values:
None.

Definition at line 1027 of file SPIRIT_Radio.c.

void SpiritRadioSearchFreqDevME ( uint32_t  lFDev,
uint8_t *  pcM,
uint8_t *  pcE 
)

Returns the mantissa and exponent, whose value used in the frequency deviation formula will give a frequency deviation value most closer to the given frequency deviation.

Parameters:
fFDevfrequency deviation expressed in Hz. This parameter can be a value in the range [F_Xo*8/2^18, F_Xo*7680/2^18].
pcMpointer to the returned mantissa value.
pcEpointer to the returned exponent value.
Return values:
None.

Definition at line 1155 of file SPIRIT_Radio.c.

uint8_t SpiritRadioSearchWCP ( uint32_t  lFc )

Returns the charge pump word for a given VCO frequency.

Parameters:
lFcchannel center frequency expressed in Hz. This parameter can be a value in one of the following ranges:

  • High_Band: from 779 MHz to 915 MHz
  • Middle Band: from 387 MHz to 470 MHz
  • Low Band: from 300 MHz to 348 MHz
  • Very low Band: from 150 MHz to 174 MHz
Return values:
uint8_tCharge pump word.

Definition at line 513 of file SPIRIT_Radio.c.

void SpiritRadioSetAFCFastGain ( uint8_t  cGain )

Sets the AFC loop gain in fast mode.

Parameters:
cGainAFC loop gain in fast mode. This parameter shall be in the range: [0:15].
Return values:
None.

Definition at line 2189 of file SPIRIT_Radio.c.

void SpiritRadioSetAFCFastPeriod ( uint8_t  cLength )

Sets the length of the AFC fast period expressed as number of samples.

Parameters:
cLengthlength of the fast period in number of samples.
Return values:
None.

Definition at line 2158 of file SPIRIT_Radio.c.

void SpiritRadioSetAFCMode ( AFCMode  xMode )

Sets the AFC working mode.

Parameters:
xModethe AFC mode. This parameter can be one of the values defined in AFCMode :

  • AFC_SLICER_CORRECTION AFC loop closed on slicer
  • AFC_2ND_IF_CORRECTION AFC loop closed on 2nd conversion stage
Return values:
None.

Definition at line 2066 of file SPIRIT_Radio.c.

void SpiritRadioSetAFCPDLeakage ( uint8_t  cLeakage )

Sets the AFC peak detector leakage.

Parameters:
cLeakagethe peak detector leakage. This parameter shall be in the range: [0:31].
Return values:
None.

Definition at line 2116 of file SPIRIT_Radio.c.

void SpiritRadioSetAFCSlowGain ( uint8_t  cGain )

Sets the AFC loop gain in slow mode.

Parameters:
cGainAFC loop gain in slow mode. This parameter shall be in the range: [0:15].
Return values:
None.

Definition at line 2231 of file SPIRIT_Radio.c.

void SpiritRadioSetAGCHighThreshold ( uint8_t  cHighThreshold )

Sets the AGC high threshold.

Parameters:
cHighThresholdAGC high threshold to write in the THRESHOLD_HIGH field of AGCCTRL_1 register. This parameter shall be in the range [0:15].
Return values:
None.

Definition at line 2677 of file SPIRIT_Radio.c.

void SpiritRadioSetAGCHoldTime ( uint8_t  cTime )

Sets the AGC hold time.

Parameters:
cTimeAGC hold time to write in the HOLD_TIME field of AGCCTRL_0 register. This parameter shall be in the range [0:63].
Return values:
None.

Definition at line 2633 of file SPIRIT_Radio.c.

void SpiritRadioSetAGCHoldTimeUs ( uint8_t  cTime )

Sets the AGC hold time.

Parameters:
cTimeAGC hold time expressed in us. This parameter shall be in the range[0, 756/F_Xo].
Return values:
None.

Definition at line 2581 of file SPIRIT_Radio.c.

void SpiritRadioSetAGCLowThreshold ( uint8_t  cLowThreshold )

Sets the AGC low threshold.

Parameters:
cLowThresholdAGC low threshold to write in the THRESHOLD_LOW field of AGCCTRL_1 register. This parameter shall be in the range [0:15].
Return values:
None.

Definition at line 2721 of file SPIRIT_Radio.c.

void SpiritRadioSetAGCMeasureTime ( uint8_t  cTime )

Sets the AGC measure time.

Parameters:
cTimeAGC measure time to write in the MEAS_TIME field of AGCCTRL_2 register. This parameter shall be in the range [0:15].
Return values:
None.

Definition at line 2538 of file SPIRIT_Radio.c.

void SpiritRadioSetAGCMeasureTimeUs ( uint16_t  nTime )

Sets the AGC measure time.

Parameters:
nTimeAGC measure time expressed in us. This parameter shall be in the range [0, 393216/F_Xo].
Return values:
None.

Definition at line 2487 of file SPIRIT_Radio.c.

void SpiritRadioSetAGCMode ( AGCMode  xMode )

Sets the AGC working mode.

Parameters:
xModethe AGC mode. This parameter can be one of the values defined in AGCMode :

  • AGC_LINEAR_MODE AGC works in linear mode
  • AGC_BINARY_MODE AGC works in binary mode
Return values:
None.

Definition at line 2349 of file SPIRIT_Radio.c.

void SpiritRadioSetBand ( BandSelect  xBand )

Sets the operating band.

Parameters:
xBandthe band to set. This parameter can be one of following parameters:

  • HIGH_BAND High_Band selected: from 779 MHz to 915 MHz
  • MIDDLE_BAND: Middle Band selected: from 387 MHz to 470 MHz
  • LOW_BAND: Low Band selected: from 300 MHz to 348 MHz
  • VERY_LOW_BAND: Very low Band selected: from 150 MHz to 174 MHz
Return values:
None.

Definition at line 618 of file SPIRIT_Radio.c.

void SpiritRadioSetChannel ( uint8_t  cChannel )

Sets the channel number.

Parameters:
cChannelthe channel number.
Return values:
None.

Definition at line 681 of file SPIRIT_Radio.c.

void SpiritRadioSetChannelBW ( uint32_t  lBandwidth )

Sets 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 SpiritRadioGetChannelBW() API.
Return values:
None.

Definition at line 1298 of file SPIRIT_Radio.c.

void SpiritRadioSetChannelSpace ( uint32_t  fChannelSpace )

Sets 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 712 of file SPIRIT_Radio.c.

void SpiritRadioSetClkRecIGain ( uint8_t  cIGain )

Sets the clock recovery integral gain.

Parameters:
cIGainthe Clock Recovery integral gain to write in the CLK_REC_I_GAIN field of CLOCKREC register. This parameter shall be in the range [0:15].
Return values:
None.

Definition at line 2856 of file SPIRIT_Radio.c.

void SpiritRadioSetClkRecMode ( ClkRecMode  xMode )

Sets the clock recovery algorithm.

Parameters:
xModethe Clock Recovery mode. This parameter can be one of the values defined in ClkRecMode :

  • CLK_REC_PLL PLL alogrithm for clock recovery
  • CLK_REC_DLL DLL alogrithm for clock recovery
Return values:
None.

Definition at line 2766 of file SPIRIT_Radio.c.

void SpiritRadioSetClkRecPGain ( uint8_t  cPGain )

Sets the clock recovery proportional gain.

Parameters:
cPGainthe Clock Recovery proportional gain to write in the CLK_REC_P_GAIN field of CLOCKREC register. It represents is log2 value of the clock recovery proportional gain. This parameter shall be in the range [0:7].
Return values:
None.

Definition at line 2812 of file SPIRIT_Radio.c.

void SpiritRadioSetClkRecPstFltLength ( PstFltLength  xLength )

Sets the postfilter length for clock recovery algorithm.

Parameters:
xLengththe postfilter length in symbols. This parameter can be one of the values defined in PstFltLength :

  • PSTFLT_LENGTH_8 Postfilter length is 8 symbols
  • PSTFLT_LENGTH_16 Postfilter length is 16 symbols
Return values:
None.

Definition at line 2902 of file SPIRIT_Radio.c.

void SpiritRadioSetDatarate ( uint32_t  lDatarate )

Sets the datarate.

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

Definition at line 1193 of file SPIRIT_Radio.c.

void SpiritRadioSetDigDiv ( SpiritFunctionalState  xNewState )

Enables or Disables the synthesizer reference divider.

Parameters:
xNewStatenew state for synthesizer reference divider. This parameter can be: S_ENABLE or S_DISABLE .
Return values:
None.

Definition at line 3060 of file SPIRIT_Radio.c.

uint8_t SpiritRadioSetFrequencyBase ( uint32_t  lFBase )

Sets 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 853 of file SPIRIT_Radio.c.

void SpiritRadioSetFrequencyDev ( uint32_t  lFDev )

Sets 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 1242 of file SPIRIT_Radio.c.

void SpiritRadioSetFrequencyOffset ( int32_t  lFOffset )

Sets the FC OFFSET register starting from frequency offset expressed in Hz.

Parameters:
lFOffsetfrequency offset expressed in Hz as signed word.
Return values:
None.

Definition at line 791 of file SPIRIT_Radio.c.

void SpiritRadioSetFrequencyOffsetPpm ( int16_t  nXtalPpm )

Sets the FC OFFSET register starting from xtal ppm value.

Parameters:
nXtalPpmthe xtal offset expressed in ppm.
Return values:
None.

Definition at line 749 of file SPIRIT_Radio.c.

void SpiritRadioSetModulation ( ModulationSelect  xModulation )

Sets the modulation type.

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

Definition at line 1347 of file SPIRIT_Radio.c.

void SpiritRadioSetOokPeakDecay ( OokPeakDecay  xOokDecay )

Sets the OOK Peak Decay.

Parameters:
xOokDecayPeak decay control for OOK. This parameter shall be of type OokPeakDecay .
Return values:
None.

Definition at line 1421 of file SPIRIT_Radio.c.

void SpiritRadioSetPACwc ( PALoadCapacitor  xCLoad )

Sets the output stage additional load capacitor bank.

Parameters:
xCLoadone of the possible value of the enum type PALoadCapacitor.

  • LOAD_0_PF No additional PA load capacitor
  • LOAD_1_2_PF 1.2pF additional PA load capacitor
  • LOAD_2_4_PF 2.4pF additional PA load capacitor
  • LOAD_3_6_PF 3.6pF additional PA load capacitor
Return values:
None.

Definition at line 1819 of file SPIRIT_Radio.c.

void SpiritRadioSetPALevel ( uint8_t  cIndex,
uint8_t  cPower 
)

Sets a specific PA_LEVEL register.

Parameters:
cIndexPA_LEVEL to set. This parameter shall be in the range [0:7].
cPowerPA value to write in the register. Be sure that this values is in the correct range [0 : 90].
Return values:
None.

Definition at line 1770 of file SPIRIT_Radio.c.

void SpiritRadioSetPALeveldBm ( uint8_t  cIndex,
float  fPowerdBm 
)

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].
fPowerdBmPA 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 SpiritRadioGetdBm2Reg fcn to interpolate the power value.

Definition at line 1642 of file SPIRIT_Radio.c.

void SpiritRadioSetPALevelMaxIndex ( 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 1867 of file SPIRIT_Radio.c.

void SpiritRadioSetPAStepWidth ( uint8_t  cWidth )

Sets a specific PA_RAMP_STEP_WIDTH.

Parameters:
cWidthstep width expressed in terms of bit period units Tb/8. This parameter shall be in the range [1:4].
Return values:
None.

Definition at line 1911 of file SPIRIT_Radio.c.

void SpiritRadioSetPATable ( uint8_t  cPALevelMaxIndex,
uint8_t  cWidth,
PALoadCapacitor  xCLoad,
uint8_t *  pcPAtable 
)

Configures the Power Amplifier Table and registers.

Parameters:
cPALevelMaxIndexnumber of levels to set. This parameter shall be in the range [0:7].
cWidthstep width expressed in terms of bit period units Tb/8. This parameter shall be in the range [1:4].
xCLoadone of the possible value of the enum type PALoadCapacitor.

  • LOAD_0_PF No additional PA load capacitor
  • LOAD_1_2_PF 1.2pF additional PA load capacitor
  • LOAD_2_4_PF 2.4pF additional PA load capacitor
  • LOAD_3_6_PF 3.6pF additional PA load capacitor
pcPAtablepointer to an array of PA values in the range [0: 90], where 0 implies no output power, 1 will be the maximum level and 90 the minimum one The first element shall be the lower level (PA_LEVEL[0]) value and the last element the higher level one (PA_LEVEL[paLevelMaxIndex]).
Return values:
None.

Definition at line 1704 of file SPIRIT_Radio.c.

void SpiritRadioSetPATabledBm ( uint8_t  cPALevelMaxIndex,
uint8_t  cWidth,
PALoadCapacitor  xCLoad,
float *  pfPAtabledBm 
)

Configures the Power Amplifier Table and registers with value expressed in dBm.

Parameters:
cPALevelMaxIndexnumber of levels to set. This parameter shall be in the range [0:7].
cWidthstep width expressed in terms of bit period units Tb/8. This parameter shall be in the range [1:4].
xCLoadone of the possible value of the enum type PALoadCapacitor.

  • LOAD_0_PF No additional PA load capacitor
  • LOAD_1_2_PF 1.2pF additional PA load capacitor
  • LOAD_2_4_PF 2.4pF additional PA load capacitor
  • LOAD_3_6_PF 3.6pF additional PA load capacitor
pfPAtabledBmpointer to an array of PA values in dbm between [-PA_LOWER_LIMIT: PA_UPPER_LIMIT] dbm. The first element shall be the lower level (PA_LEVEL[0]) value and the last element the higher level one (PA_LEVEL[paLevelMaxIndex]).
Return values:
None.

Definition at line 1566 of file SPIRIT_Radio.c.

void SpiritRadioSetRefDiv ( SpiritFunctionalState  xNewState )

Enables or Disables the synthesizer reference divider.

Parameters:
xNewStatenew state for synthesizer reference divider. This parameter can be: S_ENABLE or S_DISABLE .
Return values:
None.

Definition at line 3008 of file SPIRIT_Radio.c.

void SpiritRadioSetSynthWord ( 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 585 of file SPIRIT_Radio.c.

void SpiritRadioSetXtalFlag ( XtalFlag  xXtal )

Sets the Xtal configuration in the ANA_FUNC_CONF0 register.

Parameters:
xXtalone of the possible value of the enum type XtalFrequency.

  • XTAL_FLAG_24_MHz: in case of 24 MHz crystal
  • XTAL_FLAG_26_MHz: in case of 26 MHz crystal
Return values:
None.

Definition at line 462 of file SPIRIT_Radio.c.

void SpiritRadioSetXtalFrequency ( uint32_t  lXtalFrequency )

Sets the XTAL frequency.

Parameters:
uint32_tXTAL frequency.
Return values:
void.

Definition at line 3122 of file SPIRIT_Radio.c.

void SpiritRadioVcoCalibrationWAFB ( SpiritFunctionalState  xNewstate )

To say to the set frequency base if do or not the VCO calibration WA.

Parameters:
S_ENABLEor S_DISABLE the WA procedure.
Return values:
None.

Definition at line 961 of file SPIRIT_Radio.c.