CC26xx Driver Library
[prcm.h] Power Reset Clock Manager

Functions

void PRCMInfClockConfigureSet (uint32_t ui32ClkDiv, uint32_t ui32PowerMode)
 Configure the infrastructure clock. More...
 
uint32_t PRCMInfClockConfigureGet (uint32_t ui32PowerMode)
 Use this function to get the infrastructure clock configuration. More...
 
static void PRCMMcuUldoConfigure (uint32_t ui32Enable)
 Assert or de-assert a request for the uLDO. More...
 
static void PRCMGPTimerClockDivisionSet (uint32_t clkDiv)
 Setup the clock division factor for the GP-Timer domain. More...
 
static uint32_t PRCMGPTimerClockDivisionGet (void)
 Get the clock division factor for the GP-Timer domain. More...
 
static void PRCMAudioClockEnable (void)
 Enable the audio clock generation. More...
 
static void PRCMAudioClockDisable (void)
 Disable the audio clock generation. More...
 
void PRCMAudioClockConfigSet (uint32_t ui32ClkConfig, uint32_t ui32SampleRate)
 Configure the audio clock generation. More...
 
void PRCMAudioClockConfigSetOverride (uint32_t ui32ClkConfig, uint32_t ui32MstDiv, uint32_t ui32BitDiv, uint32_t ui32WordDiv)
 Configure the audio clock generation with manual setting of clock divider. More...
 
void PRCMAudioClockConfigOverride (uint8_t ui8SamplingEdge, uint8_t ui8WCLKPhase, uint32_t ui32MstDiv, uint32_t ui32BitDiv, uint32_t ui32WordDiv)
 Configure the audio clocks for I2S module. More...
 
void PRCMAudioClockInternalSource (void)
 Configure the audio clocks to be internally generated. More...
 
void PRCMAudioClockExternalSource (void)
 Configure the audio clocks to be externally generated. More...
 
static void PRCMLoadSet (void)
 Use this function to synchronize the load settings. More...
 
static bool PRCMLoadGet (void)
 Check if any of the load sensitive register has been updated. More...
 
static void PRCMDomainEnable (uint32_t ui32Domains)
 Enable clock domains in the MCU voltage domain. More...
 
static void PRCMDomainDisable (uint32_t ui32Domains)
 Disable clock domains in the MCU voltage domain. More...
 
void PRCMPowerDomainOn (uint32_t ui32Domains)
 Turn power on in power domains in the MCU domain. More...
 
void PRCMPowerDomainOff (uint32_t ui32Domains)
 Turn off a specific power domain. More...
 
static void PRCMRfPowerDownWhenIdle (void)
 Configure RF core to power down when idle. More...
 
void PRCMPeripheralRunEnable (uint32_t ui32Peripheral)
 Enables a peripheral in Run mode. More...
 
void PRCMPeripheralRunDisable (uint32_t ui32Peripheral)
 Disables a peripheral in Run mode. More...
 
void PRCMPeripheralSleepEnable (uint32_t ui32Peripheral)
 Enables a peripheral in sleep mode. More...
 
void PRCMPeripheralSleepDisable (uint32_t ui32Peripheral)
 Disables a peripheral in sleep mode. More...
 
void PRCMPeripheralDeepSleepEnable (uint32_t ui32Peripheral)
 Enables a peripheral in deep-sleep mode. More...
 
void PRCMPeripheralDeepSleepDisable (uint32_t ui32Peripheral)
 Disables a peripheral in deep-sleep mode. More...
 
uint32_t PRCMPowerDomainsAllOff (uint32_t ui32Domains)
 Get the status for a specific power domain. More...
 
uint32_t PRCMPowerDomainsAllOn (uint32_t ui32Domains)
 Get the status for a specific power domain. More...
 
static bool PRCMRfReady (void)
 Return the access status of the RF Core. More...
 
static void PRCMSleep (void)
 Put the processor into sleep mode. More...
 
void PRCMDeepSleep (void)
 Put the processor into deep-sleep mode. More...
 
static void PRCMCacheRetentionEnable (void)
 Enable CACHE RAM retention. More...
 
static void PRCMCacheRetentionDisable (void)
 Disable CACHE RAM retention. More...
 

Detailed Description

Function Documentation

§ PRCMAudioClockConfigOverride()

void PRCMAudioClockConfigOverride ( uint8_t  ui8SamplingEdge,
uint8_t  ui8WCLKPhase,
uint32_t  ui32MstDiv,
uint32_t  ui32BitDiv,
uint32_t  ui32WordDiv 
)

Configure the audio clocks for I2S module.

Note
See hardware documentation before setting audio clock dividers. This is user's responsability to provide valid clock dividers.
Parameters
ui8SamplingEdgeDefine the clock polarity:
ui8WCLKPhaseDefine I2S phase used
  • PRCM_I2S_WCLK_SINGLE_PHASE
  • PRCM_I2S_WCLK_DUAL_PHASE
  • PRCM_I2S_WCLK_USER_DEF
ui32MstDivis the desired master clock divider.
ui32BitDivis the desired bit clock divider.
ui32WordDivis the desired word clock divider.
Returns
None

Referenced by PRCMAudioClockDisable().

370 {
371  // Check the arguments.
372  ASSERT( ui8BitsPerSample == PRCM_WCLK_SINGLE_PHASE
373  || ui8BitsPerSample == PRCM_WCLK_DUAL_PHASE
374  || ui8BitsPerSample == PRCM_WCLK_USER_DEF);
375 
376  // Make sure the audio clock generation is disabled before reconfiguring.
378 
379  // Make sure to compensate the Frame clock division factor if using single
380  // phase format.
381  if((ui8WCLKPhase) == PRCM_WCLK_SINGLE_PHASE)
382  {
383  ui32WordDiv -= 1;
384  }
385 
386  // Write the clock division factors.
387  HWREG(PRCM_BASE + PRCM_O_I2SMCLKDIV) = ui32MstDiv;
388  HWREG(PRCM_BASE + PRCM_O_I2SBCLKDIV) = ui32BitDiv;
389  HWREG(PRCM_BASE + PRCM_O_I2SWCLKDIV) = ui32WordDiv;
390 
391  // Configure the Word clock format and polarity and enable it.
392  HWREG(PRCM_BASE + PRCM_O_I2SCLKCTL) = (ui8SamplingEdge << PRCM_I2SCLKCTL_SMPL_ON_POSEDGE_S) |
393  (ui8WCLKPhase << PRCM_I2SCLKCTL_WCLK_PHASE_S ) |
394  (1 << PRCM_I2SCLKCTL_EN_S );
395 }
#define PRCM_WCLK_DUAL_PHASE
Definition: prcm.h:174
#define PRCM_WCLK_USER_DEF
Definition: prcm.h:175
#define PRCM_WCLK_SINGLE_PHASE
Definition: prcm.h:173
#define ASSERT(expr)
Definition: debug.h:73
static void PRCMAudioClockDisable(void)
Disable the audio clock generation.
Definition: prcm.h:430
Here is the call graph for this function:

§ PRCMAudioClockConfigSet()

