CC13xx Driver Library
sys_ctrl.c
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: sys_ctrl.c
3 * Revised: 2015-06-08 08:49:51 +0200 (Mon, 08 Jun 2015)
4 * Revision: 43812
5 *
6 * Description: Driver for the System Control.
7 *
8 * Copyright (c) 2015, Texas Instruments Incorporated
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1) Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2) Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 ******************************************************************************/
38 
39 // Hardware headers
40 #include <inc/hw_types.h>
41 #include <inc/hw_ccfg.h>
42 // Driverlib headers
43 #include <driverlib/aon_batmon.h>
44 #include <driverlib/sys_ctrl.h>
45 
46 //*****************************************************************************
47 //
48 // Handle support for DriverLib in ROM:
49 // This section will undo prototype renaming made in the header file
50 //
51 //*****************************************************************************
52 #if !defined(DOXYGEN)
53  #undef SysCtrlPowerEverything
54  #define SysCtrlPowerEverything NOROM_SysCtrlPowerEverything
55  #undef SysCtrlStandby
56  #define SysCtrlStandby NOROM_SysCtrlStandby
57  #undef SysCtrlPowerdown
58  #define SysCtrlPowerdown NOROM_SysCtrlPowerdown
59  #undef SysCtrlShutdown
60  #define SysCtrlShutdown NOROM_SysCtrlShutdown
61  #undef SysCtrlResetSourceGet
62  #define SysCtrlResetSourceGet NOROM_SysCtrlResetSourceGet
63 #endif
64 
65 //*****************************************************************************
66 //
67 // Recharge calculator defines and globals
68 //
69 //*****************************************************************************
70 
71 #define PD_STATE_CACHE_RET 1
72 #define PD_STATE_RFMEM_RET 2
73 #define PD_STATE_XOSC_LPM 4
74 #define PD_STATE_EXT_REG_MODE 8
75 
76 typedef struct {
77  uint32_t pdTime ;
78  uint16_t pdRechargePeriod ;
79  uint8_t pdState ;
80  int8_t pdTemp ;
82 
84 
85 
86 //*****************************************************************************
87 //
88 // Arrays that maps the "peripheral set" number (which is stored in the
89 // third nibble of the PRCM_PERIPH_* defines) to the PRCM register that
90 // contains the relevant bit for that peripheral.
91 //
92 //*****************************************************************************
93 
94 // Run mode registers
95 static const uint32_t g_pui32ModuleCG[] =
96 {
110 };
111 
112 //*****************************************************************************
113 //
114 // Power up everything
115 //
116 //*****************************************************************************
117 void
119 {
120  uint32_t ui32Idx;
121  uint32_t ui32AuxClocks;
122 
123  //
124  // Force power on AUX
125  //
128  { }
129 
130  //
131  // Enable all the AUX domain clocks and wait for them to be ready
132  //
133  ui32AuxClocks = AUX_WUC_ADI_CLOCK | AUX_WUC_OSCCTRL_CLOCK |
139  AUXWUCClockEnable(ui32AuxClocks);
140  while(AUXWUCClockStatus(ui32AuxClocks) != AUX_WUC_CLOCK_READY)
141  { }
142 
143  //
144  // Request to switch to the crystal to enable radio operation.
145  // It takes a while for the XTAL to be ready so it is possible to
146  // perform other tasks while waiting.
149 
150  //
151  // Switch the HF source to XTAL - must be performed safely out of ROM to
152  // avoid flash issues when switching the clock.
153  //
154  // NB. If already running XTAL on HF clock source the ROM will wait forever
155  // on a flag that will never be set - need to check.
156  //
159  }
160 
161  //
162  // Turn on all the MCU power domains
163  // If the CPU is running and executing code the SYSBUS, VIMS and CPU are
164  // automatically on as well.
165  //
168  //
169  // Wait for power to be on
170  //
173 
174  PRCMLoadSet();
175  while(!PRCMLoadGet());
176 
177  //
178  // Ensure the domain clocks are running and wait for the clock settings to
179  // take effect
180  //
182  PRCMLoadSet();
183  while(!PRCMLoadGet())
184  { }
185 
186  //
187  // Enable all the RF Core clocks
188  //
189  // Do not read back to check, for two reasons:
190  // 1. CPE will update the PWMCLKENABLE register right after boot
191  // 2. The PWMCLKENABLE register always reads back what is written
192  HWREG(RFC_PWR_NONBUF_BASE + RFC_PWR_O_PWMCLKEN) = 0x7FF;
193 
194  //
195  // Enable all peripheral clocks in System CPU run/sleep/deep-sleep mode.
196  //
197  for(ui32Idx = 0; ui32Idx < sizeof(g_pui32ModuleCG) / sizeof(uint32_t);
198  ui32Idx++)
199  {
203  }
204  PRCMLoadSet();
205  while(!PRCMLoadGet())
206  { }
207 }
208 
209 //*****************************************************************************
210 //
212 //
213 //*****************************************************************************
214 void SysCtrlStandby(void)
215 {
216  //
217  // Enable the oscillator configuration interface
218  //
220 
221  //
222  // Ensure the low frequency clock source is sourced from a low frequency
223  // oscillator. The XTAL will provide the most accurate real time clock.
224  //
226 
227  //
228  // Enable the oscillator configuration interface
229  //
231 
232  //
233  // Execute the transition to standby
234  //
236 }
237 
238 //*****************************************************************************
239 //
241 //
242 //*****************************************************************************
243 void
245 {
246  //
247  // Make sure the oscillator interface is enabled
248  //
250 
251  //
252  // Source the LF clock from the low frequency XTAL_OSC.
253  // HF and MF are sourced from the high frequency RC_OSC.
254  //
257 
258  //
259  // Check if already sourcing the HF clock from RC_OSC.
260  // If a switch of the clock source is not required, then the call to ROM
261  // will loop forever.
262  //
264  {
266  }
267 
268  //
269  // Disable the oscillator interface
270  //
272 
273  //
274  // Execute the transition to power down.
275  //
277 }
278 
279 //*****************************************************************************
280 //
282 //
283 //*****************************************************************************
284 void
286 {
287  //
288  // Make sure the oscillator interface is enabled
289  //
291 
292  //
293  // Source the LF clock from the low frequency RC_OSC.
294  // HF and MF are sourced from the high frequency RC_OSC.
295  //
298 
299  //
300  // Check if already sourcing the HF clock from RC_OSC.
301  // If a switch of the clock source is not required, then the call to ROM
302  // will loop forever.
303  //
305  {
307  }
308 
309  //
310  // Disable the oscillator interface
311  //
313 
314  //
315  // Execute transition to shutdown.
316  //
318 }
319 
320 
321 //*****************************************************************************
322 // Need to know the CCFG:MODE_CONF.VDDR_TRIM_SLEEP_DELTA fild width in order
323 // to sign extend correctly but this is however not defined in the hardware
324 // description fields and are therefore defined separately here.
325 //*****************************************************************************
326 #define CCFG_MODE_CONF_VDDR_TRIM_SLEEP_DELTA_WIDTH 4
327 
328 //*****************************************************************************
329 //
330 // SysCtrlSetRechargeBeforePowerDown( xoscPowerMode )
331 //
332 //*****************************************************************************
333 void
334 SysCtrlSetRechargeBeforePowerDown( uint32_t xoscPowerMode )
335 {
336  int32_t curTemp ;
337  int32_t shiftedTemp ;
338  int32_t deltaV ;
339  uint32_t curState ;
340  uint32_t prcmRamRetention ;
341  uint32_t di ;
342  uint32_t dii ;
343  uint32_t ti ;
344  uint32_t cd ;
345  uint32_t cl ;
346  uint32_t load ;
347  uint32_t k ;
348  uint32_t vddrCap ;
349  uint32_t newRechargePeriod ;
350  uint32_t perE ;
351  uint32_t perM ;
352  const uint32_t * pLookupTable ;
353 
354  //
355  // If external regulator mode we shall:
356  // - Disable adaptive recharge (bit[31]=0) in AON_WUC_O_RECHARGECFG
357  // - Set recharge period to approximately 500 mS (perM=31, perE=5 => 0xFD)
358  // - Make sure you get a recalculation if leaving external regulator mode by setting powerQualGlobals.pdState accordingly
359  //
361  powerQualGlobals.pdState = PD_STATE_EXT_REG_MODE;
362  HWREG( AON_WUC_BASE + AON_WUC_O_RECHARGECFG ) = 0x00A4FDFD;
363  return;
364  }
365 
366  //--- Spec. point 1 ---
367  curTemp = AONBatMonTemperatureGetDegC();
368  curState = 0;
369  prcmRamRetention = HWREG( PRCM_BASE + PRCM_O_RAMRETEN );
370  if ( prcmRamRetention & PRCM_RAMRETEN_VIMS_M ) {
371  curState |= PD_STATE_CACHE_RET;
372  }
373  if ( prcmRamRetention & PRCM_RAMRETEN_RFC ) {
374  curState |= PD_STATE_RFMEM_RET;
375  }
376  if ( xoscPowerMode != XOSC_IN_HIGH_POWER_MODE ) {
377  curState |= PD_STATE_XOSC_LPM;
378  }
379 
380  pLookupTable = (uint32_t *)( FCFG1_BASE + FCFG1_O_PWD_CURR_20C );
381 
382  //--- Spec. point 2 ---
383  if ((( curTemp - powerQualGlobals.pdTemp ) >= 5 ) || ( curState != powerQualGlobals.pdState )) {
384  //--- Spec. point 3 ---
385  shiftedTemp = curTemp - 15;
386 
387  //--- Spec point 4 ---
388  //4. Check for external VDDR load option (may not be supported): ext_load = (VDDR_EXT_LOAD=0 in CCFG)
389  // Currently not implementing external load handling
390  // if ( __ccfg.ulModeConfig & MODE_CONF_VDDR_EXT_LOAD ) {
391  // }
392 
393  //--- Spec point 5 ---
394  di = 0;
395  ti = 0;
396  if ( shiftedTemp >= 0 ) {
397  //--- Spec point 5.a ---
398  shiftedTemp += ( shiftedTemp << 4 );
399 
400  //--- Spec point 5.b ---
401  ti = ( shiftedTemp >> 8 );
402  if ( ti > 7 ) {
403  ti = 7;
404  }
405  dii = ti;
406  if ( dii > 6 ) {
407  dii = 6;
408  }
409 
410  //--- Spec point 5.c ---
411  cd = pLookupTable[ dii + 1 ] - pLookupTable[ dii ];
412 
413  //--- Spec point 5.d ---
414  di = cd & 0xFF;
415 
416  //--- Spec point 5.e ---
417  if ( curState & PD_STATE_XOSC_LPM ) {
418  di += (( cd >> 8 ) & 0xFF );
419  }
420  if ( curState & PD_STATE_RFMEM_RET ) {
421  di += (( cd >> 16 ) & 0xFF );
422  }
423  if ( curState & PD_STATE_CACHE_RET ) {
424  di += (( cd >> 24 ) & 0xFF );
425  }
426 
427  //--- Spec point 5.f ---
428  // Currently not implementing external load handling
429  }
430 
431  //--- Spec. point 6 ---
432  cl = pLookupTable[ ti ];
433 
434  //--- Spec. point 7 ---
435  load = cl & 0xFF;
436 
437  //--- Spec. point 8 ---
438  if ( curState & PD_STATE_XOSC_LPM ) {
439  load += (( cl >> 8 ) & 0xFF );
440  }
441  if ( curState & PD_STATE_RFMEM_RET ) {
442  load += (( cl >> 16 ) & 0xFF );
443  }
444  if ( curState & PD_STATE_CACHE_RET ) {
445  load += (( cl >> 24 ) & 0xFF );
446  }
447 
448  //--- Spec. point 9 ---
449  load += ((( di * ( shiftedTemp - ( ti << 8 ))) + 128 ) > 8 );
450 
451  //--- Find deltaV (in range -8 to +7) ---
452  deltaV = ((((int32_t)HWREG( CCFG_BASE + CCFG_O_MODE_CONF ))
455 
456  // Currently not implementing external load handling
457  // if ( __ccfg.ulModeConfig & MODE_CONF_VDDR_EXT_LOAD ) {
458  //--- Spec. point 10 ---
459  // } else {
460  //--- Spec. point 11 ---
461  k = ( 52 * ( 8 - deltaV ));
462  // }
463 
464  //--- Spec. point 12 ---
465 
467  newRechargePeriod = ( vddrCap * k ) / load;
468  if ( newRechargePeriod > 0xFFFF ) {
469  newRechargePeriod = 0xFFFF;
470  }
471  powerQualGlobals.pdRechargePeriod = newRechargePeriod;
472 
473  //--- Spec. point 13 ---
474  if ( curTemp > 127 ) curTemp = 127;
475  if ( curTemp < -128 ) curTemp = -128;
476  powerQualGlobals.pdTemp = curTemp;
477  powerQualGlobals.pdState = curState;
478  }
479 
480  powerQualGlobals.pdTime = HWREG( AON_RTC_BASE + AON_RTC_O_SEC );
481 
482  // Calculate PER_E and PER_M (based on powerQualGlobals.pdRechargePeriod)
483  // Round downwards but make sure PER_E=0 and PER_M=1 is the minimum possible setting.
484  // (assuming that powerQualGlobals.pdRechargePeriod always are <= 0xFFFF)
485  perE = 0;
486  perM = powerQualGlobals.pdRechargePeriod;
487  if ( perM < 31 ) {
488  perM = 31;
489  powerQualGlobals.pdRechargePeriod = 31;
490  }
491  while ( perM > 511 ) {
492  perM >>= 1;
493  perE += 1;
494  }
495  perM = ( perM - 15 ) >> 4;
496 
498  ( 0x80A4E700 ) |
499  ( perM << AON_WUC_RECHARGECFG_PER_M_S ) |
500  ( perE << AON_WUC_RECHARGECFG_PER_E_S ) ;
501  HWREG( AON_WUC_BASE + AON_WUC_O_RECHARGESTAT ) = 0;
502 }
503 
504 
505 //*****************************************************************************
506 //
507 // SysCtrlAdjustRechargeAfterPowerDown()
508 //
509 //*****************************************************************************
510 void
512 {
513  int32_t curTemp ;
514  uint32_t longestRechargePeriod ;
515  uint32_t deltaTime ;
516  uint32_t newRechargePeriod ;
517 
518  //--- Spec. point 2 ---
519  longestRechargePeriod = ( HWREG( AON_WUC_BASE + AON_WUC_O_RECHARGESTAT ) &
522 
523  if ( longestRechargePeriod != 0 ) {
524  //--- Spec. changed (originaly point 1) ---
525  curTemp = AONBatMonTemperatureGetDegC();
526  if ( curTemp < powerQualGlobals.pdTemp ) {
527  if ( curTemp < -128 ) {
528  curTemp = -128;
529  }
530  powerQualGlobals.pdTemp = curTemp;
531  }
532 
533  //--- Spec. point 4 ---
534  if ( longestRechargePeriod < powerQualGlobals.pdRechargePeriod ) {
535  powerQualGlobals.pdRechargePeriod = longestRechargePeriod;
536  } else {
537  //--- Spec. point 5 ---
538  deltaTime = HWREG( AON_RTC_BASE + AON_RTC_O_SEC ) - powerQualGlobals.pdTime + 2;
539  if ( deltaTime > 31 ) {
540  deltaTime = 31;
541  }
542  newRechargePeriod = powerQualGlobals.pdRechargePeriod + (( longestRechargePeriod - powerQualGlobals.pdRechargePeriod ) >> (deltaTime>>1));
543  if ( newRechargePeriod > 0xFFFF ) {
544  newRechargePeriod = 0xFFFF;
545  }
546  powerQualGlobals.pdRechargePeriod = newRechargePeriod;
547  }
548  }
549 }
550 
551 
552 //*****************************************************************************
553 //
554 // SysCtrl_DCDC_VoltageConditionalControl()
555 //
556 //*****************************************************************************
557 void
559 {
560  uint32_t batThreshold ; // Fractional format with 8 fractional bits.
561  uint32_t aonBatmonBat ; // Fractional format with 8 fractional bits.
562  uint32_t ccfg_ModeConfReg ; // Holds a copy of the CCFG_O_MODE_CONF register.
563  uint32_t aonSysctlPwrctl ; // Reflect whats read/written to the AON_SYSCTL_O_PWRCTL register.
564 
565  //
566  // We could potentially call this function before any battery voltage measurement
567  // is made/available. In that case we must make sure that we do not turn off the DCDC.
568  // This can be done by doing nothing as long as the battery voltage is 0 (Since the
569  // reset value of the battery voltage register is 0).
570  //
571  aonBatmonBat = HWREG( AON_BATMON_BASE + AON_BATMON_O_BAT );
572  if ( aonBatmonBat != 0 ) {
573  //
574  // Check if Voltage Conditional Control is enabled
575  // It is enabled if both:
576  // - DCDC in use (either in active or recharge mode), (in use if one of the corresponding CCFG bits are zero).
577  // - Alternative DCDC settings are enabled ( DIS_ALT_DCDC_SETTING == 0 )
578  //
579  ccfg_ModeConfReg = HWREG( CCFG_BASE + CCFG_O_MODE_CONF );
580 
581  if (((( ccfg_ModeConfReg & CCFG_MODE_CONF_DCDC_RECHARGE_M ) == 0 ) ||
582  (( ccfg_ModeConfReg & CCFG_MODE_CONF_DCDC_ACTIVE_M ) == 0 ) ) &&
584  {
585  aonSysctlPwrctl = HWREG( AON_SYSCTL_BASE + AON_SYSCTL_O_PWRCTL );
586  batThreshold = (((( HWREG( CCFG_BASE + CCFG_O_MODE_CONF_1 ) &
588  CCFG_MODE_CONF_1_ALT_DCDC_VMIN_S ) + 28 ) << 4 );
589 
590  if ( aonSysctlPwrctl & ( AON_SYSCTL_PWRCTL_DCDC_EN_M | AON_SYSCTL_PWRCTL_DCDC_ACTIVE_M )) {
591  //
592  // DCDC is ON, check if it should be switched off
593  //
594  if ( aonBatmonBat < batThreshold ) {
596 
597  HWREG( AON_SYSCTL_BASE + AON_SYSCTL_O_PWRCTL ) = aonSysctlPwrctl;
598  }
599  } else {
600  //
601  // DCDC is OFF, check if it should be switched on
602  //
603  if ( aonBatmonBat > batThreshold ) {
604  if (( ccfg_ModeConfReg & CCFG_MODE_CONF_DCDC_RECHARGE_M ) == 0 ) aonSysctlPwrctl |= AON_SYSCTL_PWRCTL_DCDC_EN_M ;
605  if (( ccfg_ModeConfReg & CCFG_MODE_CONF_DCDC_ACTIVE_M ) == 0 ) aonSysctlPwrctl |= AON_SYSCTL_PWRCTL_DCDC_ACTIVE_M ;
606 
607  HWREG( AON_SYSCTL_BASE + AON_SYSCTL_O_PWRCTL ) = aonSysctlPwrctl;
608  }
609  }
610  }
611  }
612 }
613 
614 
615 //*****************************************************************************
616 //
617 // SysCtrlResetSourceGet()
618 //
619 //*****************************************************************************
620 uint32_t
622 {
624  return ( RSTSRC_WAKEUP_FROM_SHUTDOWN );
625  } else {
626  return (( HWREG( AON_SYSCTL_BASE + AON_SYSCTL_O_RESETCTL ) &
629  }
630 }
#define AUX_WUC_TDC_CLOCK
Definition: aux_wuc.h:113
#define PRCM_PERIPH_TIMER1
Definition: prcm.h:181
static void AONWUCAuxWakeupEvent(uint32_t ui32Mode)
Control the wake up procedure of the AUX domain.
Definition: aon_wuc.h:476
#define XOSC_IN_HIGH_POWER_MODE
Definition: sys_ctrl.h:135
static uint32_t AONWUCPowerStatusGet(void)
Get the power status of the device.
Definition: aon_wuc.h:556
static void OSCHfSourceSwitch(void)
Switch the high frequency clock.
Definition: osc.h:265
void AUXWUCClockEnable(uint32_t ui32Clocks)
Enable clocks for peripherals in the AUX domain.
Definition: aux_wuc.c:64
#define OSC_SRC_CLK_MF
Definition: osc.h:107
static const uint32_t g_pui32ModuleCG[]
Definition: sys_ctrl.c:95
#define AUX_WUC_OSCCTRL_CLOCK
Definition: aux_wuc.h:109
void SysCtrl_DCDC_VoltageConditionalControl(void)
Turns DCDC on or off depending of what is considered to be optimal usage.
Definition: sys_ctrl.c:558
uint32_t AUXWUCClockStatus(uint32_t ui32Clocks)
Get the status of a clock.
Definition: aux_wuc.c:162
#define PRCM_PERIPH_TRNG
Definition: prcm.h:191
#define PRCM_PERIPH_I2S
Definition: prcm.h:194
int32_t AONBatMonTemperatureGetDegC(void)
Get the current temperature measurement as a signed value in Deg Celsius.
Definition: aon_batmon.c:55
uint32_t OSCClockSourceGet(uint32_t ui32SrcClk)
Get the source clock settings.
Definition: osc.c:144
uint8_t pdState
Definition: sys_ctrl.c:79
#define PRCM_PERIPH_TIMER0
Definition: prcm.h:180
uint32_t PRCMPowerDomainStatus(uint32_t ui32Domains)
Get the status for a specific power domain.
Definition: prcm.c:610
#define AUX_WUC_CLOCK_READY
Definition: aux_wuc.h:119
uint32_t SysCtrlResetSourceGet(void)
Returns last reset source (including "wakeup from shutdown").
Definition: sys_ctrl.c:621
#define CCFG_MODE_CONF_VDDR_TRIM_SLEEP_DELTA_WIDTH
Definition: sys_ctrl.c:326
#define PRCM_DOMAIN_VIMS
Definition: prcm.h:142
#define AUX_WUC_AIODIO0_CLOCK
Definition: aux_wuc.h:104
#define PD_STATE_XOSC_LPM
Definition: sys_ctrl.c:73
#define AUX_WUC_ADI_CLOCK
Definition: aux_wuc.h:110
#define PD_STATE_CACHE_RET
Definition: sys_ctrl.c:71
#define PRCM_PERIPH_TIMER2
Definition: prcm.h:182
void OSCInterfaceEnable(void)
Enable System CPU access to the OSC_DIG module.
Definition: osc.c:178
#define AONWUC_AUX_POWER_ON
Definition: aon_wuc.h:172
#define OSC_SRC_CLK_HF
Definition: osc.h:106
void PRCMPeripheralSleepEnable(uint32_t ui32Peripheral)
Enables a peripheral in sleep mode.
Definition: prcm.c:530
#define OSC_RCOSC_HF
Definition: osc.h:110
#define AUX_WUC_AIODIO1_CLOCK
Definition: aux_wuc.h:105
#define PRCM_DOMAIN_PERIPH
Definition: prcm.h:138
#define PD_STATE_EXT_REG_MODE
Definition: sys_ctrl.c:74
static bool PRCMLoadGet(void)
Check if any of the load sensitive register has been updated.
Definition: prcm.h:574
#define OSC_XOSC_HF
Definition: osc.h:111
#define PRCM_PERIPH_SSI0
Definition: prcm.h:184
#define AONWUC_AUX_WAKEUP
Definition: aon_wuc.h:152
#define OSC_SRC_CLK_LF
Definition: osc.h:108
#define PRCM_PERIPH_TIMER3
Definition: prcm.h:183
#define PRCM_PERIPH_SSI1
Definition: prcm.h:185
void SysCtrlAdjustRechargeAfterPowerDown(void)
Adjust Recharge calculations to be used next.
Definition: sys_ctrl.c:511
static PowerQualGlobals_t powerQualGlobals
Definition: sys_ctrl.c:83
#define AUX_WUC_SMPH_CLOCK
Definition: aux_wuc.h:103
#define PD_STATE_RFMEM_RET
Definition: sys_ctrl.c:72
#define PRCM_PERIPH_CRYPTO
Definition: prcm.h:190
void SysCtrlShutdown(void)
Force the system in to shutdown.
Definition: sys_ctrl.c:285
void SysCtrlStandby(void)
Force the system in to standby mode.
Definition: sys_ctrl.c:214
#define AUX_WUC_REF_CLOCK
Definition: aux_wuc.h:115
#define PRCM_PERIPH_GPIO
Definition: prcm.h:193
#define PWRCTRL_STANDBY
Definition: pwr_ctrl.h:105
void PowerCtrlStateSet(uint32_t ui32Powerstate)
Force the system into low power modes.
Definition: pwr_ctrl.c:60
#define PRCM_PERIPH_UART0
Definition: prcm.h:186
#define OSC_RCOSC_LF
Definition: osc.h:112
#define PRCM_PERIPH_UDMA
Definition: prcm.h:192
void SysCtrlSetRechargeBeforePowerDown(uint32_t xoscPowerMode)
Set Recharge values before entering Power Down.
Definition: sys_ctrl.c:334
#define AUX_WUC_TDCIF_CLOCK
Definition: aux_wuc.h:108
#define PWRCTRL_SHUTDOWN
Definition: pwr_ctrl.h:107
static void PRCMDomainEnable(uint32_t ui32Domains)
Enable clock domains in the MCU voltage domain.
Definition: prcm.h:604
#define PRCM_DOMAIN_POWER_ON
Definition: prcm.h:153
void PRCMPowerDomainOn(uint32_t ui32Domains)
Turn power on in power domains in the MCU domain.
Definition: prcm.c:396
#define AUX_WUC_ANAIF_CLOCK
Definition: aux_wuc.h:107
#define PRCM_DOMAIN_SERIAL
Definition: prcm.h:136
#define PRCM_DOMAIN_RFCORE
Definition: prcm.h:134
static void PRCMLoadSet(void)
Use this function to synchronize the load settings.
Definition: prcm.h:554
void PRCMPeripheralRunEnable(uint32_t ui32Peripheral)
Enables a peripheral in Run mode.
Definition: prcm.c:490
void PRCMPeripheralDeepSleepEnable(uint32_t ui32Peripheral)
Enables a peripheral in deep-sleep mode.
Definition: prcm.c:570
uint32_t pdTime
Definition: sys_ctrl.c:77
#define AUX_WUC_ADC_CLOCK
Definition: aux_wuc.h:114
void SysCtrlPowerdown(void)
Force the system in to power down.
Definition: sys_ctrl.c:244
void OSCClockSourceSet(uint32_t ui32SrcClk, uint32_t ui32Osc)
Configure the oscillator input to the a source clock.
Definition: osc.c:85
#define RSTSRC_WAKEUP_FROM_SHUTDOWN
Definition: sys_ctrl.h:365
static void OSCInterfaceDisable(void)
Disable System CPU access to the OSC_DIG module.
Definition: osc.h:303
uint16_t pdRechargePeriod
Definition: sys_ctrl.c:78
#define OSC_XOSC_LF
Definition: osc.h:113
#define PRCM_PERIPH_I2C0
Definition: prcm.h:188
#define PWRCTRL_POWER_DOWN
Definition: pwr_ctrl.h:106
#define AUX_WUC_TIMER_CLOCK
Definition: aux_wuc.h:106
void SysCtrlPowerEverything(void)
Power up everything.
Definition: sys_ctrl.c:118