atsamd51p/ccl/
lutctrl.rs

1#[doc = "Register `LUTCTRL[%s]` reader"]
2pub type R = crate::R<LutctrlSpec>;
3#[doc = "Register `LUTCTRL[%s]` writer"]
4pub type W = crate::W<LutctrlSpec>;
5#[doc = "LUT Enable\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum Enableselect {
8    #[doc = "0: LUT block is disabled"]
9    Disable = 0,
10    #[doc = "1: LUT block is enabled"]
11    Enable = 1,
12}
13impl From<Enableselect> for bool {
14    #[inline(always)]
15    fn from(variant: Enableselect) -> Self {
16        variant as u8 != 0
17    }
18}
19#[doc = "Field `ENABLE` reader - LUT Enable"]
20pub type EnableR = crate::BitReader<Enableselect>;
21impl EnableR {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> Enableselect {
25        match self.bits {
26            false => Enableselect::Disable,
27            true => Enableselect::Enable,
28        }
29    }
30    #[doc = "LUT block is disabled"]
31    #[inline(always)]
32    pub fn is_disable(&self) -> bool {
33        *self == Enableselect::Disable
34    }
35    #[doc = "LUT block is enabled"]
36    #[inline(always)]
37    pub fn is_enable(&self) -> bool {
38        *self == Enableselect::Enable
39    }
40}
41#[doc = "Field `ENABLE` writer - LUT Enable"]
42pub type EnableW<'a, REG> = crate::BitWriter<'a, REG, Enableselect>;
43impl<'a, REG> EnableW<'a, REG>
44where
45    REG: crate::Writable + crate::RegisterSpec,
46{
47    #[doc = "LUT block is disabled"]
48    #[inline(always)]
49    pub fn disable(self) -> &'a mut crate::W<REG> {
50        self.variant(Enableselect::Disable)
51    }
52    #[doc = "LUT block is enabled"]
53    #[inline(always)]
54    pub fn enable(self) -> &'a mut crate::W<REG> {
55        self.variant(Enableselect::Enable)
56    }
57}
58#[doc = "Filter Selection\n\nValue on reset: 0"]
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60#[repr(u8)]
61pub enum Filtselselect {
62    #[doc = "0: Filter disabled"]
63    Disable = 0,
64    #[doc = "1: Synchronizer enabled"]
65    Synch = 1,
66    #[doc = "2: Filter enabled"]
67    Filter = 2,
68}
69impl From<Filtselselect> for u8 {
70    #[inline(always)]
71    fn from(variant: Filtselselect) -> Self {
72        variant as _
73    }
74}
75impl crate::FieldSpec for Filtselselect {
76    type Ux = u8;
77}
78impl crate::IsEnum for Filtselselect {}
79#[doc = "Field `FILTSEL` reader - Filter Selection"]
80pub type FiltselR = crate::FieldReader<Filtselselect>;
81impl FiltselR {
82    #[doc = "Get enumerated values variant"]
83    #[inline(always)]
84    pub const fn variant(&self) -> Option<Filtselselect> {
85        match self.bits {
86            0 => Some(Filtselselect::Disable),
87            1 => Some(Filtselselect::Synch),
88            2 => Some(Filtselselect::Filter),
89            _ => None,
90        }
91    }
92    #[doc = "Filter disabled"]
93    #[inline(always)]
94    pub fn is_disable(&self) -> bool {
95        *self == Filtselselect::Disable
96    }
97    #[doc = "Synchronizer enabled"]
98    #[inline(always)]
99    pub fn is_synch(&self) -> bool {
100        *self == Filtselselect::Synch
101    }
102    #[doc = "Filter enabled"]
103    #[inline(always)]
104    pub fn is_filter(&self) -> bool {
105        *self == Filtselselect::Filter
106    }
107}
108#[doc = "Field `FILTSEL` writer - Filter Selection"]
109pub type FiltselW<'a, REG> = crate::FieldWriter<'a, REG, 2, Filtselselect>;
110impl<'a, REG> FiltselW<'a, REG>
111where
112    REG: crate::Writable + crate::RegisterSpec,
113    REG::Ux: From<u8>,
114{
115    #[doc = "Filter disabled"]
116    #[inline(always)]
117    pub fn disable(self) -> &'a mut crate::W<REG> {
118        self.variant(Filtselselect::Disable)
119    }
120    #[doc = "Synchronizer enabled"]
121    #[inline(always)]
122    pub fn synch(self) -> &'a mut crate::W<REG> {
123        self.variant(Filtselselect::Synch)
124    }
125    #[doc = "Filter enabled"]
126    #[inline(always)]
127    pub fn filter(self) -> &'a mut crate::W<REG> {
128        self.variant(Filtselselect::Filter)
129    }
130}
131#[doc = "Edge Selection\n\nValue on reset: 0"]
132#[derive(Clone, Copy, Debug, PartialEq, Eq)]
133pub enum Edgeselselect {
134    #[doc = "0: Edge detector is disabled"]
135    Disable = 0,
136    #[doc = "1: Edge detector is enabled"]
137    Enable = 1,
138}
139impl From<Edgeselselect> for bool {
140    #[inline(always)]
141    fn from(variant: Edgeselselect) -> Self {
142        variant as u8 != 0
143    }
144}
145#[doc = "Field `EDGESEL` reader - Edge Selection"]
146pub type EdgeselR = crate::BitReader<Edgeselselect>;
147impl EdgeselR {
148    #[doc = "Get enumerated values variant"]
149    #[inline(always)]
150    pub const fn variant(&self) -> Edgeselselect {
151        match self.bits {
152            false => Edgeselselect::Disable,
153            true => Edgeselselect::Enable,
154        }
155    }
156    #[doc = "Edge detector is disabled"]
157    #[inline(always)]
158    pub fn is_disable(&self) -> bool {
159        *self == Edgeselselect::Disable
160    }
161    #[doc = "Edge detector is enabled"]
162    #[inline(always)]
163    pub fn is_enable(&self) -> bool {
164        *self == Edgeselselect::Enable
165    }
166}
167#[doc = "Field `EDGESEL` writer - Edge Selection"]
168pub type EdgeselW<'a, REG> = crate::BitWriter<'a, REG, Edgeselselect>;
169impl<'a, REG> EdgeselW<'a, REG>
170where
171    REG: crate::Writable + crate::RegisterSpec,
172{
173    #[doc = "Edge detector is disabled"]
174    #[inline(always)]
175    pub fn disable(self) -> &'a mut crate::W<REG> {
176        self.variant(Edgeselselect::Disable)
177    }
178    #[doc = "Edge detector is enabled"]
179    #[inline(always)]
180    pub fn enable(self) -> &'a mut crate::W<REG> {
181        self.variant(Edgeselselect::Enable)
182    }
183}
184#[doc = "Input Selection 0\n\nValue on reset: 0"]
185#[derive(Clone, Copy, Debug, PartialEq, Eq)]
186#[repr(u8)]
187pub enum Insel0select {
188    #[doc = "0: Masked input"]
189    Mask = 0,
190    #[doc = "1: Feedback input source"]
191    Feedback = 1,
192    #[doc = "2: Linked LUT input source"]
193    Link = 2,
194    #[doc = "3: Event input source"]
195    Event = 3,
196    #[doc = "4: I/O pin input source"]
197    Io = 4,
198    #[doc = "5: AC input source"]
199    Ac = 5,
200    #[doc = "6: TC input source"]
201    Tc = 6,
202    #[doc = "7: Alternate TC input source"]
203    Alttc = 7,
204    #[doc = "8: TCC input source"]
205    Tcc = 8,
206    #[doc = "9: SERCOM input source"]
207    Sercom = 9,
208}
209impl From<Insel0select> for u8 {
210    #[inline(always)]
211    fn from(variant: Insel0select) -> Self {
212        variant as _
213    }
214}
215impl crate::FieldSpec for Insel0select {
216    type Ux = u8;
217}
218impl crate::IsEnum for Insel0select {}
219#[doc = "Field `INSEL0` reader - Input Selection 0"]
220pub type Insel0R = crate::FieldReader<Insel0select>;
221impl Insel0R {
222    #[doc = "Get enumerated values variant"]
223    #[inline(always)]
224    pub const fn variant(&self) -> Option<Insel0select> {
225        match self.bits {
226            0 => Some(Insel0select::Mask),
227            1 => Some(Insel0select::Feedback),
228            2 => Some(Insel0select::Link),
229            3 => Some(Insel0select::Event),
230            4 => Some(Insel0select::Io),
231            5 => Some(Insel0select::Ac),
232            6 => Some(Insel0select::Tc),
233            7 => Some(Insel0select::Alttc),
234            8 => Some(Insel0select::Tcc),
235            9 => Some(Insel0select::Sercom),
236            _ => None,
237        }
238    }
239    #[doc = "Masked input"]
240    #[inline(always)]
241    pub fn is_mask(&self) -> bool {
242        *self == Insel0select::Mask
243    }
244    #[doc = "Feedback input source"]
245    #[inline(always)]
246    pub fn is_feedback(&self) -> bool {
247        *self == Insel0select::Feedback
248    }
249    #[doc = "Linked LUT input source"]
250    #[inline(always)]
251    pub fn is_link(&self) -> bool {
252        *self == Insel0select::Link
253    }
254    #[doc = "Event input source"]
255    #[inline(always)]
256    pub fn is_event(&self) -> bool {
257        *self == Insel0select::Event
258    }
259    #[doc = "I/O pin input source"]
260    #[inline(always)]
261    pub fn is_io(&self) -> bool {
262        *self == Insel0select::Io
263    }
264    #[doc = "AC input source"]
265    #[inline(always)]
266    pub fn is_ac(&self) -> bool {
267        *self == Insel0select::Ac
268    }
269    #[doc = "TC input source"]
270    #[inline(always)]
271    pub fn is_tc(&self) -> bool {
272        *self == Insel0select::Tc
273    }
274    #[doc = "Alternate TC input source"]
275    #[inline(always)]
276    pub fn is_alttc(&self) -> bool {
277        *self == Insel0select::Alttc
278    }
279    #[doc = "TCC input source"]
280    #[inline(always)]
281    pub fn is_tcc(&self) -> bool {
282        *self == Insel0select::Tcc
283    }
284    #[doc = "SERCOM input source"]
285    #[inline(always)]
286    pub fn is_sercom(&self) -> bool {
287        *self == Insel0select::Sercom
288    }
289}
290#[doc = "Field `INSEL0` writer - Input Selection 0"]
291pub type Insel0W<'a, REG> = crate::FieldWriter<'a, REG, 4, Insel0select>;
292impl<'a, REG> Insel0W<'a, REG>
293where
294    REG: crate::Writable + crate::RegisterSpec,
295    REG::Ux: From<u8>,
296{
297    #[doc = "Masked input"]
298    #[inline(always)]
299    pub fn mask(self) -> &'a mut crate::W<REG> {
300        self.variant(Insel0select::Mask)
301    }
302    #[doc = "Feedback input source"]
303    #[inline(always)]
304    pub fn feedback(self) -> &'a mut crate::W<REG> {
305        self.variant(Insel0select::Feedback)
306    }
307    #[doc = "Linked LUT input source"]
308    #[inline(always)]
309    pub fn link(self) -> &'a mut crate::W<REG> {
310        self.variant(Insel0select::Link)
311    }
312    #[doc = "Event input source"]
313    #[inline(always)]
314    pub fn event(self) -> &'a mut crate::W<REG> {
315        self.variant(Insel0select::Event)
316    }
317    #[doc = "I/O pin input source"]
318    #[inline(always)]
319    pub fn io(self) -> &'a mut crate::W<REG> {
320        self.variant(Insel0select::Io)
321    }
322    #[doc = "AC input source"]
323    #[inline(always)]
324    pub fn ac(self) -> &'a mut crate::W<REG> {
325        self.variant(Insel0select::Ac)
326    }
327    #[doc = "TC input source"]
328    #[inline(always)]
329    pub fn tc(self) -> &'a mut crate::W<REG> {
330        self.variant(Insel0select::Tc)
331    }
332    #[doc = "Alternate TC input source"]
333    #[inline(always)]
334    pub fn alttc(self) -> &'a mut crate::W<REG> {
335        self.variant(Insel0select::Alttc)
336    }
337    #[doc = "TCC input source"]
338    #[inline(always)]
339    pub fn tcc(self) -> &'a mut crate::W<REG> {
340        self.variant(Insel0select::Tcc)
341    }
342    #[doc = "SERCOM input source"]
343    #[inline(always)]
344    pub fn sercom(self) -> &'a mut crate::W<REG> {
345        self.variant(Insel0select::Sercom)
346    }
347}
348#[doc = "Input Selection 1\n\nValue on reset: 0"]
349#[derive(Clone, Copy, Debug, PartialEq, Eq)]
350#[repr(u8)]
351pub enum Insel1select {
352    #[doc = "0: Masked input"]
353    Mask = 0,
354    #[doc = "1: Feedback input source"]
355    Feedback = 1,
356    #[doc = "2: Linked LUT input source"]
357    Link = 2,
358    #[doc = "3: Event input source"]
359    Event = 3,
360    #[doc = "4: I/O pin input source"]
361    Io = 4,
362    #[doc = "5: AC input source"]
363    Ac = 5,
364    #[doc = "6: TC input source"]
365    Tc = 6,
366    #[doc = "7: Alternate TC input source"]
367    Alttc = 7,
368    #[doc = "8: TCC input source"]
369    Tcc = 8,
370    #[doc = "9: SERCOM input source"]
371    Sercom = 9,
372}
373impl From<Insel1select> for u8 {
374    #[inline(always)]
375    fn from(variant: Insel1select) -> Self {
376        variant as _
377    }
378}
379impl crate::FieldSpec for Insel1select {
380    type Ux = u8;
381}
382impl crate::IsEnum for Insel1select {}
383#[doc = "Field `INSEL1` reader - Input Selection 1"]
384pub type Insel1R = crate::FieldReader<Insel1select>;
385impl Insel1R {
386    #[doc = "Get enumerated values variant"]
387    #[inline(always)]
388    pub const fn variant(&self) -> Option<Insel1select> {
389        match self.bits {
390            0 => Some(Insel1select::Mask),
391            1 => Some(Insel1select::Feedback),
392            2 => Some(Insel1select::Link),
393            3 => Some(Insel1select::Event),
394            4 => Some(Insel1select::Io),
395            5 => Some(Insel1select::Ac),
396            6 => Some(Insel1select::Tc),
397            7 => Some(Insel1select::Alttc),
398            8 => Some(Insel1select::Tcc),
399            9 => Some(Insel1select::Sercom),
400            _ => None,
401        }
402    }
403    #[doc = "Masked input"]
404    #[inline(always)]
405    pub fn is_mask(&self) -> bool {
406        *self == Insel1select::Mask
407    }
408    #[doc = "Feedback input source"]
409    #[inline(always)]
410    pub fn is_feedback(&self) -> bool {
411        *self == Insel1select::Feedback
412    }
413    #[doc = "Linked LUT input source"]
414    #[inline(always)]
415    pub fn is_link(&self) -> bool {
416        *self == Insel1select::Link
417    }
418    #[doc = "Event input source"]
419    #[inline(always)]
420    pub fn is_event(&self) -> bool {
421        *self == Insel1select::Event
422    }
423    #[doc = "I/O pin input source"]
424    #[inline(always)]
425    pub fn is_io(&self) -> bool {
426        *self == Insel1select::Io
427    }
428    #[doc = "AC input source"]
429    #[inline(always)]
430    pub fn is_ac(&self) -> bool {
431        *self == Insel1select::Ac
432    }
433    #[doc = "TC input source"]
434    #[inline(always)]
435    pub fn is_tc(&self) -> bool {
436        *self == Insel1select::Tc
437    }
438    #[doc = "Alternate TC input source"]
439    #[inline(always)]
440    pub fn is_alttc(&self) -> bool {
441        *self == Insel1select::Alttc
442    }
443    #[doc = "TCC input source"]
444    #[inline(always)]
445    pub fn is_tcc(&self) -> bool {
446        *self == Insel1select::Tcc
447    }
448    #[doc = "SERCOM input source"]
449    #[inline(always)]
450    pub fn is_sercom(&self) -> bool {
451        *self == Insel1select::Sercom
452    }
453}
454#[doc = "Field `INSEL1` writer - Input Selection 1"]
455pub type Insel1W<'a, REG> = crate::FieldWriter<'a, REG, 4, Insel1select>;
456impl<'a, REG> Insel1W<'a, REG>
457where
458    REG: crate::Writable + crate::RegisterSpec,
459    REG::Ux: From<u8>,
460{
461    #[doc = "Masked input"]
462    #[inline(always)]
463    pub fn mask(self) -> &'a mut crate::W<REG> {
464        self.variant(Insel1select::Mask)
465    }
466    #[doc = "Feedback input source"]
467    #[inline(always)]
468    pub fn feedback(self) -> &'a mut crate::W<REG> {
469        self.variant(Insel1select::Feedback)
470    }
471    #[doc = "Linked LUT input source"]
472    #[inline(always)]
473    pub fn link(self) -> &'a mut crate::W<REG> {
474        self.variant(Insel1select::Link)
475    }
476    #[doc = "Event input source"]
477    #[inline(always)]
478    pub fn event(self) -> &'a mut crate::W<REG> {
479        self.variant(Insel1select::Event)
480    }
481    #[doc = "I/O pin input source"]
482    #[inline(always)]
483    pub fn io(self) -> &'a mut crate::W<REG> {
484        self.variant(Insel1select::Io)
485    }
486    #[doc = "AC input source"]
487    #[inline(always)]
488    pub fn ac(self) -> &'a mut crate::W<REG> {
489        self.variant(Insel1select::Ac)
490    }
491    #[doc = "TC input source"]
492    #[inline(always)]
493    pub fn tc(self) -> &'a mut crate::W<REG> {
494        self.variant(Insel1select::Tc)
495    }
496    #[doc = "Alternate TC input source"]
497    #[inline(always)]
498    pub fn alttc(self) -> &'a mut crate::W<REG> {
499        self.variant(Insel1select::Alttc)
500    }
501    #[doc = "TCC input source"]
502    #[inline(always)]
503    pub fn tcc(self) -> &'a mut crate::W<REG> {
504        self.variant(Insel1select::Tcc)
505    }
506    #[doc = "SERCOM input source"]
507    #[inline(always)]
508    pub fn sercom(self) -> &'a mut crate::W<REG> {
509        self.variant(Insel1select::Sercom)
510    }
511}
512#[doc = "Input Selection 2\n\nValue on reset: 0"]
513#[derive(Clone, Copy, Debug, PartialEq, Eq)]
514#[repr(u8)]
515pub enum Insel2select {
516    #[doc = "0: Masked input"]
517    Mask = 0,
518    #[doc = "1: Feedback input source"]
519    Feedback = 1,
520    #[doc = "2: Linked LUT input source"]
521    Link = 2,
522    #[doc = "3: Event input source"]
523    Event = 3,
524    #[doc = "4: I/O pin input source"]
525    Io = 4,
526    #[doc = "5: AC input source"]
527    Ac = 5,
528    #[doc = "6: TC input source"]
529    Tc = 6,
530    #[doc = "7: Alternate TC input source"]
531    Alttc = 7,
532    #[doc = "8: TCC input source"]
533    Tcc = 8,
534    #[doc = "9: SERCOM input source"]
535    Sercom = 9,
536}
537impl From<Insel2select> for u8 {
538    #[inline(always)]
539    fn from(variant: Insel2select) -> Self {
540        variant as _
541    }
542}
543impl crate::FieldSpec for Insel2select {
544    type Ux = u8;
545}
546impl crate::IsEnum for Insel2select {}
547#[doc = "Field `INSEL2` reader - Input Selection 2"]
548pub type Insel2R = crate::FieldReader<Insel2select>;
549impl Insel2R {
550    #[doc = "Get enumerated values variant"]
551    #[inline(always)]
552    pub const fn variant(&self) -> Option<Insel2select> {
553        match self.bits {
554            0 => Some(Insel2select::Mask),
555            1 => Some(Insel2select::Feedback),
556            2 => Some(Insel2select::Link),
557            3 => Some(Insel2select::Event),
558            4 => Some(Insel2select::Io),
559            5 => Some(Insel2select::Ac),
560            6 => Some(Insel2select::Tc),
561            7 => Some(Insel2select::Alttc),
562            8 => Some(Insel2select::Tcc),
563            9 => Some(Insel2select::Sercom),
564            _ => None,
565        }
566    }
567    #[doc = "Masked input"]
568    #[inline(always)]
569    pub fn is_mask(&self) -> bool {
570        *self == Insel2select::Mask
571    }
572    #[doc = "Feedback input source"]
573    #[inline(always)]
574    pub fn is_feedback(&self) -> bool {
575        *self == Insel2select::Feedback
576    }
577    #[doc = "Linked LUT input source"]
578    #[inline(always)]
579    pub fn is_link(&self) -> bool {
580        *self == Insel2select::Link
581    }
582    #[doc = "Event input source"]
583    #[inline(always)]
584    pub fn is_event(&self) -> bool {
585        *self == Insel2select::Event
586    }
587    #[doc = "I/O pin input source"]
588    #[inline(always)]
589    pub fn is_io(&self) -> bool {
590        *self == Insel2select::Io
591    }
592    #[doc = "AC input source"]
593    #[inline(always)]
594    pub fn is_ac(&self) -> bool {
595        *self == Insel2select::Ac
596    }
597    #[doc = "TC input source"]
598    #[inline(always)]
599    pub fn is_tc(&self) -> bool {
600        *self == Insel2select::Tc
601    }
602    #[doc = "Alternate TC input source"]
603    #[inline(always)]
604    pub fn is_alttc(&self) -> bool {
605        *self == Insel2select::Alttc
606    }
607    #[doc = "TCC input source"]
608    #[inline(always)]
609    pub fn is_tcc(&self) -> bool {
610        *self == Insel2select::Tcc
611    }
612    #[doc = "SERCOM input source"]
613    #[inline(always)]
614    pub fn is_sercom(&self) -> bool {
615        *self == Insel2select::Sercom
616    }
617}
618#[doc = "Field `INSEL2` writer - Input Selection 2"]
619pub type Insel2W<'a, REG> = crate::FieldWriter<'a, REG, 4, Insel2select>;
620impl<'a, REG> Insel2W<'a, REG>
621where
622    REG: crate::Writable + crate::RegisterSpec,
623    REG::Ux: From<u8>,
624{
625    #[doc = "Masked input"]
626    #[inline(always)]
627    pub fn mask(self) -> &'a mut crate::W<REG> {
628        self.variant(Insel2select::Mask)
629    }
630    #[doc = "Feedback input source"]
631    #[inline(always)]
632    pub fn feedback(self) -> &'a mut crate::W<REG> {
633        self.variant(Insel2select::Feedback)
634    }
635    #[doc = "Linked LUT input source"]
636    #[inline(always)]
637    pub fn link(self) -> &'a mut crate::W<REG> {
638        self.variant(Insel2select::Link)
639    }
640    #[doc = "Event input source"]
641    #[inline(always)]
642    pub fn event(self) -> &'a mut crate::W<REG> {
643        self.variant(Insel2select::Event)
644    }
645    #[doc = "I/O pin input source"]
646    #[inline(always)]
647    pub fn io(self) -> &'a mut crate::W<REG> {
648        self.variant(Insel2select::Io)
649    }
650    #[doc = "AC input source"]
651    #[inline(always)]
652    pub fn ac(self) -> &'a mut crate::W<REG> {
653        self.variant(Insel2select::Ac)
654    }
655    #[doc = "TC input source"]
656    #[inline(always)]
657    pub fn tc(self) -> &'a mut crate::W<REG> {
658        self.variant(Insel2select::Tc)
659    }
660    #[doc = "Alternate TC input source"]
661    #[inline(always)]
662    pub fn alttc(self) -> &'a mut crate::W<REG> {
663        self.variant(Insel2select::Alttc)
664    }
665    #[doc = "TCC input source"]
666    #[inline(always)]
667    pub fn tcc(self) -> &'a mut crate::W<REG> {
668        self.variant(Insel2select::Tcc)
669    }
670    #[doc = "SERCOM input source"]
671    #[inline(always)]
672    pub fn sercom(self) -> &'a mut crate::W<REG> {
673        self.variant(Insel2select::Sercom)
674    }
675}
676#[doc = "Inverted Event Input Enable\n\nValue on reset: 0"]
677#[derive(Clone, Copy, Debug, PartialEq, Eq)]
678pub enum Inveiselect {
679    #[doc = "0: Incoming event is not inverted"]
680    Disable = 0,
681    #[doc = "1: Incoming event is inverted"]
682    Enable = 1,
683}
684impl From<Inveiselect> for bool {
685    #[inline(always)]
686    fn from(variant: Inveiselect) -> Self {
687        variant as u8 != 0
688    }
689}
690#[doc = "Field `INVEI` reader - Inverted Event Input Enable"]
691pub type InveiR = crate::BitReader<Inveiselect>;
692impl InveiR {
693    #[doc = "Get enumerated values variant"]
694    #[inline(always)]
695    pub const fn variant(&self) -> Inveiselect {
696        match self.bits {
697            false => Inveiselect::Disable,
698            true => Inveiselect::Enable,
699        }
700    }
701    #[doc = "Incoming event is not inverted"]
702    #[inline(always)]
703    pub fn is_disable(&self) -> bool {
704        *self == Inveiselect::Disable
705    }
706    #[doc = "Incoming event is inverted"]
707    #[inline(always)]
708    pub fn is_enable(&self) -> bool {
709        *self == Inveiselect::Enable
710    }
711}
712#[doc = "Field `INVEI` writer - Inverted Event Input Enable"]
713pub type InveiW<'a, REG> = crate::BitWriter<'a, REG, Inveiselect>;
714impl<'a, REG> InveiW<'a, REG>
715where
716    REG: crate::Writable + crate::RegisterSpec,
717{
718    #[doc = "Incoming event is not inverted"]
719    #[inline(always)]
720    pub fn disable(self) -> &'a mut crate::W<REG> {
721        self.variant(Inveiselect::Disable)
722    }
723    #[doc = "Incoming event is inverted"]
724    #[inline(always)]
725    pub fn enable(self) -> &'a mut crate::W<REG> {
726        self.variant(Inveiselect::Enable)
727    }
728}
729#[doc = "LUT Event Input Enable\n\nValue on reset: 0"]
730#[derive(Clone, Copy, Debug, PartialEq, Eq)]
731pub enum Luteiselect {
732    #[doc = "0: LUT incoming event is disabled"]
733    Disable = 0,
734    #[doc = "1: LUT incoming event is enabled"]
735    Enable = 1,
736}
737impl From<Luteiselect> for bool {
738    #[inline(always)]
739    fn from(variant: Luteiselect) -> Self {
740        variant as u8 != 0
741    }
742}
743#[doc = "Field `LUTEI` reader - LUT Event Input Enable"]
744pub type LuteiR = crate::BitReader<Luteiselect>;
745impl LuteiR {
746    #[doc = "Get enumerated values variant"]
747    #[inline(always)]
748    pub const fn variant(&self) -> Luteiselect {
749        match self.bits {
750            false => Luteiselect::Disable,
751            true => Luteiselect::Enable,
752        }
753    }
754    #[doc = "LUT incoming event is disabled"]
755    #[inline(always)]
756    pub fn is_disable(&self) -> bool {
757        *self == Luteiselect::Disable
758    }
759    #[doc = "LUT incoming event is enabled"]
760    #[inline(always)]
761    pub fn is_enable(&self) -> bool {
762        *self == Luteiselect::Enable
763    }
764}
765#[doc = "Field `LUTEI` writer - LUT Event Input Enable"]
766pub type LuteiW<'a, REG> = crate::BitWriter<'a, REG, Luteiselect>;
767impl<'a, REG> LuteiW<'a, REG>
768where
769    REG: crate::Writable + crate::RegisterSpec,
770{
771    #[doc = "LUT incoming event is disabled"]
772    #[inline(always)]
773    pub fn disable(self) -> &'a mut crate::W<REG> {
774        self.variant(Luteiselect::Disable)
775    }
776    #[doc = "LUT incoming event is enabled"]
777    #[inline(always)]
778    pub fn enable(self) -> &'a mut crate::W<REG> {
779        self.variant(Luteiselect::Enable)
780    }
781}
782#[doc = "LUT Event Output Enable\n\nValue on reset: 0"]
783#[derive(Clone, Copy, Debug, PartialEq, Eq)]
784pub enum Luteoselect {
785    #[doc = "0: LUT event output is disabled"]
786    Disable = 0,
787    #[doc = "1: LUT event output is enabled"]
788    Enable = 1,
789}
790impl From<Luteoselect> for bool {
791    #[inline(always)]
792    fn from(variant: Luteoselect) -> Self {
793        variant as u8 != 0
794    }
795}
796#[doc = "Field `LUTEO` reader - LUT Event Output Enable"]
797pub type LuteoR = crate::BitReader<Luteoselect>;
798impl LuteoR {
799    #[doc = "Get enumerated values variant"]
800    #[inline(always)]
801    pub const fn variant(&self) -> Luteoselect {
802        match self.bits {
803            false => Luteoselect::Disable,
804            true => Luteoselect::Enable,
805        }
806    }
807    #[doc = "LUT event output is disabled"]
808    #[inline(always)]
809    pub fn is_disable(&self) -> bool {
810        *self == Luteoselect::Disable
811    }
812    #[doc = "LUT event output is enabled"]
813    #[inline(always)]
814    pub fn is_enable(&self) -> bool {
815        *self == Luteoselect::Enable
816    }
817}
818#[doc = "Field `LUTEO` writer - LUT Event Output Enable"]
819pub type LuteoW<'a, REG> = crate::BitWriter<'a, REG, Luteoselect>;
820impl<'a, REG> LuteoW<'a, REG>
821where
822    REG: crate::Writable + crate::RegisterSpec,
823{
824    #[doc = "LUT event output is disabled"]
825    #[inline(always)]
826    pub fn disable(self) -> &'a mut crate::W<REG> {
827        self.variant(Luteoselect::Disable)
828    }
829    #[doc = "LUT event output is enabled"]
830    #[inline(always)]
831    pub fn enable(self) -> &'a mut crate::W<REG> {
832        self.variant(Luteoselect::Enable)
833    }
834}
835#[doc = "Field `TRUTH` reader - Truth Value"]
836pub type TruthR = crate::FieldReader;
837#[doc = "Field `TRUTH` writer - Truth Value"]
838pub type TruthW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
839impl R {
840    #[doc = "Bit 1 - LUT Enable"]
841    #[inline(always)]
842    pub fn enable(&self) -> EnableR {
843        EnableR::new(((self.bits >> 1) & 1) != 0)
844    }
845    #[doc = "Bits 4:5 - Filter Selection"]
846    #[inline(always)]
847    pub fn filtsel(&self) -> FiltselR {
848        FiltselR::new(((self.bits >> 4) & 3) as u8)
849    }
850    #[doc = "Bit 7 - Edge Selection"]
851    #[inline(always)]
852    pub fn edgesel(&self) -> EdgeselR {
853        EdgeselR::new(((self.bits >> 7) & 1) != 0)
854    }
855    #[doc = "Bits 8:11 - Input Selection 0"]
856    #[inline(always)]
857    pub fn insel0(&self) -> Insel0R {
858        Insel0R::new(((self.bits >> 8) & 0x0f) as u8)
859    }
860    #[doc = "Bits 12:15 - Input Selection 1"]
861    #[inline(always)]
862    pub fn insel1(&self) -> Insel1R {
863        Insel1R::new(((self.bits >> 12) & 0x0f) as u8)
864    }
865    #[doc = "Bits 16:19 - Input Selection 2"]
866    #[inline(always)]
867    pub fn insel2(&self) -> Insel2R {
868        Insel2R::new(((self.bits >> 16) & 0x0f) as u8)
869    }
870    #[doc = "Bit 20 - Inverted Event Input Enable"]
871    #[inline(always)]
872    pub fn invei(&self) -> InveiR {
873        InveiR::new(((self.bits >> 20) & 1) != 0)
874    }
875    #[doc = "Bit 21 - LUT Event Input Enable"]
876    #[inline(always)]
877    pub fn lutei(&self) -> LuteiR {
878        LuteiR::new(((self.bits >> 21) & 1) != 0)
879    }
880    #[doc = "Bit 22 - LUT Event Output Enable"]
881    #[inline(always)]
882    pub fn luteo(&self) -> LuteoR {
883        LuteoR::new(((self.bits >> 22) & 1) != 0)
884    }
885    #[doc = "Bits 24:31 - Truth Value"]
886    #[inline(always)]
887    pub fn truth(&self) -> TruthR {
888        TruthR::new(((self.bits >> 24) & 0xff) as u8)
889    }
890}
891impl W {
892    #[doc = "Bit 1 - LUT Enable"]
893    #[inline(always)]
894    #[must_use]
895    pub fn enable(&mut self) -> EnableW<LutctrlSpec> {
896        EnableW::new(self, 1)
897    }
898    #[doc = "Bits 4:5 - Filter Selection"]
899    #[inline(always)]
900    #[must_use]
901    pub fn filtsel(&mut self) -> FiltselW<LutctrlSpec> {
902        FiltselW::new(self, 4)
903    }
904    #[doc = "Bit 7 - Edge Selection"]
905    #[inline(always)]
906    #[must_use]
907    pub fn edgesel(&mut self) -> EdgeselW<LutctrlSpec> {
908        EdgeselW::new(self, 7)
909    }
910    #[doc = "Bits 8:11 - Input Selection 0"]
911    #[inline(always)]
912    #[must_use]
913    pub fn insel0(&mut self) -> Insel0W<LutctrlSpec> {
914        Insel0W::new(self, 8)
915    }
916    #[doc = "Bits 12:15 - Input Selection 1"]
917    #[inline(always)]
918    #[must_use]
919    pub fn insel1(&mut self) -> Insel1W<LutctrlSpec> {
920        Insel1W::new(self, 12)
921    }
922    #[doc = "Bits 16:19 - Input Selection 2"]
923    #[inline(always)]
924    #[must_use]
925    pub fn insel2(&mut self) -> Insel2W<LutctrlSpec> {
926        Insel2W::new(self, 16)
927    }
928    #[doc = "Bit 20 - Inverted Event Input Enable"]
929    #[inline(always)]
930    #[must_use]
931    pub fn invei(&mut self) -> InveiW<LutctrlSpec> {
932        InveiW::new(self, 20)
933    }
934    #[doc = "Bit 21 - LUT Event Input Enable"]
935    #[inline(always)]
936    #[must_use]
937    pub fn lutei(&mut self) -> LuteiW<LutctrlSpec> {
938        LuteiW::new(self, 21)
939    }
940    #[doc = "Bit 22 - LUT Event Output Enable"]
941    #[inline(always)]
942    #[must_use]
943    pub fn luteo(&mut self) -> LuteoW<LutctrlSpec> {
944        LuteoW::new(self, 22)
945    }
946    #[doc = "Bits 24:31 - Truth Value"]
947    #[inline(always)]
948    #[must_use]
949    pub fn truth(&mut self) -> TruthW<LutctrlSpec> {
950        TruthW::new(self, 24)
951    }
952}
953#[doc = "LUT Control x\n\nYou can [`read`](crate::Reg::read) this register and get [`lutctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lutctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
954pub struct LutctrlSpec;
955impl crate::RegisterSpec for LutctrlSpec {
956    type Ux = u32;
957}
958#[doc = "`read()` method returns [`lutctrl::R`](R) reader structure"]
959impl crate::Readable for LutctrlSpec {}
960#[doc = "`write(|w| ..)` method takes [`lutctrl::W`](W) writer structure"]
961impl crate::Writable for LutctrlSpec {
962    type Safety = crate::Unsafe;
963    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
964    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
965}
966#[doc = "`reset()` method sets LUTCTRL[%s]
967to value 0"]
968impl crate::Resettable for LutctrlSpec {
969    const RESET_VALUE: u32 = 0;
970}