1#[doc = "Register `SR%s` reader"]
2pub struct R(crate::R<SR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `COVFS` reader - Counter Overflow Status"]
17pub type COVFS_R = crate::BitReader<COVFSSELECT_A>;
18#[doc = "Counter Overflow Status\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum COVFSSELECT_A {
21 #[doc = "0: No counter overflow has occurred since the last read of the Status Register."]
22 _0 = 0,
23 #[doc = "1: A counter overflow has occurred since the last read of the Status Register."]
24 _1 = 1,
25}
26impl From<COVFSSELECT_A> for bool {
27 #[inline(always)]
28 fn from(variant: COVFSSELECT_A) -> Self {
29 variant as u8 != 0
30 }
31}
32impl COVFS_R {
33 #[doc = "Get enumerated values variant"]
34 #[inline(always)]
35 pub fn variant(&self) -> COVFSSELECT_A {
36 match self.bits {
37 false => COVFSSELECT_A::_0,
38 true => COVFSSELECT_A::_1,
39 }
40 }
41 #[doc = "Checks if the value of the field is `_0`"]
42 #[inline(always)]
43 pub fn is_0(&self) -> bool {
44 *self == COVFSSELECT_A::_0
45 }
46 #[doc = "Checks if the value of the field is `_1`"]
47 #[inline(always)]
48 pub fn is_1(&self) -> bool {
49 *self == COVFSSELECT_A::_1
50 }
51}
52#[doc = "Field `LOVRS` reader - Load Overrun Status"]
53pub type LOVRS_R = crate::BitReader<LOVRSSELECT_A>;
54#[doc = "Load Overrun Status\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq, Eq)]
56pub enum LOVRSSELECT_A {
57 #[doc = "0: Load overrun has not occurred since the last read of the Status Register or WAVE:1."]
58 _0 = 0,
59 #[doc = "1: RA or RB have been loaded at least twice without any read of the corresponding register since the last read of the StatusRegister, if WAVE:0."]
60 _1 = 1,
61}
62impl From<LOVRSSELECT_A> for bool {
63 #[inline(always)]
64 fn from(variant: LOVRSSELECT_A) -> Self {
65 variant as u8 != 0
66 }
67}
68impl LOVRS_R {
69 #[doc = "Get enumerated values variant"]
70 #[inline(always)]
71 pub fn variant(&self) -> LOVRSSELECT_A {
72 match self.bits {
73 false => LOVRSSELECT_A::_0,
74 true => LOVRSSELECT_A::_1,
75 }
76 }
77 #[doc = "Checks if the value of the field is `_0`"]
78 #[inline(always)]
79 pub fn is_0(&self) -> bool {
80 *self == LOVRSSELECT_A::_0
81 }
82 #[doc = "Checks if the value of the field is `_1`"]
83 #[inline(always)]
84 pub fn is_1(&self) -> bool {
85 *self == LOVRSSELECT_A::_1
86 }
87}
88#[doc = "Field `CPAS` reader - RA Compare Status"]
89pub type CPAS_R = crate::BitReader<CPASSELECT_A>;
90#[doc = "RA Compare Status\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum CPASSELECT_A {
93 #[doc = "0: RA Compare has not occurred since the last read of the Status Register or WAVE:0."]
94 _0 = 0,
95 #[doc = "1: RA Compare has occurred since the last read of the Status Register, if WAVE:1."]
96 _1 = 1,
97}
98impl From<CPASSELECT_A> for bool {
99 #[inline(always)]
100 fn from(variant: CPASSELECT_A) -> Self {
101 variant as u8 != 0
102 }
103}
104impl CPAS_R {
105 #[doc = "Get enumerated values variant"]
106 #[inline(always)]
107 pub fn variant(&self) -> CPASSELECT_A {
108 match self.bits {
109 false => CPASSELECT_A::_0,
110 true => CPASSELECT_A::_1,
111 }
112 }
113 #[doc = "Checks if the value of the field is `_0`"]
114 #[inline(always)]
115 pub fn is_0(&self) -> bool {
116 *self == CPASSELECT_A::_0
117 }
118 #[doc = "Checks if the value of the field is `_1`"]
119 #[inline(always)]
120 pub fn is_1(&self) -> bool {
121 *self == CPASSELECT_A::_1
122 }
123}
124#[doc = "Field `CPBS` reader - RB Compare Status"]
125pub type CPBS_R = crate::BitReader<CPBSSELECT_A>;
126#[doc = "RB Compare Status\n\nValue on reset: 0"]
127#[derive(Clone, Copy, Debug, PartialEq, Eq)]
128pub enum CPBSSELECT_A {
129 #[doc = "0: RB Compare has not occurred since the last read of the Status Register or WAVE:0."]
130 _0 = 0,
131 #[doc = "1: RB Compare has occurred since the last read of the Status Register, if WAVE:1."]
132 _1 = 1,
133}
134impl From<CPBSSELECT_A> for bool {
135 #[inline(always)]
136 fn from(variant: CPBSSELECT_A) -> Self {
137 variant as u8 != 0
138 }
139}
140impl CPBS_R {
141 #[doc = "Get enumerated values variant"]
142 #[inline(always)]
143 pub fn variant(&self) -> CPBSSELECT_A {
144 match self.bits {
145 false => CPBSSELECT_A::_0,
146 true => CPBSSELECT_A::_1,
147 }
148 }
149 #[doc = "Checks if the value of the field is `_0`"]
150 #[inline(always)]
151 pub fn is_0(&self) -> bool {
152 *self == CPBSSELECT_A::_0
153 }
154 #[doc = "Checks if the value of the field is `_1`"]
155 #[inline(always)]
156 pub fn is_1(&self) -> bool {
157 *self == CPBSSELECT_A::_1
158 }
159}
160#[doc = "Field `CPCS` reader - RC Compare Status"]
161pub type CPCS_R = crate::BitReader<CPCSSELECT_A>;
162#[doc = "RC Compare Status\n\nValue on reset: 0"]
163#[derive(Clone, Copy, Debug, PartialEq, Eq)]
164pub enum CPCSSELECT_A {
165 #[doc = "0: RC Compare has not occurred since the last read of the Status Register."]
166 _0 = 0,
167 #[doc = "1: RC Compare has occurred since the last read of the Status Register."]
168 _1 = 1,
169}
170impl From<CPCSSELECT_A> for bool {
171 #[inline(always)]
172 fn from(variant: CPCSSELECT_A) -> Self {
173 variant as u8 != 0
174 }
175}
176impl CPCS_R {
177 #[doc = "Get enumerated values variant"]
178 #[inline(always)]
179 pub fn variant(&self) -> CPCSSELECT_A {
180 match self.bits {
181 false => CPCSSELECT_A::_0,
182 true => CPCSSELECT_A::_1,
183 }
184 }
185 #[doc = "Checks if the value of the field is `_0`"]
186 #[inline(always)]
187 pub fn is_0(&self) -> bool {
188 *self == CPCSSELECT_A::_0
189 }
190 #[doc = "Checks if the value of the field is `_1`"]
191 #[inline(always)]
192 pub fn is_1(&self) -> bool {
193 *self == CPCSSELECT_A::_1
194 }
195}
196#[doc = "Field `LDRAS` reader - RA Loading Status"]
197pub type LDRAS_R = crate::BitReader<LDRASSELECT_A>;
198#[doc = "RA Loading Status\n\nValue on reset: 0"]
199#[derive(Clone, Copy, Debug, PartialEq, Eq)]
200pub enum LDRASSELECT_A {
201 #[doc = "0: RA Load has not occurred since the last read of the Status Register or WAVE:1."]
202 _0 = 0,
203 #[doc = "1: RA Load has occurred since the last read of the Status Register, if WAVE:0."]
204 _1 = 1,
205}
206impl From<LDRASSELECT_A> for bool {
207 #[inline(always)]
208 fn from(variant: LDRASSELECT_A) -> Self {
209 variant as u8 != 0
210 }
211}
212impl LDRAS_R {
213 #[doc = "Get enumerated values variant"]
214 #[inline(always)]
215 pub fn variant(&self) -> LDRASSELECT_A {
216 match self.bits {
217 false => LDRASSELECT_A::_0,
218 true => LDRASSELECT_A::_1,
219 }
220 }
221 #[doc = "Checks if the value of the field is `_0`"]
222 #[inline(always)]
223 pub fn is_0(&self) -> bool {
224 *self == LDRASSELECT_A::_0
225 }
226 #[doc = "Checks if the value of the field is `_1`"]
227 #[inline(always)]
228 pub fn is_1(&self) -> bool {
229 *self == LDRASSELECT_A::_1
230 }
231}
232#[doc = "Field `LDRBS` reader - RB Loading Status"]
233pub type LDRBS_R = crate::BitReader<LDRBSSELECT_A>;
234#[doc = "RB Loading Status\n\nValue on reset: 0"]
235#[derive(Clone, Copy, Debug, PartialEq, Eq)]
236pub enum LDRBSSELECT_A {
237 #[doc = "0: RB Load has not occurred since the last read of the Status Register or WAVE:1."]
238 _0 = 0,
239 #[doc = "1: RB Load has occurred since the last read of the Status Register, if WAVE:0."]
240 _1 = 1,
241}
242impl From<LDRBSSELECT_A> for bool {
243 #[inline(always)]
244 fn from(variant: LDRBSSELECT_A) -> Self {
245 variant as u8 != 0
246 }
247}
248impl LDRBS_R {
249 #[doc = "Get enumerated values variant"]
250 #[inline(always)]
251 pub fn variant(&self) -> LDRBSSELECT_A {
252 match self.bits {
253 false => LDRBSSELECT_A::_0,
254 true => LDRBSSELECT_A::_1,
255 }
256 }
257 #[doc = "Checks if the value of the field is `_0`"]
258 #[inline(always)]
259 pub fn is_0(&self) -> bool {
260 *self == LDRBSSELECT_A::_0
261 }
262 #[doc = "Checks if the value of the field is `_1`"]
263 #[inline(always)]
264 pub fn is_1(&self) -> bool {
265 *self == LDRBSSELECT_A::_1
266 }
267}
268#[doc = "Field `ETRGS` reader - External Trigger Status"]
269pub type ETRGS_R = crate::BitReader<ETRGSSELECT_A>;
270#[doc = "External Trigger Status\n\nValue on reset: 0"]
271#[derive(Clone, Copy, Debug, PartialEq, Eq)]
272pub enum ETRGSSELECT_A {
273 #[doc = "0: External trigger has not occurred since the last read of the Status Register."]
274 _0 = 0,
275 #[doc = "1: External trigger has occurred since the last read of the Status Register."]
276 _1 = 1,
277}
278impl From<ETRGSSELECT_A> for bool {
279 #[inline(always)]
280 fn from(variant: ETRGSSELECT_A) -> Self {
281 variant as u8 != 0
282 }
283}
284impl ETRGS_R {
285 #[doc = "Get enumerated values variant"]
286 #[inline(always)]
287 pub fn variant(&self) -> ETRGSSELECT_A {
288 match self.bits {
289 false => ETRGSSELECT_A::_0,
290 true => ETRGSSELECT_A::_1,
291 }
292 }
293 #[doc = "Checks if the value of the field is `_0`"]
294 #[inline(always)]
295 pub fn is_0(&self) -> bool {
296 *self == ETRGSSELECT_A::_0
297 }
298 #[doc = "Checks if the value of the field is `_1`"]
299 #[inline(always)]
300 pub fn is_1(&self) -> bool {
301 *self == ETRGSSELECT_A::_1
302 }
303}
304#[doc = "Field `CLKSTA` reader - Clock Enabling Status"]
305pub type CLKSTA_R = crate::BitReader<CLKSTASELECT_A>;
306#[doc = "Clock Enabling Status\n\nValue on reset: 0"]
307#[derive(Clone, Copy, Debug, PartialEq, Eq)]
308pub enum CLKSTASELECT_A {
309 #[doc = "0: Clock is disabled."]
310 _0 = 0,
311 #[doc = "1: Clock is enabled."]
312 _1 = 1,
313}
314impl From<CLKSTASELECT_A> for bool {
315 #[inline(always)]
316 fn from(variant: CLKSTASELECT_A) -> Self {
317 variant as u8 != 0
318 }
319}
320impl CLKSTA_R {
321 #[doc = "Get enumerated values variant"]
322 #[inline(always)]
323 pub fn variant(&self) -> CLKSTASELECT_A {
324 match self.bits {
325 false => CLKSTASELECT_A::_0,
326 true => CLKSTASELECT_A::_1,
327 }
328 }
329 #[doc = "Checks if the value of the field is `_0`"]
330 #[inline(always)]
331 pub fn is_0(&self) -> bool {
332 *self == CLKSTASELECT_A::_0
333 }
334 #[doc = "Checks if the value of the field is `_1`"]
335 #[inline(always)]
336 pub fn is_1(&self) -> bool {
337 *self == CLKSTASELECT_A::_1
338 }
339}
340#[doc = "Field `MTIOA` reader - TIOA Mirror"]
341pub type MTIOA_R = crate::BitReader<MTIOASELECT_A>;
342#[doc = "TIOA Mirror\n\nValue on reset: 0"]
343#[derive(Clone, Copy, Debug, PartialEq, Eq)]
344pub enum MTIOASELECT_A {
345 #[doc = "0: TIOA is low. If WAVE:0, this means that TIOA pin is low. If WAVE:1, this means that TIOA is driven low."]
346 _0 = 0,
347 #[doc = "1: TIOA is high. If WAVE:0, this means that TIOA pin is high. If WAVE:1, this means that TIOA is driven high."]
348 _1 = 1,
349}
350impl From<MTIOASELECT_A> for bool {
351 #[inline(always)]
352 fn from(variant: MTIOASELECT_A) -> Self {
353 variant as u8 != 0
354 }
355}
356impl MTIOA_R {
357 #[doc = "Get enumerated values variant"]
358 #[inline(always)]
359 pub fn variant(&self) -> MTIOASELECT_A {
360 match self.bits {
361 false => MTIOASELECT_A::_0,
362 true => MTIOASELECT_A::_1,
363 }
364 }
365 #[doc = "Checks if the value of the field is `_0`"]
366 #[inline(always)]
367 pub fn is_0(&self) -> bool {
368 *self == MTIOASELECT_A::_0
369 }
370 #[doc = "Checks if the value of the field is `_1`"]
371 #[inline(always)]
372 pub fn is_1(&self) -> bool {
373 *self == MTIOASELECT_A::_1
374 }
375}
376#[doc = "Field `MTIOB` reader - TIOB Mirror"]
377pub type MTIOB_R = crate::BitReader<MTIOBSELECT_A>;
378#[doc = "TIOB Mirror\n\nValue on reset: 0"]
379#[derive(Clone, Copy, Debug, PartialEq, Eq)]
380pub enum MTIOBSELECT_A {
381 #[doc = "0: TIOB is low. If WAVE:0, this means that TIOB pin is low. If WAVE:1, this means that TIOB is driven low."]
382 _0 = 0,
383 #[doc = "1: TIOB is high. If WAVE:0, this means that TIOB pin is high. If WAVE:1, this means that TIOB is driven high."]
384 _1 = 1,
385}
386impl From<MTIOBSELECT_A> for bool {
387 #[inline(always)]
388 fn from(variant: MTIOBSELECT_A) -> Self {
389 variant as u8 != 0
390 }
391}
392impl MTIOB_R {
393 #[doc = "Get enumerated values variant"]
394 #[inline(always)]
395 pub fn variant(&self) -> MTIOBSELECT_A {
396 match self.bits {
397 false => MTIOBSELECT_A::_0,
398 true => MTIOBSELECT_A::_1,
399 }
400 }
401 #[doc = "Checks if the value of the field is `_0`"]
402 #[inline(always)]
403 pub fn is_0(&self) -> bool {
404 *self == MTIOBSELECT_A::_0
405 }
406 #[doc = "Checks if the value of the field is `_1`"]
407 #[inline(always)]
408 pub fn is_1(&self) -> bool {
409 *self == MTIOBSELECT_A::_1
410 }
411}
412impl R {
413 #[doc = "Bit 0 - Counter Overflow Status"]
414 #[inline(always)]
415 pub fn covfs(&self) -> COVFS_R {
416 COVFS_R::new((self.bits & 1) != 0)
417 }
418 #[doc = "Bit 1 - Load Overrun Status"]
419 #[inline(always)]
420 pub fn lovrs(&self) -> LOVRS_R {
421 LOVRS_R::new(((self.bits >> 1) & 1) != 0)
422 }
423 #[doc = "Bit 2 - RA Compare Status"]
424 #[inline(always)]
425 pub fn cpas(&self) -> CPAS_R {
426 CPAS_R::new(((self.bits >> 2) & 1) != 0)
427 }
428 #[doc = "Bit 3 - RB Compare Status"]
429 #[inline(always)]
430 pub fn cpbs(&self) -> CPBS_R {
431 CPBS_R::new(((self.bits >> 3) & 1) != 0)
432 }
433 #[doc = "Bit 4 - RC Compare Status"]
434 #[inline(always)]
435 pub fn cpcs(&self) -> CPCS_R {
436 CPCS_R::new(((self.bits >> 4) & 1) != 0)
437 }
438 #[doc = "Bit 5 - RA Loading Status"]
439 #[inline(always)]
440 pub fn ldras(&self) -> LDRAS_R {
441 LDRAS_R::new(((self.bits >> 5) & 1) != 0)
442 }
443 #[doc = "Bit 6 - RB Loading Status"]
444 #[inline(always)]
445 pub fn ldrbs(&self) -> LDRBS_R {
446 LDRBS_R::new(((self.bits >> 6) & 1) != 0)
447 }
448 #[doc = "Bit 7 - External Trigger Status"]
449 #[inline(always)]
450 pub fn etrgs(&self) -> ETRGS_R {
451 ETRGS_R::new(((self.bits >> 7) & 1) != 0)
452 }
453 #[doc = "Bit 16 - Clock Enabling Status"]
454 #[inline(always)]
455 pub fn clksta(&self) -> CLKSTA_R {
456 CLKSTA_R::new(((self.bits >> 16) & 1) != 0)
457 }
458 #[doc = "Bit 17 - TIOA Mirror"]
459 #[inline(always)]
460 pub fn mtioa(&self) -> MTIOA_R {
461 MTIOA_R::new(((self.bits >> 17) & 1) != 0)
462 }
463 #[doc = "Bit 18 - TIOB Mirror"]
464 #[inline(always)]
465 pub fn mtiob(&self) -> MTIOB_R {
466 MTIOB_R::new(((self.bits >> 18) & 1) != 0)
467 }
468}
469#[doc = "Status Register Channel\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sr](index.html) module"]
470pub struct SR_SPEC;
471impl crate::RegisterSpec for SR_SPEC {
472 type Ux = u32;
473}
474#[doc = "`read()` method returns [sr::R](R) reader structure"]
475impl crate::Readable for SR_SPEC {
476 type Reader = R;
477}
478#[doc = "`reset()` method sets SR%s to value 0"]
479impl crate::Resettable for SR_SPEC {
480 const RESET_VALUE: Self::Ux = 0;
481}