esp32s2/rtc_cntl/
slp_wakeup_cause.rs

1#[doc = "Register `SLP_WAKEUP_CAUSE` reader"]
2pub type R = crate::R<SLP_WAKEUP_CAUSE_SPEC>;
3#[doc = "Field `WAKEUP_CAUSE` reader - Stores the wakeup cause."]
4pub type WAKEUP_CAUSE_R = crate::FieldReader<u32>;
5impl R {
6    #[doc = "Bits 0:16 - Stores the wakeup cause."]
7    #[inline(always)]
8    pub fn wakeup_cause(&self) -> WAKEUP_CAUSE_R {
9        WAKEUP_CAUSE_R::new(self.bits & 0x0001_ffff)
10    }
11}
12#[cfg(feature = "impl-register-debug")]
13impl core::fmt::Debug for R {
14    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
15        f.debug_struct("SLP_WAKEUP_CAUSE")
16            .field("wakeup_cause", &self.wakeup_cause())
17            .finish()
18    }
19}
20#[doc = "Stores the sleep-to-wakeup cause.\n\nYou can [`read`](crate::Reg::read) this register and get [`slp_wakeup_cause::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
21pub struct SLP_WAKEUP_CAUSE_SPEC;
22impl crate::RegisterSpec for SLP_WAKEUP_CAUSE_SPEC {
23    type Ux = u32;
24}
25#[doc = "`read()` method returns [`slp_wakeup_cause::R`](R) reader structure"]
26impl crate::Readable for SLP_WAKEUP_CAUSE_SPEC {}
27#[doc = "`reset()` method sets SLP_WAKEUP_CAUSE to value 0"]
28impl crate::Resettable for SLP_WAKEUP_CAUSE_SPEC {
29    const RESET_VALUE: u32 = 0;
30}