Radio Control Layer (RCL)
LRF.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <ti/drivers/rcl/hal/hal.h>
+ Include dependency graph for LRF.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  LRF_TOPsmImage
 
union  LRF_ConfigWord
 
struct  LRF_RegConfigList
 
struct  LRF_ApplySettingsState
 
struct  LRF_ConfigWord.region
 
struct  LRF_ConfigWord.sparse
 
struct  LRF_ConfigWord.masked
 
struct  LRF_ConfigWord.segment
 

Macros

#define LRF_TxPower_Use_Min   ((LRF_TxPowerTable_Index){.rawValue = -128})
 
#define LRF_TxPower_Use_Max   ((LRF_TxPowerTable_Index){.rawValue = 125})
 
#define LRF_TxPower_Use_Raw   ((LRF_TxPowerTable_Index){.rawValue = 126})
 
#define LRF_TxPower_None   ((LRF_TxPowerTable_Index){.rawValue = 127})
 
#define LRF_SETTINGS_BUFFER_UNLIMITED   0x3FFF
 
#define LRF_RSSI_INVALID   (127)
 
#define LRF_PhyFeatures_Default   0
 
#define __ERROR_Address_is_in_an_invalid_range_for_LRF_setup   0x00040000
 
#define _ADDRESS_REGION_BIT(_address)
 
#define LRF_SETTINGS_CLEAR(_startAddress, _numWords)
 
#define LRF_SETTINGS_16BIT_BLOCK(_startAddress, _numWords)
 
#define LRF_SETTINGS_16BIT_DUAL_ENTRY(_value0, _value1)   (((_value0) & 0xFFFF) | (((_value1) & 0xFFFF) << 16))
 
#define LRF_SETTINGS_32BIT_BLOCK(_startAddress, _numWords)
 
#define LRF_SETTINGS_16BIT_SPARSE_BLOCK(_startAddress, _numWords)
 
#define LRF_SETTINGS_16BIT_SPARSE_ENTRY(_address, _value)   (((((uintptr_t)(_address)) & 0xFFFF) << 16) | ((_value) & 0xFFFF))
 
#define LRF_SETTINGS_16BIT_MASKED_BLOCK(_startAddress, _numWords)
 
#define LRF_SETTINGS_16BIT_MASKED_ENTRY(_mask, _value)   ((((_mask) & 0xFFFF) << 16) | ((_value) & 0xFFFF))
 

Enumerations

enum  LRF_RadioState { RadioState_Down = 0, RadioState_ImagesLoaded, RadioState_Configured }
 
enum  LRF_SetupResult {
  SetupResult_Ok, SetupResult_Ok_Partial, SetupResult_ErrorImageLen, SetupResult_ErrorConfigLen,
  SetupResult_ErrorElemLen, SetupResult_ErrorElemType, SetupResult_ErrorElemAddrAlign, SetupResult_ErrorParRange,
  SetupResult_ErrorSwConfig
}
 Setup operation result. More...
 
enum  LRF_RegionOperation {
  HW_Region_Clear = 0, HW_Write_16bit = 1, HW_Write_32bit = 2, HW_Write_16bit_sparse = 3,
  SW_Region_Clear = 4, SW_Write_16bit = 5, SW_Write_32bit = 6, SW_Write_16bit_sparse = 7,
  Par_Region_Clear = 8, Par_Reference_32bit = 9, Par_Write_32bit = 10, HW_Write_16bit_masked = 11,
  LRF_RegionOperation_Skip = 254, LRF_RegionOperation_Invalid = 255
}
 
enum  LRF_ApplySettingsBase { LRF_ApplySettings_NoBase = 0, LRF_ApplySettings_IncludeBase = 1 }
 

Functions

LRF_SetupResult LRF_setupRadio (const LRF_Config *lrfConfig, uint16_t phyFeatures, LRF_RadioState lrfState)
 
LRF_SetupResult LRF_loadImage (const LRF_TOPsmImage *image, uint32_t destinationAddress)
 
static void LRF_resetSettingsState (LRF_ApplySettingsState *state)
 
void LRF_initSettingsState (LRF_ApplySettingsState *state, LRF_ApplySettingsBase includeBase, uint16_t phyFeatures)
 
LRF_SetupResult LRF_applySettings (LRF_ConfigWord *config, LRF_ApplySettingsState *state, int32_t bufferAvailWords)
 
void LRF_enable (void)
 
void LRF_disable (void)
 
void LRF_powerDown (void)
 
