CC26xx Driver Library
RF Core

Data Structures

struct  rfTrim_t
 

Functions

static void RFCClockEnable (void)
 Enable the RF core clocks. More...
 
static void RFCClockDisable (void)
 Disable the RF core clocks. More...
 
static void RFCClockSet (uint32_t ui32Mask)
 Enable some of the RF core clocks. More...
 
static void RFCClockClear (uint32_t ui32Mask)
 Disable some of the RF core clocks. More...
 
static void RFCCpe0IntEnable (uint32_t ui32Mask)
 Enable CPE0 interrupt. More...
 
static void RFCCpe1IntEnable (uint32_t ui32Mask)
 Enable CPE1 interrupt. More...
 
static void RFCHwIntEnable (uint32_t ui32Mask)
 
static void RFCCpeIntDisable (uint32_t ui32Mask)
 Disable CPE interrupt. More...
 
static void RFCHwIntDisable (uint32_t ui32Mask)
 Disable HW interrupt. More...
 
uint32_t RFCCpeIntGetAndClear (void)
 Get and clear CPE interrupt flags. More...
 
static void RFCCpeIntClear (uint32_t ui32Mask)
 Clear interrupt flags. More...
 
static void RFCHwIntClear (uint32_t ui32Mask)
 Clear interrupt flags. More...
 
static void RFCAckIntClear (void)
 Clear interrupt flags. More...
 
uint32_t RFCDoorbellSendTo (uint32_t pOp)
 Send command to doorbell and wait for ack. More...
 
void RFCSynthPowerDown (void)
 Turn off synth, NOTE: Radio will no longer respond to commands! More...
 
void RFCRfTrimRead (rfc_radioOp_t *pOpSetup, rfTrim_t *rfTrim)
 Read RF trim from flash using CM3. More...
 
void RFCRfTrimSet (rfTrim_t *rfTrim)
 Write preloaded RF trim values to CM0. More...
 
void RFCRTrim (rfc_radioOp_t *pOpSetup)
 Check Override RTrim vs FCFG RTrim. More...
 
void RFCCPEPatchReset (void)
 Reset previously patched CPE RAM to a state where it can be patched again. More...
 
void RFCAdi3VcoLdoVoltageMode (bool bEnable)
 Function to set VCOLDO reference to voltage mode. More...
 

Detailed Description

Function Documentation

static void RFCAckIntClear ( void  )
inlinestatic

Clear interrupt flags.

Referenced by RFCDoorbellSendTo().

335 {
336  // Clear any pending interrupts.
337  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFACKIFG) = 0x0;
338 }
void RFCAdi3VcoLdoVoltageMode ( bool  bEnable)

Function to set VCOLDO reference to voltage mode.

224 {
225  // Function is left blank for compatibility reasons.
226 }
static void RFCClockClear ( uint32_t  ui32Mask)
inlinestatic

Disable some of the RF core clocks.

As soon as the RF core is started it will handle clock control autonomously. No check should be performed to check the clocks. Instead the radio can be ping'ed through the command interface.

When disabling clocks it is the programmers responsibility that the RF core clocks can be safely gated. I.e. the RF core should be safely 'parked'.

Returns
None
197 {
198  //
199  // Disable clocks
200  //
201  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) &= ~ui32Mask;
202 }
static void RFCClockDisable ( void  )
inlinestatic

Disable the RF core clocks.

As soon as the RF core is started it will handle clock control autonomously. No check should be performed to check the clocks. Instead the radio can be ping'ed through the command interface.

When disabling clocks it is the programmers responsibility that the RF core clocks can be safely gated. I.e. the RF core should be safely 'parked'.

Returns
None
155 {
156  // Disable all clocks
157  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) = 0x0;
158 }
static void RFCClockEnable ( void  )
inlinestatic

Enable the RF core clocks.

As soon as the RF core is started it will handle clock control autonomously. No check should be performed to check the clocks. Instead the radio can be ping'ed through the command interface.

Returns
None
122 {
123  // Enable all clocks
124  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) =
136 }
static void RFCClockSet ( uint32_t  ui32Mask)
inlinestatic

Enable some of the RF core clocks.

As soon as the RF core is started it will handle clock control autonomously. No check should be performed to check the clocks. Instead the radio can be ping'ed through the command interface.

Returns
None
173 {
174  //
175  // Enable clocks
176  //
177  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) |= ui32Mask;
178 }
static void RFCCpe0IntEnable ( uint32_t  ui32Mask)
inlinestatic

Enable CPE0 interrupt.

211 {
212  // Multiplex RF Core interrupts to CPE0 IRQ.
213  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEISL) &= ~ui32Mask;
214 
215  do
216  {
217  // Clear any pending interrupts.
218  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIFG) = 0x0;
219  }while(HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIFG) != 0x0);
220 
221  // Enable the masked interrupts
222  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIEN) |= ui32Mask;
223 }
static void RFCCpe1IntEnable ( uint32_t  ui32Mask)
inlinestatic

Enable CPE1 interrupt.

233 {
234  // Multiplex RF Core interrupts to CPE1 IRQ.
235  HWREG( RFC_DBELL_BASE + RFC_DBELL_O_RFCPEISL) |= ui32Mask;
236 
237  do
238  {
239  // Clear any pending interrupts.
240  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIFG) = 0x0;
241  }while(HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIFG) != 0x0);
242 
243  // Enable the masked interrupts
244  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIEN) |= ui32Mask;
245 }
static void RFCCpeIntClear ( uint32_t  ui32Mask)
inlinestatic

Clear interrupt flags.

