Power_s32k1xx

Detailed Description

Data Structures

struct  power_manager_user_config_t
 Power mode user configuration structure. More...
 
struct  smc_power_mode_protection_config_t
 Power mode protection configuration. More...
 
struct  smc_power_mode_config_t
 Power mode control configuration used for calling the SMC_SYS_SetPowerMode API. More...
 
struct  smc_version_info_t
 SMC module version number. More...
 
struct  rcm_version_info_t
 RCM module version number. More...
 

Enumerations

enum  power_manager_modes_t {
  POWER_MANAGER_RUN, POWER_MANAGER_VLPR, POWER_MANAGER_STOP1, POWER_MANAGER_STOP2,
  POWER_MANAGER_VLPS, POWER_MANAGER_MAX
}
 Power modes enumeration. More...
 
enum  power_mode_stat_t {
  STAT_RUN = 0x01, STAT_STOP = 0x02, STAT_VLPR = 0x04, STAT_VLPW = 0x08,
  STAT_VLPS = 0x10, STAT_HSRUN = 0x80, STAT_INVALID = 0xFF
}
 Power Modes in PMSTAT. More...
 
enum  power_modes_protect_t { ALLOW_HSRUN, ALLOW_VLP, ALLOW_MAX }
 Power Modes Protection. More...
 
enum  smc_run_mode_t { SMC_RUN, SMC_RESERVED_RUN, SMC_VLPR, SMC_HSRUN }
 Run mode definition. More...
 
enum  smc_stop_mode_t { SMC_STOP = 0U, SMC_RESERVED_STOP1 = 1U, SMC_VLPS = 2U }
 Stop mode definition. More...
 
enum  smc_stop_option_t { SMC_STOP_RESERVED = 0x00, SMC_STOP1 = 0x01, SMC_STOP2 = 0x02 }
 STOP option. More...
 
enum  pmc_int_select_t { PMC_INT_LOW_VOLT_DETECT, PMC_INT_LOW_VOLT_WARN }
 Power management control interrupts. More...
 
enum  rcm_source_names_t {
  RCM_LOW_VOLT_DETECT = 1U, RCM_LOSS_OF_CLK = 2U, RCM_LOSS_OF_LOCK = 3U, RCM_CMU_LOC = 4U,
  RCM_WATCH_DOG = 5U, RCM_EXTERNAL_PIN = 6U, RCM_POWER_ON = 7U, RCM_SJTAG = 8U,
  RCM_CORE_LOCKUP = 9U, RCM_SOFTWARE = 10U, RCM_SMDM_AP = 11U, RCM_STOP_MODE_ACK_ERR = 13U,
  RCM_SRC_NAME_MAX
}
 System Reset Source Name definitions Implements rcm_source_names_t_Class. More...
 
enum  rcm_filter_run_wait_modes_t { RCM_FILTER_DISABLED, RCM_FILTER_BUS_CLK, RCM_FILTER_LPO_CLK, RCM_FILTER_RESERVED }
 Reset pin filter select in Run and Wait modes. More...
 
enum  rcm_reset_delay_time_t { RCM_10LPO_CYCLES_DELAY, RCM_34LPO_CYCLES_DELAY, RCM_130LPO_CYCLES_DELAY, RCM_514LPO_CYCLES_DELAY }
 Reset delay time. More...
 

Functions

status_t POWER_SYS_DoInit (void)
 This function implementation-specific configuration of power modes. More...
 
status_t POWER_SYS_DoDeinit (void)
 This function implementation-specific de-initialization of power manager. More...
 
status_t POWER_SYS_DoSetMode (const power_manager_user_config_t *const configPtr)
 This function configures the power mode. More...
 
bool POWER_SYS_GetResetSrcStatusCmd (const RCM_Type *const baseAddr, const rcm_source_names_t srcName)
 Gets the reset source status. More...
 

Enumeration Type Documentation

Power management control interrupts.

Enumerator
PMC_INT_LOW_VOLT_DETECT 

Low Voltage Detect Interrupt

PMC_INT_LOW_VOLT_WARN 

Low Voltage Warning Interrupt

Definition at line 206 of file power_manager_S32K1xx.h.

Power modes enumeration.

Defines power modes. Used in the power mode configuration structure (power_manager_user_config_t). From ARM core perspective, Power modes can be generally divided into run modes (High speed run, Run and Very low power run), sleep (Wait and Very low power wait) and deep sleep modes (all Stop modes). List of power modes supported by specific chip along with requirements for entering and exiting of these modes can be found in chip documentation. List of all supported power modes:

  • POWER_MANAGER_HSRUN - High speed run mode.
  • POWER_MANAGER_RUN - Run mode.
  • POWER_MANAGER_VLPR - Very low power run mode.
  • POWER_MANAGER_WAIT - Wait mode.
  • POWER_MANAGER_VLPW - Very low power wait mode.
  • POWER_MANAGER_PSTOP1 - Partial stop 1 mode.
  • POWER_MANAGER_PSTOP2 - Partial stop 2 mode.
  • POWER_MANAGER_PSTOP1 - Stop 1 mode.
  • POWER_MANAGER_PSTOP2 - Stop 2 mode.
  • POWER_MANAGER_VLPS - Very low power stop mode. Implements power_manager_modes_t_Class
