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().

368 {
369  // Check the arguments.
370  ASSERT(ui8SamplingEdge == PRCM_I2S_WCLK_NEG_EDGE ||
371  ui8SamplingEdge == PRCM_I2S_WCLK_POS_EDGE);
372  ASSERT(ui8WCLKPhase == PRCM_WCLK_SINGLE_PHASE ||
373  ui8WCLKPhase == PRCM_WCLK_DUAL_PHASE ||
374  ui8WCLKPhase == 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 + NONSECURE_OFFSET + PRCM_O_I2SMCLKDIV) = ui32MstDiv;
388  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_I2SBCLKDIV) = ui32BitDiv;
389  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_I2SWCLKDIV) = ui32WordDiv;
390 
391  // Configure the Word clock format and polarity and enable it.
392  HWREG(PRCM_BASE + NONSECURE_OFFSET + 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:173
#define PRCM_WCLK_USER_DEF
Definition: prcm.h:174
#define PRCM_WCLK_SINGLE_PHASE
Definition: prcm.h:172
#define ASSERT(expr)
Definition: debug.h:71
static void PRCMAudioClockDisable(void)
Disable the audio clock generation.
Definition: prcm.h:429
#define PRCM_I2S_WCLK_NEG_EDGE
Definition: prcm.h:175
#define PRCM_I2S_WCLK_POS_EDGE
Definition: prcm.h:176
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().

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

330 {
331  uint32_t ui32Reg;
332 
333  // Check the arguments.
335 
336  // Make sure the audio clock generation is disabled before reconfiguring.
338 
339  // Make sure to compensate the Frame clock division factor if using single
340  // phase format.
341  if((ui32ClkConfig & PRCM_I2SCLKCTL_WCLK_PHASE_M) == PRCM_WCLK_SINGLE_PHASE)
342  {
343  ui32WordDiv -= 1;
344  }
345 
346  // Write the clock division factors.
347  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_I2SMCLKDIV) = ui32MstDiv;
348  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_I2SBCLKDIV) = ui32BitDiv;
349  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_I2SWCLKDIV) = ui32WordDiv;
350 
351  // Configure the Word clock format and polarity.
352  ui32Reg = HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_I2SCLKCTL) & ~(PRCM_I2SCLKCTL_WCLK_PHASE_M |
354  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_I2SCLKCTL) = ui32Reg | ui32ClkConfig;
355 }
#define PRCM_WCLK_SINGLE_PHASE
Definition: prcm.h:172
#define ASSERT(expr)
Definition: debug.h:71
static void PRCMAudioClockDisable(void)
Disable the audio clock generation.
Definition: prcm.h:429
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().

430 {
431  // Disable the audio clock generation
433 }
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
414 {
415  // Enable the audio clock generation.
417 }

§ 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 + NONSECURE_OFFSET + 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 {
404  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_I2SBCLKSEL) = PRCM_I2SBCLKSEL_SRC;
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().

1159 {
1161 }

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

1144 {
1146 }

§ 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:191
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()
673 {
674  // Check the arguments.
675  ASSERT((ui32Domains & PRCM_DOMAIN_RFCORE) ||
676  (ui32Domains & PRCM_DOMAIN_VIMS));
677 
678  // Disable the power domains.
679  if(ui32Domains & PRCM_DOMAIN_RFCORE)
680  {
681  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_RFCCLKG) = 0x0;
682  }
683  if(ui32Domains & PRCM_DOMAIN_VIMS)
684  {
685  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_VIMSCLKG) = 0x0;
686  }
687 }
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:145
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:137
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
634 {
635  // Check the arguments.
636  ASSERT((ui32Domains & PRCM_DOMAIN_RFCORE) ||
637  (ui32Domains & PRCM_DOMAIN_VIMS));
638 
639  // Enable the clock domain(s).
640  if(ui32Domains & PRCM_DOMAIN_RFCORE)
641  {
642  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_RFCCLKG) = PRCM_RFCCLKG_CLK_EN;
643  }
644  if(ui32Domains & PRCM_DOMAIN_VIMS)
645  {
646  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_VIMSCLKG) = PRCM_VIMSCLKG_CLK_EN_M;
647  }
648 }
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:145
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:137

§ 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()
398 {
399  return ( HWREG( PRCM_BASE + NONSECURE_OFFSET + PRCM_O_GPTCLKDIV ));
400 }

§ 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()
370 {
371  ASSERT( clkDiv <= PRCM_GPTCLKDIV_RATIO_DIV256 );
372 
373  HWREG( PRCM_BASE + NONSECURE_OFFSET + PRCM_O_GPTCLKDIV ) = clkDiv;
374 }
#define ASSERT(expr)
Definition: debug.h:71

