Skip to main content

atsamd51j20a/rtc/mode2/
tampctrl.rs

1#[doc = "Reader of register TAMPCTRL"]
2pub type R = crate::R<u32, super::TAMPCTRL>;
3#[doc = "Writer for register TAMPCTRL"]
4pub type W = crate::W<u32, super::TAMPCTRL>;
5#[doc = "Register TAMPCTRL `reset()`'s with value 0"]
6impl crate::ResetValue for super::TAMPCTRL {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Tamper Input 0 Action\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15#[repr(u8)]
16pub enum IN0ACT_A {
17    #[doc = "0: Off (Disabled)"]
18    OFF = 0,
19    #[doc = "1: Wake without timestamp"]
20    WAKE = 1,
21    #[doc = "2: Capture timestamp"]
22    CAPTURE = 2,
23    #[doc = "3: Compare IN0 to OUT"]
24    ACTL = 3,
25}
26impl From<IN0ACT_A> for u8 {
27    #[inline(always)]
28    fn from(variant: IN0ACT_A) -> Self {
29        variant as _
30    }
31}
32#[doc = "Reader of field `IN0ACT`"]
33pub type IN0ACT_R = crate::R<u8, IN0ACT_A>;
34impl IN0ACT_R {
35    #[doc = r"Get enumerated values variant"]
36    #[inline(always)]
37    pub fn variant(&self) -> IN0ACT_A {
38        match self.bits {
39            0 => IN0ACT_A::OFF,
40            1 => IN0ACT_A::WAKE,
41            2 => IN0ACT_A::CAPTURE,
42            3 => IN0ACT_A::ACTL,
43            _ => unreachable!(),
44        }
45    }
46    #[doc = "Checks if the value of the field is `OFF`"]
47    #[inline(always)]
48    pub fn is_off(&self) -> bool {
49        *self == IN0ACT_A::OFF
50    }
51    #[doc = "Checks if the value of the field is `WAKE`"]
52    #[inline(always)]
53    pub fn is_wake(&self) -> bool {
54        *self == IN0ACT_A::WAKE
55    }
56    #[doc = "Checks if the value of the field is `CAPTURE`"]
57    #[inline(always)]
58    pub fn is_capture(&self) -> bool {
59        *self == IN0ACT_A::CAPTURE
60    }
61    #[doc = "Checks if the value of the field is `ACTL`"]
62    #[inline(always)]
63    pub fn is_actl(&self) -> bool {
64        *self == IN0ACT_A::ACTL
65    }
66}
67#[doc = "Write proxy for field `IN0ACT`"]
68pub struct IN0ACT_W<'a> {
69    w: &'a mut W,
70}
71impl<'a> IN0ACT_W<'a> {
72    #[doc = r"Writes `variant` to the field"]
73    #[inline(always)]
74    pub fn variant(self, variant: IN0ACT_A) -> &'a mut W {
75        {
76            self.bits(variant.into())
77        }
78    }
79    #[doc = "Off (Disabled)"]
80    #[inline(always)]
81    pub fn off(self) -> &'a mut W {
82        self.variant(IN0ACT_A::OFF)
83    }
84    #[doc = "Wake without timestamp"]
85    #[inline(always)]
86    pub fn wake(self) -> &'a mut W {
87        self.variant(IN0ACT_A::WAKE)
88    }
89    #[doc = "Capture timestamp"]
90    #[inline(always)]
91    pub fn capture(self) -> &'a mut W {
92        self.variant(IN0ACT_A::CAPTURE)
93    }
94    #[doc = "Compare IN0 to OUT"]
95    #[inline(always)]
96    pub fn actl(self) -> &'a mut W {
97        self.variant(IN0ACT_A::ACTL)
98    }
99    #[doc = r"Writes raw bits to the field"]
100    #[inline(always)]
101    pub fn bits(self, value: u8) -> &'a mut W {
102        self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03);
103        self.w
104    }
105}
106#[doc = "Tamper Input 1 Action\n\nValue on reset: 0"]
107#[derive(Clone, Copy, Debug, PartialEq)]
108#[repr(u8)]
109pub enum IN1ACT_A {
110    #[doc = "0: Off (Disabled)"]
111    OFF = 0,
112    #[doc = "1: Wake without timestamp"]
113    WAKE = 1,
114    #[doc = "2: Capture timestamp"]
115    CAPTURE = 2,
116    #[doc = "3: Compare IN1 to OUT"]
117    ACTL = 3,
118}
119impl From<IN1ACT_A> for u8 {
120    #[inline(always)]
121    fn from(variant: IN1ACT_A) -> Self {
122        variant as _
123    }
124}
125#[doc = "Reader of field `IN1ACT`"]
126pub type IN1ACT_R = crate::R<u8, IN1ACT_A>;
127impl IN1ACT_R {
128    #[doc = r"Get enumerated values variant"]
129    #[inline(always)]
130    pub fn variant(&self) -> IN1ACT_A {
131        match self.bits {
132            0 => IN1ACT_A::OFF,
133            1 => IN1ACT_A::WAKE,
134            2 => IN1ACT_A::CAPTURE,
135            3 => IN1ACT_A::ACTL,
136            _ => unreachable!(),
137        }
138    }
139    #[doc = "Checks if the value of the field is `OFF`"]
140    #[inline(always)]
141    pub fn is_off(&self) -> bool {
142        *self == IN1ACT_A::OFF
143    }
144    #[doc = "Checks if the value of the field is `WAKE`"]
145    #[inline(always)]
146    pub fn is_wake(&self) -> bool {
147        *self == IN1ACT_A::WAKE
148    }
149    #[doc = "Checks if the value of the field is `CAPTURE`"]
150    #[inline(always)]
151    pub fn is_capture(&self) -> bool {
152        *self == IN1ACT_A::CAPTURE
153    }
154    #[doc = "Checks if the value of the field is `ACTL`"]
155    #[inline(always)]
156    pub fn is_actl(&self) -> bool {
157        *self == IN1ACT_A::ACTL
158    }
159}
160#[doc = "Write proxy for field `IN1ACT`"]
161pub struct IN1ACT_W<'a> {
162    w: &'a mut W,
163}
164impl<'a> IN1ACT_W<'a> {
165    #[doc = r"Writes `variant` to the field"]
166    #[inline(always)]
167    pub fn variant(self, variant: IN1ACT_A) -> &'a mut W {
168        {
169            self.bits(variant.into())
170        }
171    }
172    #[doc = "Off (Disabled)"]
173    #[inline(always)]
174    pub fn off(self) -> &'a mut W {
175        self.variant(IN1ACT_A::OFF)
176    }
177    #[doc = "Wake without timestamp"]
178    #[inline(always)]
179    pub fn wake(self) -> &'a mut W {
180        self.variant(IN1ACT_A::WAKE)
181    }
182    #[doc = "Capture timestamp"]
183    #[inline(always)]
184    pub fn capture(self) -> &'a mut W {
185        self.variant(IN1ACT_A::CAPTURE)
186    }
187    #[doc = "Compare IN1 to OUT"]
188    #[inline(always)]
189    pub fn actl(self) -> &'a mut W {
190        self.variant(IN1ACT_A::ACTL)
191    }
192    #[doc = r"Writes raw bits to the field"]
193    #[inline(always)]
194    pub fn bits(self, value: u8) -> &'a mut W {
195        self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2);
196        self.w
197    }
198}
199#[doc = "Tamper Input 2 Action\n\nValue on reset: 0"]
200#[derive(Clone, Copy, Debug, PartialEq)]
201#[repr(u8)]
202pub enum IN2ACT_A {
203    #[doc = "0: Off (Disabled)"]
204    OFF = 0,
205    #[doc = "1: Wake without timestamp"]
206    WAKE = 1,
207    #[doc = "2: Capture timestamp"]
208    CAPTURE = 2,
209    #[doc = "3: Compare IN2 to OUT"]
210    ACTL = 3,
211}
212impl From<IN2ACT_A> for u8 {
213    #[inline(always)]
214    fn from(variant: IN2ACT_A) -> Self {
215        variant as _
216    }
217}
218#[doc = "Reader of field `IN2ACT`"]
219pub type IN2ACT_R = crate::R<u8, IN2ACT_A>;
220impl IN2ACT_R {
221    #[doc = r"Get enumerated values variant"]
222    #[inline(always)]
223    pub fn variant(&self) -> IN2ACT_A {
224        match self.bits {
225            0 => IN2ACT_A::OFF,
226            1 => IN2ACT_A::WAKE,
227            2 => IN2ACT_A::CAPTURE,
228            3 => IN2ACT_A::ACTL,
229            _ => unreachable!(),
230        }
231    }
232    #[doc = "Checks if the value of the field is `OFF`"]
233    #[inline(always)]
234    pub fn is_off(&self) -> bool {
235        *self == IN2ACT_A::OFF
236    }
237    #[doc = "Checks if the value of the field is `WAKE`"]
238    #[inline(always)]
239    pub fn is_wake(&self) -> bool {
240        *self == IN2ACT_A::WAKE
241    }
242    #[doc = "Checks if the value of the field is `CAPTURE`"]
243    #[inline(always)]
244    pub fn is_capture(&self) -> bool {
245        *self == IN2ACT_A::CAPTURE
246    }
247    #[doc = "Checks if the value of the field is `ACTL`"]
248    #[inline(always)]
249    pub fn is_actl(&self) -> bool {
250        *self == IN2ACT_A::ACTL
251    }
252}
253#[doc = "Write proxy for field `IN2ACT`"]
254pub struct IN2ACT_W<'a> {
255    w: &'a mut W,
256}
257impl<'a> IN2ACT_W<'a> {
258    #[doc = r"Writes `variant` to the field"]
259    #[inline(always)]
260    pub fn variant(self, variant: IN2ACT_A) -> &'a mut W {
261        {
262            self.bits(variant.into())
263        }
264    }
265    #[doc = "Off (Disabled)"]
266    #[inline(always)]
267    pub fn off(self) -> &'a mut W {
268        self.variant(IN2ACT_A::OFF)
269    }
270    #[doc = "Wake without timestamp"]
271    #[inline(always)]
272    pub fn wake(self) -> &'a mut W {
273        self.variant(IN2ACT_A::WAKE)
274    }
275    #[doc = "Capture timestamp"]
276    #[inline(always)]
277    pub fn capture(self) -> &'a mut W {
278        self.variant(IN2ACT_A::CAPTURE)
279    }
280    #[doc = "Compare IN2 to OUT"]
281    #[inline(always)]
282    pub fn actl(self) -> &'a mut W {
283        self.variant(IN2ACT_A::ACTL)
284    }
285    #[doc = r"Writes raw bits to the field"]
286    #[inline(always)]
287    pub fn bits(self, value: u8) -> &'a mut W {
288        self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4);
289        self.w
290    }
291}
292#[doc = "Tamper Input 3 Action\n\nValue on reset: 0"]
293#[derive(Clone, Copy, Debug, PartialEq)]
294#[repr(u8)]
295pub enum IN3ACT_A {
296    #[doc = "0: Off (Disabled)"]
297    OFF = 0,
298    #[doc = "1: Wake without timestamp"]
299    WAKE = 1,
300    #[doc = "2: Capture timestamp"]
301    CAPTURE = 2,
302    #[doc = "3: Compare IN3 to OUT"]
303    ACTL = 3,
304}
305impl From<IN3ACT_A> for u8 {
306    #[inline(always)]
307    fn from(variant: IN3ACT_A) -> Self {
308        variant as _
309    }
310}
311#[doc = "Reader of field `IN3ACT`"]
312pub type IN3ACT_R = crate::R<u8, IN3ACT_A>;
313impl IN3ACT_R {
314    #[doc = r"Get enumerated values variant"]
315    #[inline(always)]
316    pub fn variant(&self) -> IN3ACT_A {
317        match self.bits {
318            0 => IN3ACT_A::OFF,
319            1 => IN3ACT_A::WAKE,
320            2 => IN3ACT_A::CAPTURE,
321            3 => IN3ACT_A::ACTL,
322            _ => unreachable!(),
323        }
324    }
325    #[doc = "Checks if the value of the field is `OFF`"]
326    #[inline(always)]
327    pub fn is_off(&self) -> bool {
328        *self == IN3ACT_A::OFF
329    }
330    #[doc = "Checks if the value of the field is `WAKE`"]
331    #[inline(always)]
332    pub fn is_wake(&self) -> bool {
333        *self == IN3ACT_A::WAKE
334    }
335    #[doc = "Checks if the value of the field is `CAPTURE`"]
336    #[inline(always)]
337    pub fn is_capture(&self) -> bool {
338        *self == IN3ACT_A::CAPTURE
339    }
340    #[doc = "Checks if the value of the field is `ACTL`"]
341    #[inline(always)]
342    pub fn is_actl(&self) -> bool {
343        *self == IN3ACT_A::ACTL
344    }
345}
346#[doc = "Write proxy for field `IN3ACT`"]
347pub struct IN3ACT_W<'a> {
348    w: &'a mut W,
349}
350impl<'a> IN3ACT_W<'a> {
351    #[doc = r"Writes `variant` to the field"]
352    #[inline(always)]
353    pub fn variant(self, variant: IN3ACT_A) -> &'a mut W {
354        {
355            self.bits(variant.into())
356        }
357    }
358    #[doc = "Off (Disabled)"]
359    #[inline(always)]
360    pub fn off(self) -> &'a mut W {
361        self.variant(IN3ACT_A::OFF)
362    }
363    #[doc = "Wake without timestamp"]
364    #[inline(always)]
365    pub fn wake(self) -> &'a mut W {
366        self.variant(IN3ACT_A::WAKE)
367    }
368    #[doc = "Capture timestamp"]
369    #[inline(always)]
370    pub fn capture(self) -> &'a mut W {
371        self.variant(IN3ACT_A::CAPTURE)
372    }
373    #[doc = "Compare IN3 to OUT"]
374    #[inline(always)]
375    pub fn actl(self) -> &'a mut W {
376        self.variant(IN3ACT_A::ACTL)
377    }
378    #[doc = r"Writes raw bits to the field"]
379    #[inline(always)]
380    pub fn bits(self, value: u8) -> &'a mut W {
381        self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6);
382        self.w
383    }
384}
385#[doc = "Tamper Input 4 Action\n\nValue on reset: 0"]
386#[derive(Clone, Copy, Debug, PartialEq)]
387#[repr(u8)]
388pub enum IN4ACT_A {
389    #[doc = "0: Off (Disabled)"]
390    OFF = 0,
391    #[doc = "1: Wake without timestamp"]
392    WAKE = 1,
393    #[doc = "2: Capture timestamp"]
394    CAPTURE = 2,
395    #[doc = "3: Compare IN4 to OUT"]
396    ACTL = 3,
397}
398impl From<IN4ACT_A> for u8 {
399    #[inline(always)]
400    fn from(variant: IN4ACT_A) -> Self {
401        variant as _
402    }
403}
404#[doc = "Reader of field `IN4ACT`"]
405pub type IN4ACT_R = crate::R<u8, IN4ACT_A>;
406impl IN4ACT_R {
407    #[doc = r"Get enumerated values variant"]
408    #[inline(always)]
409    pub fn variant(&self) -> IN4ACT_A {
410        match self.bits {
411            0 => IN4ACT_A::OFF,
412            1 => IN4ACT_A::WAKE,
413            2 => IN4ACT_A::CAPTURE,
414            3 => IN4ACT_A::ACTL,
415            _ => unreachable!(),
416        }
417    }
418    #[doc = "Checks if the value of the field is `OFF`"]
419    #[inline(always)]
420    pub fn is_off(&self) -> bool {
421        *self == IN4ACT_A::OFF
422    }
423    #[doc = "Checks if the value of the field is `WAKE`"]
424    #[inline(always)]
425    pub fn is_wake(&self) -> bool {
426        *self == IN4ACT_A::WAKE
427    }
428    #[doc = "Checks if the value of the field is `CAPTURE`"]
429    #[inline(always)]
430    pub fn is_capture(&self) -> bool {
431        *self == IN4ACT_A::CAPTURE
432    }
433    #[doc = "Checks if the value of the field is `ACTL`"]
434    #[inline(always)]
435    pub fn is_actl(&self) -> bool {
436        *self == IN4ACT_A::ACTL
437    }
438}
439#[doc = "Write proxy for field `IN4ACT`"]
440pub struct IN4ACT_W<'a> {
441    w: &'a mut W,
442}
443impl<'a> IN4ACT_W<'a> {
444    #[doc = r"Writes `variant` to the field"]
445    #[inline(always)]
446    pub fn variant(self, variant: IN4ACT_A) -> &'a mut W {
447        {
448            self.bits(variant.into())
449        }
450    }
451    #[doc = "Off (Disabled)"]
452    #[inline(always)]
453    pub fn off(self) -> &'a mut W {
454        self.variant(IN4ACT_A::OFF)
455    }
456    #[doc = "Wake without timestamp"]
457    #[inline(always)]
458    pub fn wake(self) -> &'a mut W {
459        self.variant(IN4ACT_A::WAKE)
460    }
461    #[doc = "Capture timestamp"]
462    #[inline(always)]
463    pub fn capture(self) -> &'a mut W {
464        self.variant(IN4ACT_A::CAPTURE)
465    }
466    #[doc = "Compare IN4 to OUT"]
467    #[inline(always)]
468    pub fn actl(self) -> &'a mut W {
469        self.variant(IN4ACT_A::ACTL)
470    }
471    #[doc = r"Writes raw bits to the field"]
472    #[inline(always)]
473    pub fn bits(self, value: u8) -> &'a mut W {
474        self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8);
475        self.w
476    }
477}
478#[doc = "Reader of field `TAMLVL0`"]
479pub type TAMLVL0_R = crate::R<bool, bool>;
480#[doc = "Write proxy for field `TAMLVL0`"]
481pub struct TAMLVL0_W<'a> {
482    w: &'a mut W,
483}
484impl<'a> TAMLVL0_W<'a> {
485    #[doc = r"Sets the field bit"]
486    #[inline(always)]
487    pub fn set_bit(self) -> &'a mut W {
488        self.bit(true)
489    }
490    #[doc = r"Clears the field bit"]
491    #[inline(always)]
492    pub fn clear_bit(self) -> &'a mut W {
493        self.bit(false)
494    }
495    #[doc = r"Writes raw bits to the field"]
496    #[inline(always)]
497    pub fn bit(self, value: bool) -> &'a mut W {
498        self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
499        self.w
500    }
501}
502#[doc = "Reader of field `TAMLVL1`"]
503pub type TAMLVL1_R = crate::R<bool, bool>;
504#[doc = "Write proxy for field `TAMLVL1`"]
505pub struct TAMLVL1_W<'a> {
506    w: &'a mut W,
507}
508impl<'a> TAMLVL1_W<'a> {
509    #[doc = r"Sets the field bit"]
510    #[inline(always)]
511    pub fn set_bit(self) -> &'a mut W {
512        self.bit(true)
513    }
514    #[doc = r"Clears the field bit"]
515    #[inline(always)]
516    pub fn clear_bit(self) -> &'a mut W {
517        self.bit(false)
518    }
519    #[doc = r"Writes raw bits to the field"]
520    #[inline(always)]
521    pub fn bit(self, value: bool) -> &'a mut W {
522        self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
523        self.w
524    }
525}
526#[doc = "Reader of field `TAMLVL2`"]
527pub type TAMLVL2_R = crate::R<bool, bool>;
528#[doc = "Write proxy for field `TAMLVL2`"]
529pub struct TAMLVL2_W<'a> {
530    w: &'a mut W,
531}
532impl<'a> TAMLVL2_W<'a> {
533    #[doc = r"Sets the field bit"]
534    #[inline(always)]
535    pub fn set_bit(self) -> &'a mut W {
536        self.bit(true)
537    }
538    #[doc = r"Clears the field bit"]
539    #[inline(always)]
540    pub fn clear_bit(self) -> &'a mut W {
541        self.bit(false)
542    }
543    #[doc = r"Writes raw bits to the field"]
544    #[inline(always)]
545    pub fn bit(self, value: bool) -> &'a mut W {
546        self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18);
547        self.w
548    }
549}
550#[doc = "Reader of field `TAMLVL3`"]
551pub type TAMLVL3_R = crate::R<bool, bool>;
552#[doc = "Write proxy for field `TAMLVL3`"]
553pub struct TAMLVL3_W<'a> {
554    w: &'a mut W,
555}
556impl<'a> TAMLVL3_W<'a> {
557    #[doc = r"Sets the field bit"]
558    #[inline(always)]
559    pub fn set_bit(self) -> &'a mut W {
560        self.bit(true)
561    }
562    #[doc = r"Clears the field bit"]
563    #[inline(always)]
564    pub fn clear_bit(self) -> &'a mut W {
565        self.bit(false)
566    }
567    #[doc = r"Writes raw bits to the field"]
568    #[inline(always)]
569    pub fn bit(self, value: bool) -> &'a mut W {
570        self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19);
571        self.w
572    }
573}
574#[doc = "Reader of field `TAMLVL4`"]
575pub type TAMLVL4_R = crate::R<bool, bool>;
576#[doc = "Write proxy for field `TAMLVL4`"]
577pub struct TAMLVL4_W<'a> {
578    w: &'a mut W,
579}
580impl<'a> TAMLVL4_W<'a> {
581    #[doc = r"Sets the field bit"]
582    #[inline(always)]
583    pub fn set_bit(self) -> &'a mut W {
584        self.bit(true)
585    }
586    #[doc = r"Clears the field bit"]
587    #[inline(always)]
588    pub fn clear_bit(self) -> &'a mut W {
589        self.bit(false)
590    }
591    #[doc = r"Writes raw bits to the field"]
592    #[inline(always)]
593    pub fn bit(self, value: bool) -> &'a mut W {
594        self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20);
595        self.w
596    }
597}
598#[doc = "Reader of field `DEBNC0`"]
599pub type DEBNC0_R = crate::R<bool, bool>;
600#[doc = "Write proxy for field `DEBNC0`"]
601pub struct DEBNC0_W<'a> {
602    w: &'a mut W,
603}
604impl<'a> DEBNC0_W<'a> {
605    #[doc = r"Sets the field bit"]
606    #[inline(always)]
607    pub fn set_bit(self) -> &'a mut W {
608        self.bit(true)
609    }
610    #[doc = r"Clears the field bit"]
611    #[inline(always)]
612    pub fn clear_bit(self) -> &'a mut W {
613        self.bit(false)
614    }
615    #[doc = r"Writes raw bits to the field"]
616    #[inline(always)]
617    pub fn bit(self, value: bool) -> &'a mut W {
618        self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
619        self.w
620    }
621}
622#[doc = "Reader of field `DEBNC1`"]
623pub type DEBNC1_R = crate::R<bool, bool>;
624#[doc = "Write proxy for field `DEBNC1`"]
625pub struct DEBNC1_W<'a> {
626    w: &'a mut W,
627}
628impl<'a> DEBNC1_W<'a> {
629    #[doc = r"Sets the field bit"]
630    #[inline(always)]
631    pub fn set_bit(self) -> &'a mut W {
632        self.bit(true)
633    }
634    #[doc = r"Clears the field bit"]
635    #[inline(always)]
636    pub fn clear_bit(self) -> &'a mut W {
637        self.bit(false)
638    }
639    #[doc = r"Writes raw bits to the field"]
640    #[inline(always)]
641    pub fn bit(self, value: bool) -> &'a mut W {
642        self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25);
643        self.w
644    }
645}
646#[doc = "Reader of field `DEBNC2`"]
647pub type DEBNC2_R = crate::R<bool, bool>;
648#[doc = "Write proxy for field `DEBNC2`"]
649pub struct DEBNC2_W<'a> {
650    w: &'a mut W,
651}
652impl<'a> DEBNC2_W<'a> {
653    #[doc = r"Sets the field bit"]
654    #[inline(always)]
655    pub fn set_bit(self) -> &'a mut W {
656        self.bit(true)
657    }
658    #[doc = r"Clears the field bit"]
659    #[inline(always)]
660    pub fn clear_bit(self) -> &'a mut W {
661        self.bit(false)
662    }
663    #[doc = r"Writes raw bits to the field"]
664    #[inline(always)]
665    pub fn bit(self, value: bool) -> &'a mut W {
666        self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26);
667        self.w
668    }
669}
670#[doc = "Reader of field `DEBNC3`"]
671pub type DEBNC3_R = crate::R<bool, bool>;
672#[doc = "Write proxy for field `DEBNC3`"]
673pub struct DEBNC3_W<'a> {
674    w: &'a mut W,
675}
676impl<'a> DEBNC3_W<'a> {
677    #[doc = r"Sets the field bit"]
678    #[inline(always)]
679    pub fn set_bit(self) -> &'a mut W {
680        self.bit(true)
681    }
682    #[doc = r"Clears the field bit"]
683    #[inline(always)]
684    pub fn clear_bit(self) -> &'a mut W {
685        self.bit(false)
686    }
687    #[doc = r"Writes raw bits to the field"]
688    #[inline(always)]
689    pub fn bit(self, value: bool) -> &'a mut W {
690        self.w.bits = (self.w.bits & !(0x01 << 27)) | (((value as u32) & 0x01) << 27);
691        self.w
692    }
693}
694#[doc = "Reader of field `DEBNC4`"]
695pub type DEBNC4_R = crate::R<bool, bool>;
696#[doc = "Write proxy for field `DEBNC4`"]
697pub struct DEBNC4_W<'a> {
698    w: &'a mut W,
699}
700impl<'a> DEBNC4_W<'a> {
701    #[doc = r"Sets the field bit"]
702    #[inline(always)]
703    pub fn set_bit(self) -> &'a mut W {
704        self.bit(true)
705    }
706    #[doc = r"Clears the field bit"]
707    #[inline(always)]
708    pub fn clear_bit(self) -> &'a mut W {
709        self.bit(false)
710    }
711    #[doc = r"Writes raw bits to the field"]
712    #[inline(always)]
713    pub fn bit(self, value: bool) -> &'a mut W {
714        self.w.bits = (self.w.bits & !(0x01 << 28)) | (((value as u32) & 0x01) << 28);
715        self.w
716    }
717}
718impl R {
719    #[doc = "Bits 0:1 - Tamper Input 0 Action"]
720    #[inline(always)]
721    pub fn in0act(&self) -> IN0ACT_R {
722        IN0ACT_R::new((self.bits & 0x03) as u8)
723    }
724    #[doc = "Bits 2:3 - Tamper Input 1 Action"]
725    #[inline(always)]
726    pub fn in1act(&self) -> IN1ACT_R {
727        IN1ACT_R::new(((self.bits >> 2) & 0x03) as u8)
728    }
729    #[doc = "Bits 4:5 - Tamper Input 2 Action"]
730    #[inline(always)]
731    pub fn in2act(&self) -> IN2ACT_R {
732        IN2ACT_R::new(((self.bits >> 4) & 0x03) as u8)
733    }
734    #[doc = "Bits 6:7 - Tamper Input 3 Action"]
735    #[inline(always)]
736    pub fn in3act(&self) -> IN3ACT_R {
737        IN3ACT_R::new(((self.bits >> 6) & 0x03) as u8)
738    }
739    #[doc = "Bits 8:9 - Tamper Input 4 Action"]
740    #[inline(always)]
741    pub fn in4act(&self) -> IN4ACT_R {
742        IN4ACT_R::new(((self.bits >> 8) & 0x03) as u8)
743    }
744    #[doc = "Bit 16 - Tamper Level Select 0"]
745    #[inline(always)]
746    pub fn tamlvl0(&self) -> TAMLVL0_R {
747        TAMLVL0_R::new(((self.bits >> 16) & 0x01) != 0)
748    }
749    #[doc = "Bit 17 - Tamper Level Select 1"]
750    #[inline(always)]
751    pub fn tamlvl1(&self) -> TAMLVL1_R {
752        TAMLVL1_R::new(((self.bits >> 17) & 0x01) != 0)
753    }
754    #[doc = "Bit 18 - Tamper Level Select 2"]
755    #[inline(always)]
756    pub fn tamlvl2(&self) -> TAMLVL2_R {
757        TAMLVL2_R::new(((self.bits >> 18) & 0x01) != 0)
758    }
759    #[doc = "Bit 19 - Tamper Level Select 3"]
760    #[inline(always)]
761    pub fn tamlvl3(&self) -> TAMLVL3_R {
762        TAMLVL3_R::new(((self.bits >> 19) & 0x01) != 0)
763    }
764    #[doc = "Bit 20 - Tamper Level Select 4"]
765    #[inline(always)]
766    pub fn tamlvl4(&self) -> TAMLVL4_R {
767        TAMLVL4_R::new(((self.bits >> 20) & 0x01) != 0)
768    }
769    #[doc = "Bit 24 - Debouncer Enable 0"]
770    #[inline(always)]
771    pub fn debnc0(&self) -> DEBNC0_R {
772        DEBNC0_R::new(((self.bits >> 24) & 0x01) != 0)
773    }
774    #[doc = "Bit 25 - Debouncer Enable 1"]
775    #[inline(always)]
776    pub fn debnc1(&self) -> DEBNC1_R {
777        DEBNC1_R::new(((self.bits >> 25) & 0x01) != 0)
778    }
779    #[doc = "Bit 26 - Debouncer Enable 2"]
780    #[inline(always)]
781    pub fn debnc2(&self) -> DEBNC2_R {
782        DEBNC2_R::new(((self.bits >> 26) & 0x01) != 0)
783    }
784    #[doc = "Bit 27 - Debouncer Enable 3"]
785    #[inline(always)]
786    pub fn debnc3(&self) -> DEBNC3_R {
787        DEBNC3_R::new(((self.bits >> 27) & 0x01) != 0)
788    }
789    #[doc = "Bit 28 - Debouncer Enable 4"]
790    #[inline(always)]
791    pub fn debnc4(&self) -> DEBNC4_R {
792        DEBNC4_R::new(((self.bits >> 28) & 0x01) != 0)
793    }
794}
795impl W {
796    #[doc = "Bits 0:1 - Tamper Input 0 Action"]
797    #[inline(always)]
798    pub fn in0act(&mut self) -> IN0ACT_W {
799        IN0ACT_W { w: self }
800    }
801    #[doc = "Bits 2:3 - Tamper Input 1 Action"]
802    #[inline(always)]
803    pub fn in1act(&mut self) -> IN1ACT_W {
804        IN1ACT_W { w: self }
805    }
806    #[doc = "Bits 4:5 - Tamper Input 2 Action"]
807    #[inline(always)]
808    pub fn in2act(&mut self) -> IN2ACT_W {
809        IN2ACT_W { w: self }
810    }
811    #[doc = "Bits 6:7 - Tamper Input 3 Action"]
812    #[inline(always)]
813    pub fn in3act(&mut self) -> IN3ACT_W {
814        IN3ACT_W { w: self }
815    }
816    #[doc = "Bits 8:9 - Tamper Input 4 Action"]
817    #[inline(always)]
818    pub fn in4act(&mut self) -> IN4ACT_W {
819        IN4ACT_W { w: self }
820    }
821    #[doc = "Bit 16 - Tamper Level Select 0"]
822    #[inline(always)]
823    pub fn tamlvl0(&mut self) -> TAMLVL0_W {
824        TAMLVL0_W { w: self }
825    }
826    #[doc = "Bit 17 - Tamper Level Select 1"]
827    #[inline(always)]
828    pub fn tamlvl1(&mut self) -> TAMLVL1_W {
829        TAMLVL1_W { w: self }
830    }
831    #[doc = "Bit 18 - Tamper Level Select 2"]
832    #[inline(always)]
833    pub fn tamlvl2(&mut self) -> TAMLVL2_W {
834        TAMLVL2_W { w: self }
835    }
836    #[doc = "Bit 19 - Tamper Level Select 3"]
837    #[inline(always)]
838    pub fn tamlvl3(&mut self) -> TAMLVL3_W {
839        TAMLVL3_W { w: self }
840    }
841    #[doc = "Bit 20 - Tamper Level Select 4"]
842    #[inline(always)]
843    pub fn tamlvl4(&mut self) -> TAMLVL4_W {
844        TAMLVL4_W { w: self }
845    }
846    #[doc = "Bit 24 - Debouncer Enable 0"]
847    #[inline(always)]
848    pub fn debnc0(&mut self) -> DEBNC0_W {
849        DEBNC0_W { w: self }
850    }
851    #[doc = "Bit 25 - Debouncer Enable 1"]
852    #[inline(always)]
853    pub fn debnc1(&mut self) -> DEBNC1_W {
854        DEBNC1_W { w: self }
855    }
856    #[doc = "Bit 26 - Debouncer Enable 2"]
857    #[inline(always)]
858    pub fn debnc2(&mut self) -> DEBNC2_W {
859        DEBNC2_W { w: self }
860    }
861    #[doc = "Bit 27 - Debouncer Enable 3"]
862    #[inline(always)]
863    pub fn debnc3(&mut self) -> DEBNC3_W {
864        DEBNC3_W { w: self }
865    }
866    #[doc = "Bit 28 - Debouncer Enable 4"]
867    #[inline(always)]
868    pub fn debnc4(&mut self) -> DEBNC4_W {
869        DEBNC4_W { w: self }
870    }
871}