//! The driver that owns the hardware enables a wakeup source. The caller of a sleep function does
//! through a deep-sleep wake. Sleep entry reads the mask back, and calculates everything else from
/// refuse a light sleep, or shorten the sleep. The caller of the sleep function selects how much
/// of the chip to power down, and it arms the wake timer. A wakeup source only adds the resources
/// that it needs, refuses the sleep, or sets a shorter limit. It cannot request a power-down, stop
/// Keep this property. A method that requests a power-down, stops a clock, cancels a refusal, or
/// It also runs when a hook refuses a light sleep. An entry hook may already have changed a pad,
/// Both hooks run with the flash accessible, so they need no [`ram`][crate::ram] attribute. The
/// entry hook runs before esp-hal writes the sleep configuration to hardware, and the exit hook
/// A source rejects a sleep if the source is already asserted when the sleep starts. Without the
/// sources are the enabled wake sources that the chip can also reject on. A chip cannot reject on
/// every source that it can wake from. esp32 rejects on GPIO and SDIO only, and esp32c2, esp32c3,
/// One [`WrappedSleepConfig::reject_sleep`] is enough. The caller ignores the refusal for a deep
/// sleep. The wake resets the chip, so there is no caller to report the refusal to. The shortest
/// The mask as read at sleep entry selects the hooks. A hook can enable another source. The GPIO
/// therefore reads the mask again after the hooks. It does not run the hooks again until the mask
/// The caller writes the kind of the sleep to the configuration before this call, so that the hooks
/// A light sleep calls this after the wake. A refused light sleep calls it too, so an entry hook
/// can undo a pad change. A sleep that a limit ends before it starts calls it for the same reason.