void PRCMAudioClockConfigSet ( uint32_t  ui32ClkConfig,
uint32_t  ui32SampleRate 
)

Configure the audio clock generation.

Deprecated:
This function will be removed in a future release.

Use this function to set the sample rate when using internal audio clock generation for the I2S module.

Note
While other clocks are possible, the stability of the four sample rates defined here are only guaranteed if the clock input to the I2S module is 48MHz.
Parameters
ui32ClkConfigis the audio clock configuration. The parameter is a bitwise OR'ed value consisting of:
ui32SampleRateis the desired audio clock sample rate. The supported sample rate configurations are:
Returns
None
See also
PRCMAudioClockConfigSetOverride()

Referenced by PRCMAudioClockDisable().

261 {
262  uint32_t ui32Reg;
263  uint32_t ui32MstDiv;
264  uint32_t ui32BitDiv;
265  uint32_t ui32WordDiv;
266 
267  // Check the arguments.
269  ASSERT((ui32SampleRate == I2S_SAMPLE_RATE_16K) ||
270  (ui32SampleRate == I2S_SAMPLE_RATE_24K) ||
271  (ui32SampleRate == I2S_SAMPLE_RATE_32K) ||
272  (ui32SampleRate == I2S_SAMPLE_RATE_48K));
273 
274  ui32MstDiv = 0;
275  ui32BitDiv = 0;
276  ui32WordDiv = 0;
277 
278  // Make sure the audio clock generation is disabled before reconfiguring.
280 
281  // Define the clock division factors for the audio interface.
282  switch(ui32SampleRate)
283  {
284  case I2S_SAMPLE_RATE_16K :
285  ui32MstDiv = 6;
286  ui32BitDiv = 60;
287  ui32WordDiv = 25;
288  break;
289  case I2S_SAMPLE_RATE_24K :
290  ui32MstDiv = 4;
291  ui32BitDiv = 40;
292  ui32WordDiv = 25;
293  break;
294  case I2S_SAMPLE_RATE_32K :
295  ui32MstDiv = 3;
296  ui32BitDiv = 30;
297  ui32WordDiv = 25;
298  break;
299  case I2S_SAMPLE_RATE_48K :
300  ui32MstDiv = 2;
301  ui32BitDiv = 20;
302  ui32WordDiv = 25;
303  break;
304  }
305 
306  // Make sure to compensate the Frame clock division factor if using single
307  // phase format.
308  if((ui32ClkConfig & PRCM_I2SCLKCTL_WCLK_PHASE_M) == PRCM_WCLK_SINGLE_PHASE)
309  {
310  ui32WordDiv -= 1;
311  }
312 
313  // Write the clock division factors.
314  HWREG(PRCM_BASE + PRCM_O_I2SMCLKDIV) = ui32MstDiv;
315  HWREG(PRCM_BASE + PRCM_O_I2SBCLKDIV) = ui32BitDiv;
316  HWREG(PRCM_BASE + PRCM_O_I2SWCLKDIV) = ui32WordDiv;
317 
318  // Configure the Word clock format and polarity.
321  HWREG(PRCM_BASE + PRCM_O_I2SCLKCTL) = ui32Reg | ui32ClkConfig;
322 }
#define I2S_SAMPLE_RATE_48K
Definition: prcm.h:185
#define I2S_SAMPLE_RATE_16K
Definition: prcm.h:182
#define I2S_SAMPLE_RATE_24K
Definition: prcm.h:183
#define PRCM_WCLK_SINGLE_PHASE
Definition: prcm.h:173
#define I2S_SAMPLE_RATE_32K
Definition: prcm.h:184
#define ASSERT(expr)
Definition: debug.h:73
static void PRCMAudioClockDisable(void)
Disable the audio clock generation.
Definition: prcm.h:430
Here is the call graph for this function:

§ PRCMAudioClockConfigSetOverride()

void PRCMAudioClockConfigSetOverride ( uint32_t  ui32ClkConfig,
uint32_t  ui32MstDiv,
uint32_t  ui32BitDiv,
uint32_t  ui32WordDiv 
)

Configure the audio clock generation with manual setting of clock divider.

Deprecated:
This function will be removed in a future release.

Use this function to set the audio clock divider values manually.

Note
See hardware documentation before setting audio clock dividers manually.
Parameters
ui32ClkConfigis the audio clock configuration. The parameter is a bitwise OR'ed value consisting of:
ui32MstDivis the desired master clock divider.
ui32WordDivis the desired word clock divider.
ui32BitDivis the desired bit clock divider.
Returns
None
See also
PRCMAudioClockConfigSet()

Referenced by PRCMAudioClockDisable().

332 {
333  uint32_t ui32Reg;
334 
335  // Check the arguments.
337 
338  // Make sure the audio clock generation is disabled before reconfiguring.
340 
341  // Make sure to compensate the Frame clock division factor if using single
342  // phase format.
343  if((ui32ClkConfig & PRCM_I2SCLKCTL_WCLK_PHASE_M) == PRCM_WCLK_SINGLE_PHASE)
344  {
345  ui32WordDiv -= 1;
346  }
347 
348  // Write the clock division factors.
349  HWREG(PRCM_BASE + PRCM_O_I2SMCLKDIV) = ui32MstDiv;
350  HWREG(PRCM_BASE + PRCM_O_I2SBCLKDIV) = ui32BitDiv;
351  HWREG(PRCM_BASE + PRCM_O_I2SWCLKDIV) = ui32WordDiv;
352 
353  // Configure the Word clock format and polarity.
356  HWREG(PRCM_BASE + PRCM_O_I2SCLKCTL) = ui32Reg | ui32ClkConfig;
357 }
#define PRCM_WCLK_SINGLE_PHASE
Definition: prcm.h:173
#define ASSERT(expr)
Definition: debug.h:73
static void PRCMAudioClockDisable(void)
Disable the audio clock generation.
Definition: prcm.h:430
Here is the call graph for this function:

§ PRCMAudioClockDisable()

static void PRCMAudioClockDisable ( void  )
inlinestatic

Disable the audio clock generation.

Use this function to disable the audio clock generation.

Returns
None

Referenced by PRCMAudioClockConfigOverride(), PRCMAudioClockConfigSet(), and PRCMAudioClockConfigSetOverride().

431 {
432  // Disable the audio clock generation
434 }
Here is the call graph for this function:

§ PRCMAudioClockEnable()

static void PRCMAudioClockEnable ( void  )
inlinestatic

Enable the audio clock generation.

Use this function to enable the audio clock generation.

Returns
None
415 {
416  // Enable the audio clock generation.
418 }

§ PRCMAudioClockExternalSource()

void PRCMAudioClockExternalSource ( void  )

Configure the audio clocks to be externally generated.

Use this function to set the audio clocks as external.

Returns
None
See also
PRCMAudioClockInternalSource()

Referenced by PRCMAudioClockDisable().

413 {
414  HWREG(PRCM_BASE + PRCM_O_I2SBCLKSEL) = 0;
415 }

§ PRCMAudioClockInternalSource()

void PRCMAudioClockInternalSource ( void  )

