Module power

Module power 

Source
Expand description

Power intents and supporting state.

Defines the PowerIntent enum that multiple sources (button task, CLI command dispatcher, low-battery monitor, USB-CDC 1200-baud touch handler) submit via an embassy channel to the single power_task.

This module deliberately stays free of embassy / hardware details so the intent vocabulary and the low-battery shutdown logic can be exercised without a runtime. The dispatch loop that maps intents to bsp::enter_* calls lives next to the runtime wiring.

Structs§

LowBatteryDetector
Tracks consecutive low-battery samples and emits a PowerIntent::PowerOff once the streak crosses the configured threshold while the device is not USB-powered.

Enums§

PowerIntent
Things the firmware can decide to do that take the device out of its normal operating state. All variants are terminal — the calling task must assume the device will be reset or powered off shortly after the intent is delivered.
PowerIntentSource
Why a PowerIntent was submitted. Useful for logging and post-mortem reporting via the persisted panic / event log.