atsamd21j/rtc/mode2/
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 `ALARMEO0` reader - Alarm 0 Event Output Enable"]
38pub type Alarmeo0R = crate::BitReader;
39#[doc = "Field `ALARMEO0` writer - Alarm 0 Event Output Enable"]
40pub type Alarmeo0W<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `OVFEO` reader - Overflow Event Output Enable"]
42pub type OvfeoR = crate::BitReader;
43#[doc = "Field `OVFEO` writer - Overflow Event Output Enable"]
44pub type OvfeoW<'a, REG> = crate::BitWriter<'a, REG>;
45impl R {
46 #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
47 #[inline(always)]
48 pub fn pereo0(&self) -> Pereo0R {
49 Pereo0R::new((self.bits & 1) != 0)
50 }
51 #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
52 #[inline(always)]
53 pub fn pereo1(&self) -> Pereo1R {
54 Pereo1R::new(((self.bits >> 1) & 1) != 0)
55 }
56 #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
57 #[inline(always)]
58 pub fn pereo2(&self) -> Pereo2R {
59 Pereo2R::new(((self.bits >> 2) & 1) != 0)
60 }
61 #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
62 #[inline(always)]
63 pub fn pereo3(&self) -> Pereo3R {
64 Pereo3R::new(((self.bits >> 3) & 1) != 0)
65 }
66 #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
67 #[inline(always)]
68 pub fn pereo4(&self) -> Pereo4R {
69 Pereo4R::new(((self.bits >> 4) & 1) != 0)
70 }
71 #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
72 #[inline(always)]
73 pub fn pereo5(&self) -> Pereo5R {
74 Pereo5R::new(((self.bits >> 5) & 1) != 0)
75 }
76 #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
77 #[inline(always)]
78 pub fn pereo6(&self) -> Pereo6R {
79 Pereo6R::new(((self.bits >> 6) & 1) != 0)
80 }
81 #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
82 #[inline(always)]
83 pub fn pereo7(&self) -> Pereo7R {
84 Pereo7R::new(((self.bits >> 7) & 1) != 0)
85 }
86 #[doc = "Bit 8 - Alarm 0 Event Output Enable"]
87 #[inline(always)]
88 pub fn alarmeo0(&self) -> Alarmeo0R {
89 Alarmeo0R::new(((self.bits >> 8) & 1) != 0)
90 }
91 #[doc = "Bit 15 - Overflow Event Output Enable"]
92 #[inline(always)]
93 pub fn ovfeo(&self) -> OvfeoR {
94 OvfeoR::new(((self.bits >> 15) & 1) != 0)
95 }
96}
97impl W {
98 #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
99 #[inline(always)]
100 #[must_use]
101 pub fn pereo0(&mut self) -> Pereo0W<EvctrlSpec> {
102 Pereo0W::new(self, 0)
103 }
104 #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
105 #[inline(always)]
106 #[must_use]
107 pub fn pereo1(&mut self) -> Pereo1W<EvctrlSpec> {
108 Pereo1W::new(self, 1)
109 }
110 #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
111 #[inline(always)]
112 #[must_use]
113 pub fn pereo2(&mut self) -> Pereo2W<EvctrlSpec> {
114 Pereo2W::new(self, 2)
115 }
116 #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
117 #[inline(always)]
118 #[must_use]
119 pub fn pereo3(&mut self) -> Pereo3W<EvctrlSpec> {
120 Pereo3W::new(self, 3)
121 }
122 #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
123 #[inline(always)]
124 #[must_use]
125 pub fn pereo4(&mut self) -> Pereo4W<EvctrlSpec> {
126 Pereo4W::new(self, 4)
127 }
128 #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
129 #[inline(always)]
130 #[must_use]
131 pub fn pereo5(&mut self) -> Pereo5W<EvctrlSpec> {
132 Pereo5W::new(self, 5)
133 }
134 #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
135 #[inline(always)]
136 #[must_use]
137 pub fn pereo6(&mut self) -> Pereo6W<EvctrlSpec> {
138 Pereo6W::new(self, 6)
139 }
140 #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
141 #[inline(always)]
142 #[must_use]
143 pub fn pereo7(&mut self) -> Pereo7W<EvctrlSpec> {
144 Pereo7W::new(self, 7)
145 }
146 #[doc = "Bit 8 - Alarm 0 Event Output Enable"]
147 #[inline(always)]
148 #[must_use]
149 pub fn alarmeo0(&mut self) -> Alarmeo0W<EvctrlSpec> {
150 Alarmeo0W::new(self, 8)
151 }
152 #[doc = "Bit 15 - Overflow Event Output Enable"]
153 #[inline(always)]
154 #[must_use]
155 pub fn ovfeo(&mut self) -> OvfeoW<EvctrlSpec> {
156 OvfeoW::new(self, 15)
157 }
158}
159#[doc = "MODE2 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)."]
160pub struct EvctrlSpec;
161impl crate::RegisterSpec for EvctrlSpec {
162 type Ux = u16;
163}
164#[doc = "`read()` method returns [`evctrl::R`](R) reader structure"]
165impl crate::Readable for EvctrlSpec {}
166#[doc = "`write(|w| ..)` method takes [`evctrl::W`](W) writer structure"]
167impl crate::Writable for EvctrlSpec {
168 type Safety = crate::Unsafe;
169 const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
170 const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
171}
172#[doc = "`reset()` method sets EVCTRL to value 0"]
173impl crate::Resettable for EvctrlSpec {
174 const RESET_VALUE: u16 = 0;
175}