atsaml21e15b/rtc/mode1/
evctrl.rs1#[doc = "Register `EVCTRL` reader"]
2pub struct R(crate::R<EVCTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<EVCTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<EVCTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<EVCTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `EVCTRL` writer"]
17pub struct W(crate::W<EVCTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<EVCTRL_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<EVCTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<EVCTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `PEREO0` reader - Periodic Interval 0 Event Output Enable"]
38pub type PEREO0_R = crate::BitReader<bool>;
39#[doc = "Field `PEREO0` writer - Periodic Interval 0 Event Output Enable"]
40pub type PEREO0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
41#[doc = "Field `PEREO1` reader - Periodic Interval 1 Event Output Enable"]
42pub type PEREO1_R = crate::BitReader<bool>;
43#[doc = "Field `PEREO1` writer - Periodic Interval 1 Event Output Enable"]
44pub type PEREO1_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
45#[doc = "Field `PEREO2` reader - Periodic Interval 2 Event Output Enable"]
46pub type PEREO2_R = crate::BitReader<bool>;
47#[doc = "Field `PEREO2` writer - Periodic Interval 2 Event Output Enable"]
48pub type PEREO2_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
49#[doc = "Field `PEREO3` reader - Periodic Interval 3 Event Output Enable"]
50pub type PEREO3_R = crate::BitReader<bool>;
51#[doc = "Field `PEREO3` writer - Periodic Interval 3 Event Output Enable"]
52pub type PEREO3_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
53#[doc = "Field `PEREO4` reader - Periodic Interval 4 Event Output Enable"]
54pub type PEREO4_R = crate::BitReader<bool>;
55#[doc = "Field `PEREO4` writer - Periodic Interval 4 Event Output Enable"]
56pub type PEREO4_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
57#[doc = "Field `PEREO5` reader - Periodic Interval 5 Event Output Enable"]
58pub type PEREO5_R = crate::BitReader<bool>;
59#[doc = "Field `PEREO5` writer - Periodic Interval 5 Event Output Enable"]
60pub type PEREO5_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
61#[doc = "Field `PEREO6` reader - Periodic Interval 6 Event Output Enable"]
62pub type PEREO6_R = crate::BitReader<bool>;
63#[doc = "Field `PEREO6` writer - Periodic Interval 6 Event Output Enable"]
64pub type PEREO6_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
65#[doc = "Field `PEREO7` reader - Periodic Interval 7 Event Output Enable"]
66pub type PEREO7_R = crate::BitReader<bool>;
67#[doc = "Field `PEREO7` writer - Periodic Interval 7 Event Output Enable"]
68pub type PEREO7_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
69#[doc = "Field `CMPEO0` reader - Compare 0 Event Output Enable"]
70pub type CMPEO0_R = crate::BitReader<bool>;
71#[doc = "Field `CMPEO0` writer - Compare 0 Event Output Enable"]
72pub type CMPEO0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
73#[doc = "Field `CMPEO1` reader - Compare 1 Event Output Enable"]
74pub type CMPEO1_R = crate::BitReader<bool>;
75#[doc = "Field `CMPEO1` writer - Compare 1 Event Output Enable"]
76pub type CMPEO1_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
77#[doc = "Field `OVFEO` reader - Overflow Event Output Enable"]
78pub type OVFEO_R = crate::BitReader<bool>;
79#[doc = "Field `OVFEO` writer - Overflow Event Output Enable"]
80pub type OVFEO_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
81impl R {
82 #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
83 #[inline(always)]
84 pub fn pereo0(&self) -> PEREO0_R {
85 PEREO0_R::new((self.bits & 1) != 0)
86 }
87 #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
88 #[inline(always)]
89 pub fn pereo1(&self) -> PEREO1_R {
90 PEREO1_R::new(((self.bits >> 1) & 1) != 0)
91 }
92 #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
93 #[inline(always)]
94 pub fn pereo2(&self) -> PEREO2_R {
95 PEREO2_R::new(((self.bits >> 2) & 1) != 0)
96 }
97 #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
98 #[inline(always)]
99 pub fn pereo3(&self) -> PEREO3_R {
100 PEREO3_R::new(((self.bits >> 3) & 1) != 0)
101 }
102 #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
103 #[inline(always)]
104 pub fn pereo4(&self) -> PEREO4_R {
105 PEREO4_R::new(((self.bits >> 4) & 1) != 0)
106 }
107 #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
108 #[inline(always)]
109 pub fn pereo5(&self) -> PEREO5_R {
110 PEREO5_R::new(((self.bits >> 5) & 1) != 0)
111 }
112 #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
113 #[inline(always)]
114 pub fn pereo6(&self) -> PEREO6_R {
115 PEREO6_R::new(((self.bits >> 6) & 1) != 0)
116 }
117 #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
118 #[inline(always)]
119 pub fn pereo7(&self) -> PEREO7_R {
120 PEREO7_R::new(((self.bits >> 7) & 1) != 0)
121 }
122 #[doc = "Bit 8 - Compare 0 Event Output Enable"]
123 #[inline(always)]
124 pub fn cmpeo0(&self) -> CMPEO0_R {
125 CMPEO0_R::new(((self.bits >> 8) & 1) != 0)
126 }
127 #[doc = "Bit 9 - Compare 1 Event Output Enable"]
128 #[inline(always)]
129 pub fn cmpeo1(&self) -> CMPEO1_R {
130 CMPEO1_R::new(((self.bits >> 9) & 1) != 0)
131 }
132 #[doc = "Bit 15 - Overflow Event Output Enable"]
133 #[inline(always)]
134 pub fn ovfeo(&self) -> OVFEO_R {
135 OVFEO_R::new(((self.bits >> 15) & 1) != 0)
136 }
137}
138impl W {
139 #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
140 #[inline(always)]
141 #[must_use]
142 pub fn pereo0(&mut self) -> PEREO0_W<0> {
143 PEREO0_W::new(self)
144 }
145 #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
146 #[inline(always)]
147 #[must_use]
148 pub fn pereo1(&mut self) -> PEREO1_W<1> {
149 PEREO1_W::new(self)
150 }
151 #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
152 #[inline(always)]
153 #[must_use]
154 pub fn pereo2(&mut self) -> PEREO2_W<2> {
155 PEREO2_W::new(self)
156 }
157 #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
158 #[inline(always)]
159 #[must_use]
160 pub fn pereo3(&mut self) -> PEREO3_W<3> {
161 PEREO3_W::new(self)
162 }
163 #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
164 #[inline(always)]
165 #[must_use]
166 pub fn pereo4(&mut self) -> PEREO4_W<4> {
167 PEREO4_W::new(self)
168 }
169 #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
170 #[inline(always)]
171 #[must_use]
172 pub fn pereo5(&mut self) -> PEREO5_W<5> {
173 PEREO5_W::new(self)
174 }
175 #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
176 #[inline(always)]
177 #[must_use]
178 pub fn pereo6(&mut self) -> PEREO6_W<6> {
179 PEREO6_W::new(self)
180 }
181 #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
182 #[inline(always)]
183 #[must_use]
184 pub fn pereo7(&mut self) -> PEREO7_W<7> {
185 PEREO7_W::new(self)
186 }
187 #[doc = "Bit 8 - Compare 0 Event Output Enable"]
188 #[inline(always)]
189 #[must_use]
190 pub fn cmpeo0(&mut self) -> CMPEO0_W<8> {
191 CMPEO0_W::new(self)
192 }
193 #[doc = "Bit 9 - Compare 1 Event Output Enable"]
194 #[inline(always)]
195 #[must_use]
196 pub fn cmpeo1(&mut self) -> CMPEO1_W<9> {
197 CMPEO1_W::new(self)
198 }
199 #[doc = "Bit 15 - Overflow Event Output Enable"]
200 #[inline(always)]
201 #[must_use]
202 pub fn ovfeo(&mut self) -> OVFEO_W<15> {
203 OVFEO_W::new(self)
204 }
205 #[doc = "Writes raw bits to the register."]
206 #[inline(always)]
207 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
208 self.0.bits(bits);
209 self
210 }
211}
212#[doc = "MODE1 Event Control\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [evctrl](index.html) module"]
213pub struct EVCTRL_SPEC;
214impl crate::RegisterSpec for EVCTRL_SPEC {
215 type Ux = u32;
216}
217#[doc = "`read()` method returns [evctrl::R](R) reader structure"]
218impl crate::Readable for EVCTRL_SPEC {
219 type Reader = R;
220}
221#[doc = "`write(|w| ..)` method takes [evctrl::W](W) writer structure"]
222impl crate::Writable for EVCTRL_SPEC {
223 type Writer = W;
224 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
225 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
226}
227#[doc = "`reset()` method sets EVCTRL to value 0"]
228impl crate::Resettable for EVCTRL_SPEC {
229 const RESET_VALUE: Self::Ux = 0;
230}