MTB CAT1 Peripheral driver library

General Description

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. More...
 
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. More...
 
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. More...
 
cy_en_syspm_status_t Cy_SysPm_SetSOCMemPartActivePwrMode (cy_en_syspm_socmem_sram_partition_index_t socmemSramPartNum, cy_en_syspm_socmem_sram_pwr_mode_t socmemSramPwrMode)
 Set Active mode Power Mode for a particular partition of SRAM in SOCMEM. More...
 
cy_en_syspm_status_t Cy_SysPm_SetSOCMemPartDsPwrMode (cy_en_syspm_socmem_sram_partition_index_t socmemSramPartNum, cy_en_syspm_socmem_sram_pwr_mode_t socmemSramPwrMode)
 Set DS mode Power Mode for a particular partition of SRAM in SOCMEM. More...
 
cy_en_syspm_socmem_sram_pwr_mode_t Cy_SysPm_GetSOCMemSramPartActivePwrMode (cy_en_syspm_socmem_sram_partition_index_t socmemSramPartNum)
 Function to get Active mode Power Mode for a particular SOCMEM SRAM Partition. More...
 
cy_en_syspm_socmem_sram_pwr_mode_t Cy_SysPm_GetSOCMemSramPartDsPwrMode (cy_en_syspm_socmem_sram_partition_index_t socmemSramPartNum)
 Function to get DS mode Power Mode for a particular SOCMEM SRAM Partition. More...
 
cy_en_syspm_status_t Cy_SysPm_WriteVoltageBitForFlash (cy_en_syspm_flash_voltage_bit_t value)
 Function that changes the voltage setting for flash. More...
 
void Cy_SysPm_SaveRegisters (cy_stc_syspm_backup_regs_t *regs)
 
void Cy_SysPm_RestoreRegisters (cy_stc_syspm_backup_regs_t const *regs)
 

Function Documentation

◆ Cy_SysPm_SetSRAMMacroPwrMode()

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.

Parameters
sramNumSRAM'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.
sramMacroNumMacro number of 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.
Parameters
sramPwrModePower Mode that needs to be set.
Returns
  • 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.
Note
CAT1B and CAT1D devices do not support CY_SYSPM_SRAM_PWR_MODE_RET, only CY_SYSPM_SRAM_PWR_MODE_ON and CY_SYSPM_SRAM_PWR_MODE_OFF power modes are supported.

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.

◆ Cy_SysPm_GetSRAMMacroPwrMode()

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.

Parameters
sramNumSRAM'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.
sramMacroNumMacro number of 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.
CAT1B and CAT1D devices do not support CY_SYSPM_SRAM_PWR_MODE_RET, only CY_SYSPM_SRAM_PWR_MODE_ON and CY_SYSPM_SRAM_PWR_MODE_OFF power modes are supported.
Returns
Returns SRAM power mode. See cy_en_syspm_sram_pwr_mode_t.

◆ Cy_SysPm_SetSRAMPwrMode()

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.

Parameters
sramNumSRAM'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.
sramPwrModePower Mode that needs to be set.
Returns
  • CY_SYSPM_SUCCESS - SRAM power mode is set.
  • CY_SYSPM_BAD_PARAM - Input parameters are out of range. See cy_en_syspm_status_t.
Note
CAT1B and CAT1D devices do not support CY_SYSPM_SRAM_PWR_MODE_RET, only CY_SYSPM_SRAM_PWR_MODE_ON and CY_SYSPM_SRAM_PWR_MODE_OFF power modes are supported.

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.

◆ Cy_SysPm_SetSOCMemPartActivePwrMode()

cy_en_syspm_status_t Cy_SysPm_SetSOCMemPartActivePwrMode ( cy_en_syspm_socmem_sram_partition_index_t  socmemSramPartNum,
cy_en_syspm_socmem_sram_pwr_mode_t  socmemSramPwrMode 
)

Set Active mode Power Mode for a particular partition of SRAM in SOCMEM.