§ 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().
203 {
204  uint32_t ui32ClkDiv;
205  uint32_t ui32Divisor;
206 
207  // Check the arguments.
208  ASSERT((ui32PowerMode == PRCM_RUN_MODE) ||
209  (ui32PowerMode == PRCM_SLEEP_MODE) ||
210  (ui32PowerMode == PRCM_DEEP_SLEEP_MODE));
211 
212  ui32ClkDiv = 0;
213  ui32Divisor = 0;
214 
215  // Determine the correct power mode.
216  if(ui32PowerMode == PRCM_RUN_MODE)
217  {
218  ui32ClkDiv = HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_INFRCLKDIVR);
219  }
220  else if(ui32PowerMode == PRCM_SLEEP_MODE)
221  {
222  ui32ClkDiv = HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_INFRCLKDIVS);
223  }
224  else if(ui32PowerMode == PRCM_DEEP_SLEEP_MODE)
225  {
226  ui32ClkDiv = HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_INFRCLKDIVDS);
227  }
228 
229  // Find the correct division factor.
230  if(ui32ClkDiv == 0x0)
231  {
232  ui32Divisor = PRCM_CLOCK_DIV_1;
233  }
234  else if(ui32ClkDiv == 0x1)
235  {
236  ui32Divisor = PRCM_CLOCK_DIV_2;
237  }
238  else if(ui32ClkDiv == 0x2)
239  {
240  ui32Divisor = PRCM_CLOCK_DIV_8;
241  }
242  else if(ui32ClkDiv == 0x3)
243  {
244  ui32Divisor = PRCM_CLOCK_DIV_32;
245  }
246 
247  // Return the clock division factor.
248  return ui32Divisor;
249 }
#define PRCM_DEEP_SLEEP_MODE
Definition: prcm.h:114
#define PRCM_CLOCK_DIV_8
Definition: prcm.h:124
#define PRCM_CLOCK_DIV_32
Definition: prcm.h:126
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_SLEEP_MODE
Definition: prcm.h:113
#define PRCM_CLOCK_DIV_1
Definition: prcm.h:121
#define PRCM_CLOCK_DIV_2
Definition: prcm.h:122
#define PRCM_RUN_MODE
Definition: prcm.h:112

§ 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
149 {
150  uint32_t ui32Divisor;
151 
152  // Check the arguments.
153  ASSERT((ui32ClkDiv == PRCM_CLOCK_DIV_1) ||
154  (ui32ClkDiv == PRCM_CLOCK_DIV_2) ||
155  (ui32ClkDiv == PRCM_CLOCK_DIV_8) ||
156  (ui32ClkDiv == PRCM_CLOCK_DIV_32));
157  ASSERT((ui32PowerMode == PRCM_RUN_MODE) ||
158  (ui32PowerMode == PRCM_SLEEP_MODE) ||
159  (ui32PowerMode == PRCM_DEEP_SLEEP_MODE));
160 
161  ui32Divisor = 0;
162 
163  // Find the correct division factor.
164  if(ui32ClkDiv == PRCM_CLOCK_DIV_1)
165  {
166  ui32Divisor = 0x0;
167  }
168  else if(ui32ClkDiv == PRCM_CLOCK_DIV_2)
169  {
170  ui32Divisor = 0x1;
171  }
172  else if(ui32ClkDiv == PRCM_CLOCK_DIV_8)
173  {
174  ui32Divisor = 0x2;
175  }
176  else if(ui32ClkDiv == PRCM_CLOCK_DIV_32)
177  {
178  ui32Divisor = 0x3;
179  }
180 
181  // Determine the correct power mode set the division factor accordingly.
182  if(ui32PowerMode == PRCM_RUN_MODE)
183  {
184  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_INFRCLKDIVR) = ui32Divisor;
185  }
186  else if(ui32PowerMode == PRCM_SLEEP_MODE)
187  {
188  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_INFRCLKDIVS) = ui32Divisor;
189  }
190  else if(ui32PowerMode == PRCM_DEEP_SLEEP_MODE)
191  {
192  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_INFRCLKDIVDS) = ui32Divisor;
193  }
194 }
#define PRCM_DEEP_SLEEP_MODE
Definition: prcm.h:114
#define PRCM_CLOCK_DIV_8
Definition: prcm.h:124
#define PRCM_CLOCK_DIV_32
Definition: prcm.h:126
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_SLEEP_MODE
Definition: prcm.h:113
#define PRCM_CLOCK_DIV_1
Definition: prcm.h:121
#define PRCM_CLOCK_DIV_2
Definition: prcm.h:122
#define PRCM_RUN_MODE
Definition: prcm.h:112

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

606 {
607  // Return the load status.
608  return ((HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_CLKLOADCTL) & PRCM_CLKLOADCTL_LOAD_DONE) ?
609  true : false);
610 }

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

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

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

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