void LRF_sendHardStop (void)
 
void LRF_sendGracefulStop (void)
 
void LRF_hardStop (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_programFrequency (uint32_t frequency, bool tx)
 
uint32_t LRF_enableSynthRefsys (void)
 
void LRF_disableSynthRefsys (void)
 
void LRF_setClockEnable (uint16_t mask, uint8_t entryNumber)
 
void LRF_clearClockEnable (uint16_t mask, uint8_t entryNumber)
 
int8_t LRF_readRssi (void)
 
void LRF_setRawTxPower (uint32_t value, uint32_t temperatureCoefficient)
 
LRF_TxPowerTable_Entry LRF_getRawTxPower (void)
 
bool LRF_imagesNeedUpdate (const LRF_Config *lrfConfig)
 
LRF_TxPowerTable_Entry LRF_TxPowerTable_findValue (const LRF_TxPowerTable *table, LRF_TxPowerTable_Index powerLevel)
 Search for settings corresponding to the highest tx power lower than specified value in the tx power table. More...
 
void LRF_rclEnableRadioClocks (void)
 
void LRF_rclDisableRadioClocks (void)
 
static void LRF_enableHwInterrupt (uint32_t mask)
 
static void LRF_disableHwInterrupt (uint32_t mask)
 
static void LRF_clearHwInterrupt (uint32_t mask)
 

Variables

uint32_t swParamList []
 
const size_t swParamListSz
 

Data Structure Documentation

§ LRF_TOPsmImage_s

struct LRF_TOPsmImage_s
Data Fields
uint32_t imageLen
uint32_t image[]

§ LRF_ConfigWord

union LRF_ConfigWord
Data Fields
struct LRF_ConfigWord region
uint32_t value32
uint16_t value16[2]
struct LRF_ConfigWord sparse
struct LRF_ConfigWord masked
struct LRF_ConfigWord segment

§ LRF_RegConfigList_s

struct LRF_RegConfigList_s
+ Collaboration diagram for LRF_RegConfigList:
Data Fields
uint32_t numEntries
LRF_ConfigWord * entries[]

§ LRF_ApplySettingsState

struct LRF_ApplySettingsState
Data Fields
uint16_t phyFeatures
LRF_ApplySettingsBase includeBase

§ LRF_ConfigWord.region

struct LRF_ConfigWord.region
Data Fields
uint32_t lengthMinus1: 12
uint32_t type: 4
uint32_t startAddress: 16

§ LRF_ConfigWord.sparse

struct LRF_ConfigWord.sparse
Data Fields
uint16_t value16
uint16_t address

§ LRF_ConfigWord.masked

struct LRF_ConfigWord.masked
Data Fields
uint16_t value16
uint16_t mask16

§ LRF_ConfigWord.segment

struct LRF_ConfigWord.segment
Data Fields
uint32_t length: 14
uint32_t invertedFeatureMask: 1
uint32_t compoundSegment: 1
uint32_t featureMask: 16

Macro Definition Documentation

§ LRF_TxPower_Use_Min

#define LRF_TxPower_Use_Min   ((LRF_TxPowerTable_Index){.rawValue = -128})

Special value given as a TX power to indicate that the lowest available TX power is requested

Referenced by LRF_TxPowerTable_findValue().

§ LRF_TxPower_Use_Max

#define LRF_TxPower_Use_Max   ((LRF_TxPowerTable_Index){.rawValue = 125})

Special value given as a TX power to indicate that the highest available TX power is requested

Referenced by LRF_TxPowerTable_findValue().

§ LRF_TxPower_Use_Raw

#define LRF_TxPower_Use_Raw   ((LRF_TxPowerTable_Index){.rawValue = 126})

Special value given as a TX power to indicate that a given raw TX power register setting should be used.

Referenced by LRF_getRawTxPower(), LRF_setRawTxPower(), and LRF_TxPowerTable_findValue().

§ LRF_TxPower_None

#define LRF_TxPower_None   ((LRF_TxPowerTable_Index){.rawValue = 127})

Special value given as a TX power to indicate that a TX power should not be programmed; instead, use the register value written through settings or register write.

Referenced by LRF_programTxPower().

§ LRF_SETTINGS_BUFFER_UNLIMITED

#define LRF_SETTINGS_BUFFER_UNLIMITED   0x3FFF

Buffer available limit when no limit exists

Referenced by LRF_setupRadio().

§ LRF_RSSI_INVALID

§ LRF_PhyFeatures_Default

#define LRF_PhyFeatures_Default   0

Referenced by RCL_Lite_config().

§ __ERROR_Address_is_in_an_invalid_range_for_LRF_setup

#define __ERROR_Address_is_in_an_invalid_range_for_LRF_setup   0x00040000

§ _ADDRESS_REGION_BIT

#define _ADDRESS_REGION_BIT (   _address)
Value:
((((((uintptr_t)(_address)) >= (LRF_BASE_ADDR)) && \
((uintptr_t)(_address)) < ((LRF_BASE_ADDR) + 0x10000)) ? 0 : \
((((uintptr_t)(_address)) >= (PBE_RAM_BASE_ADDR)) && \
(((uintptr_t)(_address)) < ((PBE_RAM_BASE_ADDR) + 0x10000)) ? \
1 : \
(((((uintptr_t)(_address)) >= 0) && \
(((uintptr_t)(_address)) < 0x10000)) ? \
2 : \
#define LRF_BASE_ADDR
Definition: LRFCC23X0.h:525
#define PBE_RAM_BASE_ADDR
Definition: LRFCC23X0.h:526
#define __ERROR_Address_is_in_an_invalid_range_for_LRF_setup
Definition: LRF.h:187

§ LRF_SETTINGS_CLEAR

#define LRF_SETTINGS_CLEAR (   _startAddress,
  _numWords 
)
Value:
((((_numWords) - 1) & 0x0FFF) | \
_ADDRESS_REGION_BIT(_startAddress) | \
((((uintptr_t)(_startAddress)) & 0xFFFF) << 16))
#define _ADDRESS_REGION_BIT(_address)
Definition: LRF.h:189

§ LRF_SETTINGS_16BIT_BLOCK

#define LRF_SETTINGS_16BIT_BLOCK (   _startAddress,
  _numWords 
)
Value:
((((_numWords) - 1) & 0x0FFF) | \
_ADDRESS_REGION_BIT(_startAddress) | (1 << 12) | \
((((uintptr_t)(_startAddress)) & 0xFFFF) << 16))
#define _ADDRESS_REGION_BIT(_address)
Definition: LRF.h:189

§ LRF_SETTINGS_16BIT_DUAL_ENTRY

#define LRF_SETTINGS_16BIT_DUAL_ENTRY (   _value0,
  _value1 
)    (((_value0) & 0xFFFF) | (((_value1) & 0xFFFF) << 16))

§ LRF_SETTINGS_32BIT_BLOCK

#define LRF_SETTINGS_32BIT_BLOCK (   _startAddress,
  _numWords 
)
Value:
((((_numWords) - 1) & 0x0FFF) | \
_ADDRESS_REGION_BIT(_startAddress) | (2 << 12) | \
((((uintptr_t)(_startAddress)) & 0xFFFF) << 16))
#define _ADDRESS_REGION_BIT(_address)
Definition: LRF.h:189

§ LRF_SETTINGS_16BIT_SPARSE_BLOCK

#define LRF_SETTINGS_16BIT_SPARSE_BLOCK (   _startAddress,
  _numWords 
)
Value:
((((_numWords) - 1) & 0x0FFF) | \
_ADDRESS_REGION_BIT(_startAddress) | (3 << 12)) \
#define _ADDRESS_REGION_BIT(_address)
Definition: LRF.h:189

