CC26xx Driver Library |

- Main Page
- Related Pages
- CC26xx APIs
- Register Descriptions
- Online Resources

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions | Enumerations
[sysctrl] System Controller

## Functions
void | SysCtrlPowerEverything (void)
| Power up everything. More...
void | SysCtrlStandby (void)
| Force the system into standby mode. More...
void | SysCtrlPowerdown (void)
| Force the system into power down. More...
void | SysCtrlShutdown (void)
| Force the system into shutdown. More...
uint32_t | SysCtrlClockGet (void)
| Get the CPU core clock frequency. More...
uint32_t | SysCtrlPeripheralClockGet (uint32_t ui32Peripheral, uint32_t ui32BusMode)
| Get the clock for a peripheral. More...
__STATIC_INLINE void | SysCtrlAonSync (void)
| Sync all accesses to the AON register interface. More...
__STATIC_INLINE void | SysCtrlAonUpdate (void)
| Update all interfaces to AON. More...
void | SysCtrlSetRechargeBeforePowerDown (XoscPowerMode_t xoscPowerMode)
| Set Recharge values before entering Power Down. More...
void | SysCtrlAdjustRechargeAfterPowerDown (void)
| Adjust Recharge calculations to be used next. More...
void | SysCtrl_DCDC_VoltageConditionalControl (void)
| Turns DCDC on or off depending of what’s considered to be optimal usage. More...
uint32_t | SysCtrlResetSourceGet (void)
| Returns last reset source (including "wakeup from shutdown") More...

## Enumerations
enum | XoscPowerMode_t { XoscInHighPowerMode = 0, XoscInLowPowerMode }
| Enumeration describing possible input options to SysCtrlSetRechargeBeforePowerDown(). More...
#define | RSTSRC_PWR_ON (( AON_SYSCTL_RESETCTL_RESET_SRC_PWR_ON >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))
#define | RSTSRC_PIN_RESET (( AON_SYSCTL_RESETCTL_RESET_SRC_PIN_RESET >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))
#define | RSTSRC_VDDS_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_VDDS_LOSS >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))
#define | RSTSRC_VDD_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_VDD_LOSS >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))
#define | RSTSRC_VDDR_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_VDDR_LOSS >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))
#define | RSTSRC_CLK_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_CLK_LOSS >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))
#define | RSTSRC_SYSRESET (( AON_SYSCTL_RESETCTL_RESET_SRC_SYSRESET >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))
#define | RSTSRC_WARMRESET (( AON_SYSCTL_RESETCTL_RESET_SRC_WARMRESET >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))
#define | RSTSRC_WAKEUP_FROM_SHUTDOWN (( AON_SYSCTL_RESETCTL_RESET_SRC_M >> AON_SYSCTL_RESETCTL_RESET_SRC_S ) + 1 )

## Detailed Description

## Function Documentation

void SysCtrl_DCDC_VoltageConditionalControl | ( | void |  | ) |

Turns DCDC on or off depending of what’s considered to be optimal usage.

This function controls the DCDC only if both the following CCFG settings are TRUE: 1) DCDC is configured to be used 2) Alternative DCDC settings are defined and enabled. The DCDC is configured in accordance to the CCFG settings when turned on. This function should be called periodically.

Returns
  None

Definition at line 658 of file sys_ctrl.c.

void SysCtrlAdjustRechargeAfterPowerDown | ( | void |  | ) |

Adjust Recharge calculations to be used next.

This function shall be called just after returning from Power Down.

Reads the results from the adaptive recharge controller and current chip temperature. This is used as additional information when calculating optimal recharge controller settings next time (When SysCtrlSetRechargeBeforePowerDown() is called next time).

Note
  Special care must be taken to make sure that the AON registers read are updated after the wakeup. Writing to an AON register and then calling SysCtrlAonSync() will handle this. Typically this must be done anyway, for example by calling AONWUCAuxWakeupEvent() and then later on calling SysCtrlAonSync() just before calling SysCtrlSetRechargeBeforePowerDown().