Enumerator
POWER_MANAGER_RUN 

Run mode.

POWER_MANAGER_VLPR 

Very low power run mode.

POWER_MANAGER_STOP1 

Stop 1 mode.

POWER_MANAGER_STOP2 

Stop 2 mode.

POWER_MANAGER_VLPS 

Very low power stop mode.

POWER_MANAGER_MAX 

Definition at line 61 of file power_manager_S32K1xx.h.

Power Modes in PMSTAT.

Enumerator
STAT_RUN 

0000_0001 - Current power mode is RUN

STAT_STOP 

0000_0010 - Current power mode is STOP

STAT_VLPR 

0000_0100 - Current power mode is VLPR

STAT_VLPW 

0000_1000 - Current power mode is VLPW

STAT_VLPS 

0001_0000 - Current power mode is VLPS

STAT_HSRUN 

1000_0000 - Current power mode is HSRUN

STAT_INVALID 

1111_1111 - Non-existing power mode

Definition at line 108 of file power_manager_S32K1xx.h.

Power Modes Protection.

Enumerator
ALLOW_HSRUN 

Allow High Speed Run mode

ALLOW_VLP 

Allow Very-Low-Power Modes

ALLOW_MAX 

Definition at line 123 of file power_manager_S32K1xx.h.

Reset pin filter select in Run and Wait modes.

Enumerator
RCM_FILTER_DISABLED 

All filtering disabled

RCM_FILTER_BUS_CLK 

Bus clock filter enabled

RCM_FILTER_LPO_CLK 

LPO clock filter enabled

RCM_FILTER_RESERVED 

Reserved setting

Definition at line 239 of file power_manager_S32K1xx.h.

Reset delay time.

Enumerator
RCM_10LPO_CYCLES_DELAY 

reset delay time 10 LPO cycles

RCM_34LPO_CYCLES_DELAY 

reset delay time 34 LPO cycles

RCM_130LPO_CYCLES_DELAY 

reset delay time 130 LPO cycles

RCM_514LPO_CYCLES_DELAY 

reset delay time 514 LPO cycles

Definition at line 252 of file power_manager_S32K1xx.h.

System Reset Source Name definitions Implements rcm_source_names_t_Class.

Enumerator
RCM_LOW_VOLT_DETECT 

Low voltage detect reset

RCM_LOSS_OF_CLK 

Loss of clock reset

RCM_LOSS_OF_LOCK 

Loss of lock reset

RCM_CMU_LOC 

CMU Loss of lock reset

RCM_WATCH_DOG 

Watch dog reset

RCM_EXTERNAL_PIN 

External pin reset

RCM_POWER_ON 

Power on reset

RCM_SJTAG 

JTAG generated reset

RCM_CORE_LOCKUP 

core lockup reset

RCM_SOFTWARE 

Software reset

RCM_SMDM_AP 

MDM-AP system reset

RCM_STOP_MODE_ACK_ERR 

Stop mode ack error reset

RCM_SRC_NAME_MAX 

Definition at line 216 of file power_manager_S32K1xx.h.

Run mode definition.

Enumerator
SMC_RUN 

normal RUN mode

SMC_RESERVED_RUN 
SMC_VLPR 

Very-Low-Power RUN mode

SMC_HSRUN 

High Speed Run mode (HSRUN)

Definition at line 134 of file power_manager_S32K1xx.h.

Stop mode definition.

Enumerator
SMC_STOP 

Normal STOP mode

SMC_RESERVED_STOP1 

Reserved

SMC_VLPS 

Very-Low-Power STOP mode

Definition at line 145 of file power_manager_S32K1xx.h.

STOP option.

Enumerator
SMC_STOP_RESERVED 

Reserved stop mode

SMC_STOP1 

Stop with both system and bus clocks disabled

SMC_STOP2 

Stop with system clock disabled and bus clock enabled

Definition at line 156 of file power_manager_S32K1xx.h.

Function Documentation

status_t POWER_SYS_DoDeinit ( void  )

This function implementation-specific de-initialization of power manager.

This function performs the actual implementation-specific de-initialization.

Returns
Operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failed.

Definition at line 178 of file power_manager_S32K1xx.c.

status_t POWER_SYS_DoInit ( void  )

This function implementation-specific configuration of power modes.

This function performs the actual implementation-specific initialization based on the provided power mode configurations.

Returns
Operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failed.

Definition at line 141 of file power_manager_S32K1xx.c.

status_t POWER_SYS_DoSetMode ( const power_manager_user_config_t *const  configPtr)

This function configures the power mode.

This function performs the actual implementation-specific logic to switch to one of the defined power modes.

Parameters
configPtrPointer to user configuration structure
Returns
Operation status
  • STATUS_SUCCESS: Operation was successful.
  • STATUS_ERROR: Operation failed.

Definition at line 191 of file power_manager_S32K1xx.c.

bool POWER_SYS_GetResetSrcStatusCmd ( const RCM_Type *const  baseAddr,
const rcm_source_names_t  srcName 
)

Gets the reset source status.

This function gets the current reset source status for a specified source.

Parameters
[in]baseAddrRegister base address of RCM
[in]srcNamereset source name
Returns
status True or false for specified reset source

Definition at line 639 of file power_manager_S32K1xx.c.