306 {
307  do
308  {
309  // Clear interrupts that may now be pending
310  HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG) = ~ui32Mask;
311  }while (HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG) & ui32Mask);
312 }
static void RFCCpeIntDisable ( uint32_t  ui32Mask)
inlinestatic

Disable CPE interrupt.

272 {
273  // Disable the masked interrupts
274  HWREG( RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIEN ) &= ~ui32Mask;
275 }
uint32_t RFCCpeIntGetAndClear ( void  )

Get and clear CPE interrupt flags.

104 {
105  uint32_t ui32Ifg = HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG);
106 
107  do {
108  HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG) = ~ui32Ifg;
109  } while (HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG) & ui32Ifg);
110 
111  return (ui32Ifg);
112 }
void RFCCPEPatchReset ( void  )

Reset previously patched CPE RAM to a state where it can be patched again.

204 {
205  uint8_t *pPatchTab = (uint8_t *) (_CPERAM_START + _PARSER_PATCH_TAB_OFFSET);
206  uint32_t *pIrqPatch = (uint32_t *) (_CPERAM_START + _IRQPATCH_OFFSET);
207 
208  memset(pPatchTab, 0xFF, _IRQPATCH_OFFSET - _PARSER_PATCH_TAB_OFFSET);
209 
210  int i;
211  for (i = 0; i < sizeof(rfc_defaultIrqAddr)/sizeof(rfc_defaultIrqAddr[0]); i++)
212  {
213  pIrqPatch[i * 2 + 1] = rfc_defaultIrqAddr[i];
214  }
215 }
static const uint16_t rfc_defaultIrqAddr[]
Definition: rfc.c:82
#define _IRQPATCH_OFFSET
Definition: rfc.c:79
#define _CPERAM_START
Definition: rfc.c:76
#define _PARSER_PATCH_TAB_OFFSET
Definition: rfc.c:77
uint32_t RFCDoorbellSendTo ( uint32_t  pOp)

Send command to doorbell and wait for ack.

122 {
123  while(HWREG(RFC_DBELL_BASE + RFC_DBELL_O_CMDR) != 0);
124 
125  RFCAckIntClear();
126 
127  HWREG(RFC_DBELL_BASE+RFC_DBELL_O_CMDR) = pOp;
128 
129  while(!HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFACKIFG));
130  RFCAckIntClear();
131 
132  return(HWREG(RFC_DBELL_BASE + RFC_DBELL_O_CMDSTA));
133 }
static void RFCAckIntClear(void)
Clear interrupt flags.
Definition: rfc.h:334

Here is the call graph for this function:

static void RFCHwIntClear ( uint32_t  ui32Mask)
inlinestatic

Clear interrupt flags.

322 {
323  // Clear pending interrupts.
324  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFHWIFG) = ~ui32Mask;
325 }
static void RFCHwIntDisable ( uint32_t  ui32Mask)
inlinestatic

Disable HW interrupt.

285 {
286  // Disable the masked interrupts
287  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFHWIEN) &= ~ui32Mask;
288 }
static void RFCHwIntEnable ( uint32_t  ui32Mask)
inlinestatic

This function is used to map only HW interrupts, and clears/unmasks them. These interrupts are then enabled.

256 {
257  // Clear any pending interrupts.
258  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFHWIFG) = 0x0;
259 
260  // Enable the masked interrupts
261  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFHWIEN) |= ui32Mask;
262 }
void RFCRfTrimRead ( rfc_radioOp_t pOpSetup,
rfTrim_t rfTrim 
)

Read RF trim from flash using CM3.

165 {
166  // Read trim from FCFG1
167  pRfTrim->configIfAdc = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_IF_ADC);
168  pRfTrim->configRfFrontend = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_RF_FRONTEND);
169  pRfTrim->configSynth = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_SYNTH);
170  // Make sure configMiscAdc is not 0 by setting an unused bit to 1
171  pRfTrim->configMiscAdc = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC)
173 }
#define CONFIG_MISC_ADC_DIVIDER_BM
Definition: rfc.c:74
#define CONFIG_MISC_ADC_DIVIDER
Definition: rfc.c:73
void RFCRfTrimSet ( rfTrim_t rfTrim)

Write preloaded RF trim values to CM0.

193 {
194  memcpy((void*)&HWREG(0x21000018), (void*)pRfTrim, sizeof(rfTrim_t));
195 }
Definition: rfc.h:72
void RFCRTrim ( rfc_radioOp_t pOpSetup)

Check Override RTrim vs FCFG RTrim.

182 {
183  // Function is left blank for compatibility reasons.
184 }
void RFCSynthPowerDown ( void  )

Turn off synth, NOTE: Radio will no longer respond to commands!

143 {
144  // Disable CPE clock, enable FSCA clock. NOTE: Radio will no longer respond to commands!
145  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) = (HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) & ~RFC_PWR_PWMCLKEN_CPE_M) | RFC_PWR_PWMCLKEN_FSCA_M;
146 
147  HWREG(RFC_RESERVED0) = 3;
148  HWREG(RFC_RESERVED1) = 0x1030;
149  HWREG(RFC_RESERVED2) = 1;
150  HWREG(RFC_RESERVED1) = 0x50;
151  HWREG(RFC_RESERVED2) = 1;
152  HWREG(RFC_RESERVED1) = 0x650;
153  HWREG(RFC_RESERVED2) = 1;
154  HWREG(RFC_RESERVED3) = 1;
155 
156 }
#define RFC_RESERVED0
Definition: rfc.c:67
#define RFC_RESERVED3
Definition: rfc.c:70
#define RFC_RESERVED2
Definition: rfc.c:69
#define RFC_RESERVED1
Definition: rfc.c:68