Skip to main content

<alp/power.h> — System Power

System-power-mode control: run, sleep, deep-sleep, standby, shutdown.

#include <alp/power.h>

Quick example

alp_power_set_mode(ALP_POWER_MODE_SLEEP);

// Configure wake source
alp_power_enable_wake_source(ALP_POWER_WAKE_GPIO, E1M_GPIO_IO0);

// Enter deep sleep until wake
alp_power_set_mode(ALP_POWER_MODE_DEEP_SLEEP);

Modes

ModeDescription
RUNAll cores active.
IDLECPU clock-gated; peripherals active.
SLEEPCore in WFI; some peripherals retain state.
DEEP_SLEEPPower-gated cores; RAM retention; wake via configured source.
STANDBYLowest power; only backup domain alive.
SHUTDOWNHard power-off; full reset on wake.

Not every SoC supports every mode; capability is exposed via <alp/soc_caps.h>.

See also

Questions about this page? Discuss in Community Forum