atsamd51g/rtc/mode1/
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 `CMPEO2` reader - Compare 2 Event Output Enable"]
46pub type Cmpeo2R = crate::BitReader;
47#[doc = "Field `CMPEO2` writer - Compare 2 Event Output Enable"]
48pub type Cmpeo2W<'a, REG> = crate::BitWriter<'a, REG>;
49#[doc = "Field `CMPEO3` reader - Compare 3 Event Output Enable"]
50pub type Cmpeo3R = crate::BitReader;
51#[doc = "Field `CMPEO3` writer - Compare 3 Event Output Enable"]
52pub type Cmpeo3W<'a, REG> = crate::BitWriter<'a, REG>;
53#[doc = "Field `TAMPEREO` reader - Tamper Event Output Enable"]
54pub type TampereoR = crate::BitReader;
55#[doc = "Field `TAMPEREO` writer - Tamper Event Output Enable"]
56pub type TampereoW<'a, REG> = crate::BitWriter<'a, REG>;
57#[doc = "Field `OVFEO` reader - Overflow Event Output Enable"]
58pub type OvfeoR = crate::BitReader;
59#[doc = "Field `OVFEO` writer - Overflow Event Output Enable"]
60pub type OvfeoW<'a, REG> = crate::BitWriter<'a, REG>;
61#[doc = "Field `TAMPEVEI` reader - Tamper Event Input Enable"]
62pub type TampeveiR = crate::BitReader;
63#[doc = "Field `TAMPEVEI` writer - Tamper Event Input Enable"]
64pub type TampeveiW<'a, REG> = crate::BitWriter<'a, REG>;
65impl R {
66    #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
67    #[inline(always)]
68    pub fn pereo0(&self) -> Pereo0R {
69        Pereo0R::new((self.bits & 1) != 0)
70    }
71    #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
72    #[inline(always)]
73    pub fn pereo1(&self) -> Pereo1R {
74        Pereo1R::new(((self.bits >> 1) & 1) != 0)
75    }
76    #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
77    #[inline(always)]
78    pub fn pereo2(&self) -> Pereo2R {
79        Pereo2R::new(((self.bits >> 2) & 1) != 0)
80    }
81    #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
82    #[inline(always)]
83    pub fn pereo3(&self) -> Pereo3R {
84        Pereo3R::new(((self.bits >> 3) & 1) != 0)
85    }
86    #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
87    #[inline(always)]
88    pub fn pereo4(&self) -> Pereo4R {
89        Pereo4R::new(((self.bits >> 4) & 1) != 0)
90    }
91    #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
92    #[inline(always)]
93    pub fn pereo5(&self) -> Pereo5R {
94        Pereo5R::new(((self.bits >> 5) & 1) != 0)
95    }
96    #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
97    #[inline(always)]
98    pub fn pereo6(&self) -> Pereo6R {
99        Pereo6R::new(((self.bits >> 6) & 1) != 0)
100    }
101    #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
102    #[inline(always)]
103    pub fn pereo7(&self) -> Pereo7R {
104        Pereo7R::new(((self.bits >> 7) & 1) != 0)
105    }
106    #[doc = "Bit 8 - Compare 0 Event Output Enable"]
107    #[inline(always)]
108    pub fn cmpeo0(&self) -> Cmpeo0R {
109        Cmpeo0R::new(((self.bits >> 8) & 1) != 0)
110    }
111    #[doc = "Bit 9 - Compare 1 Event Output Enable"]
112    #[inline(always)]
113    pub fn cmpeo1(&self) -> Cmpeo1R {
114        Cmpeo1R::new(((self.bits >> 9) & 1) != 0)
115    }
116    #[doc = "Bit 10 - Compare 2 Event Output Enable"]
117    #[inline(always)]
118    pub fn cmpeo2(&self) -> Cmpeo2R {
119        Cmpeo2R::new(((self.bits >> 10) & 1) != 0)
120    }
121    #[doc = "Bit 11 - Compare 3 Event Output Enable"]
122    #[inline(always)]
123    pub fn cmpeo3(&self) -> Cmpeo3R {
124        Cmpeo3R::new(((self.bits >> 11) & 1) != 0)
125    }
126    #[doc = "Bit 14 - Tamper Event Output Enable"]
127    #[inline(always)]
128    pub fn tampereo(&self) -> TampereoR {
129        TampereoR::new(((self.bits >> 14) & 1) != 0)
130    }
131    #[doc = "Bit 15 - Overflow Event Output Enable"]
132    #[inline(always)]
133    pub fn ovfeo(&self) -> OvfeoR {
134        OvfeoR::new(((self.bits >> 15) & 1) != 0)
135    }
136    #[doc = "Bit 16 - Tamper Event Input Enable"]
137    #[inline(always)]
138    pub fn tampevei(&self) -> TampeveiR {
139        TampeveiR::new(((self.bits >> 16) & 1) != 0)
140    }
141}
142impl W {
143    #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
144    #[inline(always)]
145    #[must_use]
146    pub fn pereo0(&mut self) -> Pereo0W<EvctrlSpec> {
147        Pereo0W::new(self, 0)
148    }
149    #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
150    #[inline(always)]
151    #[must_use]
152    pub fn pereo1(&mut self) -> Pereo1W<EvctrlSpec> {
153        Pereo1W::new(self, 1)
154    }
155    #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
156    #[inline(always)]
157    #[must_use]
158    pub fn pereo2(&mut self) -> Pereo2W<EvctrlSpec> {
159        Pereo2W::new(self, 2)
160    }
161    #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
162    #[inline(always)]
163    #[must_use]
164    pub fn pereo3(&mut self) -> Pereo3W<EvctrlSpec> {
165        Pereo3W::new(self, 3)
166    }
167    #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
168    #[inline(always)]
169    #[must_use]
170    pub fn pereo4(&mut self) -> Pereo4W<EvctrlSpec> {
171        Pereo4W::new(self, 4)
172    }
173    #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
174    #[inline(always)]
175    #[must_use]
176    pub fn pereo5(&mut self) -> Pereo5W<EvctrlSpec> {
177        Pereo5W::new(self, 5)
178    }
179    #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
180    #[inline(always)]
181    #[must_use]
182    pub fn pereo6(&mut self) -> Pereo6W<EvctrlSpec> {
183        Pereo6W::new(self, 6)
184    }
185    #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
186    #[inline(always)]
187    #[must_use]
188    pub fn pereo7(&mut self) -> Pereo7W<EvctrlSpec> {
189        Pereo7W::new(self, 7)
190    }
191    #[doc = "Bit 8 - Compare 0 Event Output Enable"]
192    #[inline(always)]
193    #[must_use]
194    pub fn cmpeo0(&mut self) -> Cmpeo0W<EvctrlSpec> {
195        Cmpeo0W::new(self, 8)
196    }
197    #[doc = "Bit 9 - Compare 1 Event Output Enable"]
198    #[inline(always)]
199    #[must_use]
200    pub fn cmpeo1(&mut self) -> Cmpeo1W<EvctrlSpec> {
201        Cmpeo1W::new(self, 9)
202    }
203    #[doc = "Bit 10 - Compare 2 Event Output Enable"]
204    #[inline(always)]
205    #[must_use]
206    pub fn cmpeo2(&mut self) -> Cmpeo2W<EvctrlSpec> {
207        Cmpeo2W::new(self, 10)
208    }
209    #[doc = "Bit 11 - Compare 3 Event Output Enable"]
210    #[inline(always)]
211    #[must_use]
212    pub fn cmpeo3(&mut self) -> Cmpeo3W<EvctrlSpec> {
213        Cmpeo3W::new(self, 11)
214    }
215    #[doc = "Bit 14 - Tamper Event Output Enable"]
216    #[inline(always)]
217    #[must_use]
218    pub fn tampereo(&mut self) -> TampereoW<EvctrlSpec> {
219        TampereoW::new(self, 14)
220    }
221    #[doc = "Bit 15 - Overflow Event Output Enable"]
222    #[inline(always)]
223    #[must_use]
224    pub fn ovfeo(&mut self) -> OvfeoW<EvctrlSpec> {
225        OvfeoW::new(self, 15)
226    }
227    #[doc = "Bit 16 - Tamper Event Input Enable"]
228    #[inline(always)]
229    #[must_use]
230    pub fn tampevei(&mut self) -> TampeveiW<EvctrlSpec> {
231        TampeveiW::new(self, 16)
232    }
233}
234#[doc = "MODE1 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)."]
235pub struct EvctrlSpec;
236impl crate::RegisterSpec for EvctrlSpec {
237    type Ux = u32;
238}
239#[doc = "`read()` method returns [`evctrl::R`](R) reader structure"]
240impl crate::Readable for EvctrlSpec {}
241#[doc = "`write(|w| ..)` method takes [`evctrl::W`](W) writer structure"]
242impl crate::Writable for EvctrlSpec {
243    type Safety = crate::Unsafe;
244    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
245    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
246}
247#[doc = "`reset()` method sets EVCTRL to value 0"]
248impl crate::Resettable for EvctrlSpec {
249    const RESET_VALUE: u32 = 0;
250}