Configure the audio clocks to be internally generated.

Use this function to set the audio clocks as internal.

Returns
None
See also
PRCMAudioClockExternalSource()

Referenced by PRCMAudioClockDisable().

403 {
405 }

§ PRCMCacheRetentionDisable()

static void PRCMCacheRetentionDisable ( void  )
inlinestatic

Disable CACHE RAM retention.

Disables CACHE RAM retention on both VIMS_TRAM and VIMS_CRAM

Returns
None

Referenced by SysCtrlStandby().

1160 {
1162 }

§ PRCMCacheRetentionEnable()

static void PRCMCacheRetentionEnable ( void  )
inlinestatic

Enable CACHE RAM retention.

Enables CACHE RAM retention on both VIMS_TRAM and VIMS_CRAM

Returns
None

Referenced by SysCtrlIdle().

1145 {
1147 }

§ PRCMDeepSleep()

void PRCMDeepSleep ( void  )

Put the processor into deep-sleep mode.

This function places the processor into deep-sleep mode; it does not return until the processor returns to run mode. The peripherals that are enabled via PRCMPeripheralDeepSleepEnable() continue to operate and can wake up the processor.

Returns
None
See also
PRCMPeripheralDeepSleepEnable()

Referenced by PRCMSleep(), SysCtrlIdle(), and SysCtrlStandby().

681 {
682  // Enable deep-sleep.
683  HWREG(NVIC_SYS_CTRL) |= NVIC_SYS_CTRL_SLEEPDEEP;
684 
685  // Wait for an interrupt.
686  CPUwfi();
687 
688  // Disable deep-sleep so that a future sleep will work correctly.
689  HWREG(NVIC_SYS_CTRL) &= ~(NVIC_SYS_CTRL_SLEEPDEEP);
690 }
static void CPUwfi(void)
Wait for interrupt.
Definition: cpu.h:193
Here is the call graph for this function:

§ PRCMDomainDisable()

static void PRCMDomainDisable ( uint32_t  ui32Domains)
inlinestatic

Disable clock domains in the MCU voltage domain.

Note
A call to this function will only setup the shadow registers in the MCU domain for the PRCM module. For the changes to propagate to the system controller in the AON domain a call to this function should always be followed by a call to PRCMLoadSet().
Clocks will only be running if the domain is powered.
Parameters
ui32Domainsis a bit mask containing the clock domains to disable. The independent clock domains inside the MCU voltage domain are:
Returns
None
See also
PRCMDomainEnable()
674 {
675  // Check the arguments.
676  ASSERT((ui32Domains & PRCM_DOMAIN_RFCORE) ||
677  (ui32Domains & PRCM_DOMAIN_VIMS));
678 
679  // Disable the power domains.
680  if(ui32Domains & PRCM_DOMAIN_RFCORE)
681  {
682  HWREG(PRCM_BASE + PRCM_O_RFCCLKG) = 0x0;
683  }
684  if(ui32Domains & PRCM_DOMAIN_VIMS)
685  {
686  HWREG(PRCM_BASE + PRCM_O_VIMSCLKG) = 0x0;
687  }
688 }
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:146
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:138
Here is the call graph for this function:

§ PRCMDomainEnable()

static void PRCMDomainEnable ( uint32_t  ui32Domains)
inlinestatic

Enable clock domains in the MCU voltage domain.

Note
A call to this function will only setup the shadow registers in the MCU domain for the PRCM module. For the changes to propagate to the system controller in the AON domain a call to this function should always be followed by a call to PRCMLoadSet().
Clocks will only be running if the domain is powered.
Parameters
ui32Domainsis a bit mask containing the clock domains to enable. The independent clock domains inside the MCU voltage domain which can be configured are:
Returns
None
635 {
636  // Check the arguments.
637  ASSERT((ui32Domains & PRCM_DOMAIN_RFCORE) ||
638  (ui32Domains & PRCM_DOMAIN_VIMS));
639 
640  // Enable the clock domain(s).
641  if(ui32Domains & PRCM_DOMAIN_RFCORE)
642  {
644  }
645  if(ui32Domains & PRCM_DOMAIN_VIMS)
646  {
648  }
649 }
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:146
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:138

§ PRCMGPTimerClockDivisionGet()

static uint32_t PRCMGPTimerClockDivisionGet ( void  )
inlinestatic

Get the clock division factor for the GP-Timer domain.

Use this function to get the clock division factor set for the GP-Timer.

Returns
Returns one of the following values:
See also
PRCMGPTimerClockDivisionSet()
399 {
400  return ( HWREG( PRCM_BASE + PRCM_O_GPTCLKDIV ));
401 }

§ PRCMGPTimerClockDivisionSet()

static void PRCMGPTimerClockDivisionSet ( uint32_t  clkDiv)
inlinestatic

Setup the clock division factor for the GP-Timer domain.

Use this function to set up the clock division factor on the GP-Timer.

The division rate will be constant and ungated for Run / Sleep / DeepSleep mode when it is slower than PRCM_GPTCLKDIV_RATIO setting. When set faster than PRCM_GPTCLKDIV_RATIO setting PRCM_GPTCLKDIV_RATIO will be used. Note that the register will contain the written content even though the setting is faster than PRCM_GPTCLKDIV_RATIO setting.

Note
For change to take effect, PRCMLoadSet() needs to be called
Parameters
clkDivis the division factor to set. The argument must be only one of the following values:
Returns
None
See also
PRCMGPTimerClockDivisionGet()
371 {
372  ASSERT( clkDiv <= PRCM_GPTCLKDIV_RATIO_DIV256 );
373 
374  HWREG( PRCM_BASE + PRCM_O_GPTCLKDIV ) = clkDiv;
375 }
#define ASSERT(expr)
Definition: debug.h:73

§ PRCMInfClockConfigureGet()

uint32_t PRCMInfClockConfigureGet ( uint32_t  ui32PowerMode)

Use this function to get the infrastructure clock configuration.

Parameters
ui32PowerModedetermines which System CPU power mode to return the infrastructure clock division ratio for. The three allowed power modes are:
Returns
Returns the infrastructure clock division factor for the specified power mode.
See also
PRCMInfClockConfigureSet().
205 {
206  uint32_t ui32ClkDiv;
207  uint32_t ui32Divisor;
208 
209  // Check the arguments.
210  ASSERT((ui32PowerMode == PRCM_RUN_MODE) ||
211  (ui32PowerMode == PRCM_SLEEP_MODE) ||
212  (ui32PowerMode == PRCM_DEEP_SLEEP_MODE));
213 
214  ui32ClkDiv = 0;
215  ui32Divisor = 0;
216 
217  // Determine the correct power mode.
218  if(ui32PowerMode == PRCM_RUN_MODE)
219  {
220  ui32ClkDiv = HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVR);
221  }
222  else if(ui32PowerMode == PRCM_SLEEP_MODE)
223  {
224  ui32ClkDiv = HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVS);
225  }
226  else if(ui32PowerMode == PRCM_DEEP_SLEEP_MODE)
227  {
228  ui32ClkDiv = HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVDS);
229  }
230 
231  // Find the correct division factor.
232  if(ui32ClkDiv == 0x0)
233  {
234  ui32Divisor = PRCM_CLOCK_DIV_1;
235  }
236  else if(ui32ClkDiv == 0x1)
237  {
238  ui32Divisor = PRCM_CLOCK_DIV_2;
239  }
240  else if(ui32ClkDiv == 0x2)
241  {
242  ui32Divisor = PRCM_CLOCK_DIV_8;
243  }
244  else if(ui32ClkDiv == 0x3)
245  {
246  ui32Divisor = PRCM_CLOCK_DIV_32;
247  }
248 
249  // Return the clock division factor.
250  return ui32Divisor;
251 }
#define PRCM_DEEP_SLEEP_MODE
Definition: prcm.h:115
#define PRCM_CLOCK_DIV_8
Definition: prcm.h:125
#define PRCM_CLOCK_DIV_32
Definition: prcm.h:127
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_SLEEP_MODE
Definition: prcm.h:114
#define PRCM_CLOCK_DIV_1
Definition: prcm.h:122
#define PRCM_CLOCK_DIV_2
Definition: prcm.h:123
#define PRCM_RUN_MODE
Definition: prcm.h:113

