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§
- LowBattery
Detector - Tracks consecutive low-battery samples and emits a
PowerIntent::PowerOffonce the streak crosses the configured threshold while the device is not USB-powered.
Enums§
- Power
Intent - 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.
- Power
Intent Source - Why a
PowerIntentwas submitted. Useful for logging and post-mortem reporting via the persisted panic / event log.