1#[doc = "Register `EXTTRIG` reader"]
2pub struct R(crate::R<EXTTRIG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<EXTTRIG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<EXTTRIG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<EXTTRIG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `EXTTRIG` writer"]
17pub struct W(crate::W<EXTTRIG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<EXTTRIG_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<EXTTRIG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<EXTTRIG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Channel 2 External Trigger Enable\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum CH2TRIG_A {
40 #[doc = "0: The generation of this external trigger is disabled."]
41 _0 = 0,
42 #[doc = "1: The generation of this external trigger is enabled."]
43 _1 = 1,
44}
45impl From<CH2TRIG_A> for bool {
46 #[inline(always)]
47 fn from(variant: CH2TRIG_A) -> Self {
48 variant as u8 != 0
49 }
50}
51#[doc = "Field `CH2TRIG` reader - Channel 2 External Trigger Enable"]
52pub struct CH2TRIG_R(crate::FieldReader<bool, CH2TRIG_A>);
53impl CH2TRIG_R {
54 #[inline(always)]
55 pub(crate) fn new(bits: bool) -> Self {
56 CH2TRIG_R(crate::FieldReader::new(bits))
57 }
58 #[doc = r"Get enumerated values variant"]
59 #[inline(always)]
60 pub fn variant(&self) -> CH2TRIG_A {
61 match self.bits {
62 false => CH2TRIG_A::_0,
63 true => CH2TRIG_A::_1,
64 }
65 }
66 #[doc = "Checks if the value of the field is `_0`"]
67 #[inline(always)]
68 pub fn is_0(&self) -> bool {
69 **self == CH2TRIG_A::_0
70 }
71 #[doc = "Checks if the value of the field is `_1`"]
72 #[inline(always)]
73 pub fn is_1(&self) -> bool {
74 **self == CH2TRIG_A::_1
75 }
76}
77impl core::ops::Deref for CH2TRIG_R {
78 type Target = crate::FieldReader<bool, CH2TRIG_A>;
79 #[inline(always)]
80 fn deref(&self) -> &Self::Target {
81 &self.0
82 }
83}
84#[doc = "Field `CH2TRIG` writer - Channel 2 External Trigger Enable"]
85pub struct CH2TRIG_W<'a> {
86 w: &'a mut W,
87}
88impl<'a> CH2TRIG_W<'a> {
89 #[doc = r"Writes `variant` to the field"]
90 #[inline(always)]
91 pub fn variant(self, variant: CH2TRIG_A) -> &'a mut W {
92 self.bit(variant.into())
93 }
94 #[doc = "The generation of this external trigger is disabled."]
95 #[inline(always)]
96 pub fn _0(self) -> &'a mut W {
97 self.variant(CH2TRIG_A::_0)
98 }
99 #[doc = "The generation of this external trigger is enabled."]
100 #[inline(always)]
101 pub fn _1(self) -> &'a mut W {
102 self.variant(CH2TRIG_A::_1)
103 }
104 #[doc = r"Sets the field bit"]
105 #[inline(always)]
106 pub fn set_bit(self) -> &'a mut W {
107 self.bit(true)
108 }
109 #[doc = r"Clears the field bit"]
110 #[inline(always)]
111 pub fn clear_bit(self) -> &'a mut W {
112 self.bit(false)
113 }
114 #[doc = r"Writes raw bits to the field"]
115 #[inline(always)]
116 pub fn bit(self, value: bool) -> &'a mut W {
117 self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
118 self.w
119 }
120}
121#[doc = "Channel 3 External Trigger Enable\n\nValue on reset: 0"]
122#[derive(Clone, Copy, Debug, PartialEq)]
123pub enum CH3TRIG_A {
124 #[doc = "0: The generation of this external trigger is disabled."]
125 _0 = 0,
126 #[doc = "1: The generation of this external trigger is enabled."]
127 _1 = 1,
128}
129impl From<CH3TRIG_A> for bool {
130 #[inline(always)]
131 fn from(variant: CH3TRIG_A) -> Self {
132 variant as u8 != 0
133 }
134}
135#[doc = "Field `CH3TRIG` reader - Channel 3 External Trigger Enable"]
136pub struct CH3TRIG_R(crate::FieldReader<bool, CH3TRIG_A>);
137impl CH3TRIG_R {
138 #[inline(always)]
139 pub(crate) fn new(bits: bool) -> Self {
140 CH3TRIG_R(crate::FieldReader::new(bits))
141 }
142 #[doc = r"Get enumerated values variant"]
143 #[inline(always)]
144 pub fn variant(&self) -> CH3TRIG_A {
145 match self.bits {
146 false => CH3TRIG_A::_0,
147 true => CH3TRIG_A::_1,
148 }
149 }
150 #[doc = "Checks if the value of the field is `_0`"]
151 #[inline(always)]
152 pub fn is_0(&self) -> bool {
153 **self == CH3TRIG_A::_0
154 }
155 #[doc = "Checks if the value of the field is `_1`"]
156 #[inline(always)]
157 pub fn is_1(&self) -> bool {
158 **self == CH3TRIG_A::_1
159 }
160}
161impl core::ops::Deref for CH3TRIG_R {
162 type Target = crate::FieldReader<bool, CH3TRIG_A>;
163 #[inline(always)]
164 fn deref(&self) -> &Self::Target {
165 &self.0
166 }
167}
168#[doc = "Field `CH3TRIG` writer - Channel 3 External Trigger Enable"]
169pub struct CH3TRIG_W<'a> {
170 w: &'a mut W,
171}
172impl<'a> CH3TRIG_W<'a> {
173 #[doc = r"Writes `variant` to the field"]
174 #[inline(always)]
175 pub fn variant(self, variant: CH3TRIG_A) -> &'a mut W {
176 self.bit(variant.into())
177 }
178 #[doc = "The generation of this external trigger is disabled."]
179 #[inline(always)]
180 pub fn _0(self) -> &'a mut W {
181 self.variant(CH3TRIG_A::_0)
182 }
183 #[doc = "The generation of this external trigger is enabled."]
184 #[inline(always)]
185 pub fn _1(self) -> &'a mut W {
186 self.variant(CH3TRIG_A::_1)
187 }
188 #[doc = r"Sets the field bit"]
189 #[inline(always)]
190 pub fn set_bit(self) -> &'a mut W {
191 self.bit(true)
192 }
193 #[doc = r"Clears the field bit"]
194 #[inline(always)]
195 pub fn clear_bit(self) -> &'a mut W {
196 self.bit(false)
197 }
198 #[doc = r"Writes raw bits to the field"]
199 #[inline(always)]
200 pub fn bit(self, value: bool) -> &'a mut W {
201 self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
202 self.w
203 }
204}
205#[doc = "Channel 4 External Trigger Enable\n\nValue on reset: 0"]
206#[derive(Clone, Copy, Debug, PartialEq)]
207pub enum CH4TRIG_A {
208 #[doc = "0: The generation of this external trigger is disabled."]
209 _0 = 0,
210 #[doc = "1: The generation of this external trigger is enabled."]
211 _1 = 1,
212}
213impl From<CH4TRIG_A> for bool {
214 #[inline(always)]
215 fn from(variant: CH4TRIG_A) -> Self {
216 variant as u8 != 0
217 }
218}
219#[doc = "Field `CH4TRIG` reader - Channel 4 External Trigger Enable"]
220pub struct CH4TRIG_R(crate::FieldReader<bool, CH4TRIG_A>);
221impl CH4TRIG_R {
222 #[inline(always)]
223 pub(crate) fn new(bits: bool) -> Self {
224 CH4TRIG_R(crate::FieldReader::new(bits))
225 }
226 #[doc = r"Get enumerated values variant"]
227 #[inline(always)]
228 pub fn variant(&self) -> CH4TRIG_A {
229 match self.bits {
230 false => CH4TRIG_A::_0,
231 true => CH4TRIG_A::_1,
232 }
233 }
234 #[doc = "Checks if the value of the field is `_0`"]
235 #[inline(always)]
236 pub fn is_0(&self) -> bool {
237 **self == CH4TRIG_A::_0
238 }
239 #[doc = "Checks if the value of the field is `_1`"]
240 #[inline(always)]
241 pub fn is_1(&self) -> bool {
242 **self == CH4TRIG_A::_1
243 }
244}
245impl core::ops::Deref for CH4TRIG_R {
246 type Target = crate::FieldReader<bool, CH4TRIG_A>;
247 #[inline(always)]
248 fn deref(&self) -> &Self::Target {
249 &self.0
250 }
251}
252#[doc = "Field `CH4TRIG` writer - Channel 4 External Trigger Enable"]
253pub struct CH4TRIG_W<'a> {
254 w: &'a mut W,
255}
256impl<'a> CH4TRIG_W<'a> {
257 #[doc = r"Writes `variant` to the field"]
258 #[inline(always)]
259 pub fn variant(self, variant: CH4TRIG_A) -> &'a mut W {
260 self.bit(variant.into())
261 }
262 #[doc = "The generation of this external trigger is disabled."]
263 #[inline(always)]
264 pub fn _0(self) -> &'a mut W {
265 self.variant(CH4TRIG_A::_0)
266 }
267 #[doc = "The generation of this external trigger is enabled."]
268 #[inline(always)]
269 pub fn _1(self) -> &'a mut W {
270 self.variant(CH4TRIG_A::_1)
271 }
272 #[doc = r"Sets the field bit"]
273 #[inline(always)]
274 pub fn set_bit(self) -> &'a mut W {
275 self.bit(true)
276 }
277 #[doc = r"Clears the field bit"]
278 #[inline(always)]
279 pub fn clear_bit(self) -> &'a mut W {
280 self.bit(false)
281 }
282 #[doc = r"Writes raw bits to the field"]
283 #[inline(always)]
284 pub fn bit(self, value: bool) -> &'a mut W {
285 self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
286 self.w
287 }
288}
289#[doc = "Channel 5 External Trigger Enable\n\nValue on reset: 0"]
290#[derive(Clone, Copy, Debug, PartialEq)]
291pub enum CH5TRIG_A {
292 #[doc = "0: The generation of this external trigger is disabled."]
293 _0 = 0,
294 #[doc = "1: The generation of this external trigger is enabled."]
295 _1 = 1,
296}
297impl From<CH5TRIG_A> for bool {
298 #[inline(always)]
299 fn from(variant: CH5TRIG_A) -> Self {
300 variant as u8 != 0
301 }
302}
303#[doc = "Field `CH5TRIG` reader - Channel 5 External Trigger Enable"]
304pub struct CH5TRIG_R(crate::FieldReader<bool, CH5TRIG_A>);
305impl CH5TRIG_R {
306 #[inline(always)]
307 pub(crate) fn new(bits: bool) -> Self {
308 CH5TRIG_R(crate::FieldReader::new(bits))
309 }
310 #[doc = r"Get enumerated values variant"]
311 #[inline(always)]
312 pub fn variant(&self) -> CH5TRIG_A {
313 match self.bits {
314 false => CH5TRIG_A::_0,
315 true => CH5TRIG_A::_1,
316 }
317 }
318 #[doc = "Checks if the value of the field is `_0`"]
319 #[inline(always)]
320 pub fn is_0(&self) -> bool {
321 **self == CH5TRIG_A::_0
322 }
323 #[doc = "Checks if the value of the field is `_1`"]
324 #[inline(always)]
325 pub fn is_1(&self) -> bool {
326 **self == CH5TRIG_A::_1
327 }
328}
329impl core::ops::Deref for CH5TRIG_R {
330 type Target = crate::FieldReader<bool, CH5TRIG_A>;
331 #[inline(always)]
332 fn deref(&self) -> &Self::Target {
333 &self.0
334 }
335}
336#[doc = "Field `CH5TRIG` writer - Channel 5 External Trigger Enable"]
337pub struct CH5TRIG_W<'a> {
338 w: &'a mut W,
339}
340impl<'a> CH5TRIG_W<'a> {
341 #[doc = r"Writes `variant` to the field"]
342 #[inline(always)]
343 pub fn variant(self, variant: CH5TRIG_A) -> &'a mut W {
344 self.bit(variant.into())
345 }
346 #[doc = "The generation of this external trigger is disabled."]
347 #[inline(always)]
348 pub fn _0(self) -> &'a mut W {
349 self.variant(CH5TRIG_A::_0)
350 }
351 #[doc = "The generation of this external trigger is enabled."]
352 #[inline(always)]
353 pub fn _1(self) -> &'a mut W {
354 self.variant(CH5TRIG_A::_1)
355 }
356 #[doc = r"Sets the field bit"]
357 #[inline(always)]
358 pub fn set_bit(self) -> &'a mut W {
359 self.bit(true)
360 }
361 #[doc = r"Clears the field bit"]
362 #[inline(always)]
363 pub fn clear_bit(self) -> &'a mut W {
364 self.bit(false)
365 }
366 #[doc = r"Writes raw bits to the field"]
367 #[inline(always)]
368 pub fn bit(self, value: bool) -> &'a mut W {
369 self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
370 self.w
371 }
372}
373#[doc = "Channel 0 External Trigger Enable\n\nValue on reset: 0"]
374#[derive(Clone, Copy, Debug, PartialEq)]
375pub enum CH0TRIG_A {
376 #[doc = "0: The generation of this external trigger is disabled."]
377 _0 = 0,
378 #[doc = "1: The generation of this external trigger is enabled."]
379 _1 = 1,
380}
381impl From<CH0TRIG_A> for bool {
382 #[inline(always)]
383 fn from(variant: CH0TRIG_A) -> Self {
384 variant as u8 != 0
385 }
386}
387#[doc = "Field `CH0TRIG` reader - Channel 0 External Trigger Enable"]
388pub struct CH0TRIG_R(crate::FieldReader<bool, CH0TRIG_A>);
389impl CH0TRIG_R {
390 #[inline(always)]
391 pub(crate) fn new(bits: bool) -> Self {
392 CH0TRIG_R(crate::FieldReader::new(bits))
393 }
394 #[doc = r"Get enumerated values variant"]
395 #[inline(always)]
396 pub fn variant(&self) -> CH0TRIG_A {
397 match self.bits {
398 false => CH0TRIG_A::_0,
399 true => CH0TRIG_A::_1,
400 }
401 }
402 #[doc = "Checks if the value of the field is `_0`"]
403 #[inline(always)]
404 pub fn is_0(&self) -> bool {
405 **self == CH0TRIG_A::_0
406 }
407 #[doc = "Checks if the value of the field is `_1`"]
408 #[inline(always)]
409 pub fn is_1(&self) -> bool {
410 **self == CH0TRIG_A::_1
411 }
412}
413impl core::ops::Deref for CH0TRIG_R {
414 type Target = crate::FieldReader<bool, CH0TRIG_A>;
415 #[inline(always)]
416 fn deref(&self) -> &Self::Target {
417 &self.0
418 }
419}
420#[doc = "Field `CH0TRIG` writer - Channel 0 External Trigger Enable"]
421pub struct CH0TRIG_W<'a> {
422 w: &'a mut W,
423}
424impl<'a> CH0TRIG_W<'a> {
425 #[doc = r"Writes `variant` to the field"]
426 #[inline(always)]
427 pub fn variant(self, variant: CH0TRIG_A) -> &'a mut W {
428 self.bit(variant.into())
429 }
430 #[doc = "The generation of this external trigger is disabled."]
431 #[inline(always)]
432 pub fn _0(self) -> &'a mut W {
433 self.variant(CH0TRIG_A::_0)
434 }
435 #[doc = "The generation of this external trigger is enabled."]
436 #[inline(always)]
437 pub fn _1(self) -> &'a mut W {
438 self.variant(CH0TRIG_A::_1)
439 }
440 #[doc = r"Sets the field bit"]
441 #[inline(always)]
442 pub fn set_bit(self) -> &'a mut W {
443 self.bit(true)
444 }
445 #[doc = r"Clears the field bit"]
446 #[inline(always)]
447 pub fn clear_bit(self) -> &'a mut W {
448 self.bit(false)
449 }
450 #[doc = r"Writes raw bits to the field"]
451 #[inline(always)]
452 pub fn bit(self, value: bool) -> &'a mut W {
453 self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
454 self.w
455 }
456}
457#[doc = "Channel 1 External Trigger Enable\n\nValue on reset: 0"]
458#[derive(Clone, Copy, Debug, PartialEq)]
459pub enum CH1TRIG_A {
460 #[doc = "0: The generation of this external trigger is disabled."]
461 _0 = 0,
462 #[doc = "1: The generation of this external trigger is enabled."]
463 _1 = 1,
464}
465impl From<CH1TRIG_A> for bool {
466 #[inline(always)]
467 fn from(variant: CH1TRIG_A) -> Self {
468 variant as u8 != 0
469 }
470}
471#[doc = "Field `CH1TRIG` reader - Channel 1 External Trigger Enable"]
472pub struct CH1TRIG_R(crate::FieldReader<bool, CH1TRIG_A>);
473impl CH1TRIG_R {
474 #[inline(always)]
475 pub(crate) fn new(bits: bool) -> Self {
476 CH1TRIG_R(crate::FieldReader::new(bits))
477 }
478 #[doc = r"Get enumerated values variant"]
479 #[inline(always)]
480 pub fn variant(&self) -> CH1TRIG_A {
481 match self.bits {
482 false => CH1TRIG_A::_0,
483 true => CH1TRIG_A::_1,
484 }
485 }
486 #[doc = "Checks if the value of the field is `_0`"]
487 #[inline(always)]
488 pub fn is_0(&self) -> bool {
489 **self == CH1TRIG_A::_0
490 }
491 #[doc = "Checks if the value of the field is `_1`"]
492 #[inline(always)]
493 pub fn is_1(&self) -> bool {
494 **self == CH1TRIG_A::_1
495 }
496}
497impl core::ops::Deref for CH1TRIG_R {
498 type Target = crate::FieldReader<bool, CH1TRIG_A>;
499 #[inline(always)]
500 fn deref(&self) -> &Self::Target {
501 &self.0
502 }
503}
504#[doc = "Field `CH1TRIG` writer - Channel 1 External Trigger Enable"]
505pub struct CH1TRIG_W<'a> {
506 w: &'a mut W,
507}
508impl<'a> CH1TRIG_W<'a> {
509 #[doc = r"Writes `variant` to the field"]
510 #[inline(always)]
511 pub fn variant(self, variant: CH1TRIG_A) -> &'a mut W {
512 self.bit(variant.into())
513 }
514 #[doc = "The generation of this external trigger is disabled."]
515 #[inline(always)]
516 pub fn _0(self) -> &'a mut W {
517 self.variant(CH1TRIG_A::_0)
518 }
519 #[doc = "The generation of this external trigger is enabled."]
520 #[inline(always)]
521 pub fn _1(self) -> &'a mut W {
522 self.variant(CH1TRIG_A::_1)
523 }
524 #[doc = r"Sets the field bit"]
525 #[inline(always)]
526 pub fn set_bit(self) -> &'a mut W {
527 self.bit(true)
528 }
529 #[doc = r"Clears the field bit"]
530 #[inline(always)]
531 pub fn clear_bit(self) -> &'a mut W {
532 self.bit(false)
533 }
534 #[doc = r"Writes raw bits to the field"]
535 #[inline(always)]
536 pub fn bit(self, value: bool) -> &'a mut W {
537 self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
538 self.w
539 }
540}
541#[doc = "Initialization Trigger Enable\n\nValue on reset: 0"]
542#[derive(Clone, Copy, Debug, PartialEq)]
543pub enum INITTRIGEN_A {
544 #[doc = "0: The generation of initialization trigger is disabled."]
545 _0 = 0,
546 #[doc = "1: The generation of initialization trigger is enabled."]
547 _1 = 1,
548}
549impl From<INITTRIGEN_A> for bool {
550 #[inline(always)]
551 fn from(variant: INITTRIGEN_A) -> Self {
552 variant as u8 != 0
553 }
554}
555#[doc = "Field `INITTRIGEN` reader - Initialization Trigger Enable"]
556pub struct INITTRIGEN_R(crate::FieldReader<bool, INITTRIGEN_A>);
557impl INITTRIGEN_R {
558 #[inline(always)]
559 pub(crate) fn new(bits: bool) -> Self {
560 INITTRIGEN_R(crate::FieldReader::new(bits))
561 }
562 #[doc = r"Get enumerated values variant"]
563 #[inline(always)]
564 pub fn variant(&self) -> INITTRIGEN_A {
565 match self.bits {
566 false => INITTRIGEN_A::_0,
567 true => INITTRIGEN_A::_1,
568 }
569 }
570 #[doc = "Checks if the value of the field is `_0`"]
571 #[inline(always)]
572 pub fn is_0(&self) -> bool {
573 **self == INITTRIGEN_A::_0
574 }
575 #[doc = "Checks if the value of the field is `_1`"]
576 #[inline(always)]
577 pub fn is_1(&self) -> bool {
578 **self == INITTRIGEN_A::_1
579 }
580}
581impl core::ops::Deref for INITTRIGEN_R {
582 type Target = crate::FieldReader<bool, INITTRIGEN_A>;
583 #[inline(always)]
584 fn deref(&self) -> &Self::Target {
585 &self.0
586 }
587}
588#[doc = "Field `INITTRIGEN` writer - Initialization Trigger Enable"]
589pub struct INITTRIGEN_W<'a> {
590 w: &'a mut W,
591}
592impl<'a> INITTRIGEN_W<'a> {
593 #[doc = r"Writes `variant` to the field"]
594 #[inline(always)]
595 pub fn variant(self, variant: INITTRIGEN_A) -> &'a mut W {
596 self.bit(variant.into())
597 }
598 #[doc = "The generation of initialization trigger is disabled."]
599 #[inline(always)]
600 pub fn _0(self) -> &'a mut W {
601 self.variant(INITTRIGEN_A::_0)
602 }
603 #[doc = "The generation of initialization trigger is enabled."]
604 #[inline(always)]
605 pub fn _1(self) -> &'a mut W {
606 self.variant(INITTRIGEN_A::_1)
607 }
608 #[doc = r"Sets the field bit"]
609 #[inline(always)]
610 pub fn set_bit(self) -> &'a mut W {
611 self.bit(true)
612 }
613 #[doc = r"Clears the field bit"]
614 #[inline(always)]
615 pub fn clear_bit(self) -> &'a mut W {
616 self.bit(false)
617 }
618 #[doc = r"Writes raw bits to the field"]
619 #[inline(always)]
620 pub fn bit(self, value: bool) -> &'a mut W {
621 self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
622 self.w
623 }
624}
625#[doc = "Channel Trigger Flag\n\nValue on reset: 0"]
626#[derive(Clone, Copy, Debug, PartialEq)]
627pub enum TRIGF_A {
628 #[doc = "0: No channel trigger was generated."]
629 _0 = 0,
630 #[doc = "1: A channel trigger was generated."]
631 _1 = 1,
632}
633impl From<TRIGF_A> for bool {
634 #[inline(always)]
635 fn from(variant: TRIGF_A) -> Self {
636 variant as u8 != 0
637 }
638}
639#[doc = "Field `TRIGF` reader - Channel Trigger Flag"]
640pub struct TRIGF_R(crate::FieldReader<bool, TRIGF_A>);
641impl TRIGF_R {
642 #[inline(always)]
643 pub(crate) fn new(bits: bool) -> Self {
644 TRIGF_R(crate::FieldReader::new(bits))
645 }
646 #[doc = r"Get enumerated values variant"]
647 #[inline(always)]
648 pub fn variant(&self) -> TRIGF_A {
649 match self.bits {
650 false => TRIGF_A::_0,
651 true => TRIGF_A::_1,
652 }
653 }
654 #[doc = "Checks if the value of the field is `_0`"]
655 #[inline(always)]
656 pub fn is_0(&self) -> bool {
657 **self == TRIGF_A::_0
658 }
659 #[doc = "Checks if the value of the field is `_1`"]
660 #[inline(always)]
661 pub fn is_1(&self) -> bool {
662 **self == TRIGF_A::_1
663 }
664}
665impl core::ops::Deref for TRIGF_R {
666 type Target = crate::FieldReader<bool, TRIGF_A>;
667 #[inline(always)]
668 fn deref(&self) -> &Self::Target {
669 &self.0
670 }
671}
672#[doc = "Channel 6 External Trigger Enable\n\nValue on reset: 0"]
673#[derive(Clone, Copy, Debug, PartialEq)]
674pub enum CH6TRIG_A {
675 #[doc = "0: The generation of this external trigger is disabled."]
676 _0 = 0,
677 #[doc = "1: The generation of this external trigger is enabled."]
678 _1 = 1,
679}
680impl From<CH6TRIG_A> for bool {
681 #[inline(always)]
682 fn from(variant: CH6TRIG_A) -> Self {
683 variant as u8 != 0
684 }
685}
686#[doc = "Field `CH6TRIG` reader - Channel 6 External Trigger Enable"]
687pub struct CH6TRIG_R(crate::FieldReader<bool, CH6TRIG_A>);
688impl CH6TRIG_R {
689 #[inline(always)]
690 pub(crate) fn new(bits: bool) -> Self {
691 CH6TRIG_R(crate::FieldReader::new(bits))
692 }
693 #[doc = r"Get enumerated values variant"]
694 #[inline(always)]
695 pub fn variant(&self) -> CH6TRIG_A {
696 match self.bits {
697 false => CH6TRIG_A::_0,
698 true => CH6TRIG_A::_1,
699 }
700 }
701 #[doc = "Checks if the value of the field is `_0`"]
702 #[inline(always)]
703 pub fn is_0(&self) -> bool {
704 **self == CH6TRIG_A::_0
705 }
706 #[doc = "Checks if the value of the field is `_1`"]
707 #[inline(always)]
708 pub fn is_1(&self) -> bool {
709 **self == CH6TRIG_A::_1
710 }
711}
712impl core::ops::Deref for CH6TRIG_R {
713 type Target = crate::FieldReader<bool, CH6TRIG_A>;
714 #[inline(always)]
715 fn deref(&self) -> &Self::Target {
716 &self.0
717 }
718}
719#[doc = "Field `CH6TRIG` writer - Channel 6 External Trigger Enable"]
720pub struct CH6TRIG_W<'a> {
721 w: &'a mut W,
722}
723impl<'a> CH6TRIG_W<'a> {
724 #[doc = r"Writes `variant` to the field"]
725 #[inline(always)]
726 pub fn variant(self, variant: CH6TRIG_A) -> &'a mut W {
727 self.bit(variant.into())
728 }
729 #[doc = "The generation of this external trigger is disabled."]
730 #[inline(always)]
731 pub fn _0(self) -> &'a mut W {
732 self.variant(CH6TRIG_A::_0)
733 }
734 #[doc = "The generation of this external trigger is enabled."]
735 #[inline(always)]
736 pub fn _1(self) -> &'a mut W {
737 self.variant(CH6TRIG_A::_1)
738 }
739 #[doc = r"Sets the field bit"]
740 #[inline(always)]
741 pub fn set_bit(self) -> &'a mut W {
742 self.bit(true)
743 }
744 #[doc = r"Clears the field bit"]
745 #[inline(always)]
746 pub fn clear_bit(self) -> &'a mut W {
747 self.bit(false)
748 }
749 #[doc = r"Writes raw bits to the field"]
750 #[inline(always)]
751 pub fn bit(self, value: bool) -> &'a mut W {
752 self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
753 self.w
754 }
755}
756#[doc = "Channel 7 External Trigger Enable\n\nValue on reset: 0"]
757#[derive(Clone, Copy, Debug, PartialEq)]
758pub enum CH7TRIG_A {
759 #[doc = "0: The generation of this external trigger is disabled."]
760 _0 = 0,
761 #[doc = "1: The generation of this external trigger is enabled."]
762 _1 = 1,
763}
764impl From<CH7TRIG_A> for bool {
765 #[inline(always)]
766 fn from(variant: CH7TRIG_A) -> Self {
767 variant as u8 != 0
768 }
769}
770#[doc = "Field `CH7TRIG` reader - Channel 7 External Trigger Enable"]
771pub struct CH7TRIG_R(crate::FieldReader<bool, CH7TRIG_A>);
772impl CH7TRIG_R {
773 #[inline(always)]
774 pub(crate) fn new(bits: bool) -> Self {
775 CH7TRIG_R(crate::FieldReader::new(bits))
776 }
777 #[doc = r"Get enumerated values variant"]
778 #[inline(always)]
779 pub fn variant(&self) -> CH7TRIG_A {
780 match self.bits {
781 false => CH7TRIG_A::_0,
782 true => CH7TRIG_A::_1,
783 }
784 }
785 #[doc = "Checks if the value of the field is `_0`"]
786 #[inline(always)]
787 pub fn is_0(&self) -> bool {
788 **self == CH7TRIG_A::_0
789 }
790 #[doc = "Checks if the value of the field is `_1`"]
791 #[inline(always)]
792 pub fn is_1(&self) -> bool {
793 **self == CH7TRIG_A::_1
794 }
795}
796impl core::ops::Deref for CH7TRIG_R {
797 type Target = crate::FieldReader<bool, CH7TRIG_A>;
798 #[inline(always)]
799 fn deref(&self) -> &Self::Target {
800 &self.0
801 }
802}
803#[doc = "Field `CH7TRIG` writer - Channel 7 External Trigger Enable"]
804pub struct CH7TRIG_W<'a> {
805 w: &'a mut W,
806}
807impl<'a> CH7TRIG_W<'a> {
808 #[doc = r"Writes `variant` to the field"]
809 #[inline(always)]
810 pub fn variant(self, variant: CH7TRIG_A) -> &'a mut W {
811 self.bit(variant.into())
812 }
813 #[doc = "The generation of this external trigger is disabled."]
814 #[inline(always)]
815 pub fn _0(self) -> &'a mut W {
816 self.variant(CH7TRIG_A::_0)
817 }
818 #[doc = "The generation of this external trigger is enabled."]
819 #[inline(always)]
820 pub fn _1(self) -> &'a mut W {
821 self.variant(CH7TRIG_A::_1)
822 }
823 #[doc = r"Sets the field bit"]
824 #[inline(always)]
825 pub fn set_bit(self) -> &'a mut W {
826 self.bit(true)
827 }
828 #[doc = r"Clears the field bit"]
829 #[inline(always)]
830 pub fn clear_bit(self) -> &'a mut W {
831 self.bit(false)
832 }
833 #[doc = r"Writes raw bits to the field"]
834 #[inline(always)]
835 pub fn bit(self, value: bool) -> &'a mut W {
836 self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
837 self.w
838 }
839}
840impl R {
841 #[doc = "Bit 0 - Channel 2 External Trigger Enable"]
842 #[inline(always)]
843 pub fn ch2trig(&self) -> CH2TRIG_R {
844 CH2TRIG_R::new((self.bits & 0x01) != 0)
845 }
846 #[doc = "Bit 1 - Channel 3 External Trigger Enable"]
847 #[inline(always)]
848 pub fn ch3trig(&self) -> CH3TRIG_R {
849 CH3TRIG_R::new(((self.bits >> 1) & 0x01) != 0)
850 }
851 #[doc = "Bit 2 - Channel 4 External Trigger Enable"]
852 #[inline(always)]
853 pub fn ch4trig(&self) -> CH4TRIG_R {
854 CH4TRIG_R::new(((self.bits >> 2) & 0x01) != 0)
855 }
856 #[doc = "Bit 3 - Channel 5 External Trigger Enable"]
857 #[inline(always)]
858 pub fn ch5trig(&self) -> CH5TRIG_R {
859 CH5TRIG_R::new(((self.bits >> 3) & 0x01) != 0)
860 }
861 #[doc = "Bit 4 - Channel 0 External Trigger Enable"]
862 #[inline(always)]
863 pub fn ch0trig(&self) -> CH0TRIG_R {
864 CH0TRIG_R::new(((self.bits >> 4) & 0x01) != 0)
865 }
866 #[doc = "Bit 5 - Channel 1 External Trigger Enable"]
867 #[inline(always)]
868 pub fn ch1trig(&self) -> CH1TRIG_R {
869 CH1TRIG_R::new(((self.bits >> 5) & 0x01) != 0)
870 }
871 #[doc = "Bit 6 - Initialization Trigger Enable"]
872 #[inline(always)]
873 pub fn inittrigen(&self) -> INITTRIGEN_R {
874 INITTRIGEN_R::new(((self.bits >> 6) & 0x01) != 0)
875 }
876 #[doc = "Bit 7 - Channel Trigger Flag"]
877 #[inline(always)]
878 pub fn trigf(&self) -> TRIGF_R {
879 TRIGF_R::new(((self.bits >> 7) & 0x01) != 0)
880 }
881 #[doc = "Bit 8 - Channel 6 External Trigger Enable"]
882 #[inline(always)]
883 pub fn ch6trig(&self) -> CH6TRIG_R {
884 CH6TRIG_R::new(((self.bits >> 8) & 0x01) != 0)
885 }
886 #[doc = "Bit 9 - Channel 7 External Trigger Enable"]
887 #[inline(always)]
888 pub fn ch7trig(&self) -> CH7TRIG_R {
889 CH7TRIG_R::new(((self.bits >> 9) & 0x01) != 0)
890 }
891}
892impl W {
893 #[doc = "Bit 0 - Channel 2 External Trigger Enable"]
894 #[inline(always)]
895 pub fn ch2trig(&mut self) -> CH2TRIG_W {
896 CH2TRIG_W { w: self }
897 }
898 #[doc = "Bit 1 - Channel 3 External Trigger Enable"]
899 #[inline(always)]
900 pub fn ch3trig(&mut self) -> CH3TRIG_W {
901 CH3TRIG_W { w: self }
902 }
903 #[doc = "Bit 2 - Channel 4 External Trigger Enable"]
904 #[inline(always)]
905 pub fn ch4trig(&mut self) -> CH4TRIG_W {
906 CH4TRIG_W { w: self }
907 }
908 #[doc = "Bit 3 - Channel 5 External Trigger Enable"]
909 #[inline(always)]
910 pub fn ch5trig(&mut self) -> CH5TRIG_W {
911 CH5TRIG_W { w: self }
912 }
913 #[doc = "Bit 4 - Channel 0 External Trigger Enable"]
914 #[inline(always)]
915 pub fn ch0trig(&mut self) -> CH0TRIG_W {
916 CH0TRIG_W { w: self }
917 }
918 #[doc = "Bit 5 - Channel 1 External Trigger Enable"]
919 #[inline(always)]
920 pub fn ch1trig(&mut self) -> CH1TRIG_W {
921 CH1TRIG_W { w: self }
922 }
923 #[doc = "Bit 6 - Initialization Trigger Enable"]
924 #[inline(always)]
925 pub fn inittrigen(&mut self) -> INITTRIGEN_W {
926 INITTRIGEN_W { w: self }
927 }
928 #[doc = "Bit 8 - Channel 6 External Trigger Enable"]
929 #[inline(always)]
930 pub fn ch6trig(&mut self) -> CH6TRIG_W {
931 CH6TRIG_W { w: self }
932 }
933 #[doc = "Bit 9 - Channel 7 External Trigger Enable"]
934 #[inline(always)]
935 pub fn ch7trig(&mut self) -> CH7TRIG_W {
936 CH7TRIG_W { w: self }
937 }
938 #[doc = "Writes raw bits to the register."]
939 #[inline(always)]
940 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
941 self.0.bits(bits);
942 self
943 }
944}
945#[doc = "FTM External Trigger\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 [exttrig](index.html) module"]
946pub struct EXTTRIG_SPEC;
947impl crate::RegisterSpec for EXTTRIG_SPEC {
948 type Ux = u32;
949}
950#[doc = "`read()` method returns [exttrig::R](R) reader structure"]
951impl crate::Readable for EXTTRIG_SPEC {
952 type Reader = R;
953}
954#[doc = "`write(|w| ..)` method takes [exttrig::W](W) writer structure"]
955impl crate::Writable for EXTTRIG_SPEC {
956 type Writer = W;
957}
958#[doc = "`reset()` method sets EXTTRIG to value 0"]
959impl crate::Resettable for EXTTRIG_SPEC {
960 #[inline(always)]
961 fn reset_value() -> Self::Ux {
962 0
963 }
964}