<alp/power.h> — System Power
System-power-mode control: run, sleep, deep-sleep, standby, shutdown.
Header
#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
| Mode | Description |
|---|---|
RUN | All cores active. |
IDLE | CPU clock-gated; peripherals active. |
SLEEP | Core in WFI; some peripherals retain state. |
DEEP_SLEEP | Power-gated cores; RAM retention; wake via configured source. |
STANDBY | Lowest power; only backup domain alive. |
SHUTDOWN | Hard power-off; full reset on wake. |
Not every SoC supports every mode; capability is exposed via <alp/soc_caps.h>.
See also
<alp/wdt.h>— wake from watchdog<alp/rtc.h>— wake on alarm
Questions about this page? Discuss in Community Forum