Synergy Software Package User's Manual

Power Profiles Framework. More...

Macros

#define SF_POWER_PROFILES_V2_CODE_VERSION_MAJOR   (2U)
 

Functions

ssp_err_t SF_POWER_PROFILES_V2_Open (sf_power_profiles_v2_ctrl_t *const p_ctrl, sf_power_profiles_v2_cfg_t const *const p_cfg)
 Configures the Power Profiles framework and opens any required HAL layer drivers that will be used. More...
 
ssp_err_t SF_POWER_PROFILES_V2_RunApply (sf_power_profiles_v2_ctrl_t *const p_ctrl, sf_power_profiles_v2_run_cfg_t const *const p_cfg)
 Applies a Run profile. More...
 
ssp_err_t SF_POWER_PROFILES_V2_LowPowerApply (sf_power_profiles_v2_ctrl_t *const p_ctrl, sf_power_profiles_v2_low_power_cfg_t const *const p_cfg)
 Applies a Low Power profile. More...
 
ssp_err_t SF_POWER_PROFILES_V2_Close (sf_power_profiles_v2_ctrl_t *const p_ctrl)
 Closes the framework. More...
 
ssp_err_t SF_POWER_PROFILES_V2_VersionGet (ssp_version_t *const p_version)
 Gets version and stores it in provided pointer p_version. More...
 

Detailed Description

Power Profiles Framework.

Macro Definition Documentation

◆ SF_POWER_PROFILES_V2_CODE_VERSION_MAJOR

#define SF_POWER_PROFILES_V2_CODE_VERSION_MAJOR   (2U)

Version of code that implements the API defined in this file

Function Documentation

◆ SF_POWER_PROFILES_V2_Close()

ssp_err_t SF_POWER_PROFILES_V2_Close ( sf_power_profiles_v2_ctrl_t *const  p_ctrl)

Closes the framework.

Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONp_ctrl is NULL.
SSP_ERR_NOT_OPENPower profiles framework is not open.
SSP_ERR_IN_USEUnable to obtain mutex.
SSP_ERR_INTERNALUnable to release mutex.

Clear information from control block so other functions know this block is closed.

◆ SF_POWER_PROFILES_V2_LowPowerApply()

ssp_err_t SF_POWER_PROFILES_V2_LowPowerApply ( sf_power_profiles_v2_ctrl_t *const  p_ctrl,
sf_power_profiles_v2_low_power_cfg_t const *const  p_cfg 
)

Applies a Low Power profile.

The SF_POWER_PROFILES_V2_LowPowerApply function will:

  • Apply a LPMv2 configuration to prepare for low power
  • Apply an IO port configuration to prepare for low power, if supplied
  • Notify application that low power is about to be entered
  • Enter low power mode
  • When low power mode is exited, apply an IO port configuration for wake up, if supplied
  • Notify application that wake up has occurred
Return values
SSP_SUCCESSEntered and exited low power mode successfully.
SSP_ERR_ASSERTIONp_ctrl or p_ctrl->p_api is NULL.
SSP_ERR_NOT_OPENPower profiles framework is not open.
SSP_ERR_UNSUPPORTEDThis function is not supported by one of the HAL drivers, r_lpmv2, r_ioport.
SSP_ERR_INVALID_MODEr_lpmv2 mode is not LPMV2_LOW_POWER_MODE_SLEEP but r_lmv2 p_extend is NULL.
SSP_ERR_IN_USEUnable to obtain mutex.
SSP_ERR_INTERNALUnable to release mutex.
Returns
See Common Error Codes, r_ioport, or r_lpmv2 drivers for other possible return codes or causes.

Apply the LPM configuration.

Apply the pre-low power IOPORT configuration.

Notify application.

Enter low power mode.

Apply the post-low power IOPORT configuration.

Notify application.

◆ SF_POWER_PROFILES_V2_Open()

ssp_err_t SF_POWER_PROFILES_V2_Open ( sf_power_profiles_v2_ctrl_t *const  p_ctrl,
sf_power_profiles_v2_cfg_t const *const  p_cfg 
)

Configures the Power Profiles framework and opens any required HAL layer drivers that will be used.

The SF_POWER_PROFILES_V2_Open function initializes the critical data structures and variables.

Return values
SSP_SUCCESSInitialization was successful.
SSP_ERR_ASSERTIONOne of the following parameters may be NULL: p_ctrl, p_api, or p_cfg. See HAL driver for other possible causes.
SSP_ERR_IN_USEPower profiles framework is already open.
SSP_ERR_INTERNALUnable to obtain mutex. Unable to release mutex.
Returns
See Common Error Codes for other possible return codes or causes.

Initialize the LPM HAL driver.

Mark control block open so other tasks know it is valid.

◆ SF_POWER_PROFILES_V2_RunApply()

ssp_err_t SF_POWER_PROFILES_V2_RunApply ( sf_power_profiles_v2_ctrl_t *const  p_ctrl,
sf_power_profiles_v2_run_cfg_t const *const  p_cfg 
)

Applies a Run profile.

The SF_POWER_PROFILES_V2_RunApply function will:

  • Apply an IO port configuration, if supplied
  • Apply a clock configuration
Return values
SSP_SUCCESSInitialization was successful.
SSP_ERR_ASSERTIONOne of the following parameters may be NULL: p_ctrl, p_api, or p_cfg. See HAL driver for other possible causes.
SSP_ERR_INVALID_ARGUMENTClock configuration is invalid.
SSP_ERR_NOT_OPENPower profiles framework is not open.
SSP_ERR_IN_USEUnable to obtain mutex.
SSP_ERR_INTERNALUnable to release mutex.
SSP_ERR_INVALID_HW_CONDITIONIncompatible system clock configuration.
Returns
See Common Error Codes, r_ioport, or r_cgc driver for other possible return codes or causes.

Apply the ioport configuration.

Set the clock config, this also sets the operating mode based on the clock speed.

◆ SF_POWER_PROFILES_V2_VersionGet()

ssp_err_t SF_POWER_PROFILES_V2_VersionGet ( ssp_version_t *const  p_version)

Gets version and stores it in provided pointer p_version.

Return values
SSP_SUCCESSVersion returned successfully.
SSP_ERR_ASSERTIONParameter p_version was null.