Radio Control Layer (RCL)
LRFCC23X0.c File Reference
#include <stdint.h>
#include <stdlib.h>
#include <ti/drivers/rcl/LRF.h>
#include <ti/drivers/rcl/RCL_Scheduler.h>
#include <ti/drivers/rcl/RCL_Command.h>
#include <ti/drivers/rcl/RCL_Feature.h>
#include <ti/log/Log.h>
#include <ti/drivers/dpl/HwiP.h>
#include <ti/devices/DeviceFamily.h>
+ Include dependency graph for LRFCC23X0.c:

Macros

#define LRF_TRIM_NORMAL_BW   0
 
#define LRF_TRIM_HIGH_BW   1 /* Revision >= 4 only */s
 
#define LRF_TRIM_MIN_VERSION_FULL_FEATURES   4 /* Only AppTrims revision 4 and above has all features */
 
#define LRF_TRIM_VERSION_DCOLDO_TEMPERATURE_COMPENSATION   8 /* Only AppTrims revision 8 and above have DCOLDO temperature compensation */
 
#define LRF_TRIM_VERSION_RSSIOFFSET_ISSUE_CC23X0R5   4 /* AppTrims revision with issue in rssiOffset field */
 
#define LRF_TRIM_LIMIT_RSSIOFFSET_ISSUE_CC23X0R5   (-4) /* If rssiOffset is less or equal to this, apply correction */
 
#define LRF_TRIM_CORRECTION_RSSIOFFSET_ISSUE_CC23X0R5   5 /* Correction to apply to devices with wrong RSSI offset */
 
#define LRF_TRIM_DCOLDO0_SECONDTRIM_INC_STATE_B_DCOLDO_WORKAROUND_CC27XX   10U /* DCOLDO0:SECONDTRIM needs to be increased by 10 on CC27XX state B devices */
 
#define LRF_TRIM_DCOLDO0_SECONDTRIM_CODED_BITS_MASK   ((1U << 3U) | (1U << 5U)) /* Bits mask for bit 3 and 5 of DCOLDO0:SECONDTRIM */
 
#define LRF_TRIM_DCOLDO0_SECONDTRIM_MAX_STATE   63U /* DCOLDO0:SECONDTRIM maximum value allowed within the range of 6-bit representation */
 
#define LRF_TRIM_DCOLDO0_FIRSTTRIM_MIN_STATE   -8 /* DCOLDO0:FIRSTTRIM minimum value allowed within the range of 4-bit two's complement representation */
 
#define LRF_DCOLDOSECOND_HIGH_TEMP_ADJ_FACTOR   5
 
#define LRF_DCOLDOSECOND_LOW_TEMP_ADJ_FACTOR   5
 
#define LRF_DCOLDO_DEADBAND   10
 
#define LRF_DCOLDO_OFFSET_LOWER_SATURATION   0
 
#define LRF_DCOLDOFIRST_HIGH_TEMP_ADJ_FACTOR_S   1
 
#define LRF_DCOLDOFIRST_HIGH_TEMP_ADJ_FACTOR_MUL   5
 
#define LRF_DCOLDOFIRST_LOW_TEMP_ADJ_FACTOR_S   1
 
#define LRF_DCOLDOFIRST_LOW_TEMP_ADJ_FACTOR_MUL   5
 
#define LRF_DCOLDOSECOND_FACTOR   2
 
#define DIV_BY_NINE_CONSTANT   1864135
 
#define LRF_DCOLDO_OFFSET_HIGH_TEMP   16
 
#define LRF_DCOLDO_OFFSET_LOW_TEMP   9
 
#define LRF_DCOLDO_SHIFT_HIGH_TEMP   5
 
#define LRF_DCOLDO_SHIFT_LOW_TEMP   25
 
#define LRF_TEMPERATURE_NOM   25
 
#define LRF_DCDC_IPEAK_RF_ACTIVITY   3
 
#define LRF_PBE_GPOCTRL_MASK   0xFF
 
#define LRF_CC27XX_RFE_SPARE5_PA_20DBM_ESD_CTRL_SET   ((uint32_t)(0x1 << 14U))
 
#define LRF_CC27XX_PA_ESD_PROTECTION_VDDS_THRESHOLD_MV   ((uint16_t)3635)
 
#define LRF_CC27XX_HIGH_PA_MODE   ((uint16_t)0x3)
 
#define LRF_CC27XX_RETRIEVE_PA_MODE_FROM_RAW_VALUE(txPowerRawValue)   (((uint16_t)(txPowerRawValue) >> 11) & 0x3)
 
#define LRF_CC27XX_RFE_SPARE5_RTRIM_TX_COMP_BITMASK   ((uint32_t)(0x1 << 13U))
 
#define LRF_TRIM_SIGN_MAG_TO_SIGNED(x)   (int8_t)(((x & 0x8) ? -(x & 0x7) : (x & 0x7)))
 
#define LRF_TxPower_Use_Vdds_Comp   ((LRF_TxPowerTable_Index){.fraction = 0, .dBm = 18})
 
#define LRF_CC27XX_VDDS_THRESHOLD_0   ((uint16_t)2850)
 
