CC13xx 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...
 
static uint8_t RFCOverrideSearch (const uint32_t *pOverride, const uint32_t pattern, const uint32_t mask)
 Function to search top RFC_MAX_SEARCH_DEPTH (5) overrides. 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...
 
uint8_t RFCOverrideUpdate (rfc_radioOp_t *pOpSetup, uint32_t *pParams)
 Function to update override list. More...
 
uint32_t RFCHWIntGetAndClear (uint32_t ui32Mask)
 Get and clear HW interrupt flags. More...
 

Detailed Description

Function Documentation

static void RFCAckIntClear ( void  )
inlinestatic

Clear interrupt flags.

Referenced by RFCDoorbellSendTo().

341 {
342  // Clear any pending interrupts.
343  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFACKIFG) = 0x0;
344 }
void RFCAdi3VcoLdoVoltageMode ( bool  bEnable)

Function to set VCOLDO reference to voltage mode.

416 {
417  if (bEnable)
418  {
419  // First make sure the REFSYSCTL0 mux output is not further muxed out
420  HWREGB(0x40086200) = 0x0;
421  // Set the REFSYSCTL0 mux as desired for VCOLDO voltage mode
423  }
424  else
425  {
426  // Revert the mux override
428  }
429 }
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
203 {
204  //
205  // Disable clocks
206  //
207  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) &= ~ui32Mask;
208 }
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
161 {
162  // Disable all clocks
163  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) = 0x0;
164 }
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
128 {
129  // Enable all clocks
130  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) =
142 }
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
179 {
180  //
181  // Enable clocks
182  //
183  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) |= ui32Mask;
184 }
static void RFCCpe0IntEnable ( uint32_t  ui32Mask)
inlinestatic

Enable CPE0 interrupt.

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

Enable CPE1 interrupt.

239 {
240  // Multiplex RF Core interrupts to CPE1 IRQ.
241  HWREG( RFC_DBELL_BASE + RFC_DBELL_O_RFCPEISL) |= ui32Mask;
242 
243  do
244  {
245  // Clear any pending interrupts.
246  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIFG) = 0x0;
247  }while(HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIFG) != 0x0);
248 
249  // Enable the masked interrupts
250  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIEN) |= ui32Mask;
251 }
static void RFCCpeIntClear ( uint32_t  ui32Mask)
inlinestatic

Clear interrupt flags.

312 {
313  do
314  {
315  // Clear interrupts that may now be pending
316  HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG) = ~ui32Mask;
317  }while (HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG) & ui32Mask);
318 }
static void RFCCpeIntDisable ( uint32_t  ui32Mask)
inlinestatic

Disable CPE interrupt.

278 {
279  // Disable the masked interrupts
280  HWREG( RFC_DBELL_BASE + RFC_DBELL_O_RFCPEIEN ) &= ~ui32Mask;
281 }
uint32_t RFCCpeIntGetAndClear ( void  )

Get and clear CPE interrupt flags.

113 {
114  uint32_t ui32Ifg = HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG);
115 
116  do {
117  HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG) = ~ui32Ifg;
118  } while (HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFCPEIFG) & ui32Ifg);
119 
120  return (ui32Ifg);
121 }
void RFCCPEPatchReset ( void  )

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

396 {
397  uint8_t *pPatchTab = (uint8_t *) (_CPERAM_START + _PARSER_PATCH_TAB_OFFSET);
398  uint32_t *pIrqPatch = (uint32_t *) (_CPERAM_START + _IRQPATCH_OFFSET);
399 
400  memset(pPatchTab, 0xFF, _IRQPATCH_OFFSET - _PARSER_PATCH_TAB_OFFSET);
401 
402  int i;
403  for (i = 0; i < sizeof(rfc_defaultIrqAddr)/sizeof(rfc_defaultIrqAddr[0]); i++)
404  {
405  pIrqPatch[i * 2 + 1] = rfc_defaultIrqAddr[i];
406  }
407 }
static const uint16_t rfc_defaultIrqAddr[]
Definition: rfc.c:90
#define _IRQPATCH_OFFSET
Definition: rfc.c:87
#define _CPERAM_START
Definition: rfc.c:84
#define _PARSER_PATCH_TAB_OFFSET
Definition: rfc.c:85
uint32_t RFCDoorbellSendTo ( uint32_t  pOp)