§ PRCMInfClockConfigureSet()

void PRCMInfClockConfigureSet ( uint32_t  ui32ClkDiv,
uint32_t  ui32PowerMode 
)

Configure the infrastructure clock.

Each System CPU power mode has its own infrastructure clock division factor. This function can be used for setting up the division factor for the infrastructure clock in the available power modes for the System CPU. The infrastructure clock is used for all internal logic in the PRCM, and is always running as long as power is on in the MCU voltage domain. This can be enabled and disabled from the AON Wake Up Controller.

Note
If source clock is 48 MHz, minimum clock divider is PRCM_CLOCK_DIV_2.
Parameters
ui32ClkDivdetermines the division ratio for the infrastructure clock when the device is in the specified mode. Allowed division factors for all three System CPU power modes are:
ui32PowerModedetermines the System CPU operation mode for which to modify the clock division factor. The three allowed power modes are:
Returns
None
151 {
152  uint32_t ui32Divisor;
153 
154  // Check the arguments.
155  ASSERT((ui32ClkDiv == PRCM_CLOCK_DIV_1) ||
156  (ui32ClkDiv == PRCM_CLOCK_DIV_2) ||
157  (ui32ClkDiv == PRCM_CLOCK_DIV_8) ||
158  (ui32ClkDiv == PRCM_CLOCK_DIV_32));
159  ASSERT((ui32PowerMode == PRCM_RUN_MODE) ||
160  (ui32PowerMode == PRCM_SLEEP_MODE) ||
161  (ui32PowerMode == PRCM_DEEP_SLEEP_MODE));
162 
163  ui32Divisor = 0;
164 
165  // Find the correct division factor.
166  if(ui32ClkDiv == PRCM_CLOCK_DIV_1)
167  {
168  ui32Divisor = 0x0;
169  }
170  else if(ui32ClkDiv == PRCM_CLOCK_DIV_2)
171  {
172  ui32Divisor = 0x1;
173  }
174  else if(ui32ClkDiv == PRCM_CLOCK_DIV_8)
175  {
176  ui32Divisor = 0x2;
177  }
178  else if(ui32ClkDiv == PRCM_CLOCK_DIV_32)
179  {
180  ui32Divisor = 0x3;
181  }
182 
183  // Determine the correct power mode set the division factor accordingly.
184  if(ui32PowerMode == PRCM_RUN_MODE)
185  {
186  HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVR) = ui32Divisor;
187  }
188  else if(ui32PowerMode == PRCM_SLEEP_MODE)
189  {
190  HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVS) = ui32Divisor;
191  }
192  else if(ui32PowerMode == PRCM_DEEP_SLEEP_MODE)
193  {
194  HWREG(PRCM_BASE + PRCM_O_INFRCLKDIVDS) = ui32Divisor;
195  }
196 }
#define PRCM_DEEP_SLEEP_MODE
Definition: prcm.h:115
#define PRCM_CLOCK_DIV_8
Definition: prcm.h:125
#define PRCM_CLOCK_DIV_32
Definition: prcm.h:127
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_SLEEP_MODE
Definition: prcm.h:114
#define PRCM_CLOCK_DIV_1
Definition: prcm.h:122
#define PRCM_CLOCK_DIV_2
Definition: prcm.h:123
#define PRCM_RUN_MODE
Definition: prcm.h:113

§ PRCMLoadGet()

static bool PRCMLoadGet ( void  )
inlinestatic

Check if any of the load sensitive register has been updated.

Returns
Returns status of the load sensitive register:
  • true : No registers have changed since the last load.
  • false : Any register has changed.
See also
PRCMLoadSet()

Referenced by SysCtrlStandby().

607 {
608  // Return the load status.
610  true : false);
611 }

§ PRCMLoadSet()

static void PRCMLoadSet ( void  )
inlinestatic

Use this function to synchronize the load settings.

Most of the clock settings in the PRCM module should be updated synchronously. This is ensured by the implementation of a load registers that, when written to, will let the previous written update values for all the relevant registers propagate through to hardware.

The functions that require a synchronization of the clock settings are:

Returns
None
See also
PRCMLoadGet()

Referenced by SysCtrlStandby().

589 {
590  // Enable the update of all load related registers.
591  HWREG(PRCM_NONBUF_BASE + PRCM_O_CLKLOADCTL) = PRCM_CLKLOADCTL_LOAD;
592 }

§ PRCMMcuUldoConfigure()

static void PRCMMcuUldoConfigure ( uint32_t  ui32Enable)
inlinestatic

Assert or de-assert a request for the uLDO.

Use this function to request to switch to the micro Low Voltage Dropout regulator (uLDO). The uLDO has a much lower capacity for supplying power to the system. It is therefore imperative and solely the programmers responsibility to ensure that a sufficient amount of peripheral modules have been turned of before requesting a switch to the uLDO.

Note
Asserting this bit has no effect until:
  1. FLASH has accepted to be powered down
  2. Deepsleep must be asserted
Parameters
ui32Enable
  • 0 : Disable uLDO request
  • 1 : Enable uLDO request
Returns
None
See also
PRCMDeepSleep()

Referenced by PowerCtrlSourceSet(), and SysCtrlStandby().

333 {
334  // Enable or disable the uLDO request signal.
335  HWREG(PRCM_BASE + PRCM_O_VDCTL) = ui32Enable;
336 }

§ PRCMPeripheralDeepSleepDisable()

void PRCMPeripheralDeepSleepDisable ( uint32_t  ui32Peripheral)

Disables a peripheral in deep-sleep mode.

This function causes a peripheral to stop operating when the processor goes into deep-sleep mode. Disabling peripherals while in deep-sleep mode helps to lower the current draw of the device, and can keep peripherals that require a particular clock frequency from operating when the clock changes as a result of entering deep-sleep mode. If enabled (via PRCMPeripheralRunEnable()), the peripheral will automatically resume operation when the processor leaves deep-sleep mode, maintaining its entire state from before deep-sleep mode was entered.