§ LRF_SETTINGS_16BIT_SPARSE_ENTRY

#define LRF_SETTINGS_16BIT_SPARSE_ENTRY (   _address,
  _value 
)    (((((uintptr_t)(_address)) & 0xFFFF) << 16) | ((_value) & 0xFFFF))

§ LRF_SETTINGS_16BIT_MASKED_BLOCK

#define LRF_SETTINGS_16BIT_MASKED_BLOCK (   _startAddress,
  _numWords 
)
Value:
((((_numWords) - 1) & 0x0FFF) | (11 << 12) | \
((((uintptr_t)(_startAddress)) & 0xFFFF) << 16))

§ LRF_SETTINGS_16BIT_MASKED_ENTRY

#define LRF_SETTINGS_16BIT_MASKED_ENTRY (   _mask,
  _value 
)    ((((_mask) & 0xFFFF) << 16) | ((_value) & 0xFFFF))

Enumeration Type Documentation

§ LRF_RadioState

Enumerator
RadioState_Down 
RadioState_ImagesLoaded 
RadioState_Configured 

§ LRF_SetupResult

Setup operation result.

Enumerator
SetupResult_Ok 

Setup was successful

SetupResult_Ok_Partial 

Setup was successful so far, need rest of buffer

SetupResult_ErrorImageLen 