Send command to doorbell and wait for ack.

131 {
132  while(HWREG(RFC_DBELL_BASE + RFC_DBELL_O_CMDR) != 0);
133 
134  RFCAckIntClear();
135 
136  HWREG(RFC_DBELL_BASE+RFC_DBELL_O_CMDR) = pOp;
137 
138  while(!HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFACKIFG));
139  RFCAckIntClear();
140 
141  return(HWREG(RFC_DBELL_BASE + RFC_DBELL_O_CMDSTA));
142 }
static void RFCAckIntClear(void)
Clear interrupt flags.
Definition: rfc.h:340

Here is the call graph for this function:

static void RFCHwIntClear ( uint32_t  ui32Mask)
inlinestatic

Clear interrupt flags.

328 {
329  // Clear pending interrupts.
330  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFHWIFG) = ~ui32Mask;
331 }
static void RFCHwIntDisable ( uint32_t  ui32Mask)
inlinestatic

Disable HW interrupt.

291 {
292  // Disable the masked interrupts
293  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFHWIEN) &= ~ui32Mask;
294 }
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.

262 {
263  // Clear any pending interrupts.
264  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFHWIFG) = 0x0;
265 
266  // Enable the masked interrupts
267  HWREG(RFC_DBELL_BASE + RFC_DBELL_O_RFHWIEN) |= ui32Mask;
268 }
uint32_t RFCHWIntGetAndClear ( uint32_t  ui32Mask)

Get and clear HW interrupt flags.

572 {
573  uint32_t ui32Ifg = HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFHWIFG) & ui32Mask;
574 
575  do {
576  HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFHWIFG) = ~ui32Ifg;
577  } while (HWREG(RFC_DBELL_BASE+RFC_DBELL_O_RFHWIFG) & ui32Ifg);
578 
579  return (ui32Ifg);
580 }
static uint8_t RFCOverrideSearch ( const uint32_t *  pOverride,
const uint32_t  pattern,
const uint32_t  mask 
)
inlinestatic

Function to search top RFC_MAX_SEARCH_DEPTH (5) overrides.

354 {
355  uint8_t override_index;
356 
357  // Search top overrides for RTRIM
358  for(override_index = 0; override_index < RFC_MAX_SEARCH_DEPTH; override_index++)
359  {
360  if((pOverride[override_index] & mask) == pattern)
361  {
362  return override_index;
363  }
364  }
365  return 0xFF;
366 }
#define RFC_MAX_SEARCH_DEPTH
Definition: rfc.h:81
uint8_t RFCOverrideUpdate ( rfc_radioOp_t pOpSetup,
uint32_t *  pParams 
)

Function to update override list.