§ 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(g_pui32DCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) &=
589  ~PRCM_PERIPH_MASKBIT(ui32Peripheral);
590 }
static const uint32_t g_pui32DCGCRegs[]
Definition: prcm.c:116
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:139
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:132

§ 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(g_pui32DCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) |=
573  PRCM_PERIPH_MASKBIT(ui32Peripheral);
574 }
static const uint32_t g_pui32DCGCRegs[]
Definition: prcm.c:116
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:139
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:132

§ 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(g_pui32RCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) &=
525  ~PRCM_PERIPH_MASKBIT(ui32Peripheral);
526 }
static const uint32_t g_pui32RCGCRegs[]
Definition: prcm.c:92
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:139
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:132

§ 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(g_pui32RCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) |=
509  PRCM_PERIPH_MASKBIT(ui32Peripheral);
510 }
static const uint32_t g_pui32RCGCRegs[]
Definition: prcm.c:92
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:139
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:132

§ 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(g_pui32SCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) &=
557  ~PRCM_PERIPH_MASKBIT(ui32Peripheral);
558 }
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:139
static const uint32_t g_pui32SCGCRegs[]
Definition: prcm.c:104
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:132

§ 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(g_pui32SCGCRegs[PRCM_PERIPH_INDEX(ui32Peripheral)]) |=
541  PRCM_PERIPH_MASKBIT(ui32Peripheral);
542 }
#define PRCM_PERIPH_MASKBIT(a)
Definition: prcm.c:139
static const uint32_t g_pui32SCGCRegs[]
Definition: prcm.c:104
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_PERIPH_INDEX(a)
Definition: prcm.c:132

§ 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 + NONSECURE_OFFSET + PRCM_O_PDCTL0RFC ) = 0;
474  }
475  if(ui32Domains & PRCM_DOMAIN_SERIAL)
476  {
477  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_PDCTL0SERIAL) = 0;
478  }
479  if(ui32Domains & PRCM_DOMAIN_PERIPH)
480  {
481  HWREG(PRCM_BASE + NONSECURE_OFFSET + 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 + NONSECURE_OFFSET + PRCM_O_PDCTL1VIMS ) = ( ui32Domains >> 16 ) & 3;
489  }
490  if(ui32Domains & PRCM_DOMAIN_CPU)
491  {
492  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_PDCTL1CPU ) = 0;
493  }
494 }
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:145
#define PRCM_DOMAIN_PERIPH
Definition: prcm.h:141
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:139
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:137
#define PRCM_DOMAIN_CPU
Definition: prcm.h:151

§ 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 + NONSECURE_OFFSET + PRCM_O_PDCTL0RFC ) = 1;
436  }
437  if(ui32Domains & PRCM_DOMAIN_SERIAL)
438  {
439  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_PDCTL0SERIAL) = 1;
440  }
441  if(ui32Domains & PRCM_DOMAIN_PERIPH)
442  {
443  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_PDCTL0PERIPH) = 1;
444  }
445  if(ui32Domains & PRCM_DOMAIN_VIMS)
446  {
447  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_PDCTL1VIMS ) = 1;
448  }
449  if(ui32Domains & PRCM_DOMAIN_CPU)
450  {
451  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_PDCTL1CPU ) = 1;
452  }
453 }
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:145
#define PRCM_DOMAIN_PERIPH
Definition: prcm.h:141
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:139
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:137
#define PRCM_DOMAIN_CPU
Definition: prcm.h:151

§ 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 + NONSECURE_OFFSET + PRCM_O_PDSTAT0);
611  ui32StatusRegister1 = HWREG(PRCM_BASE + NONSECURE_OFFSET + 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:141
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_DOMAIN_POWER_ON
Definition: prcm.h:160
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:139
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:137
#define PRCM_DOMAIN_POWER_OFF
Definition: prcm.h:159

§ 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 + NONSECURE_OFFSET + PRCM_O_PDSTAT0);
652  ui32StatusRegister1 = HWREG(PRCM_BASE + NONSECURE_OFFSET + 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:141
#define ASSERT(expr)
Definition: debug.h:71
#define PRCM_DOMAIN_POWER_ON
Definition: prcm.h:160
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:139
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:137
#define PRCM_DOMAIN_POWER_OFF
Definition: prcm.h:159

§ 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
776 {
777  // Configure the RF power domain.
778  HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_PDCTL0RFC) = 0;
779 }
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.
1089 {
1090  // Return the ready status of the RF Core.
1091  return ((HWREG(PRCM_BASE + NONSECURE_OFFSET + PRCM_O_PDSTAT1RFC) &
1092  PRCM_PDSTAT1RFC_ON) ? true : false);
1093 }

§ 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()
1112 {
1113  // Wait for an interrupt.
1114  CPUwfi();
1115 }
static void CPUwfi(void)
Wait for interrupt.
Definition: cpu.h:191
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