An image was too long

SetupResult_ErrorConfigLen 

A register configuration table was too long

SetupResult_ErrorElemLen 

A register configuration element exceeded the table length

SetupResult_ErrorElemType 

A register configuration element had invalid type

SetupResult_ErrorElemAddrAlign 

A register configuration element had unsupported address alignment

SetupResult_ErrorParRange 

A register parameter element was outside the allowed range

SetupResult_ErrorSwConfig 

The swConfig field was NULL

§ LRF_RegionOperation

Enumerator
HW_Region_Clear 
HW_Write_16bit 
HW_Write_32bit 
HW_Write_16bit_sparse 
SW_Region_Clear 
SW_Write_16bit 
SW_Write_32bit 
SW_Write_16bit_sparse 
Par_Region_Clear 
Par_Reference_32bit 
Par_Write_32bit 
HW_Write_16bit_masked 
LRF_RegionOperation_Skip 
LRF_RegionOperation_Invalid 

§ LRF_ApplySettingsBase

Enumerator
LRF_ApplySettings_NoBase 
LRF_ApplySettings_IncludeBase 

Function Documentation

§ LRF_setupRadio()

§ LRF_loadImage()

LRF_SetupResult LRF_loadImage ( const LRF_TOPsmImage *  image,
uint32_t  destinationAddress 
)

§ LRF_resetSettingsState()

§ LRF_initSettingsState()

void LRF_initSettingsState ( LRF_ApplySettingsState state,
LRF_ApplySettingsBase  includeBase,
uint16_t  phyFeatures 
)

§ LRF_applySettings()

§ LRF_enable()

§ LRF_disable()

§ LRF_powerDown()

void LRF_powerDown ( void  )

Referenced by LRF_resetSettingsState().

§ LRF_sendHardStop()

§ LRF_sendGracefulStop()

void LRF_sendGracefulStop ( void  )

§ LRF_hardStop()

void LRF_hardStop ( void  )

§ 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_programFrequency()

§ LRF_enableSynthRefsys()

§ LRF_disableSynthRefsys()

§ LRF_setClockEnable()

void LRF_setClockEnable ( uint16_t  mask,
uint8_t  entryNumber 
)

Referenced by LRF_resetSettingsState().

§ LRF_clearClockEnable()

void LRF_clearClockEnable ( uint16_t  mask,
uint8_t  entryNumber 
)

Referenced by LRF_resetSettingsState().

§ LRF_readRssi()

int8_t LRF_readRssi ( void  )

§ LRF_setRawTxPower()

void LRF_setRawTxPower ( uint32_t  value,
uint32_t  temperatureCoefficient 
)

§ LRF_getRawTxPower()

§ LRF_imagesNeedUpdate()

bool LRF_imagesNeedUpdate ( const LRF_Config lrfConfig)

§ LRF_TxPowerTable_findValue()

LRF_TxPowerTable_Entry LRF_TxPowerTable_findValue ( const LRF_TxPowerTable table,
LRF_TxPowerTable_Index  powerLevel 
)

Search for settings corresponding to the highest tx power lower than specified value in the tx power table.

Parameters
tablepointer to the tx power table to be searched
powerLevelmaximum allowed power level
Returns
Settings corresponding to a power level equal to or lower than requested or LRF_TxPowerTable_INVALID_VALUE if no valid setting was found.

References LRF_getRawTxPower(), LRF_TxPower_Use_Max, LRF_TxPower_Use_Min, LRF_TxPower_Use_Raw, LRF_TxPowerEntry_INVALID_VALUE, LRF_TxPowerTable::numEntries, LRF_TxPowerTable_Entry::power, LRF_TxPowerTable::powerTable, and LRF_TxPowerTable_Index::rawValue.

Referenced by LRF_programTxPower(), and LRF_resetSettingsState().

§ LRF_rclEnableRadioClocks()

void LRF_rclEnableRadioClocks ( void  )

§ LRF_rclDisableRadioClocks()

void LRF_rclDisableRadioClocks ( void  )

§ LRF_enableHwInterrupt()

§ LRF_disableHwInterrupt()

static void LRF_disableHwInterrupt ( uint32_t  mask)
inlinestatic

§ LRF_clearHwInterrupt()

static void LRF_clearHwInterrupt ( uint32_t  mask)
inlinestatic

Variable Documentation

§ swParamList

§ swParamListSz

const size_t swParamListSz