Returns
  None

Definition at line 609 of file sys_ctrl.c.

__STATIC_INLINE void SysCtrlAonSync | ( | void |  | ) |

Sync all accesses to the AON register interface.

When this function returns, all writes to the AON register interface is guaranteed to have progressed to hardware.

Returns
  None

Definition at line 248 of file sys_ctrl.h.

__STATIC_INLINE void SysCtrlAonUpdate | ( | void |  | ) |

Update all interfaces to AON.

When this function returns, at least 1 clock cycle has progressed on the AON domain, so that any outstanding updates to and from the AON interface is guaranteed to be in sync.

Note
  This function should primarily be used after wakeup from sleep modes, as it will guarantee that all shadow registers on the interface between MCU and AON are updated. If a write has been done to the AON interface it is sufficient to call the SysCtrlAonSync().

Returns
  None

Definition at line 273 of file sys_ctrl.h.

uint32_t SysCtrlClockGet | ( | void |  | ) |

Get the CPU core clock frequency.

Use this function to retreive the current clock frequency for the CPU.

The CPU can run from 48 MHz and down to 750kHz. The frequency is defined by the combined division factor of the SYSBUS and the CPU clock divider.

Returns
  Returns the current CPU core clock frequency.

Definition at line 338 of file sys_ctrl.c.

uint32_t SysCtrlPeripheralClockGet | ( | uint32_t | ui32Peripheral,
|  | uint32_t | ui32BusMode
| ) |  |

Get the clock for a peripheral.

Use this function for retrieving the current clock frequency for a specific MCU domain peripheral. The clock source for many of the peripheral changes if the System Bus is gated. The `ui32Mode` parameter specifies for which state of the System Bus the peripheral clock should be calculated.

Note
  No checks are made for peripheral clock gating. It is left to the programmer to ensure that the clock for a peripheral is not gated.

Parameters

  ui32Peripheral | identifies the peripheral for which to return the clock frequency.
  ui32BusMode | is the mode of the System Bus. SYSCTRL_SYSBUS_OFF SYSCTRL_SYSBUS_ON

Returns
  Returns the clock speed of the selected peripheral.

Definition at line 364 of file sys_ctrl.c.

void SysCtrlPowerdown | ( | void |  | ) |

Force the system into power down.

Note
  The sequencing in this function is not necessarily how you would want to sequence the powerdown in a real application. There might be application specific prerequisites you would want to do before entering powerdown which deviate from this specific implementation.

Returns
  None

Force the system into power down.

Definition at line 255 of file sys_ctrl.c.

void SysCtrlPowerEverything | ( | void |  | ) |

Power up everything.

Note
  The sequencing in this function is not necessarily how you would want to sequence active mode in a real application. There might be application specific prerequisites or hardware restrictions you would want to consider which deviate from this specific implementation.

Returns
  None

Definition at line 121 of file sys_ctrl.c.

uint32_t SysCtrlResetSourceGet | ( | void |  | ) |

Returns last reset source (including "wakeup from shutdown")

Returns
  Returns on of the RSTSRC_.. defines

Definition at line 711 of file sys_ctrl.c.

void SysCtrlSetRechargeBeforePowerDown | ( | XoscPowerMode_t | xoscPowerMode | ) |

Set Recharge values before entering Power Down.

This function shall be called just before entering Power Down. It calculates an optimal and safe recharge setting of the adaptive recharge controller. The results of previous setting are also taken into account.

Note
  In order to make sure that the register writes are completed, SysCtrlAonSync() must be called before entering standby/power down. This is not done internally in this function due to two reasons:
  - 1) There might be other register writes that must be synchronized as well.
  - 2) It is possible to save some time by doing other things before calling SysCtrlAonSync() since this call will not return before there are no outstanding write requests between MCU and AON.

Parameters

  xoscPowerMode | (typically running in XoscInHighPowerMode all the time).