Note
A call to this function will only setup the shadow registers in the MCU domain for the PRCM module. For the changes to propagate to the system controller in the AON domain a call to this function should always be followed by a call to PRCMLoadSet().
Parameters
ui32Peripheralis the peripheral to disable in deep-sleep mode. The parameter must be one of the following:
Returns
None
See also
PRCMLoadSet()

Referenced by PRCMRfPowerDownWhenIdle(), and SysCtrlStandby().

583 {
584  // Check the arguments.
585  ASSERT(PRCMPeripheralValid(ui32Peripheral));
586 
587  // Disable this peripheral in Deep Sleep mode.
588  HWREG(PRCM_BASE + g_pui32DCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) &=
589  ~PRCM_PERIPH_MASKBIT(ui32Peripheral);
590 }
static const uint32_t g_pui32DCGCRegs[]
Definition: prcm.c:118
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:141
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:134

§ PRCMPeripheralDeepSleepEnable()

void PRCMPeripheralDeepSleepEnable ( uint32_t  ui32Peripheral)

Enables a peripheral in deep-sleep mode.

This function allows a peripheral to continue operating when the processor goes into deep-sleep mode. Since the clocking configuration of the device may change, not all peripherals can safely continue operating while the processor is in sleep mode. This in turn depends on the chosen power mode. It is the responsibility of the caller to make sensible choices.

Note
A call to this function will only setup the shadow registers in the MCU domain for the PRCM module. For the changes to propagate to the system controller in the AON domain a call to this function should always be followed by a call to PRCMLoadSet().
Parameters
ui32Peripheralis the peripheral to enable in deep-sleep mode. The parameter must be one of the following:
Returns
None
See also
PRCMLoadSet()

Referenced by PRCMRfPowerDownWhenIdle().

567 {
568  // Check the arguments.
569  ASSERT(PRCMPeripheralValid(ui32Peripheral));
570 
571  // Enable this peripheral in deep-sleep mode.
572  HWREG(PRCM_BASE + g_pui32DCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) |=
573  PRCM_PERIPH_MASKBIT(ui32Peripheral);
574 }
static const uint32_t g_pui32DCGCRegs[]
Definition: prcm.c:118
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:141
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:134

§ PRCMPeripheralRunDisable()

void PRCMPeripheralRunDisable ( uint32_t  ui32Peripheral)

Disables a peripheral in Run mode.

Peripherals are disabled with this function. Once disabled, they will not operate or respond to register reads/writes.

Note
A call to this function will only setup the shadow registers in the MCU domain for the PRCM module. For the changes to propagate to the system controller in the AON domain a call to this function should always be followed by a call to PRCMLoadSet().
The actual disabling of the peripheral may be delayed until some time after this function returns. Care should be taken by the user to ensure that the peripheral is not accessed in this interval as this might cause the system to hang.
Parameters
ui32Peripheralis the peripheral to disable. The parameter must be one of the following:
Returns
None
See also
PRCMLoadSet()

Referenced by PRCMRfPowerDownWhenIdle().

519 {
520  // Check the arguments.
521  ASSERT(PRCMPeripheralValid(ui32Peripheral));
522 
523  // Disable module in Run Mode.
524  HWREG(PRCM_BASE + g_pui32RCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) &=
525  ~PRCM_PERIPH_MASKBIT(ui32Peripheral);
526 }
static const uint32_t g_pui32RCGCRegs[]
Definition: prcm.c:94
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:141
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:134

§ PRCMPeripheralRunEnable()

void PRCMPeripheralRunEnable ( uint32_t  ui32Peripheral)

Enables a peripheral in Run mode.

Peripherals are enabled with this function. At power-up, some peripherals are disabled; they must be enabled in order to operate or respond to register reads/writes.

Note
The actual enabling of the peripheral may be delayed until some time after this function returns. Care should be taken to ensure that the peripheral is not accessed until it is enabled. When enabling Timers always make sure that the division factor for the PERBUSCPUCLK is set. This will guarantee that the timers run at a continuous rate even if the SYSBUSCLK is gated.
A call to this function will only setup the shadow registers in the MCU domain for the PRCM module. For the changes to propagate to the system controller in the AON domain a call to this function should always be followed by a call to PRCMLoadSet().
Parameters
ui32Peripheralis the peripheral to enable. The parameter must be one of the following:
Returns
None
See also
PRCMLoadSet()

Referenced by PRCMRfPowerDownWhenIdle().

503 {
504  // Check the arguments.
505  ASSERT(PRCMPeripheralValid(ui32Peripheral));
506 
507  // Enable module in Run Mode.
508  HWREG(PRCM_BASE + g_pui32RCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) |=
509  PRCM_PERIPH_MASKBIT(ui32Peripheral);
510 }
static const uint32_t g_pui32RCGCRegs[]
Definition: prcm.c:94
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:141
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:134

§ PRCMPeripheralSleepDisable()

void PRCMPeripheralSleepDisable ( uint32_t  ui32Peripheral)

Disables a peripheral in sleep mode.

This function causes a peripheral to stop operating when the processor goes into sleep mode. Disabling peripherals while in sleep mode helps to lower the current draw of the device. If enabled (via PRCMPeripheralRunEnable()), the peripheral will automatically resume operation when the processor leaves sleep mode, maintaining its entire state from before sleep mode was entered.

Note
A call to this function will only setup the shadow registers in the MCU domain for the PRCM module. For the changes to propagate to the system controller in the AON domain a call to this function should always be followed by a call to PRCMLoadSet().
Parameters
ui32Peripheralis the peripheral to disable in sleep mode. The parameter must be one of the following:
Returns
None
See also
PRCMLoadSet()

Referenced by PRCMRfPowerDownWhenIdle().

551 {
552  // Check the arguments.
553  ASSERT(PRCMPeripheralValid(ui32Peripheral));
554 
555  // Disable this peripheral in sleep mode
556  HWREG(PRCM_BASE + g_pui32SCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) &=
557  ~PRCM_PERIPH_MASKBIT(ui32Peripheral);
558 }
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:141
static const uint32_t g_pui32SCGCRegs[]
Definition: prcm.c:106
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:134

§ PRCMPeripheralSleepEnable()

void PRCMPeripheralSleepEnable ( uint32_t  ui32Peripheral)

Enables a peripheral in sleep mode.

This function allows a peripheral to continue operating when the processor goes into sleep mode. Since the clocking configuration of the device does not change, any peripheral can safely continue operating while the processor is in sleep mode, and can therefore wake the processor from sleep mode.

Note
A call to this function will only setup the shadow registers in the MCU domain for the PRCM module. For the changes to propagate to the system controller in the AON domain a call to this function should always be followed by a call to PRCMLoadSet().
Parameters
ui32Peripheralis the peripheral to enable in sleep mode. The parameter must be one of the following:
Returns
None
See also
PRCMLoadSet()

Referenced by PRCMRfPowerDownWhenIdle().