#define LRF_CC27XX_VDDS_THRESHOLD_1   ((uint16_t)3150)
 
#define LRF_CC27XX_VDDS_THRESHOLD_2   ((uint16_t)3450)
 
#define LRF_CC27XX_SCALE_TEMP_COEFF   1024
 
#define LRF_CC27XX_NOM_TEMP_FACTOR   16 /* Resolution in FCFG field is 16 degrees/LSB, covering a range from -96 C to 112 C */
 
#define LRF_TxPower_Min_Temp_Coeff_Comp   ((LRF_TxPowerTable_Index){.fraction = 0, .dBm = 4})
 
#define LRF_TxPower_Max_Temp_Coeff_Comp   ((LRF_TxPowerTable_Index){.fraction = 0, .dBm = 20})
 
#define LRF_REFSYS_ENABLE_TIME   RCL_SCHEDULER_SYSTIM_US(30)
 
#define LRF_EXTTRIM1_TEMPERATURE_SCALE_EXP   4U
 
#define LRF_DIVLDO_LOW_TEMP_ADJ_FACTOR   10U
 
#define LRF_DIVLDO_HIGH_TEMP_ADJ_FACTOR   10U
 
#define LRF_TDCLDO_LOW_TEMP_ADJ_FACTOR   10U
 
#define LRF_TDCLDO_HIGH_TEMP_ADJ_FACTOR   10U
 
#define LRF_RTRIM_LOW_TEMP_ADJ_FACTOR   1U
 
#define LRF_RTRIM_HIGH_TEMP_ADJ_FACTOR   1U
 
#define LRF_DEFAULT_RTRIM_MAX   12U
 
#define LRF_EXTTRIM0_TEMPERATURE_SCALE_EXP   7
 
#define LRF_TEMPERATURE_MIN   (-40)
 
#define LRF_TEMPERATURE_MAX   125
 
#define RFE_SPARE0_LOW_GAIN_BM   0x000F
 
#define RFE_SPARE0_LOW_GAIN   0
 
#define RFE_SPARE0_HIGH_GAIN_BM   0x00F0
 
#define RFE_SPARE0_HIGH_GAIN   4
 
#define RFE_SPARE1_AGC_VALUE_BM   0x000FF
 
#define RFE_SPARE1_AGC_VALUE   0
 
#define LRF_ONE_THIRD_MANTISSA   21845U /* (round(1/3 * 2^16)) */
 
#define LRF_ONE_THIRD_NEG_EXP   16
 
#define FXTALINVL   0x00001E52U
 
#define FXTALINVH   0x02CBD3F0U
 
#define NUM_TX_FILTER_TAPS   24
 
#define P_FACTOR   9
 
#define P_SHIFT   4
 
#define Q_MAGN_SHIFT   6
 
#define FRAC_NUM_BITS   28
 
#define FRAC_EXTRA_BITS   (32 - FRAC_NUM_BITS)
 
#define RFE_PA0_IB_MIN_USED   1
 

Functions

static uint32_t LRF_findPllMBase (uint32_t frequency)
 
static uint32_t countLeadingZeros (uint16_t value)
 
static uint32_t LRF_findCalM (uint32_t frequency, uint32_t prediv)
 
static uint32_t LRF_findFoff (int32_t frequencyOffset, uint32_t invSynthFreq)
 
static void LRF_programShape (const LRF_TxShape *txShape, uint32_t deviation, uint32_t invSynthFreq)
 
static uint32_t LRF_findLog2Bde1 (uint32_t demmisc3)
 
static uint32_t LRF_programPQ (uint32_t pllMBase)
 
static void LRF_programCMixN (int32_t rxIntFrequency, uint32_t invSynthFreq)
 
static void LRF_applyTrim (const LRF_TrimDef *trimDef, const LRF_SwConfig *swConfig)
 
static void LRF_updateTrim (const LRF_TrimDef *trimDef, const LRF_SwConfig *swConfig)
 
static void LRF_setTrimCommon (const LRF_TrimDef *trimDef, const LRF_SwConfig *swConfig)
 
static void LRF_setTemperatureTrim (const LRF_TrimDef *trimDef)
 
static void LRF_temperatureCompensateTrim (const LRF_TrimDef *trimDef)
 
static void LRF_temperatureCompensateDcoldo (int32_t temperature, const LRF_TrimDef *trimDef)
 
static uint32_t LRF_findExtTrim1TrimAdjustment (uint32_t temperatureDiff, uint32_t tempThreshFactor, uint32_t maxAdjustment)
 
static int32_t LRF_findExtTrim0TrimAdjustment (int32_t temperature, int32_t tempCompFactor, int32_t offset)
 
static uint32_t LRF_scaleFreqWithHFXTOffset (uint32_t frequency)
 
static void LRF_writeFifoPtr (uint32_t value, uintptr_t regAddr)
 
static void LRF_writeFifoPtrs (uint32_t value, uintptr_t regAddr0, uintptr_t regAddr1)
 
static void LRF_temperatureNotification (int16_t currentTemperature)
 
static void LRF_applyAntennaSelection (void)
 
