esp32s2/rtc_io/
rtc_pad19.rs

1#[doc = "Register `RTC_PAD19` reader"]
2pub type R = crate::R<RTC_PAD19_SPEC>;
3#[doc = "Register `RTC_PAD19` writer"]
4pub type W = crate::W<RTC_PAD19_SPEC>;
5#[doc = "Field `FUN_IE` reader - Input enable in normal execution."]
6pub type FUN_IE_R = crate::BitReader;
7#[doc = "Field `FUN_IE` writer - Input enable in normal execution."]
8pub type FUN_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SLP_OE` reader - Output enable in sleep mode."]
10pub type SLP_OE_R = crate::BitReader;
11#[doc = "Field `SLP_OE` writer - Output enable in sleep mode."]
12pub type SLP_OE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SLP_IE` reader - Input enable in sleep mode."]
14pub type SLP_IE_R = crate::BitReader;
15#[doc = "Field `SLP_IE` writer - Input enable in sleep mode."]
16pub type SLP_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SLP_SEL` reader - 1: enable sleep mode. 0: no sleep mode"]
18pub type SLP_SEL_R = crate::BitReader;
19#[doc = "Field `SLP_SEL` writer - 1: enable sleep mode. 0: no sleep mode"]
20pub type SLP_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `FUN_SEL` reader - Function selection."]
22pub type FUN_SEL_R = crate::FieldReader;
23#[doc = "Field `FUN_SEL` writer - Function selection."]
24pub type FUN_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
25#[doc = "Field `MUX_SEL` reader - 1: use RTC GPIO. 0: use digital GPIO."]
26pub type MUX_SEL_R = crate::BitReader;
27#[doc = "Field `MUX_SEL` writer - 1: use RTC GPIO. 0: use digital GPIO."]
28pub type MUX_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `RUE` reader - Pull-down enable of the pad. 1: internal pull-down enabled. 0: internal pull-down disabled."]
30pub type RUE_R = crate::BitReader;
31#[doc = "Field `RUE` writer - Pull-down enable of the pad. 1: internal pull-down enabled. 0: internal pull-down disabled."]
32pub type RUE_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `RDE` reader - Pull-up enable of the pad. 1: internal pull-up enabled. 0: internal pull-up disabled."]
34pub type RDE_R = crate::BitReader;
35#[doc = "Field `RDE` writer - Pull-up enable of the pad. 1: internal pull-up enabled. 0: internal pull-up disabled."]
36pub type RDE_W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `DRV` reader - Select the drive strength of the pad. 0: ~5 mA. 1: ~10 mA. 2: ~20 mA. 3: ~40 mA."]
38pub type DRV_R = crate::FieldReader;
39#[doc = "Field `DRV` writer - Select the drive strength of the pad. 0: ~5 mA. 1: ~10 mA. 2: ~20 mA. 3: ~40 mA."]
40pub type DRV_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
41impl R {
42    #[doc = "Bit 13 - Input enable in normal execution."]
43    #[inline(always)]
44    pub fn fun_ie(&self) -> FUN_IE_R {
45        FUN_IE_R::new(((self.bits >> 13) & 1) != 0)
46    }
47    #[doc = "Bit 14 - Output enable in sleep mode."]
48    #[inline(always)]
49    pub fn slp_oe(&self) -> SLP_OE_R {
50        SLP_OE_R::new(((self.bits >> 14) & 1) != 0)
51    }
52    #[doc = "Bit 15 - Input enable in sleep mode."]
53    #[inline(always)]
54    pub fn slp_ie(&self) -> SLP_IE_R {
55        SLP_IE_R::new(((self.bits >> 15) & 1) != 0)
56    }
57    #[doc = "Bit 16 - 1: enable sleep mode. 0: no sleep mode"]
58    #[inline(always)]
59    pub fn slp_sel(&self) -> SLP_SEL_R {
60        SLP_SEL_R::new(((self.bits >> 16) & 1) != 0)
61    }
62    #[doc = "Bits 17:18 - Function selection."]
63    #[inline(always)]
64    pub fn fun_sel(&self) -> FUN_SEL_R {
65        FUN_SEL_R::new(((self.bits >> 17) & 3) as u8)
66    }
67    #[doc = "Bit 19 - 1: use RTC GPIO. 0: use digital GPIO."]
68    #[inline(always)]
69    pub fn mux_sel(&self) -> MUX_SEL_R {
70        MUX_SEL_R::new(((self.bits >> 19) & 1) != 0)
71    }
72    #[doc = "Bit 27 - Pull-down enable of the pad. 1: internal pull-down enabled. 0: internal pull-down disabled."]
73    #[inline(always)]
74    pub fn rue(&self) -> RUE_R {
75        RUE_R::new(((self.bits >> 27) & 1) != 0)
76    }
77    #[doc = "Bit 28 - Pull-up enable of the pad. 1: internal pull-up enabled. 0: internal pull-up disabled."]
78    #[inline(always)]
79    pub fn rde(&self) -> RDE_R {
80        RDE_R::new(((self.bits >> 28) & 1) != 0)
81    }
82    #[doc = "Bits 29:30 - Select the drive strength of the pad. 0: ~5 mA. 1: ~10 mA. 2: ~20 mA. 3: ~40 mA."]
83    #[inline(always)]
84    pub fn drv(&self) -> DRV_R {
85        DRV_R::new(((self.bits >> 29) & 3) as u8)
86    }
87}
88#[cfg(feature = "impl-register-debug")]
89impl core::fmt::Debug for R {
90    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
91        f.debug_struct("RTC_PAD19")
92            .field("fun_ie", &self.fun_ie())
93            .field("slp_oe", &self.slp_oe())
94            .field("slp_ie", &self.slp_ie())
95            .field("slp_sel", &self.slp_sel())
96            .field("fun_sel", &self.fun_sel())
97            .field("mux_sel", &self.mux_sel())
98            .field("rue", &self.rue())
99            .field("rde", &self.rde())
100            .field("drv", &self.drv())
101            .finish()
102    }
103}
104impl W {
105    #[doc = "Bit 13 - Input enable in normal execution."]
106    #[inline(always)]
107    pub fn fun_ie(&mut self) -> FUN_IE_W<RTC_PAD19_SPEC> {
108        FUN_IE_W::new(self, 13)
109    }
110    #[doc = "Bit 14 - Output enable in sleep mode."]
111    #[inline(always)]
112    pub fn slp_oe(&mut self) -> SLP_OE_W<RTC_PAD19_SPEC> {
113        SLP_OE_W::new(self, 14)
114    }
115    #[doc = "Bit 15 - Input enable in sleep mode."]
116    #[inline(always)]
117    pub fn slp_ie(&mut self) -> SLP_IE_W<RTC_PAD19_SPEC> {
118        SLP_IE_W::new(self, 15)
119    }
120    #[doc = "Bit 16 - 1: enable sleep mode. 0: no sleep mode"]
121    #[inline(always)]
122    pub fn slp_sel(&mut self) -> SLP_SEL_W<RTC_PAD19_SPEC> {
123        SLP_SEL_W::new(self, 16)
124    }
125    #[doc = "Bits 17:18 - Function selection."]
126    #[inline(always)]
127    pub fn fun_sel(&mut self) -> FUN_SEL_W<RTC_PAD19_SPEC> {
128        FUN_SEL_W::new(self, 17)
129    }
130    #[doc = "Bit 19 - 1: use RTC GPIO. 0: use digital GPIO."]
131    #[inline(always)]
132    pub fn mux_sel(&mut self) -> MUX_SEL_W<RTC_PAD19_SPEC> {
133        MUX_SEL_W::new(self, 19)
134    }
135    #[doc = "Bit 27 - Pull-down enable of the pad. 1: internal pull-down enabled. 0: internal pull-down disabled."]
136    #[inline(always)]
137    pub fn rue(&mut self) -> RUE_W<RTC_PAD19_SPEC> {
138        RUE_W::new(self, 27)
139    }
140    #[doc = "Bit 28 - Pull-up enable of the pad. 1: internal pull-up enabled. 0: internal pull-up disabled."]
141    #[inline(always)]
142    pub fn rde(&mut self) -> RDE_W<RTC_PAD19_SPEC> {
143        RDE_W::new(self, 28)
144    }
145    #[doc = "Bits 29:30 - Select the drive strength of the pad. 0: ~5 mA. 1: ~10 mA. 2: ~20 mA. 3: ~40 mA."]
146    #[inline(always)]
147    pub fn drv(&mut self) -> DRV_W<RTC_PAD19_SPEC> {
148        DRV_W::new(self, 29)
149    }
150}
151#[doc = "Touch pad 19 configuration register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtc_pad19::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtc_pad19::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
152pub struct RTC_PAD19_SPEC;
153impl crate::RegisterSpec for RTC_PAD19_SPEC {
154    type Ux = u32;
155}
156#[doc = "`read()` method returns [`rtc_pad19::R`](R) reader structure"]
157impl crate::Readable for RTC_PAD19_SPEC {}
158#[doc = "`write(|w| ..)` method takes [`rtc_pad19::W`](W) writer structure"]
159impl crate::Writable for RTC_PAD19_SPEC {
160    type Safety = crate::Unsafe;
161}
162#[doc = "`reset()` method sets RTC_PAD19 to value 0x5000_0000"]
163impl crate::Resettable for RTC_PAD19_SPEC {
164    const RESET_VALUE: u32 = 0x5000_0000;
165}