438 {
439  int32_t divider;
440  uint32_t fcfg1_rtrim;
441  uint32_t *pOverride;
442  int32_t override_index;
443  uint32_t override_value;
444  uint32_t override_rtrim = 0;
445 
446  // Check which setup command is used
447  switch (pOpSetup->commandNo)
448  {
449  case CMD_RADIO_SETUP:
450  divider = ((rfc_CMD_RADIO_SETUP_t *)pOpSetup)->loDivider;
451  pOverride = ((rfc_CMD_RADIO_SETUP_t *)pOpSetup)->pRegOverride;
452  break;
454  divider = 2;
455  pOverride = ((rfc_CMD_PROP_RADIO_SETUP_t *)pOpSetup)->pRegOverride;
456  break;
458  divider = ((rfc_CMD_PROP_RADIO_DIV_SETUP_t *)pOpSetup)->loDivider;
459  pOverride = ((rfc_CMD_PROP_RADIO_DIV_SETUP_t *)pOpSetup)->pRegOverride;
460  break;
461  default:
462  return 1;
463  }
464 
465  if (pOverride == 0)
466  {
467  // Did not find override, return
468  return 1;
469  }
470 
471 
472  // Search top 5 overrides for RTRIM
473  for(override_index = 0; override_index < 5; override_index++)
474  {
475  override_value = pOverride[override_index];
476  if((override_value & 0xFFFF) == 0x4038)
477  {
478  override_rtrim = (override_value & 0xF0000) >> 16;
479  break;
480  }
481  }
482 
483  if (override_rtrim == 0)
484  {
485  // Did not find override, return
486  return 1;
487  }
488 
489  // Read trim from FCFG1
490  switch (divider)
491  {
492  case 2:
493  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC)
495  break;
496  case 5:
497  // Legacy
498  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_MISC_OTP_DATA)
500  break;
501  case 6:
502  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV6)
504  break;
505  case 10:
506  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV10)
508  break;
509  case 12:
510  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV12)
512  break;
513  case 15:
514  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV15)
516  break;
517  case 30:
518  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV30)
520  break;
521  default:
522  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC)
524  break;
525  }
526 
527  // Check for early samples
528  if(fcfg1_rtrim == 0xF)
529  {
530  // set default
531  switch (divider)
532  {
533  case 5:
534  case 10:
535  case 15:
536  case 30:
537  pOverride[override_index] = (override_value & 0xFFF0FFFF) | (0x7 << 16);
538  break;
539  case 2:
540  case 6:
541  case 12:
542  default:
543  pOverride[override_index] = (override_value & 0xFFF0FFFF) | (0x4 << 16);
544  break;
545  }
546  }
547  else
548  {
549  // Test Override vs FCFG1 limit.
550  if(override_rtrim >= fcfg1_rtrim)
551  {
552  // Do nothing
553  ;
554  }
555  else
556  {
557  // Set override to FCFG1 limit value
558  pOverride[override_index] = (override_value & 0xFFF0FFFF) | (fcfg1_rtrim << 16);
559  }
560  }
561  return 0;
562 }
#define CMD_PROP_RADIO_SETUP
Definition: rf_prop_cmd.h:447
struct __RFC_STRUCT rfc_CMD_PROP_RADIO_DIV_SETUP_s rfc_CMD_PROP_RADIO_DIV_SETUP_t
Definition: rf_prop_cmd.h:67
struct __RFC_STRUCT rfc_CMD_RADIO_SETUP_s rfc_CMD_RADIO_SETUP_t
Definition: rf_common_cmd.h:62
#define CMD_PROP_RADIO_DIV_SETUP
Definition: rf_prop_cmd.h:541
struct __RFC_STRUCT rfc_CMD_PROP_RADIO_SETUP_s rfc_CMD_PROP_RADIO_SETUP_t
Definition: rf_prop_cmd.h:66
#define CMD_RADIO_SETUP
Definition: rf_common_cmd.h:163
void RFCRfTrimRead ( rfc_radioOp_t pOpSetup,
rfTrim_t rfTrim 
)

Read RF trim from flash using CM3.

