Trait avr_oxide::hal::generic::cpu::SleepControl

source ·
pub trait SleepControl {
    // Required methods
    unsafe fn reset(&mut self);
    fn inhibit_standby(&mut self) -> PermitStandbyToken;
    fn permit_standby(&mut self, token: PermitStandbyToken);
    fn standby_permitted(&self) -> bool;
    fn inhibit_idle(&mut self) -> PermitIdleToken;
    fn permit_idle(&mut self, token: PermitIdleToken);
    fn idle_permitted(&self) -> bool;
}

Required Methods§

source

unsafe fn reset(&mut self)

Reset the sleep mode to default state. Both Idle and Standby mode will be uninhibited.

source

fn inhibit_standby(&mut self) -> PermitStandbyToken

Prevent the CPU going into Standby mode. The CPU will not be allowed to Standby until a corresponding call to permit_standby() is made.

Calls may be nested, but up to a hard limit of 256.

§Panics

Will panic if more than 256 inhibit_sleep() calls are made without corresponding permit_standby().

source

fn permit_standby(&mut self, token: PermitStandbyToken)

Permit the CPU to enter Standby mode, if it was previously inhibited by inhibit_standby().

If stanndby was already permitted, this call does nothing.

source

fn standby_permitted(&self) -> bool

Return true iff the CPU is currently permitted to Standby.

source

fn inhibit_idle(&mut self) -> PermitIdleToken

Prevent the CPU going into Idle mode. The CPU will not be allowed to Idle until a corresponding call to permit_idle() is made.

Calls may be nested, but up to a hard limit of 256.

§Panics

Will panic if more than 256 inhibit_idle() calls are made without corresponding permit_idle().

source

fn permit_idle(&mut self, token: PermitIdleToken)

Permit the CPU to enter Idle mode, if it was previously inhibited by inhibit_idle().

If sleep was already permitted, this call does nothing.

source

fn idle_permitted(&self) -> bool

Return true iff the CPU is currently permitted to Idle.

Implementors§