Returns
  None

Definition at line 452 of file sys_ctrl.c.

void SysCtrlShutdown | ( | void |  | ) |

Force the system into shutdown.

Note
  It is solely the programmer's responsibility to properly configure an interrupt that will enable the device to wakeup from the shutdown mode, before calling this function. In shutdown the only possible wakeup action is an IO interrupt.
  The sequencing in this function is not necessarily how you would want to sequence the shutdown in a real application. There might be application specific prerequisites you would want to do before entering shutdown which deviate from this specific implementation.

Returns
  This function does not return.

Force the system into shutdown.

Definition at line 296 of file sys_ctrl.c.

void SysCtrlStandby | ( | void |  | ) |

Force the system into standby mode.

Note
  The sequencing in this function is not necessarily how you would want to sequence the standby in a real application. There might be application specific prerequisites you would want to do before entering standby which deviate from this specific implementation.

Returns
  None

Force the system into standby mode.

Definition at line 225 of file sys_ctrl.c.

## Macro Definition Documentation

#define CPU_DEEP_SLEEP 0x00000002

Definition at line 130 of file sys_ctrl.h.

#define CPU_RUN 0x00000000

Definition at line 128 of file sys_ctrl.h.

#define CPU_SLEEP 0x00000001

Definition at line 129 of file sys_ctrl.h.

#define RSTSRC_CLK_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_CLK_LOSS >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))

Definition at line 375 of file sys_ctrl.h.

#define RSTSRC_PIN_RESET (( AON_SYSCTL_RESETCTL_RESET_SRC_PIN_RESET >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))

Definition at line 371 of file sys_ctrl.h.

#define RSTSRC_PWR_ON (( AON_SYSCTL_RESETCTL_RESET_SRC_PWR_ON >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))

Definition at line 370 of file sys_ctrl.h.

#define RSTSRC_SYSRESET (( AON_SYSCTL_RESETCTL_RESET_SRC_SYSRESET >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))

Definition at line 376 of file sys_ctrl.h.

#define RSTSRC_VDD_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_VDD_LOSS >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))

Definition at line 373 of file sys_ctrl.h.

#define RSTSRC_VDDR_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_VDDR_LOSS >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))

Definition at line 374 of file sys_ctrl.h.

#define RSTSRC_VDDS_LOSS (( AON_SYSCTL_RESETCTL_RESET_SRC_VDDS_LOSS >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))

Definition at line 372 of file sys_ctrl.h.

#define RSTSRC_WAKEUP_FROM_SHUTDOWN (( AON_SYSCTL_RESETCTL_RESET_SRC_M >> AON_SYSCTL_RESETCTL_RESET_SRC_S ) + 1 )

Definition at line 378 of file sys_ctrl.h.

Referenced by SysCtrlResetSourceGet().

#define RSTSRC_WARMRESET (( AON_SYSCTL_RESETCTL_RESET_SRC_WARMRESET >> AON_SYSCTL_RESETCTL_RESET_SRC_S ))

Definition at line 377 of file sys_ctrl.h.

#define SYSCTRL_SYSBUS_OFF 0x00000000

Definition at line 121 of file sys_ctrl.h.

Referenced by SysCtrlPeripheralClockGet().

#define SYSCTRL_SYSBUS_ON 0x00000001

Definition at line 120 of file sys_ctrl.h.

Referenced by SysCtrlPeripheralClockGet().

## Enumeration Type Documentation

enum XoscPowerMode_t

Enumeration describing possible input options to SysCtrlSetRechargeBeforePowerDown().

Inform the SysCtrlSetRechargeBeforePowerDown() function whether the XOSC is in High or Low power mode. This is typically set by calling the function OSCXHfPowerModeSet().

Enumerator
XoscInHighPowerMode | When xosc_hf is in HIGH_POWER_XOSC.
XoscInLowPowerMode | When xosc_hf is in LOW_POWER_XOSC.

Definition at line 294 of file sys_ctrl.h.