535 {
536  // Check the arguments.
537  ASSERT(PRCMPeripheralValid(ui32Peripheral));
538 
539  // Enable this peripheral in sleep mode.
540  HWREG(PRCM_BASE + g_pui32SCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) |=
541  PRCM_PERIPH_MASKBIT(ui32Peripheral);
542 }
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:141
static const uint32_t g_pui32SCGCRegs[]
Definition: prcm.c:106
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:134

§ PRCMPowerDomainOff()

void PRCMPowerDomainOff ( uint32_t  ui32Domains)

Turn off a specific power domain.

Use this function to power down domains inside the MCU voltage domain.

Note
For specifics regarding on/off configuration please see PRCMPowerDomainOn().
Parameters
ui32Domainsdetermines which domain to request a power down for. The domains that can be turned on/off are:
  • PRCM_DOMAIN_RFCORE : RF Core
  • PRCM_DOMAIN_SERIAL : SSI0, UART0, I2C0
  • PRCM_DOMAIN_PERIPH : GPT0, GPT1, GPT2, GPT3, GPIO, SSI1, I2S, DMA, UART1
  • PRCM_DOMAIN_VIMS : SRAM, FLASH, ROM
  • PRCM_DOMAIN_VIMS_OFF_NO_WAKEUP : SRAM, FLASH, ROM
  • PRCM_DOMAIN_SYSBUS
  • PRCM_DOMAIN_CPU
Returns
None

Referenced by PRCMDomainDisable(), SysCtrlIdle(), and SysCtrlStandby().

462 {
463  // Check the arguments.
464  ASSERT((ui32Domains & PRCM_DOMAIN_RFCORE) ||
465  (ui32Domains & PRCM_DOMAIN_SERIAL) ||
466  (ui32Domains & PRCM_DOMAIN_PERIPH) ||
467  (ui32Domains & PRCM_DOMAIN_CPU) ||
468  (ui32Domains & PRCM_DOMAIN_VIMS));
469 
470  // Assert the request to power off the right domains.
471  if(ui32Domains & PRCM_DOMAIN_RFCORE)
472  {
473  HWREG(PRCM_BASE + PRCM_O_PDCTL0RFC ) = 0;
474  }
475  if(ui32Domains & PRCM_DOMAIN_SERIAL)
476  {
477  HWREG(PRCM_BASE + PRCM_O_PDCTL0SERIAL) = 0;
478  }
479  if(ui32Domains & PRCM_DOMAIN_PERIPH)
480  {
481  HWREG(PRCM_BASE + PRCM_O_PDCTL0PERIPH) = 0;
482  }
483  if(ui32Domains & PRCM_DOMAIN_VIMS)
484  {
485  // Write bits ui32Domains[17:16] to the VIMS_MODE alias register.
486  // PRCM_DOMAIN_VIMS sets VIMS_MODE=0b00, PRCM_DOMAIN_VIMS_OFF_NO_WAKEUP sets VIMS_MODE=0b10.
487  ASSERT(!(ui32Domains & 0x00010000));
488  HWREG(PRCM_BASE + PRCM_O_PDCTL1VIMS ) = ( ui32Domains >> 16 ) & 3;
489  }
490  if(ui32Domains & PRCM_DOMAIN_CPU)
491  {
492  HWREG(PRCM_BASE + PRCM_O_PDCTL1CPU ) = 0;
493  }
494 }
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:146
#define PRCM_DOMAIN_PERIPH
Definition: prcm.h:142
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:140
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:138
#define PRCM_DOMAIN_CPU
Definition: prcm.h:152

§ PRCMPowerDomainOn()

void PRCMPowerDomainOn ( uint32_t  ui32Domains)

Turn power on in power domains in the MCU domain.

Use this function to turn on power domains inside the MCU voltage domain.

Power on and power off request has different implications for the different power domains.

  • RF Core power domain:
    • Power On : Domain is on or in the process of turning on.
    • Power Off : Domain is powered down when System CPU is in deep sleep. The third option for the RF Core is to power down when the it is idle. This can be set using PRCMRfPowerDownWhenIdle()
  • SERIAL power domain:
    • Power on : Domain is powered on.
    • Power off : Domain is powered off.
  • PERIPHERIAL power domain:
    • Power on : Domain is powered on.
    • Power off : Domain is powered off.
  • VIMS power domain:
    • Power On : Domain is powered if Bus domain is powered.
    • Power Off : Domain is only powered when CPU domain is on.
  • BUS power domain:
    • Power On : Domain is on.
    • Power Off : Domain is on if requested by RF Core or if CPU domain is on.
  • CPU power domain:
    • Power On : Domain is on.
    • Power Off : Domain is powering down if System CPU is idle. This will also initiate a power down of the SRAM and BUS power domains, unless RF Core is requesting them to be on.
Note
After a call to this function the status of the power domain should be checked using either PRCMPowerDomainsAllOff() or PRCMPowerDomainsAllOn(). Any write operation to a power domain which is still not operational can result in unexpected behavior.
Parameters
ui32Domainsdetermines which power domains to turn on. The domains that can be turned on/off are:
  • PRCM_DOMAIN_RFCORE : RF Core
  • PRCM_DOMAIN_SERIAL : SSI0, UART0, I2C0
  • PRCM_DOMAIN_PERIPH : GPT0, GPT1, GPT2, GPT3, GPIO, SSI1, I2S, DMA, UART1
  • PRCM_DOMAIN_VIMS : SRAM, FLASH, ROM
  • PRCM_DOMAIN_SYSBUS
  • PRCM_DOMAIN_CPU
Returns
None

Referenced by PRCMDomainDisable().

424 {
425  // Check the arguments.
426  ASSERT((ui32Domains & PRCM_DOMAIN_RFCORE) ||
427  (ui32Domains & PRCM_DOMAIN_SERIAL) ||
428  (ui32Domains & PRCM_DOMAIN_PERIPH) ||
429  (ui32Domains & PRCM_DOMAIN_CPU) ||
430  (ui32Domains & PRCM_DOMAIN_VIMS));
431 
432  // Assert the request to power on the right domains.
433  if(ui32Domains & PRCM_DOMAIN_RFCORE)
434  {
435  HWREG(PRCM_BASE + PRCM_O_PDCTL0RFC ) = 1;
436  }
437  if(ui32Domains & PRCM_DOMAIN_SERIAL)
438  {
439  HWREG(PRCM_BASE + PRCM_O_PDCTL0SERIAL) = 1;
440  }
441  if(ui32Domains & PRCM_DOMAIN_PERIPH)
442  {
443  HWREG(PRCM_BASE + PRCM_O_PDCTL0PERIPH) = 1;
444  }
445  if(ui32Domains & PRCM_DOMAIN_VIMS)
446  {
447  HWREG(PRCM_BASE + PRCM_O_PDCTL1VIMS ) = 1;
448  }
449  if(ui32Domains & PRCM_DOMAIN_CPU)
450  {
451  HWREG(PRCM_BASE + PRCM_O_PDCTL1CPU ) = 1;
452  }
453 }
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:146
#define PRCM_DOMAIN_PERIPH
Definition: prcm.h:142
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:140
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:138
#define PRCM_DOMAIN_CPU
Definition: prcm.h:152

