atsamd51j/rtc/mode1/
tampid.rs

1#[doc = "Register `TAMPID` reader"]
2pub type R = crate::R<TampidSpec>;
3#[doc = "Register `TAMPID` writer"]
4pub type W = crate::W<TampidSpec>;
5#[doc = "Field `TAMPID0` reader - Tamper Input 0 Detected"]
6pub type Tampid0R = crate::BitReader;
7#[doc = "Field `TAMPID0` writer - Tamper Input 0 Detected"]
8pub type Tampid0W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `TAMPID1` reader - Tamper Input 1 Detected"]
10pub type Tampid1R = crate::BitReader;
11#[doc = "Field `TAMPID1` writer - Tamper Input 1 Detected"]
12pub type Tampid1W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `TAMPID2` reader - Tamper Input 2 Detected"]
14pub type Tampid2R = crate::BitReader;
15#[doc = "Field `TAMPID2` writer - Tamper Input 2 Detected"]
16pub type Tampid2W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `TAMPID3` reader - Tamper Input 3 Detected"]
18pub type Tampid3R = crate::BitReader;
19#[doc = "Field `TAMPID3` writer - Tamper Input 3 Detected"]
20pub type Tampid3W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `TAMPID4` reader - Tamper Input 4 Detected"]
22pub type Tampid4R = crate::BitReader;
23#[doc = "Field `TAMPID4` writer - Tamper Input 4 Detected"]
24pub type Tampid4W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `TAMPEVT` reader - Tamper Event Detected"]
26pub type TampevtR = crate::BitReader;
27#[doc = "Field `TAMPEVT` writer - Tamper Event Detected"]
28pub type TampevtW<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30    #[doc = "Bit 0 - Tamper Input 0 Detected"]
31    #[inline(always)]
32    pub fn tampid0(&self) -> Tampid0R {
33        Tampid0R::new((self.bits & 1) != 0)
34    }
35    #[doc = "Bit 1 - Tamper Input 1 Detected"]
36    #[inline(always)]
37    pub fn tampid1(&self) -> Tampid1R {
38        Tampid1R::new(((self.bits >> 1) & 1) != 0)
39    }
40    #[doc = "Bit 2 - Tamper Input 2 Detected"]
41    #[inline(always)]
42    pub fn tampid2(&self) -> Tampid2R {
43        Tampid2R::new(((self.bits >> 2) & 1) != 0)
44    }
45    #[doc = "Bit 3 - Tamper Input 3 Detected"]
46    #[inline(always)]
47    pub fn tampid3(&self) -> Tampid3R {
48        Tampid3R::new(((self.bits >> 3) & 1) != 0)
49    }
50    #[doc = "Bit 4 - Tamper Input 4 Detected"]
51    #[inline(always)]
52    pub fn tampid4(&self) -> Tampid4R {
53        Tampid4R::new(((self.bits >> 4) & 1) != 0)
54    }
55    #[doc = "Bit 31 - Tamper Event Detected"]
56    #[inline(always)]
57    pub fn tampevt(&self) -> TampevtR {
58        TampevtR::new(((self.bits >> 31) & 1) != 0)
59    }
60}
61impl W {
62    #[doc = "Bit 0 - Tamper Input 0 Detected"]
63    #[inline(always)]
64    #[must_use]
65    pub fn tampid0(&mut self) -> Tampid0W<TampidSpec> {
66        Tampid0W::new(self, 0)
67    }
68    #[doc = "Bit 1 - Tamper Input 1 Detected"]
69    #[inline(always)]
70    #[must_use]
71    pub fn tampid1(&mut self) -> Tampid1W<TampidSpec> {
72        Tampid1W::new(self, 1)
73    }
74    #[doc = "Bit 2 - Tamper Input 2 Detected"]
75    #[inline(always)]
76    #[must_use]
77    pub fn tampid2(&mut self) -> Tampid2W<TampidSpec> {
78        Tampid2W::new(self, 2)
79    }
80    #[doc = "Bit 3 - Tamper Input 3 Detected"]
81    #[inline(always)]
82    #[must_use]
83    pub fn tampid3(&mut self) -> Tampid3W<TampidSpec> {
84        Tampid3W::new(self, 3)
85    }
86    #[doc = "Bit 4 - Tamper Input 4 Detected"]
87    #[inline(always)]
88    #[must_use]
89    pub fn tampid4(&mut self) -> Tampid4W<TampidSpec> {
90        Tampid4W::new(self, 4)
91    }
92    #[doc = "Bit 31 - Tamper Event Detected"]
93    #[inline(always)]
94    #[must_use]
95    pub fn tampevt(&mut self) -> TampevtW<TampidSpec> {
96        TampevtW::new(self, 31)
97    }
98}
99#[doc = "Tamper ID\n\nYou can [`read`](crate::Reg::read) this register and get [`tampid::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tampid::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
100pub struct TampidSpec;
101impl crate::RegisterSpec for TampidSpec {
102    type Ux = u32;
103}
104#[doc = "`read()` method returns [`tampid::R`](R) reader structure"]
105impl crate::Readable for TampidSpec {}
106#[doc = "`write(|w| ..)` method takes [`tampid::W`](W) writer structure"]
107impl crate::Writable for TampidSpec {
108    type Safety = crate::Unsafe;
109    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
110    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
111}
112#[doc = "`reset()` method sets TAMPID to value 0"]
113impl crate::Resettable for TampidSpec {
114    const RESET_VALUE: u32 = 0;
115}