pub enum WakeupSource {
LpCore = 0,
Gpio = 2,
Usb = 3,
Uart1 = 7,
Uart0 = 8,
Ext1 = 12,
Timer = 13,
Wifi = 22,
WifiBeacon = 23,
Bt = 25,
}Expand description
A source that can wake the chip from sleep.
Each variant models a single bit in the wakeup registers. Internal representation shared
by [WakeTriggers][crate::rtc_cntl::sleep::WakeTriggers] (the sources configured to
end a sleep) and WakeupReason (the source(s) that caused the most recent wakeup,
see wakeup_cause)
The available variants depend on the target chip.
Variants§
LpCore = 0
LP core wakeup.
Gpio = 2
GPIO wakeup.
Usb = 3
USB wakeup.
Uart1 = 7
UART1 wakeup.
Uart0 = 8
UART0 wakeup.
Ext1 = 12
EXT1 wakeup, via one or more RTC GPIOs (RTC_CNTL).
Timer = 13
Timer wakeup.
Wifi = 22
Wi-Fi (MAC) wakeup.
WifiBeacon = 23
Wi-Fi beacon wakeup.
Bt = 25
Bluetooth wakeup.
Implementations§
Source§impl WakeupSource
impl WakeupSource
Sourcepub fn enable_with_hooks(
self,
entry: Option<SleepEntryHook>,
exit: Option<SleepExitHook>,
)
Available on crate feature unstable only.
pub fn enable_with_hooks( self, entry: Option<SleepEntryHook>, exit: Option<SleepExitHook>, )
unstable only.Enables this source and registers the hooks that run around a sleep.
A source has one slot for each kind of hook, so a second call replaces the hooks of the first call. One driver owns each source, so only that driver can replace its own hooks. A call for a source that is already enabled does this.
Both hooks run with the flash accessible, so they need no ram attribute. The
entry hook runs before esp-hal writes the sleep configuration to hardware, and the exit hook
runs after the wake sequence restores it. Both hooks are part of sleep entry, so keep them
short.
Only the driver that owns the source calls this. esp-hal owns the sources of its own drivers, for example the timer source. A call for such a source replaces the hooks of that driver, and the driver then does not work through a sleep.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Sourcepub fn disable(self)
Available on crate feature unstable only.
pub fn disable(self)
unstable only.Disables this source, and removes its hooks.
Only the driver that owns the source calls this, as for Self::enable_with_hooks.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
Trait Implementations§
Source§impl<O: Into<EnumSet<WakeupSource>>> BitAnd<O> for WakeupSource
Available on crate feature unstable only.
impl<O: Into<EnumSet<WakeupSource>>> BitAnd<O> for WakeupSource
unstable only.Source§impl<O: Into<EnumSet<WakeupSource>>> BitOr<O> for WakeupSource
Available on crate feature unstable only.
impl<O: Into<EnumSet<WakeupSource>>> BitOr<O> for WakeupSource
unstable only.Source§impl<O: Into<EnumSet<WakeupSource>>> BitXor<O> for WakeupSource
Available on crate feature unstable only.
impl<O: Into<EnumSet<WakeupSource>>> BitXor<O> for WakeupSource
unstable only.Source§impl Clone for WakeupSource
Available on crate feature unstable only.
impl Clone for WakeupSource
unstable only.impl Copy for WakeupSource
unstable only.Source§impl Debug for WakeupSource
Available on crate feature unstable only.
impl Debug for WakeupSource
unstable only.Source§impl EnumSetConstHelper for WakeupSource
Available on crate feature unstable only.
impl EnumSetConstHelper for WakeupSource
unstable only.Source§const CONST_INIT_HELPER: __EnumSetInitHelper = __EnumSetInitHelper
const CONST_INIT_HELPER: __EnumSetInitHelper = __EnumSetInitHelper
ConstInitHelper.Source§const CONST_OP_HELPER: __EnumSetOpHelper = __EnumSetOpHelper
const CONST_OP_HELPER: __EnumSetOpHelper = __EnumSetOpHelper
ConstOpHelper.Source§type ConstInitHelper = __EnumSetInitHelper
type ConstInitHelper = __EnumSetInitHelper
Source§type ConstOpHelper = __EnumSetOpHelper
type ConstOpHelper = __EnumSetOpHelper
impl EnumSetType for WakeupSource
unstable only.Source§impl EnumSetTypePrivate for WakeupSource
Available on crate feature unstable only.
impl EnumSetTypePrivate for WakeupSource
unstable only.Source§const ALL_BITS: <Self as EnumSetTypePrivate>::Repr = 46150029
const ALL_BITS: <Self as EnumSetTypePrivate>::Repr = 46150029
Source§const VARIANT_COUNT: u32 = 10u32
const VARIANT_COUNT: u32 = 10u32
Source§fn enum_into_u32(self) -> u32
fn enum_into_u32(self) -> u32
Source§unsafe fn enum_from_u32(val: u32) -> Self
unsafe fn enum_from_u32(val: u32) -> Self
Source§unsafe fn enum_from_u32_checked(val: u32) -> Self
unsafe fn enum_from_u32_checked(val: u32) -> Self
impl Eq for WakeupSource
unstable only.Source§impl Not for WakeupSource
Available on crate feature unstable only.
impl Not for WakeupSource
unstable only.Source§impl PartialEq for WakeupSource
Available on crate feature unstable only.
impl PartialEq for WakeupSource
unstable only.Source§impl PartialEq<EnumSet<WakeupSource>> for WakeupSource
Available on crate feature unstable only.
impl PartialEq<EnumSet<WakeupSource>> for WakeupSource
unstable only.Source§impl<O: Into<EnumSet<WakeupSource>>> Sub<O> for WakeupSource
Available on crate feature unstable only.
impl<O: Into<EnumSet<WakeupSource>>> Sub<O> for WakeupSource
unstable only.Auto Trait Implementations§
impl Freeze for WakeupSource
impl RefUnwindSafe for WakeupSource
impl Send for WakeupSource
impl Sync for WakeupSource
impl Unpin for WakeupSource
impl UnsafeUnpin for WakeupSource
impl UnwindSafe for WakeupSource
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)