pub struct Ext0WakeupSource<P: RtcIoWakeupPinType> { /* private fields */ }
Available on crate feature
unstable
only.Expand description
External wake-up source (Ext0).
let delay = Delay::new();
let mut rtc = Rtc::new(peripherals.LPWR);
let config = InputConfig::default().with_pull(Pull::None);
let mut pin_4 = peripherals.GPIO4;
let pin_4_input = Input::new(pin_4.reborrow(), config);
let reason = reset_reason(Cpu::ProCpu);
let wake_reason = wakeup_cause();
println!("{:?} {?}", reason, wake_reason);
let timer = TimerWakeupSource::new(Duration::from_secs(30));
core::mem::drop(pin_4_input);
let ext0 = Ext0WakeupSource::new(pin_4, WakeupLevel::High);
delay.delay_millis(100);
rtc.sleep_deep(&[&timer, &ext0]);
Implementations§
Source§impl<P: RtcIoWakeupPinType> Ext0WakeupSource<P>
impl<P: RtcIoWakeupPinType> Ext0WakeupSource<P>
Sourcepub fn new(pin: P, level: WakeupLevel) -> Self
pub fn new(pin: P, level: WakeupLevel) -> Self
Creates a new external wake-up source (Ext0``) with the specified pin and wake-up level.
Trait Implementations§
Source§impl<P: RtcPin> Drop for Ext0WakeupSource<P>
impl<P: RtcPin> Drop for Ext0WakeupSource<P>
Source§impl<P: RtcPin> WakeSource for Ext0WakeupSource<P>
impl<P: RtcPin> WakeSource for Ext0WakeupSource<P>
Source§fn apply(
&self,
_rtc: &Rtc<'_>,
triggers: &mut WakeTriggers,
sleep_config: &mut RtcSleepConfig,
)
fn apply( &self, _rtc: &Rtc<'_>, triggers: &mut WakeTriggers, sleep_config: &mut RtcSleepConfig, )
Configures the RTC and applies the wakeup triggers.