Power

../_images/pwr.svg

Examples

HAL

Warning

doxygenfile: Cannot find file “halmcu/hal/pwr.h

LL

Enums

enum pwr_mode_t

Power mode enumeration

Values:

enumerator PWR_MODE_RUN

Normal running mode

enumerator PWR_MODE_SLEEP

CPU clock gets stopped while core peripherals are kept running

enumerator PWR_MODE_DEEP_SLEEP

Not only CPU clock but also most of peripheral clocks get stopped. External clock sources are also get off

enumerator PWR_MODE_BLACKOUT

RTC is the only one running. SRAM and peripheral registers are not preserved

Functions

void pwr_reset(void)

Reset PWR unit.

This function makes PWR unit the reset state.

void pwr_reboot(void)

Software system reset

uint32_t pwr_get_reboot_source(void)

Get reboot source

void pwr_clear_reboot_source(uint32_t bitmask)

Clear reboot source

void pwr_set_mode(pwr_mode_t sleep_mode)

Set power(sleep) mode

void pwr_set_wakeup_source(periph_t peri)

Set wakeup source

void pwr_clear_wakeup_source(periph_t peri)

Clear wakeup source

uint32_t pwr_get_wakeup_source(void)

Get wakeup source

void pwr_enable_peripheral(periph_t peri)

Enable peripheral

void pwr_disable_peripheral(periph_t peri)

Disable peripheral