const LRF_CoexConfiguration lrfCoexConfiguration __attribute__ ((weak))
 
bool LRF_imagesNeedUpdate (const LRF_Config *lrfConfig)
 
void LRF_enable (void)
 
void LRF_disable (void)
 
void LRF_waitForTopsmReady (void)
 
uint32_t LRF_prepareRxFifo (void)
 
uint32_t LRF_prepareTxFifo (void)
 
uint32_t LRF_peekRxFifo (int32_t offset)
 
uint32_t LRF_peekTxFifo (int32_t offset)
 
uint8_t * LRF_getTxFifoWrAddr (int32_t offset)
 
void LRF_skipTxFifoWords (uint32_t wordLength)
 
void LRF_discardRxFifoWords (uint32_t wordLength)
 
void LRF_readRxFifoWords (uint32_t *data32, uint32_t wordLength)
 
void LRF_writeTxFifoWords (const uint32_t *data32, uint32_t wordLength)
 
void LRF_setRxFifoEffSz (uint32_t maxSz)
 
void LRF_peekRxFifoWords (uint32_t *data32, uint32_t wordLength, uint32_t startRp)
 
uint32_t LRF_getUncommittedFifoStatus (uint32_t *currentRp)
 
void LRF_programFrequency (uint32_t frequency, bool tx)
 
uint32_t LRF_enableSynthRefsys (void)
 
void LRF_disableSynthRefsys (void)
 
void LRF_rclEnableRadioClocks (void)
 
void LRF_rclDisableRadioClocks (void)
 
int8_t LRF_readRssi (void)
 
int8_t LRF_readMaxRssi (void)
 Reads maximum RSSI from register. More...
 
void LRF_initializeMaxRssi (int8_t initRssi)
 Initialize maximum RSSI register. More...
 
void LRF_setRawTxPower (uint32_t value, uint32_t temperatureCoefficient)
 
LRF_TxPowerTable_Entry LRF_getRawTxPower (void)
 
void LRF_enableCoexGrant (void)
 Enable monitoring of coexistence grant signal in RFE. More...
 
void LRF_disableCoexGrant (void)
 Disable monitoring of coexistence grant signal in RFE. More...
 
void LRF_deassertCoexRequest (void)
 Deassert coexistence REQUEST. More...
 
void LRF_programTemperatureCompensatedTxPower (void)
 Programs current TX power setting in radio with temperature compensation. More...
 
LRF_TxPowerResult LRF_programTxPower (LRF_TxPowerTable_Index powerLevel, uint32_t rfFreq)
 Finds settings corresponding to the highest tx power lower than the specified value in the tx power table and programs it in the radio. More...
 
void LRF_enableTemperatureMonitoring (void)
 Enable temperature monitoring to allow handlers to update temperature compensation. More...
 
void LRF_disableTemperatureMonitoring (void)
 Disable temperature monitoring. More...
 
void LRF_updateTemperatureCompensation (uint32_t rfFrequency, bool tx)
 Update temperature compensation in radio. More...
 
int16_t LRF_getLastTrimTemperature (void)
 Get temperature used in last setting of trims. More...
 
void LRF_setAntennaSelection (uint32_t value)
 Set the default antenna to be used during the next radio configuration. More...
 

Variables

uint32_t swParamList [sizeof(LRF_SwParam)/sizeof(uint32_t)]
 
const size_t swParamListSz = sizeof(LRF_SwParam)
 