§ PRCMPowerDomainsAllOff()

uint32_t PRCMPowerDomainsAllOff ( uint32_t  ui32Domains)

Get the status for a specific power domain.

Use this function to retrieve the current power status of one or more power domains.

Parameters
ui32Domainsdetermines which domain to get the power status for. The parameter must be an OR'ed combination of one or several of:
Returns
Returns status of the requested domains:

Referenced by PRCMRfPowerDownWhenIdle(), and SysCtrlStandby().

599 {
600  bool bStatus;
601  uint32_t ui32StatusRegister0;
602  uint32_t ui32StatusRegister1;
603 
604  // Check the arguments.
605  ASSERT((ui32Domains & (PRCM_DOMAIN_RFCORE |
608 
609  bStatus = false;
610  ui32StatusRegister0 = HWREG(PRCM_BASE + PRCM_O_PDSTAT0);
611  ui32StatusRegister1 = HWREG(PRCM_BASE + PRCM_O_PDSTAT1);
612 
613  // Return the correct power status.
614  if(ui32Domains & PRCM_DOMAIN_RFCORE)
615  {
616  bStatus = bStatus ||
617  ((ui32StatusRegister0 & PRCM_PDSTAT0_RFC_ON) ||
618  (ui32StatusRegister1 & PRCM_PDSTAT1_RFC_ON));
619  }
620  if(ui32Domains & PRCM_DOMAIN_SERIAL)
621  {
622  bStatus = bStatus || (ui32StatusRegister0 & PRCM_PDSTAT0_SERIAL_ON);
623  }
624  if(ui32Domains & PRCM_DOMAIN_PERIPH)
625  {
626  bStatus = bStatus || (ui32StatusRegister0 & PRCM_PDSTAT0_PERIPH_ON);
627  }
628 
629  // Return the status.
630  return (bStatus ? PRCM_DOMAIN_POWER_ON : PRCM_DOMAIN_POWER_OFF);
631 }
#define PRCM_DOMAIN_PERIPH
Definition: prcm.h:142
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_DOMAIN_POWER_ON
Definition: prcm.h:161
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:140
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:138
#define PRCM_DOMAIN_POWER_OFF
Definition: prcm.h:160

§ PRCMPowerDomainsAllOn()

uint32_t PRCMPowerDomainsAllOn ( uint32_t  ui32Domains)

Get the status for a specific power domain.

Use this function to retrieve the current power status of one or more power domains.

Parameters
ui32Domainsdetermines which domain to get the power status for. The parameter must be an OR'ed combination of one or several of:
Returns
Returns status of the requested domains:

Referenced by PRCMRfPowerDownWhenIdle().

640 {
641  bool bStatus;
642  uint32_t ui32StatusRegister0;
643  uint32_t ui32StatusRegister1;
644 
645  // Check the arguments.
646  ASSERT((ui32Domains & (PRCM_DOMAIN_RFCORE |
649 
650  bStatus = true;
651  ui32StatusRegister0 = HWREG(PRCM_BASE + PRCM_O_PDSTAT0);
652  ui32StatusRegister1 = HWREG(PRCM_BASE + PRCM_O_PDSTAT1);
653 
654  // Return the correct power status.
655  if(ui32Domains & PRCM_DOMAIN_RFCORE)
656  {
657  bStatus = bStatus &&
658  ((ui32StatusRegister0 & PRCM_PDSTAT0_RFC_ON) ||
659  (ui32StatusRegister1 & PRCM_PDSTAT1_RFC_ON));
660  }
661  if(ui32Domains & PRCM_DOMAIN_SERIAL)
662  {
663  bStatus = bStatus && (ui32StatusRegister0 & PRCM_PDSTAT0_SERIAL_ON);
664  }
665  if(ui32Domains & PRCM_DOMAIN_PERIPH)
666  {
667  bStatus = bStatus && (ui32StatusRegister0 & PRCM_PDSTAT0_PERIPH_ON);
668  }
669 
670  // Return the status.
671  return (bStatus ? PRCM_DOMAIN_POWER_ON : PRCM_DOMAIN_POWER_OFF);
672 }
#define PRCM_DOMAIN_PERIPH
Definition: prcm.h:142
#define ASSERT(expr)
Definition: debug.h:73
#define PRCM_DOMAIN_POWER_ON
Definition: prcm.h:161
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:140
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:138
#define PRCM_DOMAIN_POWER_OFF
Definition: prcm.h:160

§ PRCMRfPowerDownWhenIdle()

static void PRCMRfPowerDownWhenIdle ( void  )
inlinestatic

Configure RF core to power down when idle.

Use this function to configure the RF core to power down when Idle. This is handled automatically in hardware if the RF Core reports that it is idle.

Returns
None
777 {
778  // Configure the RF power domain.
779  HWREG(PRCM_BASE + PRCM_O_PDCTL0RFC) = 0;
780 }
Here is the call graph for this function:

§ PRCMRfReady()

static bool PRCMRfReady ( void  )
inlinestatic

Return the access status of the RF Core.

Use this function to check if the RF Core is on and ready to be accessed. Accessing register or memories that are not powered and clocked will cause a bus fault.

Returns
Returns access status of the RF Core.
  • true : RF Core can be accessed.
  • false : RF Core domain is not ready for access.
1090 {
1091  // Return the ready status of the RF Core.
1092  return ((HWREG(PRCM_BASE + PRCM_O_PDSTAT1RFC) &
1093  PRCM_PDSTAT1RFC_ON) ? true : false);
1094 }

§ PRCMSleep()

static void PRCMSleep ( void  )
inlinestatic

Put the processor into sleep mode.

This function places the processor into sleep mode; it does not return until the processor returns to run mode. The peripherals that are enabled via PRCMPeripheralSleepEnable() continue to operate and can wake up the processor.

Returns
None
See also
PRCMPeripheralSleepEnable()
1113 {
1114  // Wait for an interrupt.
1115  CPUwfi();
1116 }
static void CPUwfi(void)
Wait for interrupt.
Definition: cpu.h:193
Here is the call graph for this function:

Macro Definition Documentation

§ I2S_SAMPLE_RATE_16K

#define I2S_SAMPLE_RATE_16K   0x00000001

Referenced by PRCMAudioClockConfigSet().

§ I2S_SAMPLE_RATE_24K

#define I2S_SAMPLE_RATE_24K   0x00000002

Referenced by PRCMAudioClockConfigSet().

§ I2S_SAMPLE_RATE_32K

#define I2S_SAMPLE_RATE_32K   0x00000004

Referenced by PRCMAudioClockConfigSet().

§ I2S_SAMPLE_RATE_48K

#define I2S_SAMPLE_RATE_48K   0x00000008

Referenced by PRCMAudioClockConfigSet().

§ PRCM_CLOCK_DIV_1

#define PRCM_CLOCK_DIV_1   PRCM_GPTCLKDIV_RATIO_DIV1

§ PRCM_CLOCK_DIV_128

#define PRCM_CLOCK_DIV_128   PRCM_GPTCLKDIV_RATIO_DIV128

§ PRCM_CLOCK_DIV_16

#define PRCM_CLOCK_DIV_16   PRCM_GPTCLKDIV_RATIO_DIV16

§ PRCM_CLOCK_DIV_2

#define PRCM_CLOCK_DIV_2   PRCM_GPTCLKDIV_RATIO_DIV2

§ PRCM_CLOCK_DIV_256

#define PRCM_CLOCK_DIV_256   PRCM_GPTCLKDIV_RATIO_DIV256

§ PRCM_CLOCK_DIV_32

#define PRCM_CLOCK_DIV_32   PRCM_GPTCLKDIV_RATIO_DIV32

§ PRCM_CLOCK_DIV_4

#define PRCM_CLOCK_DIV_4   PRCM_GPTCLKDIV_RATIO_DIV4

§ PRCM_CLOCK_DIV_64

#define PRCM_CLOCK_DIV_64   PRCM_GPTCLKDIV_RATIO_DIV64

§ PRCM_CLOCK_DIV_8

#define PRCM_CLOCK_DIV_8   PRCM_GPTCLKDIV_RATIO_DIV8

§ PRCM_DEEP_SLEEP_MODE

#define PRCM_DEEP_SLEEP_MODE   0x00000004

§ PRCM_DOMAIN_CLKCTRL

#define PRCM_DOMAIN_CLKCTRL   0x00000080

§ PRCM_DOMAIN_CPU

#define PRCM_DOMAIN_CPU   0x00000020

§ PRCM_DOMAIN_MCU

#define PRCM_DOMAIN_MCU   0x00000100

§ PRCM_DOMAIN_PERIPH

#define PRCM_DOMAIN_PERIPH   0x00000004

§ PRCM_DOMAIN_POWER_DOWN_READY

#define PRCM_DOMAIN_POWER_DOWN_READY   0x00000000

§ PRCM_DOMAIN_POWER_OFF

#define PRCM_DOMAIN_POWER_OFF   0x00000002

§ PRCM_DOMAIN_POWER_ON

#define PRCM_DOMAIN_POWER_ON   0x00000001

§ PRCM_DOMAIN_RFCORE

§ PRCM_DOMAIN_SERIAL

#define PRCM_DOMAIN_SERIAL   0x00000002

§ PRCM_DOMAIN_SYSBUS

#define PRCM_DOMAIN_SYSBUS   0x00000008

§ PRCM_DOMAIN_TIMER

#define PRCM_DOMAIN_TIMER   0x00000040

§ PRCM_DOMAIN_VIMS

#define PRCM_DOMAIN_VIMS   0x00000010

§ PRCM_DOMAIN_VIMS_OFF_NO_WAKEUP

#define PRCM_DOMAIN_VIMS_OFF_NO_WAKEUP   0x00020010

§ PRCM_I2S_WCLK_DUAL_PHASE

#define PRCM_I2S_WCLK_DUAL_PHASE   1

§ PRCM_I2S_WCLK_NEG_EDGE

#define PRCM_I2S_WCLK_NEG_EDGE   0

§ PRCM_I2S_WCLK_POS_EDGE

#define PRCM_I2S_WCLK_POS_EDGE   1

§ PRCM_I2S_WCLK_SINGLE_PHASE

#define PRCM_I2S_WCLK_SINGLE_PHASE   0

§ PRCM_I2S_WCLK_USER_DEF

#define PRCM_I2S_WCLK_USER_DEF   2

§ PRCM_PERIPH_CRYPTO

#define PRCM_PERIPH_CRYPTO   ( 0x00000400 | ( PRCM_SECDMACLKGR_CRYPTO_CLK_EN_S ))

Referenced by SysCtrlStandby().

§ PRCM_PERIPH_GPIO

#define PRCM_PERIPH_GPIO   ( 0x00000500 | ( PRCM_GPIOCLKGR_CLK_EN_S ))

§ PRCM_PERIPH_I2C0

#define PRCM_PERIPH_I2C0   ( 0x00000300 | ( PRCM_I2CCLKGR_CLK_EN_S ))

§ PRCM_PERIPH_I2S

#define PRCM_PERIPH_I2S   ( 0x00000600 | ( PRCM_I2SCLKGR_CLK_EN_S ))

Referenced by SysCtrlStandby().

§ PRCM_PERIPH_PKA

#define PRCM_PERIPH_PKA   ( 0x00000400 | ( PRCM_SECDMACLKGR_PKA_CLK_EN_S ))

§ PRCM_PERIPH_SSI0

#define PRCM_PERIPH_SSI0   ( 0x00000100 | ( PRCM_SSICLKGR_CLK_EN_S ))

§ PRCM_PERIPH_SSI1

#define PRCM_PERIPH_SSI1   ( 0x00000100 | ( PRCM_SSICLKGR_CLK_EN_S + 1 ))

§ PRCM_PERIPH_TIMER0

#define PRCM_PERIPH_TIMER0   ( 0x00000000 | ( PRCM_GPTCLKGR_CLK_EN_S ))

§ PRCM_PERIPH_TIMER1

#define PRCM_PERIPH_TIMER1   ( 0x00000000 | ( PRCM_GPTCLKGR_CLK_EN_S + 1 ))

§ PRCM_PERIPH_TIMER2

#define PRCM_PERIPH_TIMER2   ( 0x00000000 | ( PRCM_GPTCLKGR_CLK_EN_S + 2 ))

§ PRCM_PERIPH_TIMER3

#define PRCM_PERIPH_TIMER3   ( 0x00000000 | ( PRCM_GPTCLKGR_CLK_EN_S + 3 ))

§ PRCM_PERIPH_TRNG

#define PRCM_PERIPH_TRNG   ( 0x00000400 | ( PRCM_SECDMACLKGR_TRNG_CLK_EN_S ))

§ PRCM_PERIPH_UART0

#define PRCM_PERIPH_UART0   ( 0x00000200 | ( PRCM_UARTCLKGR_CLK_EN_S ))

§ PRCM_PERIPH_UART1

#define PRCM_PERIPH_UART1   ( 0x00000200 | ( PRCM_UARTCLKGR_CLK_EN_S + 1 ))

§ PRCM_PERIPH_UDMA

#define PRCM_PERIPH_UDMA   ( 0x00000400 | ( PRCM_SECDMACLKGR_DMA_CLK_EN_S ))

Referenced by SysCtrlStandby().

§ PRCM_RUN_MODE

#define PRCM_RUN_MODE   0x00000001

§ PRCM_SLEEP_MODE

#define PRCM_SLEEP_MODE   0x00000002

§ PRCM_WCLK_DUAL_PHASE

#define PRCM_WCLK_DUAL_PHASE   0x00000002

§ PRCM_WCLK_NEG_EDGE

#define PRCM_WCLK_NEG_EDGE   0x00000008

§ PRCM_WCLK_POS_EDGE

#define PRCM_WCLK_POS_EDGE   0x00000000

§ PRCM_WCLK_SINGLE_PHASE

#define PRCM_WCLK_SINGLE_PHASE   0x00000000

§ PRCM_WCLK_USER_DEF

#define PRCM_WCLK_USER_DEF   0x00000004