atsamd51p/rtc/mode0/
evctrl.rs

1#[doc = "Register `EVCTRL` reader"]
2pub type R = crate::R<EvctrlSpec>;
3#[doc = "Register `EVCTRL` writer"]
4pub type W = crate::W<EvctrlSpec>;
5#[doc = "Field `PEREO0` reader - Periodic Interval 0 Event Output Enable"]
6pub type Pereo0R = crate::BitReader;
7#[doc = "Field `PEREO0` writer - Periodic Interval 0 Event Output Enable"]
8pub type Pereo0W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `PEREO1` reader - Periodic Interval 1 Event Output Enable"]
10pub type Pereo1R = crate::BitReader;
11#[doc = "Field `PEREO1` writer - Periodic Interval 1 Event Output Enable"]
12pub type Pereo1W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `PEREO2` reader - Periodic Interval 2 Event Output Enable"]
14pub type Pereo2R = crate::BitReader;
15#[doc = "Field `PEREO2` writer - Periodic Interval 2 Event Output Enable"]
16pub type Pereo2W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `PEREO3` reader - Periodic Interval 3 Event Output Enable"]
18pub type Pereo3R = crate::BitReader;
19#[doc = "Field `PEREO3` writer - Periodic Interval 3 Event Output Enable"]
20pub type Pereo3W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `PEREO4` reader - Periodic Interval 4 Event Output Enable"]
22pub type Pereo4R = crate::BitReader;
23#[doc = "Field `PEREO4` writer - Periodic Interval 4 Event Output Enable"]
24pub type Pereo4W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `PEREO5` reader - Periodic Interval 5 Event Output Enable"]
26pub type Pereo5R = crate::BitReader;
27#[doc = "Field `PEREO5` writer - Periodic Interval 5 Event Output Enable"]
28pub type Pereo5W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `PEREO6` reader - Periodic Interval 6 Event Output Enable"]
30pub type Pereo6R = crate::BitReader;
31#[doc = "Field `PEREO6` writer - Periodic Interval 6 Event Output Enable"]
32pub type Pereo6W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `PEREO7` reader - Periodic Interval 7 Event Output Enable"]
34pub type Pereo7R = crate::BitReader;
35#[doc = "Field `PEREO7` writer - Periodic Interval 7 Event Output Enable"]
36pub type Pereo7W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `CMPEO0` reader - Compare 0 Event Output Enable"]
38pub type Cmpeo0R = crate::BitReader;
39#[doc = "Field `CMPEO0` writer - Compare 0 Event Output Enable"]
40pub type Cmpeo0W<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `CMPEO1` reader - Compare 1 Event Output Enable"]
42pub type Cmpeo1R = crate::BitReader;
43#[doc = "Field `CMPEO1` writer - Compare 1 Event Output Enable"]
44pub type Cmpeo1W<'a, REG> = crate::BitWriter<'a, REG>;
45#[doc = "Field `TAMPEREO` reader - Tamper Event Output Enable"]
46pub type TampereoR = crate::BitReader;
47#[doc = "Field `TAMPEREO` writer - Tamper Event Output Enable"]
48pub type TampereoW<'a, REG> = crate::BitWriter<'a, REG>;
49#[doc = "Field `OVFEO` reader - Overflow Event Output Enable"]
50pub type OvfeoR = crate::BitReader;
51#[doc = "Field `OVFEO` writer - Overflow Event Output Enable"]
52pub type OvfeoW<'a, REG> = crate::BitWriter<'a, REG>;
53#[doc = "Field `TAMPEVEI` reader - Tamper Event Input Enable"]
54pub type TampeveiR = crate::BitReader;
55#[doc = "Field `TAMPEVEI` writer - Tamper Event Input Enable"]
56pub type TampeveiW<'a, REG> = crate::BitWriter<'a, REG>;
57impl R {
58    #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
59    #[inline(always)]
60    pub fn pereo0(&self) -> Pereo0R {
61        Pereo0R::new((self.bits & 1) != 0)
62    }
63    #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
64    #[inline(always)]
65    pub fn pereo1(&self) -> Pereo1R {
66        Pereo1R::new(((self.bits >> 1) & 1) != 0)
67    }
68    #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
69    #[inline(always)]
70    pub fn pereo2(&self) -> Pereo2R {
71        Pereo2R::new(((self.bits >> 2) & 1) != 0)
72    }
73    #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
74    #[inline(always)]
75    pub fn pereo3(&self) -> Pereo3R {
76        Pereo3R::new(((self.bits >> 3) & 1) != 0)
77    }
78    #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
79    #[inline(always)]
80    pub fn pereo4(&self) -> Pereo4R {
81        Pereo4R::new(((self.bits >> 4) & 1) != 0)
82    }
83    #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
84    #[inline(always)]
85    pub fn pereo5(&self) -> Pereo5R {
86        Pereo5R::new(((self.bits >> 5) & 1) != 0)
87    }
88    #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
89    #[inline(always)]
90    pub fn pereo6(&self) -> Pereo6R {
91        Pereo6R::new(((self.bits >> 6) & 1) != 0)
92    }
93    #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
94    #[inline(always)]
95    pub fn pereo7(&self) -> Pereo7R {
96        Pereo7R::new(((self.bits >> 7) & 1) != 0)
97    }
98    #[doc = "Bit 8 - Compare 0 Event Output Enable"]
99    #[inline(always)]
100    pub fn cmpeo0(&self) -> Cmpeo0R {
101        Cmpeo0R::new(((self.bits >> 8) & 1) != 0)
102    }
103    #[doc = "Bit 9 - Compare 1 Event Output Enable"]
104    #[inline(always)]
105    pub fn cmpeo1(&self) -> Cmpeo1R {
106        Cmpeo1R::new(((self.bits >> 9) & 1) != 0)
107    }
108    #[doc = "Bit 14 - Tamper Event Output Enable"]
109    #[inline(always)]
110    pub fn tampereo(&self) -> TampereoR {
111        TampereoR::new(((self.bits >> 14) & 1) != 0)
112    }
113    #[doc = "Bit 15 - Overflow Event Output Enable"]
114    #[inline(always)]
115    pub fn ovfeo(&self) -> OvfeoR {
116        OvfeoR::new(((self.bits >> 15) & 1) != 0)
117    }
118    #[doc = "Bit 16 - Tamper Event Input Enable"]
119    #[inline(always)]
120    pub fn tampevei(&self) -> TampeveiR {
121        TampeveiR::new(((self.bits >> 16) & 1) != 0)
122    }
123}
124impl W {
125    #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
126    #[inline(always)]
127    #[must_use]
128    pub fn pereo0(&mut self) -> Pereo0W<EvctrlSpec> {
129        Pereo0W::new(self, 0)
130    }
131    #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
132    #[inline(always)]
133    #[must_use]
134    pub fn pereo1(&mut self) -> Pereo1W<EvctrlSpec> {
135        Pereo1W::new(self, 1)
136    }
137    #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
138    #[inline(always)]
139    #[must_use]
140    pub fn pereo2(&mut self) -> Pereo2W<EvctrlSpec> {
141        Pereo2W::new(self, 2)
142    }
143    #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
144    #[inline(always)]
145    #[must_use]
146    pub fn pereo3(&mut self) -> Pereo3W<EvctrlSpec> {
147        Pereo3W::new(self, 3)
148    }
149    #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
150    #[inline(always)]
151    #[must_use]
152    pub fn pereo4(&mut self) -> Pereo4W<EvctrlSpec> {
153        Pereo4W::new(self, 4)
154    }
155    #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
156    #[inline(always)]
157    #[must_use]
158    pub fn pereo5(&mut self) -> Pereo5W<EvctrlSpec> {
159        Pereo5W::new(self, 5)
160    }
161    #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
162    #[inline(always)]
163    #[must_use]
164    pub fn pereo6(&mut self) -> Pereo6W<EvctrlSpec> {
165        Pereo6W::new(self, 6)
166    }
167    #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
168    #[inline(always)]
169    #[must_use]
170    pub fn pereo7(&mut self) -> Pereo7W<EvctrlSpec> {
171        Pereo7W::new(self, 7)
172    }
173    #[doc = "Bit 8 - Compare 0 Event Output Enable"]
174    #[inline(always)]
175    #[must_use]
176    pub fn cmpeo0(&mut self) -> Cmpeo0W<EvctrlSpec> {
177        Cmpeo0W::new(self, 8)
178    }
179    #[doc = "Bit 9 - Compare 1 Event Output Enable"]
180    #[inline(always)]
181    #[must_use]
182    pub fn cmpeo1(&mut self) -> Cmpeo1W<EvctrlSpec> {
183        Cmpeo1W::new(self, 9)
184    }
185    #[doc = "Bit 14 - Tamper Event Output Enable"]
186    #[inline(always)]
187    #[must_use]
188    pub fn tampereo(&mut self) -> TampereoW<EvctrlSpec> {
189        TampereoW::new(self, 14)
190    }
191    #[doc = "Bit 15 - Overflow Event Output Enable"]
192    #[inline(always)]
193    #[must_use]
194    pub fn ovfeo(&mut self) -> OvfeoW<EvctrlSpec> {
195        OvfeoW::new(self, 15)
196    }
197    #[doc = "Bit 16 - Tamper Event Input Enable"]
198    #[inline(always)]
199    #[must_use]
200    pub fn tampevei(&mut self) -> TampeveiW<EvctrlSpec> {
201        TampeveiW::new(self, 16)
202    }
203}
204#[doc = "MODE0 Event Control\n\nYou can [`read`](crate::Reg::read) this register and get [`evctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`evctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
205pub struct EvctrlSpec;
206impl crate::RegisterSpec for EvctrlSpec {
207    type Ux = u32;
208}
209#[doc = "`read()` method returns [`evctrl::R`](R) reader structure"]
210impl crate::Readable for EvctrlSpec {}
211#[doc = "`write(|w| ..)` method takes [`evctrl::W`](W) writer structure"]
212impl crate::Writable for EvctrlSpec {
213    type Safety = crate::Unsafe;
214    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
215    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
216}
217#[doc = "`reset()` method sets EVCTRL to value 0"]
218impl crate::Resettable for EvctrlSpec {
219    const RESET_VALUE: u32 = 0;
220}