Appiko
Macros | Functions
S2LP_Radio.c File Reference

This file provides all the low level API to manage Analog and Digital radio part of S2-LP. More...

#include "S2LP_Radio.h"
#include "S2LP_Config.h"
#include "MCU_Interface.h"

Go to the source code of this file.

Macros

#define VCO_CENTER_FREQ   3600000000
 
#define HIGH_BAND_FACTOR   4
 
#define MIDDLE_BAND_FACTOR   8
 
#define HIGH_BAND_LOWER_LIMIT   825900000
 
#define HIGH_BAND_UPPER_LIMIT   1056000000
 
#define MIDDLE_BAND_LOWER_LIMIT   412900000
 
#define MIDDLE_BAND_UPPER_LIMIT   527100000
 
#define MINIMUM_DATARATE   100
 
#define MAXIMUM_DATARATE   250000
 
#define CH_BW_LOWER_LIMIT(F_CLK)   (((uint64_t)1100*F_CLK/1000000)/26)
 
#define CH_BW_UPPER_LIMIT(F_CLK)   (((uint64_t)800100*F_CLK/1000000)/26)
 

Functions

uint32_t S2LPRadioComputeDatarate (uint16_t cM, uint8_t cE)
 Returns the mantissa and exponent, whose value used in the datarate formula will give the datarate value closer to the given datarate. More...
 
void S2LPRadioSearchDatarateME (uint32_t lDatarate, uint16_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. More...
 
void S2LPRadioSearchFreqDevME (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. More...
 
void S2LPRadioSearchChannelBwME (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. More...
 
uint32_t S2LPRadioComputeFreqDeviation (uint8_t cM, uint8_t cE, uint8_t bs, uint8_t refdiv)
 Returns the mantissa and exponent, whose value used in the datarate formula will give the datarate value closer to the given datarate. More...
 
uint32_t S2LPRadioComputeChannelFilterBw (uint8_t cM, uint8_t cE)
 Computes the channel filter value starting from mantissa and exponent. More...
 
uint32_t S2LPRadioComputeFrequencyBase (uint32_t lSynthWord, uint8_t bs, uint8_t refdiv)
 Computes a frequency from a given SYNTH word. More...
 
uint32_t S2LPRadioComputeSynthWord (uint32_t frequency, uint8_t refdiv)
 Computes the synth word from a given frequency. More...
 
uint8_t S2LPRadioComputeChannelSpacingRegValue (uint32_t lChannelSpace)
 Computes the channel space register staring from the channel space value in Hz. The channel spacing step is F_Xo/32768. More...
 
uint32_t S2LPRadioComputeChannelSpacing (uint8_t cChSpaceRegVal)
 Compute the channel spacing register from the channel spacing given in Hz. The channel spacing step is F_Xo/32768. More...
 
void S2LPRadioSearchWCP (uint8_t *cp_isel, uint8_t *pfd_split, uint32_t lFc, uint8_t refdiv)
 Returns the charge pump word for a given VCO frequency. More...
 
void S2LPRadioComputeIF (uint32_t nIF, uint8_t *pcAnaIf, uint8_t *pcDigIf)
 Computes the ANALOG_IF and DIGITAL_IF register values staring from a image frequency value in Hz. More...
 
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 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 lPowerdBm)
 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...
 
void S2LPRadioSetPALevelMaxIndex (uint8_t cIndex)
 Sets a specific PA_LEVEL_MAX_INDEX. More...
 
uint8_t S2LPRadioGetPALevelMaxIndex (void)
 Returns the actual PA_LEVEL_MAX_INDEX. More...
 
void S2LPRadioSetAutoRampingMode (SFunctionalState xNewState)
 Set the autoramping mode. If enabled: More...
 
void S2LPRadioSetManualRampingMode (SFunctionalState xNewState)
 Set the manual ramping mode. 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 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 S2LPRadioSetIsiEqualizationMode (SIsiEqu xSIsiMode)
 Set the ISI equalizer. More...
 
SIsiEqu S2LPRadioGetIsiEqualizationMode (void)
 Returnthe ISI equalization. More...
 
void S2LPRadioSymClkRecoverInit (SSymClkRecInit *xSSymClkRecInit)
 Clock recovery configuration. More...
 
void S2LPRadioGetSymClkRecoverInfo (SSymClkRecInit *xSSymClkRecInit)
 Return the clock recovery configuration. More...
 

Detailed Description

Author
LowPower RF BU - AMG
Version
1.2.1
Date
16-April-2018

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

THIS SOURCE CODE IS PROTECTED BY A LICENSE. FOR MORE INFORMATION PLEASE CAREFULLY READ THE LICENSE AGREEMENT FILE LOCATED IN THE ROOT DIRECTORY OF THIS FIRMWARE PACKAGE.

© COPYRIGHT 2016 STMicroelectronics

Definition in file S2LP_Radio.c.