esp32/rtc_cntl/
state0.rs

1#[doc = "Register `STATE0` reader"]
2pub type R = crate::R<STATE0_SPEC>;
3#[doc = "Register `STATE0` writer"]
4pub type W = crate::W<STATE0_SPEC>;
5#[doc = "Field `TOUCH_WAKEUP_FORCE_EN` reader - touch controller force wake up"]
6pub type TOUCH_WAKEUP_FORCE_EN_R = crate::BitReader;
7#[doc = "Field `TOUCH_WAKEUP_FORCE_EN` writer - touch controller force wake up"]
8pub type TOUCH_WAKEUP_FORCE_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `ULP_CP_WAKEUP_FORCE_EN` reader - ULP-coprocessor force wake up"]
10pub type ULP_CP_WAKEUP_FORCE_EN_R = crate::BitReader;
11#[doc = "Field `ULP_CP_WAKEUP_FORCE_EN` writer - ULP-coprocessor force wake up"]
12pub type ULP_CP_WAKEUP_FORCE_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `APB2RTC_BRIDGE_SEL` reader - 1: APB to RTC using bridge 0: APB to RTC using sync"]
14pub type APB2RTC_BRIDGE_SEL_R = crate::BitReader;
15#[doc = "Field `APB2RTC_BRIDGE_SEL` writer - 1: APB to RTC using bridge 0: APB to RTC using sync"]
16pub type APB2RTC_BRIDGE_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `TOUCH_SLP_TIMER_EN` reader - touch timer enable bit"]
18pub type TOUCH_SLP_TIMER_EN_R = crate::BitReader;
19#[doc = "Field `TOUCH_SLP_TIMER_EN` writer - touch timer enable bit"]
20pub type TOUCH_SLP_TIMER_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `ULP_CP_SLP_TIMER_EN` reader - ULP-coprocessor timer enable bit"]
22pub type ULP_CP_SLP_TIMER_EN_R = crate::BitReader;
23#[doc = "Field `ULP_CP_SLP_TIMER_EN` writer - ULP-coprocessor timer enable bit"]
24pub type ULP_CP_SLP_TIMER_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `SDIO_ACTIVE_IND` reader - SDIO active indication"]
26pub type SDIO_ACTIVE_IND_R = crate::BitReader;
27#[doc = "Field `SLP_WAKEUP` reader - sleep wakeup bit"]
28pub type SLP_WAKEUP_R = crate::BitReader;
29#[doc = "Field `SLP_WAKEUP` writer - sleep wakeup bit"]
30pub type SLP_WAKEUP_W<'a, REG> = crate::BitWriter<'a, REG>;
31#[doc = "Field `SLP_REJECT` reader - sleep reject bit"]
32pub type SLP_REJECT_R = crate::BitReader;
33#[doc = "Field `SLP_REJECT` writer - sleep reject bit"]
34pub type SLP_REJECT_W<'a, REG> = crate::BitWriter<'a, REG>;
35#[doc = "Field `SLEEP_EN` reader - sleep enable bit"]
36pub type SLEEP_EN_R = crate::BitReader;
37#[doc = "Field `SLEEP_EN` writer - sleep enable bit"]
38pub type SLEEP_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
39impl R {
40    #[doc = "Bit 20 - touch controller force wake up"]
41    #[inline(always)]
42    pub fn touch_wakeup_force_en(&self) -> TOUCH_WAKEUP_FORCE_EN_R {
43        TOUCH_WAKEUP_FORCE_EN_R::new(((self.bits >> 20) & 1) != 0)
44    }
45    #[doc = "Bit 21 - ULP-coprocessor force wake up"]
46    #[inline(always)]
47    pub fn ulp_cp_wakeup_force_en(&self) -> ULP_CP_WAKEUP_FORCE_EN_R {
48        ULP_CP_WAKEUP_FORCE_EN_R::new(((self.bits >> 21) & 1) != 0)
49    }
50    #[doc = "Bit 22 - 1: APB to RTC using bridge 0: APB to RTC using sync"]
51    #[inline(always)]
52    pub fn apb2rtc_bridge_sel(&self) -> APB2RTC_BRIDGE_SEL_R {
53        APB2RTC_BRIDGE_SEL_R::new(((self.bits >> 22) & 1) != 0)
54    }
55    #[doc = "Bit 23 - touch timer enable bit"]
56    #[inline(always)]
57    pub fn touch_slp_timer_en(&self) -> TOUCH_SLP_TIMER_EN_R {
58        TOUCH_SLP_TIMER_EN_R::new(((self.bits >> 23) & 1) != 0)
59    }
60    #[doc = "Bit 24 - ULP-coprocessor timer enable bit"]
61    #[inline(always)]
62    pub fn ulp_cp_slp_timer_en(&self) -> ULP_CP_SLP_TIMER_EN_R {
63        ULP_CP_SLP_TIMER_EN_R::new(((self.bits >> 24) & 1) != 0)
64    }
65    #[doc = "Bit 28 - SDIO active indication"]
66    #[inline(always)]
67    pub fn sdio_active_ind(&self) -> SDIO_ACTIVE_IND_R {
68        SDIO_ACTIVE_IND_R::new(((self.bits >> 28) & 1) != 0)
69    }
70    #[doc = "Bit 29 - sleep wakeup bit"]
71    #[inline(always)]
72    pub fn slp_wakeup(&self) -> SLP_WAKEUP_R {
73        SLP_WAKEUP_R::new(((self.bits >> 29) & 1) != 0)
74    }
75    #[doc = "Bit 30 - sleep reject bit"]
76    #[inline(always)]
77    pub fn slp_reject(&self) -> SLP_REJECT_R {
78        SLP_REJECT_R::new(((self.bits >> 30) & 1) != 0)
79    }
80    #[doc = "Bit 31 - sleep enable bit"]
81    #[inline(always)]
82    pub fn sleep_en(&self) -> SLEEP_EN_R {
83        SLEEP_EN_R::new(((self.bits >> 31) & 1) != 0)
84    }
85}
86#[cfg(feature = "impl-register-debug")]
87impl core::fmt::Debug for R {
88    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
89        f.debug_struct("STATE0")
90            .field("touch_wakeup_force_en", &self.touch_wakeup_force_en())
91            .field("ulp_cp_wakeup_force_en", &self.ulp_cp_wakeup_force_en())
92            .field("apb2rtc_bridge_sel", &self.apb2rtc_bridge_sel())
93            .field("touch_slp_timer_en", &self.touch_slp_timer_en())
94            .field("ulp_cp_slp_timer_en", &self.ulp_cp_slp_timer_en())
95            .field("sdio_active_ind", &self.sdio_active_ind())
96            .field("slp_wakeup", &self.slp_wakeup())
97            .field("slp_reject", &self.slp_reject())
98            .field("sleep_en", &self.sleep_en())
99            .finish()
100    }
101}
102impl W {
103    #[doc = "Bit 20 - touch controller force wake up"]
104    #[inline(always)]
105    pub fn touch_wakeup_force_en(&mut self) -> TOUCH_WAKEUP_FORCE_EN_W<STATE0_SPEC> {
106        TOUCH_WAKEUP_FORCE_EN_W::new(self, 20)
107    }
108    #[doc = "Bit 21 - ULP-coprocessor force wake up"]
109    #[inline(always)]
110    pub fn ulp_cp_wakeup_force_en(&mut self) -> ULP_CP_WAKEUP_FORCE_EN_W<STATE0_SPEC> {
111        ULP_CP_WAKEUP_FORCE_EN_W::new(self, 21)
112    }
113    #[doc = "Bit 22 - 1: APB to RTC using bridge 0: APB to RTC using sync"]
114    #[inline(always)]
115    pub fn apb2rtc_bridge_sel(&mut self) -> APB2RTC_BRIDGE_SEL_W<STATE0_SPEC> {
116        APB2RTC_BRIDGE_SEL_W::new(self, 22)
117    }
118    #[doc = "Bit 23 - touch timer enable bit"]
119    #[inline(always)]
120    pub fn touch_slp_timer_en(&mut self) -> TOUCH_SLP_TIMER_EN_W<STATE0_SPEC> {
121        TOUCH_SLP_TIMER_EN_W::new(self, 23)
122    }
123    #[doc = "Bit 24 - ULP-coprocessor timer enable bit"]
124    #[inline(always)]
125    pub fn ulp_cp_slp_timer_en(&mut self) -> ULP_CP_SLP_TIMER_EN_W<STATE0_SPEC> {
126        ULP_CP_SLP_TIMER_EN_W::new(self, 24)
127    }
128    #[doc = "Bit 29 - sleep wakeup bit"]
129    #[inline(always)]
130    pub fn slp_wakeup(&mut self) -> SLP_WAKEUP_W<STATE0_SPEC> {
131        SLP_WAKEUP_W::new(self, 29)
132    }
133    #[doc = "Bit 30 - sleep reject bit"]
134    #[inline(always)]
135    pub fn slp_reject(&mut self) -> SLP_REJECT_W<STATE0_SPEC> {
136        SLP_REJECT_W::new(self, 30)
137    }
138    #[doc = "Bit 31 - sleep enable bit"]
139    #[inline(always)]
140    pub fn sleep_en(&mut self) -> SLEEP_EN_W<STATE0_SPEC> {
141        SLEEP_EN_W::new(self, 31)
142    }
143}
144#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`state0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`state0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
145pub struct STATE0_SPEC;
146impl crate::RegisterSpec for STATE0_SPEC {
147    type Ux = u32;
148}
149#[doc = "`read()` method returns [`state0::R`](R) reader structure"]
150impl crate::Readable for STATE0_SPEC {}
151#[doc = "`write(|w| ..)` method takes [`state0::W`](W) writer structure"]
152impl crate::Writable for STATE0_SPEC {
153    type Safety = crate::Unsafe;
154}
155#[doc = "`reset()` method sets STATE0 to value 0x0030_0000"]
156impl crate::Resettable for STATE0_SPEC {
157    const RESET_VALUE: u32 = 0x0030_0000;
158}