General

group group_syspm_functions_general

Functions

cy_en_syspm_status_t Cy_SysPm_SetSRAMMacroPwrMode(cy_en_syspm_sram_index_t sramNum, uint32_t sramMacroNum, cy_en_syspm_sram_pwr_mode_t sramPwrMode)

Function to set Power Mode for each of the Macro in a particular SRAM.

note

If SRAM1 and SRAM2 consists of single power partition, power mode will be applied to whole SRAM region, so 0 must be passed for sramMacroNum parameter.

For the PSoC 64 devices there are possible situations when function returns the PRA error status code. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to

cy_en_pra_status_t for more details.
Return

  • CY_SYSPM_SUCCESS - SRAM MACRO power mode is set.

  • CY_SYSPM_BAD_PARAM - Input parameters are out of range. See cy_en_syspm_status_t.

Parameters
  • sramNum: SRAM’s index number has to be passed ex: CY_SYSPM_SRAM0_MEMORY or CY_SYSPM_SRAM1_MEMORY or CY_SYSPM_SRAM2_MEMORY See cy_en_syspm_sram_index_t.

  • sramMacroNum: Macro number of a particular SRAM.

Parameters
  • sramPwrMode: Power Mode that needs to be set.

note

This API is available for CAT1A devices.

cy_en_syspm_sram_pwr_mode_t Cy_SysPm_GetSRAMMacroPwrMode(cy_en_syspm_sram_index_t sramNum, uint32_t sramMacroNum)

Function to get Power Mode for each of the Macro in a particular SRAM.

note

If SRAM1 and SRAM2 consists of single power partition, power mode will be applied to whole SRAM region, so 0 must be passed for sramMacroNum parameter, and the power mode obtained will be for whole SRAM.

note

This API is available for CAT1A devices.

Return

Returns SRAM power mode. See cy_en_syspm_sram_pwr_mode_t.

Parameters
  • sramNum: SRAM’s index number has to be passed ex: CY_SYSPM_SRAM0_MEMORY or CY_SYSPM_SRAM1_MEMORY or CY_SYSPM_SRAM2_MEMORY See cy_en_syspm_sram_index_t.

  • sramMacroNum: Macro number of a particular SRAM.

cy_en_syspm_status_t Cy_SysPm_SetSRAMPwrMode(cy_en_syspm_sram_index_t sramNum, cy_en_syspm_sram_pwr_mode_t sramPwrMode)

Function to set Power Mode for all the Macros for a particular SRAM.

For the PSoC 64 devices there are possible situations when function returns the PRA error status code. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to

cy_en_pra_status_t for more details.
Return

  • CY_SYSPM_SUCCESS - SRAM power mode is set.

  • CY_SYSPM_BAD_PARAM - Input parameters are out of range. See cy_en_syspm_status_t.

Parameters
  • sramNum: SRAM’s index number has to be passed ex: CY_SYSPM_SRAM0_MEMORY or CY_SYSPM_SRAM1_MEMORY or CY_SYSPM_SRAM2_MEMORY See cy_en_syspm_sram_index_t.

  • sramPwrMode: Power Mode that needs to be set.

note

This API is available for CAT1A devices.

cy_en_syspm_status_t Cy_SysPm_WriteVoltageBitForFlash(cy_en_syspm_flash_voltage_bit_t value)

Function that changes the voltage setting for flash.

note

Call this function before system enters ULP mode. Call this function after the system enters LP mode.

Return

  • CY_SYSPM_SUCCESS - The voltage is set.

  • CY_SYSPM_CANCELED - Operation was canceled. Call the function again until the function returns CY_SYSPM_SUCCESS. See cy_en_syspm_status_t.

Function Usage

    
    /* The system may continue operating while the voltage on Vccd 
    * discharges to the new voltage. The time it takes to reach the 
    * new voltage depends on operating conditions, including the load current
    * on Vccd and external capacitor size.
    */
    SRSS_PWR_BUCK_CTL = 
    _CLR_SET_FLD32U((SRSS_PWR_BUCK_CTL), SRSS_PWR_BUCK_CTL_BUCK_OUT1_SEL, (uint32_t) CY_SYSPM_BUCK_OUT1_VOLTAGE_ULP);

Parameters

void Cy_SysPm_SaveRegisters(cy_stc_syspm_backup_regs_t *regs)

note

Behavior of this API is IP dependent.
On CAT1A devices:
Saves non-retained UDB registers and the slow and fast clock dividers before system entering system Deep Sleep. Must be called if programmable logic or function are implemented in the UDB array. Cypress ID #280370, #1451. On CAT1B devices:
Saves non-retained UDB registers before system entering system Deep Sleep. Must be called if programmable logic or function are implemented in the UDB array. Cypress ID #280370.

warning

Only one CPU on dual CPU devices should call this function. If both CPUs call this function the UDB state restored may be inconsistent with the expected state when restored.

Function Usage

    /* Scenario: There is a need to save the non-retained UDB registers while 
    *  in system Deep Sleep routine.
    */
    static cy_stc_syspm_backup_regs_t regs;
    
    /* Save non-retained UDB registers */
    Cy_SysPm_SaveRegisters(&regs);
    
    SCB_SCR |= SCB_SCR_SLEEPDEEP_Msk;

    __WFI();

    /* Restore non-retained UDB registers after system Deep Sleep */
    Cy_SysPm_RestoreRegisters(&regs);

Parameters
  • regs: The structure where the registers are saved.

void Cy_SysPm_RestoreRegisters(cy_stc_syspm_backup_regs_t const *regs)

note

Behavior of this API is IP dependent.
On CAT1A devices: \ Restores non-retained UDB registers and the slow and fast clock dividers before system entering system Deep Sleep. Must be called if programmable logic or function are implemented in the UDB array. Cypress ID #280370, #1451. On CAT1B devices: \ Restores non-retained UDB registers before system entering system Deep Sleep. Must be called if programmable logic or function are implemented in the UDB array. Cypress ID #280370.

warning

Only one CPU on dual CPU devices should call this function. If both CPUs call this function the UDB state restored may be inconsistent with the expected state when restored.

note

CAT1B devices, registers are non-retained type.

Function Usage

    /* Scenario: There is a need to save the non-retained UDB registers while 
    *  in system Deep Sleep routine.
    */
    static cy_stc_syspm_backup_regs_t regs;
    
    /* Save non-retained UDB registers */
    Cy_SysPm_SaveRegisters(&regs);
    
    SCB_SCR |= SCB_SCR_SLEEPDEEP_Msk;

    __WFI();

    /* Restore non-retained UDB registers after system Deep Sleep */
    Cy_SysPm_RestoreRegisters(&regs);

Parameters