Parameters
socmemSramPartNumSOCMEM- SRAM's Partition Number See cy_en_syspm_socmem_sram_partition_index_t.
socmemSramPwrModePower Mode that needs to be set. See cy_en_syspm_socmem_sram_pwr_mode_t.
Returns
  • CY_SYSPM_SUCCESS - SRAM power mode is set.
  • CY_SYSPM_BAD_PARAM - Input parameters are out of range. See cy_en_syspm_status_t.

◆ Cy_SysPm_SetSOCMemPartDsPwrMode()

cy_en_syspm_status_t Cy_SysPm_SetSOCMemPartDsPwrMode ( cy_en_syspm_socmem_sram_partition_index_t  socmemSramPartNum,
cy_en_syspm_socmem_sram_pwr_mode_t  socmemSramPwrMode 
)

Set DS mode Power Mode for a particular partition of SRAM in SOCMEM.

Parameters
socmemSramPartNumSOCMEM- SRAM's Partition Number See cy_en_syspm_socmem_sram_partition_index_t.
socmemSramPwrModePower Mode that needs to be set. See cy_en_syspm_socmem_sram_pwr_mode_t.
Returns
  • CY_SYSPM_SUCCESS - SRAM power mode is set.
  • CY_SYSPM_BAD_PARAM - Input parameters are out of range. See cy_en_syspm_status_t.

◆ Cy_SysPm_GetSOCMemSramPartActivePwrMode()

cy_en_syspm_socmem_sram_pwr_mode_t Cy_SysPm_GetSOCMemSramPartActivePwrMode ( cy_en_syspm_socmem_sram_partition_index_t  socmemSramPartNum)

Function to get Active mode Power Mode for a particular SOCMEM SRAM Partition.

Parameters
socmemSramPartNumSOCMEM- SRAM's Partition Number See cy_en_syspm_socmem_sram_partition_index_t.
Returns
Returns SRAM power mode. See cy_en_syspm_socmem_sram_pwr_mode_t.

◆ Cy_SysPm_GetSOCMemSramPartDsPwrMode()

cy_en_syspm_socmem_sram_pwr_mode_t Cy_SysPm_GetSOCMemSramPartDsPwrMode ( cy_en_syspm_socmem_sram_partition_index_t  socmemSramPartNum)

Function to get DS mode Power Mode for a particular SOCMEM SRAM Partition.

Parameters
socmemSramPartNumSOCMEM- SRAM's Partition Number See cy_en_syspm_socmem_sram_partition_index_t.
Returns
Returns SRAM power mode. See cy_en_syspm_socmem_sram_pwr_mode_t.

◆ Cy_SysPm_WriteVoltageBitForFlash()

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.
Parameters
valueValue to be set in the flash voltage control register. See cy_en_syspm_flash_voltage_bit_t.
Returns
  • 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.
Note
This API is available for CAT1A devices.
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);

◆ Cy_SysPm_SaveRegisters()

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.
Parameters
regsThe structure where the registers are saved.
Note
This API is available for CAT1A devices.
Function Usage
/* Scenario: There is a need to save the non-retained UDB registers while
* in system Deep Sleep routine.
*/
/* Save non-retained UDB registers */
SCB_SCR |= SCB_SCR_SLEEPDEEP_Msk;
__WFI();
/* Restore non-retained UDB registers after system Deep Sleep */

◆ Cy_SysPm_RestoreRegisters()

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.
Parameters
regsThe structure with data stored (using Cy_SysPm_SaveRegisters()) into the required registers after Deep Sleep.
Note
This API is available for CAT1A devices.
Function Usage
/* Scenario: There is a need to save the non-retained UDB registers while
* in system Deep Sleep routine.
*/
/* Save non-retained UDB registers */
SCB_SCR |= SCB_SCR_SLEEPDEEP_Msk;
__WFI();
/* Restore non-retained UDB registers after system Deep Sleep */