174 {
175  int divider;
176  // Check which setup command is used
177  switch (pOpSetup->commandNo)
178  {
179  case CMD_RADIO_SETUP:
180  divider = ((rfc_CMD_RADIO_SETUP_t *)pOpSetup)->loDivider;
181  break;
183  divider = ((rfc_CMD_PROP_RADIO_DIV_SETUP_t *)pOpSetup)->loDivider;
184  break;
185  default:
186  divider = 0; // Use 2.4 GHz
187  break;
188  }
189 
190  // Read trim from FCFG1
191  pRfTrim->configIfAdc = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_IF_ADC);
192  switch (divider)
193  {
194  case 5:
195  pRfTrim->configRfFrontend = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_RF_FRONTEND_DIV5);
196  pRfTrim->configSynth = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_SYNTH_DIV5);
197  pRfTrim->configMiscAdc = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV5)
199  break;
200 
201  case 6:
202  pRfTrim->configRfFrontend = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_RF_FRONTEND_DIV6);
203  pRfTrim->configSynth = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_SYNTH_DIV6);
204  pRfTrim->configMiscAdc = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV6)
206  break;
207 
208  case 10:
209  pRfTrim->configRfFrontend = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_RF_FRONTEND_DIV10);
210  pRfTrim->configSynth = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_SYNTH_DIV10);
211  pRfTrim->configMiscAdc = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV10)
213  break;
214 
215  case 12:
216  pRfTrim->configRfFrontend = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_RF_FRONTEND_DIV12);
217  pRfTrim->configSynth = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_SYNTH_DIV12);
218  pRfTrim->configMiscAdc = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV12)
220  break;
221 
222  case 15:
223  pRfTrim->configRfFrontend = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_RF_FRONTEND_DIV15);
224  pRfTrim->configSynth = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_SYNTH_DIV15);
225  pRfTrim->configMiscAdc = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV15)
227  break;
228 
229  case 30:
230  pRfTrim->configRfFrontend = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_RF_FRONTEND_DIV30);
231  pRfTrim->configSynth = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_SYNTH_DIV30);
232  pRfTrim->configMiscAdc = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV30)
234  break;
235 
236  default:
237  pRfTrim->configRfFrontend = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_RF_FRONTEND);
238  pRfTrim->configSynth = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_SYNTH);
239  // Make sure configMiscAdc is not 0 by setting an unused bit to 1
240  pRfTrim->configMiscAdc = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC)
242  break;
243  }
244 }
struct __RFC_STRUCT rfc_CMD_PROP_RADIO_DIV_SETUP_s rfc_CMD_PROP_RADIO_DIV_SETUP_t
Definition: rf_prop_cmd.h:67
struct __RFC_STRUCT rfc_CMD_RADIO_SETUP_s rfc_CMD_RADIO_SETUP_t
Definition: rf_common_cmd.h:62
#define CMD_PROP_RADIO_DIV_SETUP
Definition: rf_prop_cmd.h:541
#define CONFIG_MISC_ADC_DIVIDER_BM
Definition: rfc.c:82
#define CONFIG_MISC_ADC_DIVIDER
Definition: rfc.c:81
#define CMD_RADIO_SETUP
Definition: rf_common_cmd.h:163
void RFCRfTrimSet ( rfTrim_t rfTrim)

Write preloaded RF trim values to CM0.

385 {
386  memcpy((void*)&HWREG(0x21000018), (void*)pRfTrim, sizeof(rfTrim_t));
387 }
Definition: rfc.h:73
void RFCRTrim ( rfc_radioOp_t pOpSetup)

Check Override RTrim vs FCFG RTrim.

