esp32/rtc_io/
adc_pad.rs

1#[doc = "Register `ADC_PAD` reader"]
2pub type R = crate::R<ADC_PAD_SPEC>;
3#[doc = "Register `ADC_PAD` writer"]
4pub type W = crate::W<ADC_PAD_SPEC>;
5#[doc = "Field `ADC2_FUN_IE` reader - the input enable of the pad"]
6pub type ADC2_FUN_IE_R = crate::BitReader;
7#[doc = "Field `ADC2_FUN_IE` writer - the input enable of the pad"]
8pub type ADC2_FUN_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `ADC2_SLP_IE` reader - the input enable of the pad in sleep status"]
10pub type ADC2_SLP_IE_R = crate::BitReader;
11#[doc = "Field `ADC2_SLP_IE` writer - the input enable of the pad in sleep status"]
12pub type ADC2_SLP_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `ADC2_SLP_SEL` reader - the sleep status selection signal of the pad"]
14pub type ADC2_SLP_SEL_R = crate::BitReader;
15#[doc = "Field `ADC2_SLP_SEL` writer - the sleep status selection signal of the pad"]
16pub type ADC2_SLP_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `ADC2_FUN_SEL` reader - the functional selection signal of the pad"]
18pub type ADC2_FUN_SEL_R = crate::FieldReader;
19#[doc = "Field `ADC2_FUN_SEL` writer - the functional selection signal of the pad"]
20pub type ADC2_FUN_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
21#[doc = "Field `ADC1_FUN_IE` reader - the input enable of the pad"]
22pub type ADC1_FUN_IE_R = crate::BitReader;
23#[doc = "Field `ADC1_FUN_IE` writer - the input enable of the pad"]
24pub type ADC1_FUN_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `ADC1_SLP_IE` reader - the input enable of the pad in sleep status"]
26pub type ADC1_SLP_IE_R = crate::BitReader;
27#[doc = "Field `ADC1_SLP_IE` writer - the input enable of the pad in sleep status"]
28pub type ADC1_SLP_IE_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `ADC1_SLP_SEL` reader - the sleep status selection signal of the pad"]
30pub type ADC1_SLP_SEL_R = crate::BitReader;
31#[doc = "Field `ADC1_SLP_SEL` writer - the sleep status selection signal of the pad"]
32pub type ADC1_SLP_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `ADC1_FUN_SEL` reader - the functional selection signal of the pad"]
34pub type ADC1_FUN_SEL_R = crate::FieldReader;
35#[doc = "Field `ADC1_FUN_SEL` writer - the functional selection signal of the pad"]
36pub type ADC1_FUN_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
37#[doc = "Field `ADC2_MUX_SEL` reader - Ò1Ó select the digital function Ó0Óslection the rtc function"]
38pub type ADC2_MUX_SEL_R = crate::BitReader;
39#[doc = "Field `ADC2_MUX_SEL` writer - Ò1Ó select the digital function Ó0Óslection the rtc function"]
40pub type ADC2_MUX_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `ADC1_MUX_SEL` reader - Ò1Ó select the digital function Ó0Óslection the rtc function"]
42pub type ADC1_MUX_SEL_R = crate::BitReader;
43#[doc = "Field `ADC1_MUX_SEL` writer - Ò1Ó select the digital function Ó0Óslection the rtc function"]
44pub type ADC1_MUX_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
45#[doc = "Field `ADC2_HOLD` reader - hold the current value of the output when setting the hold to Ò1Ó"]
46pub type ADC2_HOLD_R = crate::BitReader;
47#[doc = "Field `ADC2_HOLD` writer - hold the current value of the output when setting the hold to Ò1Ó"]
48pub type ADC2_HOLD_W<'a, REG> = crate::BitWriter<'a, REG>;
49#[doc = "Field `ADC1_HOLD` reader - hold the current value of the output when setting the hold to Ò1Ó"]
50pub type ADC1_HOLD_R = crate::BitReader;
51#[doc = "Field `ADC1_HOLD` writer - hold the current value of the output when setting the hold to Ò1Ó"]
52pub type ADC1_HOLD_W<'a, REG> = crate::BitWriter<'a, REG>;
53impl R {
54    #[doc = "Bit 18 - the input enable of the pad"]
55    #[inline(always)]
56    pub fn adc2_fun_ie(&self) -> ADC2_FUN_IE_R {
57        ADC2_FUN_IE_R::new(((self.bits >> 18) & 1) != 0)
58    }
59    #[doc = "Bit 19 - the input enable of the pad in sleep status"]
60    #[inline(always)]
61    pub fn adc2_slp_ie(&self) -> ADC2_SLP_IE_R {
62        ADC2_SLP_IE_R::new(((self.bits >> 19) & 1) != 0)
63    }
64    #[doc = "Bit 20 - the sleep status selection signal of the pad"]
65    #[inline(always)]
66    pub fn adc2_slp_sel(&self) -> ADC2_SLP_SEL_R {
67        ADC2_SLP_SEL_R::new(((self.bits >> 20) & 1) != 0)
68    }
69    #[doc = "Bits 21:22 - the functional selection signal of the pad"]
70    #[inline(always)]
71    pub fn adc2_fun_sel(&self) -> ADC2_FUN_SEL_R {
72        ADC2_FUN_SEL_R::new(((self.bits >> 21) & 3) as u8)
73    }
74    #[doc = "Bit 23 - the input enable of the pad"]
75    #[inline(always)]
76    pub fn adc1_fun_ie(&self) -> ADC1_FUN_IE_R {
77        ADC1_FUN_IE_R::new(((self.bits >> 23) & 1) != 0)
78    }
79    #[doc = "Bit 24 - the input enable of the pad in sleep status"]
80    #[inline(always)]
81    pub fn adc1_slp_ie(&self) -> ADC1_SLP_IE_R {
82        ADC1_SLP_IE_R::new(((self.bits >> 24) & 1) != 0)
83    }
84    #[doc = "Bit 25 - the sleep status selection signal of the pad"]
85    #[inline(always)]
86    pub fn adc1_slp_sel(&self) -> ADC1_SLP_SEL_R {
87        ADC1_SLP_SEL_R::new(((self.bits >> 25) & 1) != 0)
88    }
89    #[doc = "Bits 26:27 - the functional selection signal of the pad"]
90    #[inline(always)]
91    pub fn adc1_fun_sel(&self) -> ADC1_FUN_SEL_R {
92        ADC1_FUN_SEL_R::new(((self.bits >> 26) & 3) as u8)
93    }
94    #[doc = "Bit 28 - Ò1Ó select the digital function Ó0Óslection the rtc function"]
95    #[inline(always)]
96    pub fn adc2_mux_sel(&self) -> ADC2_MUX_SEL_R {
97        ADC2_MUX_SEL_R::new(((self.bits >> 28) & 1) != 0)
98    }
99    #[doc = "Bit 29 - Ò1Ó select the digital function Ó0Óslection the rtc function"]
100    #[inline(always)]
101    pub fn adc1_mux_sel(&self) -> ADC1_MUX_SEL_R {
102        ADC1_MUX_SEL_R::new(((self.bits >> 29) & 1) != 0)
103    }
104    #[doc = "Bit 30 - hold the current value of the output when setting the hold to Ò1Ó"]
105    #[inline(always)]
106    pub fn adc2_hold(&self) -> ADC2_HOLD_R {
107        ADC2_HOLD_R::new(((self.bits >> 30) & 1) != 0)
108    }
109    #[doc = "Bit 31 - hold the current value of the output when setting the hold to Ò1Ó"]
110    #[inline(always)]
111    pub fn adc1_hold(&self) -> ADC1_HOLD_R {
112        ADC1_HOLD_R::new(((self.bits >> 31) & 1) != 0)
113    }
114}
115#[cfg(feature = "impl-register-debug")]
116impl core::fmt::Debug for R {
117    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
118        f.debug_struct("ADC_PAD")
119            .field("adc2_fun_ie", &self.adc2_fun_ie())
120            .field("adc2_slp_ie", &self.adc2_slp_ie())
121            .field("adc2_slp_sel", &self.adc2_slp_sel())
122            .field("adc2_fun_sel", &self.adc2_fun_sel())
123            .field("adc1_fun_ie", &self.adc1_fun_ie())
124            .field("adc1_slp_ie", &self.adc1_slp_ie())
125            .field("adc1_slp_sel", &self.adc1_slp_sel())
126            .field("adc1_fun_sel", &self.adc1_fun_sel())
127            .field("adc2_mux_sel", &self.adc2_mux_sel())
128            .field("adc1_mux_sel", &self.adc1_mux_sel())
129            .field("adc2_hold", &self.adc2_hold())
130            .field("adc1_hold", &self.adc1_hold())
131            .finish()
132    }
133}
134impl W {
135    #[doc = "Bit 18 - the input enable of the pad"]
136    #[inline(always)]
137    pub fn adc2_fun_ie(&mut self) -> ADC2_FUN_IE_W<ADC_PAD_SPEC> {
138        ADC2_FUN_IE_W::new(self, 18)
139    }
140    #[doc = "Bit 19 - the input enable of the pad in sleep status"]
141    #[inline(always)]
142    pub fn adc2_slp_ie(&mut self) -> ADC2_SLP_IE_W<ADC_PAD_SPEC> {
143        ADC2_SLP_IE_W::new(self, 19)
144    }
145    #[doc = "Bit 20 - the sleep status selection signal of the pad"]
146    #[inline(always)]
147    pub fn adc2_slp_sel(&mut self) -> ADC2_SLP_SEL_W<ADC_PAD_SPEC> {
148        ADC2_SLP_SEL_W::new(self, 20)
149    }
150    #[doc = "Bits 21:22 - the functional selection signal of the pad"]
151    #[inline(always)]
152    pub fn adc2_fun_sel(&mut self) -> ADC2_FUN_SEL_W<ADC_PAD_SPEC> {
153        ADC2_FUN_SEL_W::new(self, 21)
154    }
155    #[doc = "Bit 23 - the input enable of the pad"]
156    #[inline(always)]
157    pub fn adc1_fun_ie(&mut self) -> ADC1_FUN_IE_W<ADC_PAD_SPEC> {
158        ADC1_FUN_IE_W::new(self, 23)
159    }
160    #[doc = "Bit 24 - the input enable of the pad in sleep status"]
161    #[inline(always)]
162    pub fn adc1_slp_ie(&mut self) -> ADC1_SLP_IE_W<ADC_PAD_SPEC> {
163        ADC1_SLP_IE_W::new(self, 24)
164    }
165    #[doc = "Bit 25 - the sleep status selection signal of the pad"]
166    #[inline(always)]
167    pub fn adc1_slp_sel(&mut self) -> ADC1_SLP_SEL_W<ADC_PAD_SPEC> {
168        ADC1_SLP_SEL_W::new(self, 25)
169    }
170    #[doc = "Bits 26:27 - the functional selection signal of the pad"]
171    #[inline(always)]
172    pub fn adc1_fun_sel(&mut self) -> ADC1_FUN_SEL_W<ADC_PAD_SPEC> {
173        ADC1_FUN_SEL_W::new(self, 26)
174    }
175    #[doc = "Bit 28 - Ò1Ó select the digital function Ó0Óslection the rtc function"]
176    #[inline(always)]
177    pub fn adc2_mux_sel(&mut self) -> ADC2_MUX_SEL_W<ADC_PAD_SPEC> {
178        ADC2_MUX_SEL_W::new(self, 28)
179    }
180    #[doc = "Bit 29 - Ò1Ó select the digital function Ó0Óslection the rtc function"]
181    #[inline(always)]
182    pub fn adc1_mux_sel(&mut self) -> ADC1_MUX_SEL_W<ADC_PAD_SPEC> {
183        ADC1_MUX_SEL_W::new(self, 29)
184    }
185    #[doc = "Bit 30 - hold the current value of the output when setting the hold to Ò1Ó"]
186    #[inline(always)]
187    pub fn adc2_hold(&mut self) -> ADC2_HOLD_W<ADC_PAD_SPEC> {
188        ADC2_HOLD_W::new(self, 30)
189    }
190    #[doc = "Bit 31 - hold the current value of the output when setting the hold to Ò1Ó"]
191    #[inline(always)]
192    pub fn adc1_hold(&mut self) -> ADC1_HOLD_W<ADC_PAD_SPEC> {
193        ADC1_HOLD_W::new(self, 31)
194    }
195}
196#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`adc_pad::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`adc_pad::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
197pub struct ADC_PAD_SPEC;
198impl crate::RegisterSpec for ADC_PAD_SPEC {
199    type Ux = u32;
200}
201#[doc = "`read()` method returns [`adc_pad::R`](R) reader structure"]
202impl crate::Readable for ADC_PAD_SPEC {}
203#[doc = "`write(|w| ..)` method takes [`adc_pad::W`](W) writer structure"]
204impl crate::Writable for ADC_PAD_SPEC {
205    type Safety = crate::Unsafe;
206}
207#[doc = "`reset()` method sets ADC_PAD to value 0"]
208impl crate::Resettable for ADC_PAD_SPEC {}