struct {
const LRF_TOPsmImage * pbeLoaded
 
const LRF_TOPsmImage * mceLoaded
 
const LRF_TOPsmImage * rfeLoaded
 
uint16_t phyFeatures
 
int16_t lastTrimTemperature
 
LRF_TxPowerTable_Entry currentTxPower
 
LRF_TxPowerTable_Entry rawTxPower
 
lrfPhyState = {0}
 
static bool rxFifoDeallocated = true
 
uint16_t rclTemperatureThreshold = 8
 
LRF_DoubleWord fXtalInv
 

Macro Definition Documentation

§ LRF_TRIM_NORMAL_BW

#define LRF_TRIM_NORMAL_BW   0

§ LRF_TRIM_HIGH_BW

#define LRF_TRIM_HIGH_BW   1 /* Revision >= 4 only */s

§ LRF_TRIM_MIN_VERSION_FULL_FEATURES

#define LRF_TRIM_MIN_VERSION_FULL_FEATURES   4 /* Only AppTrims revision 4 and above has all features */

§ LRF_TRIM_VERSION_DCOLDO_TEMPERATURE_COMPENSATION

#define LRF_TRIM_VERSION_DCOLDO_TEMPERATURE_COMPENSATION   8 /* Only AppTrims revision 8 and above have DCOLDO temperature compensation */

§ LRF_TRIM_VERSION_RSSIOFFSET_ISSUE_CC23X0R5

#define LRF_TRIM_VERSION_RSSIOFFSET_ISSUE_CC23X0R5   4 /* AppTrims revision with issue in rssiOffset field */

§ LRF_TRIM_LIMIT_RSSIOFFSET_ISSUE_CC23X0R5

#define LRF_TRIM_LIMIT_RSSIOFFSET_ISSUE_CC23X0R5   (-4) /* If rssiOffset is less or equal to this, apply correction */

§ LRF_TRIM_CORRECTION_RSSIOFFSET_ISSUE_CC23X0R5

#define LRF_TRIM_CORRECTION_RSSIOFFSET_ISSUE_CC23X0R5   5 /* Correction to apply to devices with wrong RSSI offset */

§ LRF_TRIM_DCOLDO0_SECONDTRIM_INC_STATE_B_DCOLDO_WORKAROUND_CC27XX

#define LRF_TRIM_DCOLDO0_SECONDTRIM_INC_STATE_B_DCOLDO_WORKAROUND_CC27XX   10U /* DCOLDO0:SECONDTRIM needs to be increased by 10 on CC27XX state B devices */

§ LRF_TRIM_DCOLDO0_SECONDTRIM_CODED_BITS_MASK

#define LRF_TRIM_DCOLDO0_SECONDTRIM_CODED_BITS_MASK   ((1U << 3U) | (1U << 5U)) /* Bits mask for bit 3 and 5 of DCOLDO0:SECONDTRIM */

§ LRF_TRIM_DCOLDO0_SECONDTRIM_MAX_STATE

#define LRF_TRIM_DCOLDO0_SECONDTRIM_MAX_STATE   63U /* DCOLDO0:SECONDTRIM maximum value allowed within the range of 6-bit representation */

§ LRF_TRIM_DCOLDO0_FIRSTTRIM_MIN_STATE

#define LRF_TRIM_DCOLDO0_FIRSTTRIM_MIN_STATE   -8 /* DCOLDO0:FIRSTTRIM minimum value allowed within the range of 4-bit two's complement representation */

§ LRF_DCOLDOSECOND_HIGH_TEMP_ADJ_FACTOR

#define LRF_DCOLDOSECOND_HIGH_TEMP_ADJ_FACTOR   5

§ LRF_DCOLDOSECOND_LOW_TEMP_ADJ_FACTOR

#define LRF_DCOLDOSECOND_LOW_TEMP_ADJ_FACTOR   5

§ LRF_DCOLDO_DEADBAND

#define LRF_DCOLDO_DEADBAND   10

§ LRF_DCOLDO_OFFSET_LOWER_SATURATION

#define LRF_DCOLDO_OFFSET_LOWER_SATURATION   0

§ LRF_DCOLDOFIRST_HIGH_TEMP_ADJ_FACTOR_S

#define LRF_DCOLDOFIRST_HIGH_TEMP_ADJ_FACTOR_S   1

§ LRF_DCOLDOFIRST_HIGH_TEMP_ADJ_FACTOR_MUL

#define LRF_DCOLDOFIRST_HIGH_TEMP_ADJ_FACTOR_MUL   5

§ LRF_DCOLDOFIRST_LOW_TEMP_ADJ_FACTOR_S

#define LRF_DCOLDOFIRST_LOW_TEMP_ADJ_FACTOR_S   1

§ LRF_DCOLDOFIRST_LOW_TEMP_ADJ_FACTOR_MUL

#define LRF_DCOLDOFIRST_LOW_TEMP_ADJ_FACTOR_MUL   5

§ LRF_DCOLDOSECOND_FACTOR

#define LRF_DCOLDOSECOND_FACTOR   2

§ DIV_BY_NINE_CONSTANT

#define DIV_BY_NINE_CONSTANT   1864135

§ LRF_DCOLDO_OFFSET_HIGH_TEMP

#define LRF_DCOLDO_OFFSET_HIGH_TEMP   16

§ LRF_DCOLDO_OFFSET_LOW_TEMP

#define LRF_DCOLDO_OFFSET_LOW_TEMP   9

§ LRF_DCOLDO_SHIFT_HIGH_TEMP

#define LRF_DCOLDO_SHIFT_HIGH_TEMP   5

§ LRF_DCOLDO_SHIFT_LOW_TEMP

#define LRF_DCOLDO_SHIFT_LOW_TEMP   25

§ LRF_TEMPERATURE_NOM

#define LRF_TEMPERATURE_NOM   25

§ LRF_DCDC_IPEAK_RF_ACTIVITY

#define LRF_DCDC_IPEAK_RF_ACTIVITY   3

Referenced by LRF_enable().

§ LRF_PBE_GPOCTRL_MASK

#define LRF_PBE_GPOCTRL_MASK   0xFF

Referenced by LRF_setAntennaSelection().

§ LRF_CC27XX_RFE_SPARE5_PA_20DBM_ESD_CTRL_SET

#define LRF_CC27XX_RFE_SPARE5_PA_20DBM_ESD_CTRL_SET   ((uint32_t)(0x1 << 14U))

§ LRF_CC27XX_PA_ESD_PROTECTION_VDDS_THRESHOLD_MV

#define LRF_CC27XX_PA_ESD_PROTECTION_VDDS_THRESHOLD_MV   ((uint16_t)3635)

§ LRF_CC27XX_HIGH_PA_MODE

#define LRF_CC27XX_HIGH_PA_MODE   ((uint16_t)0x3)

§ LRF_CC27XX_RETRIEVE_PA_MODE_FROM_RAW_VALUE

#define LRF_CC27XX_RETRIEVE_PA_MODE_FROM_RAW_VALUE (   txPowerRawValue)    (((uint16_t)(txPowerRawValue) >> 11) & 0x3)

§ LRF_CC27XX_RFE_SPARE5_RTRIM_TX_COMP_BITMASK

#define LRF_CC27XX_RFE_SPARE5_RTRIM_TX_COMP_BITMASK   ((uint32_t)(0x1 << 13U))

§ LRF_TRIM_SIGN_MAG_TO_SIGNED

#define LRF_TRIM_SIGN_MAG_TO_SIGNED (   x)    (int8_t)(((x & 0x8) ? -(x & 0x7) : (x & 0x7)))

§ LRF_TxPower_Use_Vdds_Comp

#define LRF_TxPower_Use_Vdds_Comp   ((LRF_TxPowerTable_Index){.fraction = 0, .dBm = 18})

Referenced by LRF_programTxPower().

§ LRF_CC27XX_VDDS_THRESHOLD_0

#define LRF_CC27XX_VDDS_THRESHOLD_0   ((uint16_t)2850)

Referenced by LRF_programTxPower().

§ LRF_CC27XX_VDDS_THRESHOLD_1

#define LRF_CC27XX_VDDS_THRESHOLD_1   ((uint16_t)3150)

Referenced by LRF_programTxPower().

§ LRF_CC27XX_VDDS_THRESHOLD_2

#define LRF_CC27XX_VDDS_THRESHOLD_2   ((uint16_t)3450)

Referenced by LRF_programTxPower().

§ LRF_CC27XX_SCALE_TEMP_COEFF

#define LRF_CC27XX_SCALE_TEMP_COEFF   1024

Referenced by LRF_programTxPower().

§ LRF_CC27XX_NOM_TEMP_FACTOR

#define LRF_CC27XX_NOM_TEMP_FACTOR   16 /* Resolution in FCFG field is 16 degrees/LSB, covering a range from -96 C to 112 C */

Referenced by LRF_programTxPower().

§ LRF_TxPower_Min_Temp_Coeff_Comp

#define LRF_TxPower_Min_Temp_Coeff_Comp   ((LRF_TxPowerTable_Index){.fraction = 0, .dBm = 4})

Referenced by LRF_programTxPower().

§ LRF_TxPower_Max_Temp_Coeff_Comp

#define LRF_TxPower_Max_Temp_Coeff_Comp   ((LRF_TxPowerTable_Index){.fraction = 0, .dBm = 20})

Referenced by LRF_programTxPower().

§ LRF_REFSYS_ENABLE_TIME

#define LRF_REFSYS_ENABLE_TIME   RCL_SCHEDULER_SYSTIM_US(30)

Referenced by LRF_enableSynthRefsys().

§ LRF_EXTTRIM1_TEMPERATURE_SCALE_EXP

#define LRF_EXTTRIM1_TEMPERATURE_SCALE_EXP   4U

§ LRF_DIVLDO_LOW_TEMP_ADJ_FACTOR

#define LRF_DIVLDO_LOW_TEMP_ADJ_FACTOR   10U

§ LRF_DIVLDO_HIGH_TEMP_ADJ_FACTOR

#define LRF_DIVLDO_HIGH_TEMP_ADJ_FACTOR   10U

§ LRF_TDCLDO_LOW_TEMP_ADJ_FACTOR

#define LRF_TDCLDO_LOW_TEMP_ADJ_FACTOR   10U

§ LRF_TDCLDO_HIGH_TEMP_ADJ_FACTOR

#define LRF_TDCLDO_HIGH_TEMP_ADJ_FACTOR   10U

§ LRF_RTRIM_LOW_TEMP_ADJ_FACTOR

#define LRF_RTRIM_LOW_TEMP_ADJ_FACTOR   1U

§ LRF_RTRIM_HIGH_TEMP_ADJ_FACTOR

#define LRF_RTRIM_HIGH_TEMP_ADJ_FACTOR   1U

§ LRF_DEFAULT_RTRIM_MAX

#define LRF_DEFAULT_RTRIM_MAX   12U

§ LRF_EXTTRIM0_TEMPERATURE_SCALE_EXP

#define LRF_EXTTRIM0_TEMPERATURE_SCALE_EXP   7

§ LRF_TEMPERATURE_MIN

#define LRF_TEMPERATURE_MIN   (-40)

§ LRF_TEMPERATURE_MAX

#define LRF_TEMPERATURE_MAX   125

§ RFE_SPARE0_LOW_GAIN_BM

#define RFE_SPARE0_LOW_GAIN_BM   0x000F

§ RFE_SPARE0_LOW_GAIN

#define RFE_SPARE0_LOW_GAIN   0

§ RFE_SPARE0_HIGH_GAIN_BM

#define RFE_SPARE0_HIGH_GAIN_BM   0x00F0

§ RFE_SPARE0_HIGH_GAIN

#define RFE_SPARE0_HIGH_GAIN   4

§ RFE_SPARE1_AGC_VALUE_BM

#define RFE_SPARE1_AGC_VALUE_BM   0x000FF

§ RFE_SPARE1_AGC_VALUE

#define RFE_SPARE1_AGC_VALUE   0

§ LRF_ONE_THIRD_MANTISSA

#define LRF_ONE_THIRD_MANTISSA   21845U /* (round(1/3 * 2^16)) */

§ LRF_ONE_THIRD_NEG_EXP

#define LRF_ONE_THIRD_NEG_EXP   16

§ FXTALINVL

#define FXTALINVL   0x00001E52U

§ FXTALINVH

#define FXTALINVH   0x02CBD3F0U

§ NUM_TX_FILTER_TAPS

#define NUM_TX_FILTER_TAPS   24

Referenced by LRF_programShape().

§ P_FACTOR

#define P_FACTOR   9

Referenced by LRF_programPQ().

§ P_SHIFT

#define P_SHIFT   4

Referenced by LRF_programPQ().

§ Q_MAGN_SHIFT

#define Q_MAGN_SHIFT   6

Referenced by LRF_programPQ().

§ FRAC_NUM_BITS

#define FRAC_NUM_BITS   28

§ FRAC_EXTRA_BITS

#define FRAC_EXTRA_BITS   (32 - FRAC_NUM_BITS)

Referenced by LRF_programPQ().

§ RFE_PA0_IB_MIN_USED

#define RFE_PA0_IB_MIN_USED   1

Function Documentation

§ LRF_findPllMBase()

static uint32_t LRF_findPllMBase ( uint32_t  frequency)
static

References LRF_DoubleWord::word.

Referenced by LRF_programFrequency().

§ countLeadingZeros()

static uint32_t countLeadingZeros ( uint16_t  value)
static

Referenced by LRF_programPQ(), and LRF_programShape().

§ LRF_findCalM()

static uint32_t LRF_findCalM ( uint32_t  frequency,
uint32_t  prediv 
)
static

References LRF_DoubleWord::word.

Referenced by LRF_programFrequency().

§ LRF_findFoff()

static uint32_t LRF_findFoff ( int32_t  frequencyOffset,
uint32_t  invSynthFreq 
)
static

Referenced by LRF_programFrequency().

§ LRF_programShape()

static void LRF_programShape ( const LRF_TxShape txShape,
uint32_t  deviation,
uint32_t  invSynthFreq 
)
static

§ LRF_findLog2Bde1()

static uint32_t LRF_findLog2Bde1 ( uint32_t  demmisc3)
static

Referenced by LRF_programCMixN(), and LRF_programPQ().

§ LRF_programPQ()

static uint32_t LRF_programPQ ( uint32_t  pllMBase)
static

§ LRF_programCMixN()

static void LRF_programCMixN ( int32_t  rxIntFrequency,
uint32_t  invSynthFreq 
)
static

References LRF_findLog2Bde1().

Referenced by LRF_programFrequency().

§ LRF_applyTrim()

static void LRF_applyTrim ( const LRF_TrimDef trimDef,
const LRF_SwConfig swConfig 
)
static

§ LRF_updateTrim()

static void LRF_updateTrim ( const LRF_TrimDef trimDef,
const LRF_SwConfig swConfig 
)
static

§ LRF_setTrimCommon()

static void LRF_setTrimCommon ( const LRF_TrimDef trimDef,
const LRF_SwConfig swConfig 
)
static

§ LRF_setTemperatureTrim()

static void LRF_setTemperatureTrim ( const LRF_TrimDef trimDef)
static

§ LRF_temperatureCompensateTrim()

§ LRF_temperatureCompensateDcoldo()

§ LRF_findExtTrim1TrimAdjustment()

static uint32_t LRF_findExtTrim1TrimAdjustment ( uint32_t  temperatureDiff,
uint32_t  tempThreshFactor,
uint32_t  maxAdjustment 
)
static

§ LRF_findExtTrim0TrimAdjustment()

static int32_t LRF_findExtTrim0TrimAdjustment ( int32_t  temperature,
int32_t  tempCompFactor,
int32_t  offset 
)
static

§ LRF_scaleFreqWithHFXTOffset()

static uint32_t LRF_scaleFreqWithHFXTOffset ( uint32_t  frequency)
static

§ LRF_writeFifoPtr()

static void LRF_writeFifoPtr ( uint32_t  value,
uintptr_t  regAddr 
)
static

§ LRF_writeFifoPtrs()

static void LRF_writeFifoPtrs ( uint32_t  value,
uintptr_t  regAddr0,
uintptr_t  regAddr1 
)
static

Referenced by LRF_discardRxFifoWords().

§ LRF_temperatureNotification()

static void LRF_temperatureNotification ( int16_t  currentTemperature)
static

§ LRF_applyAntennaSelection()

§ __attribute__()

§ LRF_imagesNeedUpdate()

bool LRF_imagesNeedUpdate ( const LRF_Config lrfConfig)

§ LRF_enable()

§ LRF_disable()

§ LRF_waitForTopsmReady()

§ LRF_prepareRxFifo()

§ LRF_prepareTxFifo()

§ LRF_peekRxFifo()

§ LRF_peekTxFifo()

uint32_t LRF_peekTxFifo ( int32_t  offset)

Referenced by LRF_resetSettingsState().

§ LRF_getTxFifoWrAddr()

§ LRF_skipTxFifoWords()

void LRF_skipTxFifoWords ( uint32_t  wordLength)

§ LRF_discardRxFifoWords()

void LRF_discardRxFifoWords ( uint32_t  wordLength)

§ LRF_readRxFifoWords()

§ LRF_writeTxFifoWords()

void LRF_writeTxFifoWords ( const uint32_t *  data32,
uint32_t  wordLength 
)

§ LRF_setRxFifoEffSz()

§ LRF_peekRxFifoWords()

void LRF_peekRxFifoWords ( uint32_t *  data32,
uint32_t  wordLength,
uint32_t  startRp 
)

§ LRF_getUncommittedFifoStatus()

uint32_t LRF_getUncommittedFifoStatus ( uint32_t *  currentRp)

§ LRF_programFrequency()

§ LRF_enableSynthRefsys()

§ LRF_disableSynthRefsys()

§ LRF_rclEnableRadioClocks()

void LRF_rclEnableRadioClocks ( void  )

§ LRF_rclDisableRadioClocks()

void LRF_rclDisableRadioClocks ( void  )

§ LRF_readRssi()

§ LRF_readMaxRssi()

int8_t LRF_readMaxRssi ( void  )

Reads maximum RSSI from register.

Referenced by LRF_getTxFifoWritable(), and RCL_Handler_Ieee_updateStats().

§ LRF_initializeMaxRssi()

void LRF_initializeMaxRssi ( int8_t  initRssi)

Initialize maximum RSSI register.

Referenced by LRF_getTxFifoWritable(), and RCL_Handler_Ieee_initStats().

§ LRF_setRawTxPower()

void LRF_setRawTxPower ( uint32_t  value,
uint32_t  temperatureCoefficient 
)

§ LRF_getRawTxPower()

§ LRF_enableCoexGrant()

void LRF_enableCoexGrant ( void  )

Enable monitoring of coexistence grant signal in RFE.

Turns on the coex grant signal for the configured IO pin (if any). The function must be called before starting a PBE operation. The handler is responsible for disabling in order to avoid coex operation in commands not supporting it.

Note
This function is intended as internal to RCL and its handlers

References LRF_CoexConfiguration::grantPin, and lrfCoexConfiguration.

Referenced by LRF_clearRclClockEnable(), and RCL_Handler_Ieee_RxTx().

§ LRF_disableCoexGrant()

void LRF_disableCoexGrant ( void  )

Disable monitoring of coexistence grant signal in RFE.

Turns off the coex grant signal to the RFE. Should be called by the handler at the end of a command where LRF_enableCoexGrant was called. The function must be called after the PBE operation ended, but can safely be called even without a previous LRF_enableCoexGrant.

Note
This function is intended as internal to RCL and its handlers

Referenced by __attribute__(), LRF_clearRclClockEnable(), and RCL_Handler_Ieee_RxTx().

§ LRF_deassertCoexRequest()

void LRF_deassertCoexRequest ( void  )

Deassert coexistence REQUEST.

Set coex REQUEST and PRIORITY lines low to indicate no request. Should only be done when PBE is finished.

Note
This function is intended as internal to RCL and its handlers

Referenced by LRF_clearRclClockEnable(), and RCL_Handler_Ieee_RxTx().

§ LRF_programTemperatureCompensatedTxPower()

§ LRF_programTxPower()

LRF_TxPowerResult LRF_programTxPower ( LRF_TxPowerTable_Index  powerLevel,
uint32_t  rfFreq 
)

Finds settings corresponding to the highest tx power lower than the specified value in the tx power table and programs it in the radio.

Parameters
powerLevelmaximum allowed power level in dBm, or special value (LRF_TxPower_Use_Min, LRF_TxPower_Use_Max, LRF_TxPower_Use_Raw, or LRF_TxPower_None)
rfFreqRadio frequency in Hz for which the maximum Tx power is calculated
Returns
TxPowerResult_Ok on success; TxPowerResult_Error if no valid settings were found

References LRF_TxPowerLimitTable::freqDiv, hal_get_temperature(), hal_get_vdds_voltage(), LRF_TxPowerLimitTable::limitTable, LRF_CC27XX_NOM_TEMP_FACTOR, LRF_CC27XX_SCALE_TEMP_COEFF, LRF_CC27XX_VDDS_THRESHOLD_0, LRF_CC27XX_VDDS_THRESHOLD_1, LRF_CC27XX_VDDS_THRESHOLD_2, LRF_programTemperatureCompensatedTxPower(), LRF_TRIM_SIGN_MAG_TO_SIGNED, LRF_TXPOWER_BYPASS_FREQUENCY_BACKOFF, LRF_TxPower_Max_Temp_Coeff_Comp, LRF_TxPower_Min_Temp_Coeff_Comp, LRF_TxPower_None, LRF_TxPower_Use_Max, LRF_TxPower_Use_Raw, LRF_TxPower_Use_Vdds_Comp, LRF_TxPowerTable_findValue(), LRF_TxPowerTable_INVALID_VALUE, lrfPhyState, LRF_TxPowerLimitTable_Entry::maxTxPower, LRF_TxPowerLimitTable_Entry::minFreq, LRF_TxPowerTable::numEntries, LRF_TxPowerLimitTable::numEntries, LRF_TxPowerTable_Entry::power, LRF_TxPowerTable::powerTable, LRF_TxPowerTable_Value::rawValue, LRF_TxPowerTable_Index::rawValue, rclFeatureControl, LRF_TxPowerLimitTable_Entry::regulatoryMask, swParamList, LRF_SwParam::trimDef, LRF_SwParam::txPowerLimitTable, TxPowerResult_Error, TxPowerResult_Ok, LRF_SwParam::txPowerTable, and LRF_TxPowerTable_Entry::value.

Referenced by LRF_getTxFifoWritable(), RCL_Handler_BLE5_adv(), RCL_Handler_BLE5_aux_adv(), RCL_Handler_BLE5_conn(), RCL_Handler_BLE5_dtmTx(), RCL_Handler_BLE5_genericTx(), RCL_Handler_BLE5_periodicAdv(), RCL_Handler_BLE5_periodicScan(), RCL_Handler_BLE5_scan_init(), RCL_Handler_Ble5_txTest(), RCL_Handler_BLE_CS(), RCL_Handler_Generic_Tx(), RCL_Handler_Generic_TxRepeat(), RCL_Handler_Generic_TxTest(), RCL_Handler_Ieee_RxTx(), RCL_Handler_Ieee_TxTest(), RCL_Handler_Nesb_Prx(), RCL_Handler_Nesb_Ptx(), and RCL_IEEE_updateTxPower().

§ LRF_enableTemperatureMonitoring()

void LRF_enableTemperatureMonitoring ( void  )

Enable temperature monitoring to allow handlers to update temperature compensation.

Note
This function is intended as internal to RCL and its handlers

References RCL_FeatureControl::enableTemperatureMonitoring, hal_set_temperature_notification(), LRF_temperatureNotification(), lrfPhyState, rclFeatureControl, and rclTemperatureThreshold.

Referenced by LRF_clearRclClockEnable(), LRF_updateTemperatureCompensation(), and RCL_Handler_Ieee_RxTx().

§ LRF_disableTemperatureMonitoring()

void LRF_disableTemperatureMonitoring ( void  )

Disable temperature monitoring.

Note
This function is intended as internal to RCL and its handlers

References RCL_FeatureControl::enableTemperatureMonitoring, hal_stop_temperature_notification(), and rclFeatureControl.

Referenced by LRF_clearRclClockEnable(), and RCL_Handler_Ieee_RxTx().

§ LRF_updateTemperatureCompensation()

void LRF_updateTemperatureCompensation ( uint32_t  rfFrequency,
bool  tx 
)

Update temperature compensation in radio.

Update temperature compensation by allowing TCXO updates, set new RF frequency correction, update temperature compensated trim values, and update temperature compensation for TX power

Note
This function is intended as internal to RCL and its handlers
Parameters
rfFrequencyRF frequency at which the command is operating
txTrue if radio will be starting in TX; false if it will be starting in RX

References RCL_FeatureControl::enableTemperatureMonitoring, hal_power_release_swtcxo_update_constraint(), hal_power_set_swtcxo_update_constraint(), LRF_enableTemperatureMonitoring(), LRF_programFrequency(), LRF_programTemperatureCompensatedTxPower(), LRF_setTemperatureTrim(), rclFeatureControl, swParamList, and LRF_SwParam::trimDef.

Referenced by LRF_clearRclClockEnable(), and RCL_Handler_Ieee_RxTx().

§ LRF_getLastTrimTemperature()

int16_t LRF_getLastTrimTemperature ( void  )

Get temperature used in last setting of trims.

References lrfPhyState.

Referenced by LRF_clearRclClockEnable().

§ LRF_setAntennaSelection()

void LRF_setAntennaSelection ( uint32_t  value)

Set the default antenna to be used during the next radio configuration.

This function configures the antenna selection value for the current PHY. The selection does not take effect immediately but will be applied the next time the radio is configured. This typically occurs when a radio command is started or when the device wakes up from standby while running a radio command.

Note
This function is intended for internal use only.
Parameters
valueAntenna selection value.

References LRF_PBE_GPOCTRL_MASK.

Referenced by LRF_clearRclClockEnable().

Variable Documentation

§ swParamList

§ swParamListSz

const size_t swParamListSz = sizeof(LRF_SwParam)

§ lrfPhyState

§ rxFifoDeallocated

bool rxFifoDeallocated = true
static

§ rclTemperatureThreshold

uint16_t rclTemperatureThreshold = 8

§ fXtalInv

LRF_DoubleWord fXtalInv
Initial value:
=
{
.word = {FXTALINVL, FXTALINVH},
}
#define FXTALINVL
Definition: LRFCC23X0.c:1158
#define FXTALINVH
Definition: LRFCC23X0.c:1159