Astra MCU SDK Peripheral Driver Library
Loading...
Searching...
No Matches

Topics

 Enumerated Types
 Enumerated types for the PCSM driver.
 Data Structures
 Data structures describing PCSM state.
 Functions
 Wakeup and power-mode control APIs.

Detailed Description

The PCSM driver provides APIs for wakeup configuration, domain stability checks, power-state queries, and deep-sleep mode control.

Use these APIs to configure wakeup masks/polarity and drive platform power state transitions through PCSM control registers.

Features:

  • Wakeup source mask and polarity configuration
  • Wakeup mask readback and selective clear
  • Power domain stable-state query
  • Power-state readback and deep-sleep mode control mapping

Configuration Considerations

Typical usage flow:

  1. Configure wake sources via pcsm_set_wakeup.
  2. Read back applied mask using pcsm_get_wakeup_mask.
  3. Apply deep-sleep policy with pcsm_ctrl_config_ds_mode.
  4. Monitor status using is_power_domain_stable and get_power_state.

Usage Examples

Configure Wakeup Mask and Polarity

uint32_t wake_mask = (1U << 0) | (1U << 3);
uint32_t wake_pol = (1U << 3);
if (pcsm_set_wakeup(PCSM_INSTANCE_0, wake_mask, wake_pol) != PCSM_OK) {
/* handle error */
}

Configure Deep-Sleep Mode

if (pcsm_ctrl_config_ds_mode(PCSM_INSTANCE_0, PM_STATE_MEM_RET) != PCSM_OK) {
/* handle error */
}