253 {
254  int32_t divider;
255  uint32_t fcfg1_rtrim;
256  uint32_t *pOverride;
257  int32_t override_index;
258  uint32_t override_value;
259  uint32_t override_rtrim = 0;
260 
261  // Check which setup command is used
262  switch (pOpSetup->commandNo)
263  {
264  case CMD_RADIO_SETUP:
265  divider = ((rfc_CMD_RADIO_SETUP_t *)pOpSetup)->loDivider;
266  pOverride = ((rfc_CMD_RADIO_SETUP_t *)pOpSetup)->pRegOverride;
267  break;
269  divider = 2;
270  pOverride = ((rfc_CMD_PROP_RADIO_SETUP_t *)pOpSetup)->pRegOverride;
271  break;
273  divider = ((rfc_CMD_PROP_RADIO_DIV_SETUP_t *)pOpSetup)->loDivider;
274  pOverride = ((rfc_CMD_PROP_RADIO_DIV_SETUP_t *)pOpSetup)->pRegOverride;
275  break;
276  default:
277  return;
278  }
279 
280  if (pOverride == 0)
281  {
282  // Did not find override, return
283  return;
284  }
285 
286 
287  // Search top 5 overrides for RTRIM
288  for(override_index = 0; override_index < 5; override_index++)
289  {
290  override_value = pOverride[override_index];
291  if((override_value & 0xFFFF) == 0x4038)
292  {
293  override_rtrim = (override_value & 0xF0000) >> 16;
294  break;
295  }
296  }
297 
298  if (override_rtrim == 0)
299  {
300  // Did not find override, return
301  return;
302  }
303 
304  // Read trim from FCFG1
305  switch (divider)
306  {
307  case 2:
308  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC)
310  break;
311  case 5:
312  // Legacy
313  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_MISC_OTP_DATA)
315  break;
316  case 6:
317  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV6)
319  break;
320  case 10:
321  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV10)
323  break;
324  case 12:
325  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV12)
327  break;
328  case 15:
329  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV15)
331  break;
332  case 30:
333  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC_DIV30)
335  break;
336  default:
337  fcfg1_rtrim = (HWREG(FCFG1_BASE + FCFG1_O_CONFIG_MISC_ADC)
339  break;
340  }
341 
342  // Check for early samples
343  if(fcfg1_rtrim == 0xF)
344  {
345  // set default
346  switch (divider)
347  {
348  case 5:
349  case 10:
350  case 15:
351  case 30:
352  pOverride[override_index] = (override_value & 0xFFF0FFFF) | (0x7 << 16);
353  break;
354  case 2:
355  case 6:
356  case 12:
357  default:
358  pOverride[override_index] = (override_value & 0xFFF0FFFF) | (0x4 << 16);
359  break;
360  }
361  }
362  else
363  {
364  // Test Override vs FCFG1 limit.
365  if(override_rtrim >= fcfg1_rtrim)
366  {
367  // Do nothing
368  ;
369  }
370  else
371  {
372  // Set override to FCFG1 limit value
373  pOverride[override_index] = (override_value & 0xFFF0FFFF) | (fcfg1_rtrim << 16);
374  }
375  }
376 }
#define CMD_PROP_RADIO_SETUP
Definition: rf_prop_cmd.h:447
struct __RFC_STRUCT rfc_CMD_PROP_RADIO_DIV_SETUP_s rfc_CMD_PROP_RADIO_DIV_SETUP_t
Definition: rf_prop_cmd.h:67
struct __RFC_STRUCT rfc_CMD_RADIO_SETUP_s rfc_CMD_RADIO_SETUP_t
Definition: rf_common_cmd.h:62
#define CMD_PROP_RADIO_DIV_SETUP
Definition: rf_prop_cmd.h:541
struct __RFC_STRUCT rfc_CMD_PROP_RADIO_SETUP_s rfc_CMD_PROP_RADIO_SETUP_t
Definition: rf_prop_cmd.h:66
#define CMD_RADIO_SETUP
Definition: rf_common_cmd.h:163
void RFCSynthPowerDown ( void  )

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

152 {
153  // Disable CPE clock, enable FSCA clock. NOTE: Radio will no longer respond to commands!
154  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;
155 
156  HWREG(RFC_RESERVED0) = 3;
157  HWREG(RFC_RESERVED1) = 0x1030;
158  HWREG(RFC_RESERVED2) = 1;
159  HWREG(RFC_RESERVED1) = 0x50;
160  HWREG(RFC_RESERVED2) = 1;
161  HWREG(RFC_RESERVED1) = 0x650;
162  HWREG(RFC_RESERVED2) = 1;
163  HWREG(RFC_RESERVED3) = 1;
164 
165 }
#define RFC_RESERVED0
Definition: rfc.c:71
#define RFC_RESERVED3
Definition: rfc.c:74
#define RFC_RESERVED2
Definition: rfc.c:73
#define RFC_RESERVED1
Definition: rfc.c:72

Macro Definition Documentation

#define RFC_MAX_SEARCH_DEPTH   5

Referenced by RFCOverrideSearch().