xmc4500/vadc/
brspnd.rs

1#[doc = "Register `BRSPND[%s]` reader"]
2pub type R = crate::R<BRSPND_SPEC>;
3#[doc = "Register `BRSPND[%s]` writer"]
4pub type W = crate::W<BRSPND_SPEC>;
5#[doc = "Channels Pending Group x\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum CHPNDG0_A {
8    #[doc = "0: Ignore this channel"]
9    VALUE1 = 0,
10    #[doc = "1: Request conversion of this channel"]
11    VALUE2 = 1,
12}
13impl From<CHPNDG0_A> for bool {
14    #[inline(always)]
15    fn from(variant: CHPNDG0_A) -> Self {
16        variant as u8 != 0
17    }
18}
19#[doc = "Field `CHPNDG0` reader - Channels Pending Group x"]
20pub type CHPNDG0_R = crate::BitReader<CHPNDG0_A>;
21impl CHPNDG0_R {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> CHPNDG0_A {
25        match self.bits {
26            false => CHPNDG0_A::VALUE1,
27            true => CHPNDG0_A::VALUE2,
28        }
29    }
30    #[doc = "Ignore this channel"]
31    #[inline(always)]
32    pub fn is_value1(&self) -> bool {
33        *self == CHPNDG0_A::VALUE1
34    }
35    #[doc = "Request conversion of this channel"]
36    #[inline(always)]
37    pub fn is_value2(&self) -> bool {
38        *self == CHPNDG0_A::VALUE2
39    }
40}
41#[doc = "Field `CHPNDG0` writer - Channels Pending Group x"]
42pub type CHPNDG0_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG0_A>;
43impl<'a, REG> CHPNDG0_W<'a, REG>
44where
45    REG: crate::Writable + crate::RegisterSpec,
46{
47    #[doc = "Ignore this channel"]
48    #[inline(always)]
49    pub fn value1(self) -> &'a mut crate::W<REG> {
50        self.variant(CHPNDG0_A::VALUE1)
51    }
52    #[doc = "Request conversion of this channel"]
53    #[inline(always)]
54    pub fn value2(self) -> &'a mut crate::W<REG> {
55        self.variant(CHPNDG0_A::VALUE2)
56    }
57}
58#[doc = "Channels Pending Group x\n\nValue on reset: 0"]
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60pub enum CHPNDG1_A {
61    #[doc = "0: Ignore this channel"]
62    VALUE1 = 0,
63    #[doc = "1: Request conversion of this channel"]
64    VALUE2 = 1,
65}
66impl From<CHPNDG1_A> for bool {
67    #[inline(always)]
68    fn from(variant: CHPNDG1_A) -> Self {
69        variant as u8 != 0
70    }
71}
72#[doc = "Field `CHPNDG1` reader - Channels Pending Group x"]
73pub type CHPNDG1_R = crate::BitReader<CHPNDG1_A>;
74impl CHPNDG1_R {
75    #[doc = "Get enumerated values variant"]
76    #[inline(always)]
77    pub const fn variant(&self) -> CHPNDG1_A {
78        match self.bits {
79            false => CHPNDG1_A::VALUE1,
80            true => CHPNDG1_A::VALUE2,
81        }
82    }
83    #[doc = "Ignore this channel"]
84    #[inline(always)]
85    pub fn is_value1(&self) -> bool {
86        *self == CHPNDG1_A::VALUE1
87    }
88    #[doc = "Request conversion of this channel"]
89    #[inline(always)]
90    pub fn is_value2(&self) -> bool {
91        *self == CHPNDG1_A::VALUE2
92    }
93}
94#[doc = "Field `CHPNDG1` writer - Channels Pending Group x"]
95pub type CHPNDG1_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG1_A>;
96impl<'a, REG> CHPNDG1_W<'a, REG>
97where
98    REG: crate::Writable + crate::RegisterSpec,
99{
100    #[doc = "Ignore this channel"]
101    #[inline(always)]
102    pub fn value1(self) -> &'a mut crate::W<REG> {
103        self.variant(CHPNDG1_A::VALUE1)
104    }
105    #[doc = "Request conversion of this channel"]
106    #[inline(always)]
107    pub fn value2(self) -> &'a mut crate::W<REG> {
108        self.variant(CHPNDG1_A::VALUE2)
109    }
110}
111#[doc = "Channels Pending Group x\n\nValue on reset: 0"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum CHPNDG2_A {
114    #[doc = "0: Ignore this channel"]
115    VALUE1 = 0,
116    #[doc = "1: Request conversion of this channel"]
117    VALUE2 = 1,
118}
119impl From<CHPNDG2_A> for bool {
120    #[inline(always)]
121    fn from(variant: CHPNDG2_A) -> Self {
122        variant as u8 != 0
123    }
124}
125#[doc = "Field `CHPNDG2` reader - Channels Pending Group x"]
126pub type CHPNDG2_R = crate::BitReader<CHPNDG2_A>;
127impl CHPNDG2_R {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub const fn variant(&self) -> CHPNDG2_A {
131        match self.bits {
132            false => CHPNDG2_A::VALUE1,
133            true => CHPNDG2_A::VALUE2,
134        }
135    }
136    #[doc = "Ignore this channel"]
137    #[inline(always)]
138    pub fn is_value1(&self) -> bool {
139        *self == CHPNDG2_A::VALUE1
140    }
141    #[doc = "Request conversion of this channel"]
142    #[inline(always)]
143    pub fn is_value2(&self) -> bool {
144        *self == CHPNDG2_A::VALUE2
145    }
146}
147#[doc = "Field `CHPNDG2` writer - Channels Pending Group x"]
148pub type CHPNDG2_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG2_A>;
149impl<'a, REG> CHPNDG2_W<'a, REG>
150where
151    REG: crate::Writable + crate::RegisterSpec,
152{
153    #[doc = "Ignore this channel"]
154    #[inline(always)]
155    pub fn value1(self) -> &'a mut crate::W<REG> {
156        self.variant(CHPNDG2_A::VALUE1)
157    }
158    #[doc = "Request conversion of this channel"]
159    #[inline(always)]
160    pub fn value2(self) -> &'a mut crate::W<REG> {
161        self.variant(CHPNDG2_A::VALUE2)
162    }
163}
164#[doc = "Channels Pending Group x\n\nValue on reset: 0"]
165#[derive(Clone, Copy, Debug, PartialEq, Eq)]
166pub enum CHPNDG3_A {
167    #[doc = "0: Ignore this channel"]
168    VALUE1 = 0,
169    #[doc = "1: Request conversion of this channel"]
170    VALUE2 = 1,
171}
172impl From<CHPNDG3_A> for bool {
173    #[inline(always)]
174    fn from(variant: CHPNDG3_A) -> Self {
175        variant as u8 != 0
176    }
177}
178#[doc = "Field `CHPNDG3` reader - Channels Pending Group x"]
179pub type CHPNDG3_R = crate::BitReader<CHPNDG3_A>;
180impl CHPNDG3_R {
181    #[doc = "Get enumerated values variant"]
182    #[inline(always)]
183    pub const fn variant(&self) -> CHPNDG3_A {
184        match self.bits {
185            false => CHPNDG3_A::VALUE1,
186            true => CHPNDG3_A::VALUE2,
187        }
188    }
189    #[doc = "Ignore this channel"]
190    #[inline(always)]
191    pub fn is_value1(&self) -> bool {
192        *self == CHPNDG3_A::VALUE1
193    }
194    #[doc = "Request conversion of this channel"]
195    #[inline(always)]
196    pub fn is_value2(&self) -> bool {
197        *self == CHPNDG3_A::VALUE2
198    }
199}
200#[doc = "Field `CHPNDG3` writer - Channels Pending Group x"]
201pub type CHPNDG3_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG3_A>;
202impl<'a, REG> CHPNDG3_W<'a, REG>
203where
204    REG: crate::Writable + crate::RegisterSpec,
205{
206    #[doc = "Ignore this channel"]
207    #[inline(always)]
208    pub fn value1(self) -> &'a mut crate::W<REG> {
209        self.variant(CHPNDG3_A::VALUE1)
210    }
211    #[doc = "Request conversion of this channel"]
212    #[inline(always)]
213    pub fn value2(self) -> &'a mut crate::W<REG> {
214        self.variant(CHPNDG3_A::VALUE2)
215    }
216}
217#[doc = "Channels Pending Group x\n\nValue on reset: 0"]
218#[derive(Clone, Copy, Debug, PartialEq, Eq)]
219pub enum CHPNDG4_A {
220    #[doc = "0: Ignore this channel"]
221    VALUE1 = 0,
222    #[doc = "1: Request conversion of this channel"]
223    VALUE2 = 1,
224}
225impl From<CHPNDG4_A> for bool {
226    #[inline(always)]
227    fn from(variant: CHPNDG4_A) -> Self {
228        variant as u8 != 0
229    }
230}
231#[doc = "Field `CHPNDG4` reader - Channels Pending Group x"]
232pub type CHPNDG4_R = crate::BitReader<CHPNDG4_A>;
233impl CHPNDG4_R {
234    #[doc = "Get enumerated values variant"]
235    #[inline(always)]
236    pub const fn variant(&self) -> CHPNDG4_A {
237        match self.bits {
238            false => CHPNDG4_A::VALUE1,
239            true => CHPNDG4_A::VALUE2,
240        }
241    }
242    #[doc = "Ignore this channel"]
243    #[inline(always)]
244    pub fn is_value1(&self) -> bool {
245        *self == CHPNDG4_A::VALUE1
246    }
247    #[doc = "Request conversion of this channel"]
248    #[inline(always)]
249    pub fn is_value2(&self) -> bool {
250        *self == CHPNDG4_A::VALUE2
251    }
252}
253#[doc = "Field `CHPNDG4` writer - Channels Pending Group x"]
254pub type CHPNDG4_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG4_A>;
255impl<'a, REG> CHPNDG4_W<'a, REG>
256where
257    REG: crate::Writable + crate::RegisterSpec,
258{
259    #[doc = "Ignore this channel"]
260    #[inline(always)]
261    pub fn value1(self) -> &'a mut crate::W<REG> {
262        self.variant(CHPNDG4_A::VALUE1)
263    }
264    #[doc = "Request conversion of this channel"]
265    #[inline(always)]
266    pub fn value2(self) -> &'a mut crate::W<REG> {
267        self.variant(CHPNDG4_A::VALUE2)
268    }
269}
270#[doc = "Channels Pending Group x\n\nValue on reset: 0"]
271#[derive(Clone, Copy, Debug, PartialEq, Eq)]
272pub enum CHPNDG5_A {
273    #[doc = "0: Ignore this channel"]
274    VALUE1 = 0,
275    #[doc = "1: Request conversion of this channel"]
276    VALUE2 = 1,
277}
278impl From<CHPNDG5_A> for bool {
279    #[inline(always)]
280    fn from(variant: CHPNDG5_A) -> Self {
281        variant as u8 != 0
282    }
283}
284#[doc = "Field `CHPNDG5` reader - Channels Pending Group x"]
285pub type CHPNDG5_R = crate::BitReader<CHPNDG5_A>;
286impl CHPNDG5_R {
287    #[doc = "Get enumerated values variant"]
288    #[inline(always)]
289    pub const fn variant(&self) -> CHPNDG5_A {
290        match self.bits {
291            false => CHPNDG5_A::VALUE1,
292            true => CHPNDG5_A::VALUE2,
293        }
294    }
295    #[doc = "Ignore this channel"]
296    #[inline(always)]
297    pub fn is_value1(&self) -> bool {
298        *self == CHPNDG5_A::VALUE1
299    }
300    #[doc = "Request conversion of this channel"]
301    #[inline(always)]
302    pub fn is_value2(&self) -> bool {
303        *self == CHPNDG5_A::VALUE2
304    }
305}
306#[doc = "Field `CHPNDG5` writer - Channels Pending Group x"]
307pub type CHPNDG5_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG5_A>;
308impl<'a, REG> CHPNDG5_W<'a, REG>
309where
310    REG: crate::Writable + crate::RegisterSpec,
311{
312    #[doc = "Ignore this channel"]
313    #[inline(always)]
314    pub fn value1(self) -> &'a mut crate::W<REG> {
315        self.variant(CHPNDG5_A::VALUE1)
316    }
317    #[doc = "Request conversion of this channel"]
318    #[inline(always)]
319    pub fn value2(self) -> &'a mut crate::W<REG> {
320        self.variant(CHPNDG5_A::VALUE2)
321    }
322}
323#[doc = "Channels Pending Group x\n\nValue on reset: 0"]
324#[derive(Clone, Copy, Debug, PartialEq, Eq)]
325pub enum CHPNDG6_A {
326    #[doc = "0: Ignore this channel"]
327    VALUE1 = 0,
328    #[doc = "1: Request conversion of this channel"]
329    VALUE2 = 1,
330}
331impl From<CHPNDG6_A> for bool {
332    #[inline(always)]
333    fn from(variant: CHPNDG6_A) -> Self {
334        variant as u8 != 0
335    }
336}
337#[doc = "Field `CHPNDG6` reader - Channels Pending Group x"]
338pub type CHPNDG6_R = crate::BitReader<CHPNDG6_A>;
339impl CHPNDG6_R {
340    #[doc = "Get enumerated values variant"]
341    #[inline(always)]
342    pub const fn variant(&self) -> CHPNDG6_A {
343        match self.bits {
344            false => CHPNDG6_A::VALUE1,
345            true => CHPNDG6_A::VALUE2,
346        }
347    }
348    #[doc = "Ignore this channel"]
349    #[inline(always)]
350    pub fn is_value1(&self) -> bool {
351        *self == CHPNDG6_A::VALUE1
352    }
353    #[doc = "Request conversion of this channel"]
354    #[inline(always)]
355    pub fn is_value2(&self) -> bool {
356        *self == CHPNDG6_A::VALUE2
357    }
358}
359#[doc = "Field `CHPNDG6` writer - Channels Pending Group x"]
360pub type CHPNDG6_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG6_A>;
361impl<'a, REG> CHPNDG6_W<'a, REG>
362where
363    REG: crate::Writable + crate::RegisterSpec,
364{
365    #[doc = "Ignore this channel"]
366    #[inline(always)]
367    pub fn value1(self) -> &'a mut crate::W<REG> {
368        self.variant(CHPNDG6_A::VALUE1)
369    }
370    #[doc = "Request conversion of this channel"]
371    #[inline(always)]
372    pub fn value2(self) -> &'a mut crate::W<REG> {
373        self.variant(CHPNDG6_A::VALUE2)
374    }
375}
376#[doc = "Channels Pending Group x\n\nValue on reset: 0"]
377#[derive(Clone, Copy, Debug, PartialEq, Eq)]
378pub enum CHPNDG7_A {
379    #[doc = "0: Ignore this channel"]
380    VALUE1 = 0,
381    #[doc = "1: Request conversion of this channel"]
382    VALUE2 = 1,
383}
384impl From<CHPNDG7_A> for bool {
385    #[inline(always)]
386    fn from(variant: CHPNDG7_A) -> Self {
387        variant as u8 != 0
388    }
389}
390#[doc = "Field `CHPNDG7` reader - Channels Pending Group x"]
391pub type CHPNDG7_R = crate::BitReader<CHPNDG7_A>;
392impl CHPNDG7_R {
393    #[doc = "Get enumerated values variant"]
394    #[inline(always)]
395    pub const fn variant(&self) -> CHPNDG7_A {
396        match self.bits {
397            false => CHPNDG7_A::VALUE1,
398            true => CHPNDG7_A::VALUE2,
399        }
400    }
401    #[doc = "Ignore this channel"]
402    #[inline(always)]
403    pub fn is_value1(&self) -> bool {
404        *self == CHPNDG7_A::VALUE1
405    }
406    #[doc = "Request conversion of this channel"]
407    #[inline(always)]
408    pub fn is_value2(&self) -> bool {
409        *self == CHPNDG7_A::VALUE2
410    }
411}
412#[doc = "Field `CHPNDG7` writer - Channels Pending Group x"]
413pub type CHPNDG7_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG7_A>;
414impl<'a, REG> CHPNDG7_W<'a, REG>
415where
416    REG: crate::Writable + crate::RegisterSpec,
417{
418    #[doc = "Ignore this channel"]
419    #[inline(always)]
420    pub fn value1(self) -> &'a mut crate::W<REG> {
421        self.variant(CHPNDG7_A::VALUE1)
422    }
423    #[doc = "Request conversion of this channel"]
424    #[inline(always)]
425    pub fn value2(self) -> &'a mut crate::W<REG> {
426        self.variant(CHPNDG7_A::VALUE2)
427    }
428}
429impl R {
430    #[doc = "Bit 0 - Channels Pending Group x"]
431    #[inline(always)]
432    pub fn chpndg0(&self) -> CHPNDG0_R {
433        CHPNDG0_R::new((self.bits & 1) != 0)
434    }
435    #[doc = "Bit 1 - Channels Pending Group x"]
436    #[inline(always)]
437    pub fn chpndg1(&self) -> CHPNDG1_R {
438        CHPNDG1_R::new(((self.bits >> 1) & 1) != 0)
439    }
440    #[doc = "Bit 2 - Channels Pending Group x"]
441    #[inline(always)]
442    pub fn chpndg2(&self) -> CHPNDG2_R {
443        CHPNDG2_R::new(((self.bits >> 2) & 1) != 0)
444    }
445    #[doc = "Bit 3 - Channels Pending Group x"]
446    #[inline(always)]
447    pub fn chpndg3(&self) -> CHPNDG3_R {
448        CHPNDG3_R::new(((self.bits >> 3) & 1) != 0)
449    }
450    #[doc = "Bit 4 - Channels Pending Group x"]
451    #[inline(always)]
452    pub fn chpndg4(&self) -> CHPNDG4_R {
453        CHPNDG4_R::new(((self.bits >> 4) & 1) != 0)
454    }
455    #[doc = "Bit 5 - Channels Pending Group x"]
456    #[inline(always)]
457    pub fn chpndg5(&self) -> CHPNDG5_R {
458        CHPNDG5_R::new(((self.bits >> 5) & 1) != 0)
459    }
460    #[doc = "Bit 6 - Channels Pending Group x"]
461    #[inline(always)]
462    pub fn chpndg6(&self) -> CHPNDG6_R {
463        CHPNDG6_R::new(((self.bits >> 6) & 1) != 0)
464    }
465    #[doc = "Bit 7 - Channels Pending Group x"]
466    #[inline(always)]
467    pub fn chpndg7(&self) -> CHPNDG7_R {
468        CHPNDG7_R::new(((self.bits >> 7) & 1) != 0)
469    }
470}
471impl W {
472    #[doc = "Bit 0 - Channels Pending Group x"]
473    #[inline(always)]
474    pub fn chpndg0(&mut self) -> CHPNDG0_W<BRSPND_SPEC> {
475        CHPNDG0_W::new(self, 0)
476    }
477    #[doc = "Bit 1 - Channels Pending Group x"]
478    #[inline(always)]
479    pub fn chpndg1(&mut self) -> CHPNDG1_W<BRSPND_SPEC> {
480        CHPNDG1_W::new(self, 1)
481    }
482    #[doc = "Bit 2 - Channels Pending Group x"]
483    #[inline(always)]
484    pub fn chpndg2(&mut self) -> CHPNDG2_W<BRSPND_SPEC> {
485        CHPNDG2_W::new(self, 2)
486    }
487    #[doc = "Bit 3 - Channels Pending Group x"]
488    #[inline(always)]
489    pub fn chpndg3(&mut self) -> CHPNDG3_W<BRSPND_SPEC> {
490        CHPNDG3_W::new(self, 3)
491    }
492    #[doc = "Bit 4 - Channels Pending Group x"]
493    #[inline(always)]
494    pub fn chpndg4(&mut self) -> CHPNDG4_W<BRSPND_SPEC> {
495        CHPNDG4_W::new(self, 4)
496    }
497    #[doc = "Bit 5 - Channels Pending Group x"]
498    #[inline(always)]
499    pub fn chpndg5(&mut self) -> CHPNDG5_W<BRSPND_SPEC> {
500        CHPNDG5_W::new(self, 5)
501    }
502    #[doc = "Bit 6 - Channels Pending Group x"]
503    #[inline(always)]
504    pub fn chpndg6(&mut self) -> CHPNDG6_W<BRSPND_SPEC> {
505        CHPNDG6_W::new(self, 6)
506    }
507    #[doc = "Bit 7 - Channels Pending Group x"]
508    #[inline(always)]
509    pub fn chpndg7(&mut self) -> CHPNDG7_W<BRSPND_SPEC> {
510        CHPNDG7_W::new(self, 7)
511    }
512}
513#[doc = "Background Request Source Pending Register\n\nYou can [`read`](crate::Reg::read) this register and get [`brspnd::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`brspnd::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
514pub struct BRSPND_SPEC;
515impl crate::RegisterSpec for BRSPND_SPEC {
516    type Ux = u32;
517}
518#[doc = "`read()` method returns [`brspnd::R`](R) reader structure"]
519impl crate::Readable for BRSPND_SPEC {}
520#[doc = "`write(|w| ..)` method takes [`brspnd::W`](W) writer structure"]
521impl crate::Writable for BRSPND_SPEC {
522    type Safety = crate::Unsafe;
523    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
524    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
525}
526#[doc = "`reset()` method sets BRSPND[%s]
527to value 0"]
528impl crate::Resettable for BRSPND_SPEC {
529    const RESET_VALUE: u32 = 0;
530}