PowerControl

Trait PowerControl 

Source
pub trait PowerControl {
    // Required method
    fn request_power_off(&self);

    // Provided method
    fn request_reboot(&self) { ... }
}
Expand description

Optional power-control hook for higher layers (e.g. the CLI).

Implementations request a controlled shutdown — the actual sequencing (display, storage flush, GPIO sense, entering System OFF, etc.) lives in the firmware that owns those peripherals. This call MUST return promptly; it’s typically a Signal::signal(()) to a shutdown task.

Required Methods§

Provided Methods§

Source

fn request_reboot(&self)

Request a soft reboot. The default implementation is a no-op; targets without a wired reboot path can leave it as such. Like request_power_off, this MUST return promptly — typically a Signal::signal(()) to a reboot task that performs any final flushes before triggering a system reset.

Implementors§