33 #ifndef ti_drivers_LRFCC2340_h__include 34 #define ti_drivers_LRFCC2340_h__include 39 #include <ti/devices/DeviceFamily.h> 40 #include DeviceFamily_constructPath(inc/hw_memmap.h) 41 #include DeviceFamily_constructPath(inc/hw_lrfdpbe.h) 42 #include DeviceFamily_constructPath(inc/hw_lrfddbell.h) 43 #include DeviceFamily_constructPath(inc/pbe_generic_regdef_regs.h) 51 #ifdef DeviceFamily_CC27XX 53 #define LRFDPBE32_BASE 0x40081400 // LRFDPBE32 54 #define LRFDMDM32_BASE 0x40082400 // LRFDMDM32 55 #define LRFDRFE32_BASE 0x40083400 // LRFDRFE32 64 uint16_t noIfampRfLdoBypass: 1;
76 uint16_t noIfampRfLdoBypass: 1;
81 #define LRF_TxPowerTable_INVALID_VALUE ((LRF_TxPowerTable_Value){.rawValue = 0xFFFF}) 83 typedef uint8_t LRF_TxPowerTable_TempCoeff; 85 typedef enum LRF_TxPowerResult_e {
91 #define LRF_EventNone ((LRF_Events){ .value = (0U << 0U)}) 92 #define LRF_EventOpDone ((LRF_Events){ .value = (1U << 0U)}) 93 #define LRF_EventPingRsp ((LRF_Events){ .value = (1U << 1U)}) 94 #define LRF_EventRxCtrl ((LRF_Events){ .value = (1U << 2U)}) 95 #define LRF_EventRxCtrlAck ((LRF_Events){ .value = (1U << 3U)}) 96 #define LRF_EventRxNok ((LRF_Events){ .value = (1U << 4U)}) 97 #define LRF_EventRxIgnored ((LRF_Events){ .value = (1U << 5U)}) 98 #define LRF_EventRxEmpty ((LRF_Events){ .value = (1U << 6U)}) 99 #define LRF_EventRxBufFull ((LRF_Events){ .value = (1U << 7U)}) 100 #define LRF_EventRxOk ((LRF_Events){ .value = (1U << 8U)}) 101 #define LRF_EventTxCtrl ((LRF_Events){ .value = (1U << 9U)}) 102 #define LRF_EventTxCtrlAckAck ((LRF_Events){ .value = (1U << 10U)}) 103 #define LRF_EventTxRetrans ((LRF_Events){ .value = (1U << 11U)}) 104 #define LRF_EventTxAck ((LRF_Events){ .value = (1U << 12U)}) 105 #define LRF_EventTxDone ((LRF_Events){ .value = (1U << 13U)}) 106 #define LRF_EventTxCtrlAck ((LRF_Events){ .value = (1U << 14U)}) 107 #define LRF_EventOpError ((LRF_Events){ .value = (1U << 15U)}) 108 #define LRF_EventRxfifo ((LRF_Events){ .value = (1U << 16U)}) 109 #define LRF_EventTxfifo ((LRF_Events){ .value = (1U << 17U)}) 110 #define LRF_EventLossOfLock ((LRF_Events){ .value = (1U << 18U)}) 111 #define LRF_EventLock ((LRF_Events){ .value = (1U << 19U)}) 112 #define LRF_EventRfesoft0 ((LRF_Events){ .value = (1U << 20U)}) 113 #define LRF_EventRfesoft1 ((LRF_Events){ .value = (1U << 21U)}) 114 #define LRF_EventRfedone ((LRF_Events){ .value = (1U << 22U)}) 115 #define LRF_EventMdmsoft0 ((LRF_Events){ .value = (1U << 23U)}) 116 #define LRF_EventMdmsoft1 ((LRF_Events){ .value = (1U << 24U)}) 117 #define LRF_EventMdmsoft2 ((LRF_Events){ .value = (1U << 25U)}) 118 #define LRF_EventMdmout ((LRF_Events){ .value = (1U << 26U)}) 119 #define LRF_EventMdmin ((LRF_Events){ .value = (1U << 27U)}) 120 #define LRF_EventMdmdone ((LRF_Events){ .value = (1U << 28U)}) 121 #define LRF_EventSystim0 ((LRF_Events){ .value = (1U << 29U)}) 122 #define LRF_EventSystim1 ((LRF_Events){ .value = (1U << 30U)}) 123 #define LRF_EventSystim2 ((LRF_Events){ .value = (1U << 31U)}) 129 uint32_t pingRsp : 1;
131 uint32_t rxCtrlAck : 1;
134 uint32_t rxIgnored : 1;
135 uint32_t rxEmpty : 1;
136 uint32_t rxBufFull : 1;
139 uint32_t txCtrlAckAck : 1;
140 uint32_t txRetrans : 1;
143 uint32_t txCtrlAck : 1;
144 uint32_t opError : 1;
147 uint32_t lossOfLock : 1;
149 uint32_t rfesoft0 : 1;
150 uint32_t rfesoft1 : 1;
151 uint32_t rfedone : 1;
152 uint32_t mdmsoft0 : 1;
153 uint32_t mdmsoft1 : 1;
154 uint32_t mdmsoft2 : 1;
157 uint32_t mdmdone : 1;
158 uint32_t systim0 : 1;
159 uint32_t systim1 : 1;
160 uint32_t systim2 : 1;
165 typedef struct LRF_RegConfig_s {
167 uint32_t regConfig[];
176 uint8_t fraction : 1;
193 #define LRF_TxPowerEntry_INVALID_VALUE \ 194 ((LRF_TxPowerTable_Entry) {\ 195 .power = LRF_TxPower_None,\ 197 .value = LRF_TxPowerTable_INVALID_VALUE,\ 210 typedef struct LRF_TxShape_s {
213 uint32_t numCoeff :15;
218 #define LRF_TRIM_NUM_VARIANTS 2 219 #define LRF_TRIM_NORMAL_BW 0 220 #define LRF_TRIM_HIGH_BW 1 222 #define LRF_TRIM_MIN_VERSION_FULL_FEATURES 4 225 #define LRF_TRIM_VERSION_RSSIOFFSET_ISSUE_CC23X0R5 4 226 #define LRF_TRIM_LIMIT_RSSIOFFSET_ISSUE_CC23X0R5 (-4) 227 #define LRF_TRIM_CORRECTION_RSSIOFFSET_ISSUE_CC23X0R5 5 229 #define LRF_TRIM_VERSION_STATE_C_TRIM_WORKAROUND_CC27XX 7U 231 #define LRF_TRIM_RTRIM_VALUE_STATE_B_RTRIM_WORKAROUND_CC27XX 10U 233 #define LRF_TRIM_DCOLDO0_FIRSTTRIM_VALUE_STATE_B_DCOLDO_WORKAROUND_CC27XX 8U 234 #define LRF_TRIM_DCOLDO0_SECONDTRIM_INC_STATE_B_DCOLDO_WORKAROUND_CC27XX 10U 235 #define LRF_TRIM_DCOLDO0_SECONDTRIM_CODED_BITS_MASK_STATE_B_DCOLDO_WORKAROUND_CC27XX ((1U << 3U) | (1U << 5U)) 236 #define LRF_TRIM_DCOLDO0_SECONDTRIM_MAX_STATE_B_DCOLDO_WORKAROUND_CC27XX 63U 239 #define LRF_TRIM_VERSION_CORRECT_AMOUNT_OF_PA_TRIMS_CC27XX 5 254 #ifdef DeviceFamily_CC27XX 267 uint16_t irefTrim : 5;
272 #ifdef DeviceFamily_CC27XX 298 uint16_t voutTrim : 7;
304 uint16_t voutTrim : 7;
322 uint16_t firstTrim : 4;
323 uint16_t secondTrim : 6;
329 uint16_t trimout : 6;
335 uint16_t trimout : 6;
341 uint16_t tailresTrim : 4;
358 uint16_t quantThr : 3;
365 uint16_t int2Adj : 4;
367 uint16_t ditheren : 2;
368 uint16_t dithertrim : 3;
396 uint16_t rtrimMinOffset : 2;
397 uint16_t rtrimMaxOffset : 2;
398 uint16_t divLdoMinOffset: 2;
399 uint16_t divLdoMaxOffset: 2;
400 uint16_t tdcLdoMinOffset: 2;
401 uint16_t tdcLdoMaxOffset: 2;
407 int32_t rssiTcomp : 4;
408 int32_t magnTcomp : 4;
409 int32_t magnOffset : 4;
411 int32_t agcThrTcomp : 4;
412 int32_t agcThrOffset : 4;
413 int32_t lowGainOffset : 4;
414 int32_t highGainOffset : 4;
428 uint32_t lrfdrfeExtTrim1;
429 uint32_t lrfdrfeExtTrim0;
440 uint16_t trimCompleteN : 1;
449 #ifdef DeviceFamily_CC27XX 467 uint8_t trimCompleteN;
469 #ifdef DeviceFamily_CC27XX 496 typedef struct LRF_SwConfig_s {
509 typedef struct LRF_SwParam_s {
518 typedef struct LRF_Config_s {
525 #define LRF_BASE_ADDR 0x40080000U 526 #define PBE_RAM_BASE_ADDR 0x40090000U 527 #define BUF_RAM_BASE_ADDR 0x40092000U 528 #define RXF_UNWRAPPED_BASE_ADDR 0x40093000U 529 #define TXF_UNWRAPPED_BASE_ADDR 0x40093800U 530 #define MCE_RAM_BASE_ADDR 0x40094000U 531 #define RFE_RAM_BASE_ADDR 0x40096000U 532 #define S2R_RAM_BASE_ADDR 0x40098000U 533 #define TOPSM_RAM_SZ 0x00001000U 534 #define MAX_REG_CONFIG_LEN 1024U 536 #define LRF_TXPOWER_REFERENCE_TEMPERATURE 25 537 #define LRF_TXPOWER_TEMPERATURE_SCALING 0x100 539 extern const LRF_TxShape LRF_shapeBaseGfsk05; 547 HWREG_WRITE_LRF(LRFDPBE_BASE + LRFDPBE_O_API) = PBE_GENERIC_REGDEF_API_OP_STOP;
554 HWREG_WRITE_LRF(LRFDPBE_BASE + LRFDPBE_O_API) = PBE_GENERIC_REGDEF_API_OP_EOPSTOP;
564 return HWREG_READ_LRF(LRFDPBE_BASE + LRFDPBE_O_TXFWRITABLE);
608 #include <ti/drivers/Power.h> 610 #ifdef DeviceFamily_CC27XX 611 #define LRF_POWER_PERIPH_VALUE(x) (PowerCC27XX_PERIPH_GROUP_LRFD | (x)) 613 #define LRF_POWER_PERIPH_VALUE(x) (PowerCC23X0_PERIPH_GROUP_LRFD | (x)) 616 #ifdef PowerLPF3_PERIPH_LRFD_BUFRAM 617 #error "Remove local definition in LRFCC23X0.h and rely on Power driver's definition" 619 #define PowerLPF3_PERIPH_LRFD_BUFRAM LRF_POWER_PERIPH_VALUE(LRFDDBELL_CLKCTL_BUFRAM_S) 622 #ifdef PowerLPF3_PERIPH_LRFD_MDM 623 #error "Remove local definition in LRFCC23X0.h and rely on Power driver's definition" 625 #define PowerLPF3_PERIPH_LRFD_MDM LRF_POWER_PERIPH_VALUE(LRFDDBELL_CLKCTL_MDM_S) 628 #ifdef PowerLPF3_PERIPH_LRFD_TRC 629 #error "Remove local definition in LRFCC23X0.h and rely on Power driver's definition" 631 #define PowerLPF3_PERIPH_LRFD_TRC LRF_POWER_PERIPH_VALUE(LRFDDBELL_CLKCTL_TRC_S) LRF_Trim3 trim3
Definition: LRFCC23X0.h:489
uint16_t rawValue
Definition: LRFCC23X0.h:78
LRF_DoubleWord data
Definition: LRFCC23X0.h:314
LRF_TxPowerTable_TempCoeff tempCoeff
Definition: LRFCC23X0.h:188
static void LRF_sendGracefulStop(void)
Definition: LRFCC23X0.h:550
const LRF_TxShape LRF_shapeBaseGfsk20
static void LRF_hardStop(void)
Definition: LRFCC23X0.h:557
Software defined PHY parameters.
Definition: LRFCC23X0.h:496
uint8_t revision
Definition: LRFCC23X0.h:482
Definition: LRFCC23X0.h:210
LRF_Trim4 trim4
Definition: LRFCC23X0.h:490
int8_t rawValue
Definition: LRFCC23X0.h:179
static void LRF_setRclClockEnable(uint16_t mask)
Request specific clock enable bits for use by the RCL.
Definition: LRFCC23X0.h:590
const LRF_SwConfig * swConfig
Definition: LRFCC23X0.h:510
Single entry of the tx power table. Maps power in dBm to specific register settings.
Definition: LRFCC23X0.h:186
uint8_t LRF_TxPowerTable_TempCoeff
Definition: LRFCC23X0.h:83
const LRF_TOPsmImage * mceImage
Definition: LRFCC23X0.h:520
LRF_Trim1 trim1
Definition: LRFCC23X0.h:486
void hal_clear_rcl_clock_enable(uint16_t mask)
Definition: hal_cc23x0.c:386
Tx power table, containing all characterized dBm to register settings mappings.
Definition: LRFCC23X0.h:205
Definition: LRFCC23X0.h:87
Definition: LRFCC23X0.h:246
Definition: LRFCC23X0.h:282
Definition: LRFCC23X0.h:317
Definition: LRFCC23X0.h:417
Definition: LRFCC23X0.h:434
LRF_TxPowerTable_Index power
Definition: LRFCC23X0.h:187
Index of the tx power table.
Definition: LRFCC23X0.h:173
int32_t txFrequencyOffset
Definition: LRFCC23X0.h:499
Radio configuration structure.
Definition: LRFCC23X0.h:518
const LRF_TOPsmImage * rfeImage
Definition: LRFCC23X0.h:521
static void LRF_clearRclClockEnable(uint16_t mask)
Remove request of specific clock enable bits for use by the RCL.
Definition: LRFCC23X0.h:601
#define LRF_TRIM_NUM_VARIANTS
Definition: LRFCC23X0.h:218
LRF_TxPowerTable_Value value
Definition: LRFCC23X0.h:189
LRF_Trim0 trim0
Definition: LRFCC23X0.h:485
void hal_set_rcl_clock_enable(uint16_t mask)
Definition: hal_cc23x0.c:379
uint32_t data
Definition: LRFCC23X0.h:279
const LRF_RegConfigList * regConfigList
Definition: LRFCC23X0.h:522
uint32_t value
Definition: LRFCC23X0.h:162
LRF_Trim2 trim2
Definition: LRFCC23X0.h:487
uint32_t data
Definition: LRFCC23X0.h:476
uint8_t bwIndex
Definition: LRFCC23X0.h:502
Definition: LRFCC23X0.h:481
Definition: LRFCC23X0.h:86
Definition: LRFCC23X0.h:394
LRF_DoubleWord data
Definition: LRFCC23X0.h:351
int32_t rxFrequencyOffset
Definition: LRFCC23X0.h:498
const LRF_TxShape * txShape
Definition: LRFCC23X0.h:501
uint8_t nToolsClientOffset
Definition: LRFCC23X0.h:483
static uint32_t LRF_getTxFifoWritable(void)
Definition: LRFCC23X0.h:562
const LRF_TrimDef * trimDef
Definition: LRFCC23X0.h:512
uint32_t modFrequencyDeviation
Definition: LRFCC23X0.h:500
const LRF_TxPowerTable * txPowerTable
Definition: LRFCC23X0.h:511
LRF_TxPowerResult LRF_programTxPower(LRF_TxPowerTable_Index powerLevel)
Finds settings corresponding to the highest tx power lower than the specified value in the tx power t...
Definition: LRFCC23X0.c:1477
void LRF_programTemperatureCompensatedTxPower(void)
Programs current TX power setting in radio with temperature compensation.
Definition: LRFCC23X0.c:1442
uint32_t configLen
Definition: LRFCC23X0.h:166
Definition: LRFCC23X0.h:354
LRF_TxPowerResult
Definition: LRFCC23X0.h:85
uint32_t data
Definition: LRFCC23X0.h:431
int32_t rxIntFrequency
Definition: LRFCC23X0.h:497
Definition: LRFCC23X0.h:165
uint32_t numEntries
Definition: LRFCC23X0.h:206
Definition: LRFCC23X0.h:242
const LRF_TxShape LRF_shapeBaseGfsk067
uint8_t bwIndexDither
Definition: LRFCC23X0.h:503
const LRF_TOPsmImage * pbeImage
Definition: LRFCC23X0.h:519
LRF_DoubleWord data
Definition: LRFCC23X0.h:391
Type for tx power configuration.
Definition: LRFCC23X0.h:69
Software defined PHY parameter list.
Definition: LRFCC23X0.h:509
static void LRF_sendHardStop(void)
Definition: LRFCC23X0.h:543