mimxrt685s_pac/pmc/
padvrange.rs

1#[doc = "Register `PADVRANGE` reader"]
2pub type R = crate::R<PadvrangeSpec>;
3#[doc = "Register `PADVRANGE` writer"]
4pub type W = crate::W<PadvrangeSpec>;
5#[doc = "no description available\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum Vddio0range {
10    #[doc = "0: 1.71 - 3.6V. Consumes static current to detect VDDE0 level"]
11    Vddio0range0 = 0,
12    #[doc = "1: 1.71 - 1.98V, vdde detector off"]
13    Vddio0range1 = 1,
14    #[doc = "2: 3.00 - 3.6V, vdde detector off"]
15    Vddio0range2 = 2,
16    #[doc = "3: Not allowed (hardware should translate to 10)"]
17    Vddio0range3 = 3,
18}
19impl From<Vddio0range> for u8 {
20    #[inline(always)]
21    fn from(variant: Vddio0range) -> Self {
22        variant as _
23    }
24}
25impl crate::FieldSpec for Vddio0range {
26    type Ux = u8;
27}
28impl crate::IsEnum for Vddio0range {}
29#[doc = "Field `VDDIO_0RANGE` reader - no description available"]
30pub type Vddio0rangeR = crate::FieldReader<Vddio0range>;
31impl Vddio0rangeR {
32    #[doc = "Get enumerated values variant"]
33    #[inline(always)]
34    pub const fn variant(&self) -> Vddio0range {
35        match self.bits {
36            0 => Vddio0range::Vddio0range0,
37            1 => Vddio0range::Vddio0range1,
38            2 => Vddio0range::Vddio0range2,
39            3 => Vddio0range::Vddio0range3,
40            _ => unreachable!(),
41        }
42    }
43    #[doc = "1.71 - 3.6V. Consumes static current to detect VDDE0 level"]
44    #[inline(always)]
45    pub fn is_vddio_0range_0(&self) -> bool {
46        *self == Vddio0range::Vddio0range0
47    }
48    #[doc = "1.71 - 1.98V, vdde detector off"]
49    #[inline(always)]
50    pub fn is_vddio_0range_1(&self) -> bool {
51        *self == Vddio0range::Vddio0range1
52    }
53    #[doc = "3.00 - 3.6V, vdde detector off"]
54    #[inline(always)]
55    pub fn is_vddio_0range_2(&self) -> bool {
56        *self == Vddio0range::Vddio0range2
57    }
58    #[doc = "Not allowed (hardware should translate to 10)"]
59    #[inline(always)]
60    pub fn is_vddio_0range_3(&self) -> bool {
61        *self == Vddio0range::Vddio0range3
62    }
63}
64#[doc = "Field `VDDIO_0RANGE` writer - no description available"]
65pub type Vddio0rangeW<'a, REG> = crate::FieldWriter<'a, REG, 2, Vddio0range, crate::Safe>;
66impl<'a, REG> Vddio0rangeW<'a, REG>
67where
68    REG: crate::Writable + crate::RegisterSpec,
69    REG::Ux: From<u8>,
70{
71    #[doc = "1.71 - 3.6V. Consumes static current to detect VDDE0 level"]
72    #[inline(always)]
73    pub fn vddio_0range_0(self) -> &'a mut crate::W<REG> {
74        self.variant(Vddio0range::Vddio0range0)
75    }
76    #[doc = "1.71 - 1.98V, vdde detector off"]
77    #[inline(always)]
78    pub fn vddio_0range_1(self) -> &'a mut crate::W<REG> {
79        self.variant(Vddio0range::Vddio0range1)
80    }
81    #[doc = "3.00 - 3.6V, vdde detector off"]
82    #[inline(always)]
83    pub fn vddio_0range_2(self) -> &'a mut crate::W<REG> {
84        self.variant(Vddio0range::Vddio0range2)
85    }
86    #[doc = "Not allowed (hardware should translate to 10)"]
87    #[inline(always)]
88    pub fn vddio_0range_3(self) -> &'a mut crate::W<REG> {
89        self.variant(Vddio0range::Vddio0range3)
90    }
91}
92#[doc = "no description available\n\nValue on reset: 0"]
93#[cfg_attr(feature = "defmt", derive(defmt::Format))]
94#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95#[repr(u8)]
96pub enum Vddio1range {
97    #[doc = "0: 1.71-3.6V. Consumes static current to detect VDDE1 level"]
98    Vddio1range0 = 0,
99    #[doc = "1: 1.71 - 1.98V, vdde detector off"]
100    Vddio1range1 = 1,
101    #[doc = "2: 3.00 - 3.6V, vdde detector off"]
102    Vddio1range2 = 2,
103    #[doc = "3: Not allowed (hardware should translate to 10)"]
104    Vddio1range3 = 3,
105}
106impl From<Vddio1range> for u8 {
107    #[inline(always)]
108    fn from(variant: Vddio1range) -> Self {
109        variant as _
110    }
111}
112impl crate::FieldSpec for Vddio1range {
113    type Ux = u8;
114}
115impl crate::IsEnum for Vddio1range {}
116#[doc = "Field `VDDIO_1RANGE` reader - no description available"]
117pub type Vddio1rangeR = crate::FieldReader<Vddio1range>;
118impl Vddio1rangeR {
119    #[doc = "Get enumerated values variant"]
120    #[inline(always)]
121    pub const fn variant(&self) -> Vddio1range {
122        match self.bits {
123            0 => Vddio1range::Vddio1range0,
124            1 => Vddio1range::Vddio1range1,
125            2 => Vddio1range::Vddio1range2,
126            3 => Vddio1range::Vddio1range3,
127            _ => unreachable!(),
128        }
129    }
130    #[doc = "1.71-3.6V. Consumes static current to detect VDDE1 level"]
131    #[inline(always)]
132    pub fn is_vddio_1range_0(&self) -> bool {
133        *self == Vddio1range::Vddio1range0
134    }
135    #[doc = "1.71 - 1.98V, vdde detector off"]
136    #[inline(always)]
137    pub fn is_vddio_1range_1(&self) -> bool {
138        *self == Vddio1range::Vddio1range1
139    }
140    #[doc = "3.00 - 3.6V, vdde detector off"]
141    #[inline(always)]
142    pub fn is_vddio_1range_2(&self) -> bool {
143        *self == Vddio1range::Vddio1range2
144    }
145    #[doc = "Not allowed (hardware should translate to 10)"]
146    #[inline(always)]
147    pub fn is_vddio_1range_3(&self) -> bool {
148        *self == Vddio1range::Vddio1range3
149    }
150}
151#[doc = "Field `VDDIO_1RANGE` writer - no description available"]
152pub type Vddio1rangeW<'a, REG> = crate::FieldWriter<'a, REG, 2, Vddio1range, crate::Safe>;
153impl<'a, REG> Vddio1rangeW<'a, REG>
154where
155    REG: crate::Writable + crate::RegisterSpec,
156    REG::Ux: From<u8>,
157{
158    #[doc = "1.71-3.6V. Consumes static current to detect VDDE1 level"]
159    #[inline(always)]
160    pub fn vddio_1range_0(self) -> &'a mut crate::W<REG> {
161        self.variant(Vddio1range::Vddio1range0)
162    }
163    #[doc = "1.71 - 1.98V, vdde detector off"]
164    #[inline(always)]
165    pub fn vddio_1range_1(self) -> &'a mut crate::W<REG> {
166        self.variant(Vddio1range::Vddio1range1)
167    }
168    #[doc = "3.00 - 3.6V, vdde detector off"]
169    #[inline(always)]
170    pub fn vddio_1range_2(self) -> &'a mut crate::W<REG> {
171        self.variant(Vddio1range::Vddio1range2)
172    }
173    #[doc = "Not allowed (hardware should translate to 10)"]
174    #[inline(always)]
175    pub fn vddio_1range_3(self) -> &'a mut crate::W<REG> {
176        self.variant(Vddio1range::Vddio1range3)
177    }
178}
179#[doc = "no description available\n\nValue on reset: 0"]
180#[cfg_attr(feature = "defmt", derive(defmt::Format))]
181#[derive(Clone, Copy, Debug, PartialEq, Eq)]
182#[repr(u8)]
183pub enum Vddio2range {
184    #[doc = "0: 1.71 - 3.6V. Consumes static current to detect VDDE2 level"]
185    Vddio2range0 = 0,
186    #[doc = "1: 1.71 - 1.98V, vdde detector off"]
187    Vddio2range1 = 1,
188    #[doc = "2: 3.00 - 3.6V, vdde detector off"]
189    Vddio2range2 = 2,
190    #[doc = "3: Not allowed (hardware should translate to 10)"]
191    Vddio2range3 = 3,
192}
193impl From<Vddio2range> for u8 {
194    #[inline(always)]
195    fn from(variant: Vddio2range) -> Self {
196        variant as _
197    }
198}
199impl crate::FieldSpec for Vddio2range {
200    type Ux = u8;
201}
202impl crate::IsEnum for Vddio2range {}
203#[doc = "Field `VDDIO_2RANGE` reader - no description available"]
204pub type Vddio2rangeR = crate::FieldReader<Vddio2range>;
205impl Vddio2rangeR {
206    #[doc = "Get enumerated values variant"]
207    #[inline(always)]
208    pub const fn variant(&self) -> Vddio2range {
209        match self.bits {
210            0 => Vddio2range::Vddio2range0,
211            1 => Vddio2range::Vddio2range1,
212            2 => Vddio2range::Vddio2range2,
213            3 => Vddio2range::Vddio2range3,
214            _ => unreachable!(),
215        }
216    }
217    #[doc = "1.71 - 3.6V. Consumes static current to detect VDDE2 level"]
218    #[inline(always)]
219    pub fn is_vddio_2range_0(&self) -> bool {
220        *self == Vddio2range::Vddio2range0
221    }
222    #[doc = "1.71 - 1.98V, vdde detector off"]
223    #[inline(always)]
224    pub fn is_vddio_2range_1(&self) -> bool {
225        *self == Vddio2range::Vddio2range1
226    }
227    #[doc = "3.00 - 3.6V, vdde detector off"]
228    #[inline(always)]
229    pub fn is_vddio_2range_2(&self) -> bool {
230        *self == Vddio2range::Vddio2range2
231    }
232    #[doc = "Not allowed (hardware should translate to 10)"]
233    #[inline(always)]
234    pub fn is_vddio_2range_3(&self) -> bool {
235        *self == Vddio2range::Vddio2range3
236    }
237}
238#[doc = "Field `VDDIO_2RANGE` writer - no description available"]
239pub type Vddio2rangeW<'a, REG> = crate::FieldWriter<'a, REG, 2, Vddio2range, crate::Safe>;
240impl<'a, REG> Vddio2rangeW<'a, REG>
241where
242    REG: crate::Writable + crate::RegisterSpec,
243    REG::Ux: From<u8>,
244{
245    #[doc = "1.71 - 3.6V. Consumes static current to detect VDDE2 level"]
246    #[inline(always)]
247    pub fn vddio_2range_0(self) -> &'a mut crate::W<REG> {
248        self.variant(Vddio2range::Vddio2range0)
249    }
250    #[doc = "1.71 - 1.98V, vdde detector off"]
251    #[inline(always)]
252    pub fn vddio_2range_1(self) -> &'a mut crate::W<REG> {
253        self.variant(Vddio2range::Vddio2range1)
254    }
255    #[doc = "3.00 - 3.6V, vdde detector off"]
256    #[inline(always)]
257    pub fn vddio_2range_2(self) -> &'a mut crate::W<REG> {
258        self.variant(Vddio2range::Vddio2range2)
259    }
260    #[doc = "Not allowed (hardware should translate to 10)"]
261    #[inline(always)]
262    pub fn vddio_2range_3(self) -> &'a mut crate::W<REG> {
263        self.variant(Vddio2range::Vddio2range3)
264    }
265}
266impl R {
267    #[doc = "Bits 0:1 - no description available"]
268    #[inline(always)]
269    pub fn vddio_0range(&self) -> Vddio0rangeR {
270        Vddio0rangeR::new((self.bits & 3) as u8)
271    }
272    #[doc = "Bits 2:3 - no description available"]
273    #[inline(always)]
274    pub fn vddio_1range(&self) -> Vddio1rangeR {
275        Vddio1rangeR::new(((self.bits >> 2) & 3) as u8)
276    }
277    #[doc = "Bits 4:5 - no description available"]
278    #[inline(always)]
279    pub fn vddio_2range(&self) -> Vddio2rangeR {
280        Vddio2rangeR::new(((self.bits >> 4) & 3) as u8)
281    }
282}
283#[cfg(feature = "debug")]
284impl core::fmt::Debug for R {
285    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
286        f.debug_struct("PADVRANGE")
287            .field("vddio_0range", &self.vddio_0range())
288            .field("vddio_1range", &self.vddio_1range())
289            .field("vddio_2range", &self.vddio_2range())
290            .finish()
291    }
292}
293impl W {
294    #[doc = "Bits 0:1 - no description available"]
295    #[inline(always)]
296    pub fn vddio_0range(&mut self) -> Vddio0rangeW<PadvrangeSpec> {
297        Vddio0rangeW::new(self, 0)
298    }
299    #[doc = "Bits 2:3 - no description available"]
300    #[inline(always)]
301    pub fn vddio_1range(&mut self) -> Vddio1rangeW<PadvrangeSpec> {
302        Vddio1rangeW::new(self, 2)
303    }
304    #[doc = "Bits 4:5 - no description available"]
305    #[inline(always)]
306    pub fn vddio_2range(&mut self) -> Vddio2rangeW<PadvrangeSpec> {
307        Vddio2rangeW::new(self, 4)
308    }
309}
310#[doc = "GPIO vdde range selection control\n\nYou can [`read`](crate::Reg::read) this register and get [`padvrange::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`padvrange::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
311pub struct PadvrangeSpec;
312impl crate::RegisterSpec for PadvrangeSpec {
313    type Ux = u32;
314}
315#[doc = "`read()` method returns [`padvrange::R`](R) reader structure"]
316impl crate::Readable for PadvrangeSpec {}
317#[doc = "`write(|w| ..)` method takes [`padvrange::W`](W) writer structure"]
318impl crate::Writable for PadvrangeSpec {
319    type Safety = crate::Unsafe;
320    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
321    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
322}
323#[doc = "`reset()` method sets PADVRANGE to value 0"]
324impl crate::Resettable for PadvrangeSpec {
325    const RESET_VALUE: u32 = 0;
326}