1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
#[doc = r" Value read from the register"]
pub struct R {
    bits: u32,
}
#[doc = r" Value to write to the register"]
pub struct W {
    bits: u32,
}
impl super::SMCR {
    #[doc = r" Modifies the contents of the register"]
    #[inline]
    pub fn modify<F>(&self, f: F)
    where
        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
    {
        let bits = self.register.get();
        let r = R { bits: bits };
        let mut w = W { bits: bits };
        f(&r, &mut w);
        self.register.set(w.bits);
    }
    #[doc = r" Reads the contents of the register"]
    #[inline]
    pub fn read(&self) -> R {
        R {
            bits: self.register.get(),
        }
    }
    #[doc = r" Writes to the register"]
    #[inline]
    pub fn write<F>(&self, f: F)
    where
        F: FnOnce(&mut W) -> &mut W,
    {
        let mut w = W::reset_value();
        f(&mut w);
        self.register.set(w.bits);
    }
    #[doc = r" Writes the reset value to the register"]
    #[inline]
    pub fn reset(&self) {
        self.write(|w| w)
    }
}
#[doc = r" Value of the field"]
pub struct ETPR {
    bits: bool,
}
impl ETPR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bit(&self) -> bool {
        self.bits
    }
    #[doc = r" Returns `true` if the bit is clear (0)"]
    #[inline]
    pub fn bit_is_clear(&self) -> bool {
        !self.bit()
    }
    #[doc = r" Returns `true` if the bit is set (1)"]
    #[inline]
    pub fn bit_is_set(&self) -> bool {
        self.bit()
    }
}
#[doc = r" Value of the field"]
pub struct ECER {
    bits: bool,
}
impl ECER {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bit(&self) -> bool {
        self.bits
    }
    #[doc = r" Returns `true` if the bit is clear (0)"]
    #[inline]
    pub fn bit_is_clear(&self) -> bool {
        !self.bit()
    }
    #[doc = r" Returns `true` if the bit is set (1)"]
    #[inline]
    pub fn bit_is_set(&self) -> bool {
        self.bit()
    }
}
#[doc = r" Value of the field"]
pub struct ETPSR {
    bits: u8,
}
impl ETPSR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bits(&self) -> u8 {
        self.bits
    }
}
#[doc = r" Value of the field"]
pub struct ETFR {
    bits: u8,
}
impl ETFR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bits(&self) -> u8 {
        self.bits
    }
}
#[doc = r" Value of the field"]
pub struct MSMR {
    bits: bool,
}
impl MSMR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bit(&self) -> bool {
        self.bits
    }
    #[doc = r" Returns `true` if the bit is clear (0)"]
    #[inline]
    pub fn bit_is_clear(&self) -> bool {
        !self.bit()
    }
    #[doc = r" Returns `true` if the bit is set (1)"]
    #[inline]
    pub fn bit_is_set(&self) -> bool {
        self.bit()
    }
}
#[doc = "Possible values of the field `TS`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSR {
    #[doc = "Internal Trigger 0 (ITR0)"]
    ITR0,
    #[doc = "Internal Trigger 1 (ITR1)"]
    ITR1,
    #[doc = "Internal Trigger 2 (ITR2)"]
    ITR2,
    #[doc = "Internal Trigger 3 (ITR3)"]
    ITR3,
    #[doc = "TI1 Edge Detector"]
    TI1F_ED,
    #[doc = "Filtered Timer Input 1"]
    TI1FP1,
    #[doc = "Filtered Timer Input 2"]
    TI2FP2,
    #[doc = "External Trigger input"]
    ETRF,
}
impl TSR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bits(&self) -> u8 {
        match *self {
            TSR::ITR0 => 0,
            TSR::ITR1 => 1,
            TSR::ITR2 => 2,
            TSR::ITR3 => 3,
            TSR::TI1F_ED => 4,
            TSR::TI1FP1 => 5,
            TSR::TI2FP2 => 6,
            TSR::ETRF => 7,
        }
    }
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _from(value: u8) -> TSR {
        match value {
            0 => TSR::ITR0,
            1 => TSR::ITR1,
            2 => TSR::ITR2,
            3 => TSR::ITR3,
            4 => TSR::TI1F_ED,
            5 => TSR::TI1FP1,
            6 => TSR::TI2FP2,
            7 => TSR::ETRF,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `ITR0`"]
    #[inline]
    pub fn is_itr0(&self) -> bool {
        *self == TSR::ITR0
    }
    #[doc = "Checks if the value of the field is `ITR1`"]
    #[inline]
    pub fn is_itr1(&self) -> bool {
        *self == TSR::ITR1
    }
    #[doc = "Checks if the value of the field is `ITR2`"]
    #[inline]
    pub fn is_itr2(&self) -> bool {
        *self == TSR::ITR2
    }
    #[doc = "Checks if the value of the field is `ITR3`"]
    #[inline]
    pub fn is_itr3(&self) -> bool {
        *self == TSR::ITR3
    }
    #[doc = "Checks if the value of the field is `TI1F_ED`"]
    #[inline]
    pub fn is_ti1f_ed(&self) -> bool {
        *self == TSR::TI1F_ED
    }
    #[doc = "Checks if the value of the field is `TI1FP1`"]
    #[inline]
    pub fn is_ti1fp1(&self) -> bool {
        *self == TSR::TI1FP1
    }
    #[doc = "Checks if the value of the field is `TI2FP2`"]
    #[inline]
    pub fn is_ti2fp2(&self) -> bool {
        *self == TSR::TI2FP2
    }
    #[doc = "Checks if the value of the field is `ETRF`"]
    #[inline]
    pub fn is_etrf(&self) -> bool {
        *self == TSR::ETRF
    }
}
#[doc = "Possible values of the field `SMS`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SMSR {
    #[doc = "Counter disabled"]
    DISABLED,
    #[doc = "Encoder mode, count up/down on TI2FP1"]
    ENCODERTI2,
    #[doc = "Encoder mode, count up/down on TI1FP2"]
    ENCODERTI1,
    #[doc = "Encoder mode, count up/down on both TI1FP1 and TI2FP2"]
    ENCODERTI1TI2,
    #[doc = "Rising edge of the selected trigger input (TRGI) reinitializes the counter"]
    RESET,
    #[doc = " The counter clock is enabled when the trigger input (TRGI) is high"]
    GATED,
    #[doc = "The counter starts at a rising edge of the trigger TRGI "]
    TRIGGER,
    #[doc = " Rising edges of the selected trigger (TRGI) clock the counter"]
    EXTERNAL,
}
impl SMSR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bits(&self) -> u8 {
        match *self {
            SMSR::DISABLED => 0,
            SMSR::ENCODERTI2 => 1,
            SMSR::ENCODERTI1 => 2,
            SMSR::ENCODERTI1TI2 => 3,
            SMSR::RESET => 4,
            SMSR::GATED => 5,
            SMSR::TRIGGER => 6,
            SMSR::EXTERNAL => 7,
        }
    }
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _from(value: u8) -> SMSR {
        match value {
            0 => SMSR::DISABLED,
            1 => SMSR::ENCODERTI2,
            2 => SMSR::ENCODERTI1,
            3 => SMSR::ENCODERTI1TI2,
            4 => SMSR::RESET,
            5 => SMSR::GATED,
            6 => SMSR::TRIGGER,
            7 => SMSR::EXTERNAL,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DISABLED`"]
    #[inline]
    pub fn is_disabled(&self) -> bool {
        *self == SMSR::DISABLED
    }
    #[doc = "Checks if the value of the field is `ENCODERTI2`"]
    #[inline]
    pub fn is_encoder_ti2(&self) -> bool {
        *self == SMSR::ENCODERTI2
    }
    #[doc = "Checks if the value of the field is `ENCODERTI1`"]
    #[inline]
    pub fn is_encoder_ti1(&self) -> bool {
        *self == SMSR::ENCODERTI1
    }
    #[doc = "Checks if the value of the field is `ENCODERTI1TI2`"]
    #[inline]
    pub fn is_encoder_ti1ti2(&self) -> bool {
        *self == SMSR::ENCODERTI1TI2
    }
    #[doc = "Checks if the value of the field is `RESET`"]
    #[inline]
    pub fn is_reset(&self) -> bool {
        *self == SMSR::RESET
    }
    #[doc = "Checks if the value of the field is `GATED`"]
    #[inline]
    pub fn is_gated(&self) -> bool {
        *self == SMSR::GATED
    }
    #[doc = "Checks if the value of the field is `TRIGGER`"]
    #[inline]
    pub fn is_trigger(&self) -> bool {
        *self == SMSR::TRIGGER
    }
    #[doc = "Checks if the value of the field is `EXTERNAL`"]
    #[inline]
    pub fn is_external(&self) -> bool {
        *self == SMSR::EXTERNAL
    }
}
#[doc = r" Proxy"]
pub struct _ETPW<'a> {
    w: &'a mut W,
}
impl<'a> _ETPW<'a> {
    #[doc = r" Sets the field bit"]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r" Clears the field bit"]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub fn bit(self, value: bool) -> &'a mut W {
        const MASK: bool = true;
        const OFFSET: u8 = 15;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = r" Proxy"]
pub struct _ECEW<'a> {
    w: &'a mut W,
}
impl<'a> _ECEW<'a> {
    #[doc = r" Sets the field bit"]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r" Clears the field bit"]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub fn bit(self, value: bool) -> &'a mut W {
        const MASK: bool = true;
        const OFFSET: u8 = 14;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = r" Proxy"]
pub struct _ETPSW<'a> {
    w: &'a mut W,
}
impl<'a> _ETPSW<'a> {
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        const MASK: u8 = 3;
        const OFFSET: u8 = 12;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = r" Proxy"]
pub struct _ETFW<'a> {
    w: &'a mut W,
}
impl<'a> _ETFW<'a> {
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        const MASK: u8 = 15;
        const OFFSET: u8 = 8;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = r" Proxy"]
pub struct _MSMW<'a> {
    w: &'a mut W,
}
impl<'a> _MSMW<'a> {
    #[doc = r" Sets the field bit"]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r" Clears the field bit"]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub fn bit(self, value: bool) -> &'a mut W {
        const MASK: bool = true;
        const OFFSET: u8 = 7;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = "Values that can be written to the field `TS`"]
pub enum TSW {
    #[doc = "Internal Trigger 0 (ITR0)"]
    ITR0,
    #[doc = "Internal Trigger 1 (ITR1)"]
    ITR1,
    #[doc = "Internal Trigger 2 (ITR2)"]
    ITR2,
    #[doc = "Internal Trigger 3 (ITR3)"]
    ITR3,
    #[doc = "TI1 Edge Detector"]
    TI1F_ED,
    #[doc = "Filtered Timer Input 1"]
    TI1FP1,
    #[doc = "Filtered Timer Input 2"]
    TI2FP2,
    #[doc = "External Trigger input"]
    ETRF,
}
impl TSW {
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _bits(&self) -> u8 {
        match *self {
            TSW::ITR0 => 0,
            TSW::ITR1 => 1,
            TSW::ITR2 => 2,
            TSW::ITR3 => 3,
            TSW::TI1F_ED => 4,
            TSW::TI1FP1 => 5,
            TSW::TI2FP2 => 6,
            TSW::ETRF => 7,
        }
    }
}
#[doc = r" Proxy"]
pub struct _TSW<'a> {
    w: &'a mut W,
}
impl<'a> _TSW<'a> {
    #[doc = r" Writes `variant` to the field"]
    #[inline]
    pub fn variant(self, variant: TSW) -> &'a mut W {
        {
            self.bits(variant._bits())
        }
    }
    #[doc = "Internal Trigger 0 (ITR0)"]
    #[inline]
    pub fn itr0(self) -> &'a mut W {
        self.variant(TSW::ITR0)
    }
    #[doc = "Internal Trigger 1 (ITR1)"]
    #[inline]
    pub fn itr1(self) -> &'a mut W {
        self.variant(TSW::ITR1)
    }
    #[doc = "Internal Trigger 2 (ITR2)"]
    #[inline]
    pub fn itr2(self) -> &'a mut W {
        self.variant(TSW::ITR2)
    }
    #[doc = "Internal Trigger 3 (ITR3)"]
    #[inline]
    pub fn itr3(self) -> &'a mut W {
        self.variant(TSW::ITR3)
    }
    #[doc = "TI1 Edge Detector"]
    #[inline]
    pub fn ti1f_ed(self) -> &'a mut W {
        self.variant(TSW::TI1F_ED)
    }
    #[doc = "Filtered Timer Input 1"]
    #[inline]
    pub fn ti1fp1(self) -> &'a mut W {
        self.variant(TSW::TI1FP1)
    }
    #[doc = "Filtered Timer Input 2"]
    #[inline]
    pub fn ti2fp2(self) -> &'a mut W {
        self.variant(TSW::TI2FP2)
    }
    #[doc = "External Trigger input"]
    #[inline]
    pub fn etrf(self) -> &'a mut W {
        self.variant(TSW::ETRF)
    }
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub fn bits(self, value: u8) -> &'a mut W {
        const MASK: u8 = 7;
        const OFFSET: u8 = 4;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = "Values that can be written to the field `SMS`"]
pub enum SMSW {
    #[doc = "Counter disabled"]
    DISABLED,
    #[doc = "Encoder mode, count up/down on TI2FP1"]
    ENCODERTI2,
    #[doc = "Encoder mode, count up/down on TI1FP2"]
    ENCODERTI1,
    #[doc = "Encoder mode, count up/down on both TI1FP1 and TI2FP2"]
    ENCODERTI1TI2,
    #[doc = "Rising edge of the selected trigger input (TRGI) reinitializes the counter"]
    RESET,
    #[doc = " The counter clock is enabled when the trigger input (TRGI) is high"]
    GATED,
    #[doc = "The counter starts at a rising edge of the trigger TRGI "]
    TRIGGER,
    #[doc = " Rising edges of the selected trigger (TRGI) clock the counter"]
    EXTERNAL,
}
impl SMSW {
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _bits(&self) -> u8 {
        match *self {
            SMSW::DISABLED => 0,
            SMSW::ENCODERTI2 => 1,
            SMSW::ENCODERTI1 => 2,
            SMSW::ENCODERTI1TI2 => 3,
            SMSW::RESET => 4,
            SMSW::GATED => 5,
            SMSW::TRIGGER => 6,
            SMSW::EXTERNAL => 7,
        }
    }
}
#[doc = r" Proxy"]
pub struct _SMSW<'a> {
    w: &'a mut W,
}
impl<'a> _SMSW<'a> {
    #[doc = r" Writes `variant` to the field"]
    #[inline]
    pub fn variant(self, variant: SMSW) -> &'a mut W {
        {
            self.bits(variant._bits())
        }
    }
    #[doc = "Counter disabled"]
    #[inline]
    pub fn disabled(self) -> &'a mut W {
        self.variant(SMSW::DISABLED)
    }
    #[doc = "Encoder mode, count up/down on TI2FP1"]
    #[inline]
    pub fn encoder_ti2(self) -> &'a mut W {
        self.variant(SMSW::ENCODERTI2)
    }
    #[doc = "Encoder mode, count up/down on TI1FP2"]
    #[inline]
    pub fn encoder_ti1(self) -> &'a mut W {
        self.variant(SMSW::ENCODERTI1)
    }
    #[doc = "Encoder mode, count up/down on both TI1FP1 and TI2FP2"]
    #[inline]
    pub fn encoder_ti1ti2(self) -> &'a mut W {
        self.variant(SMSW::ENCODERTI1TI2)
    }
    #[doc = "Rising edge of the selected trigger input (TRGI) reinitializes the counter"]
    #[inline]
    pub fn reset(self) -> &'a mut W {
        self.variant(SMSW::RESET)
    }
    #[doc = "The counter clock is enabled when the trigger input (TRGI) is high"]
    #[inline]
    pub fn gated(self) -> &'a mut W {
        self.variant(SMSW::GATED)
    }
    #[doc = "The counter starts at a rising edge of the trigger TRGI"]
    #[inline]
    pub fn trigger(self) -> &'a mut W {
        self.variant(SMSW::TRIGGER)
    }
    #[doc = "Rising edges of the selected trigger (TRGI) clock the counter"]
    #[inline]
    pub fn external(self) -> &'a mut W {
        self.variant(SMSW::EXTERNAL)
    }
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub fn bits(self, value: u8) -> &'a mut W {
        const MASK: u8 = 7;
        const OFFSET: u8 = 0;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
impl R {
    #[doc = r" Value of the register as raw bits"]
    #[inline]
    pub fn bits(&self) -> u32 {
        self.bits
    }
    #[doc = "Bit 15 - External trigger polarity"]
    #[inline]
    pub fn etp(&self) -> ETPR {
        let bits = {
            const MASK: bool = true;
            const OFFSET: u8 = 15;
            ((self.bits >> OFFSET) & MASK as u32) != 0
        };
        ETPR { bits }
    }
    #[doc = "Bit 14 - External clock enable"]
    #[inline]
    pub fn ece(&self) -> ECER {
        let bits = {
            const MASK: bool = true;
            const OFFSET: u8 = 14;
            ((self.bits >> OFFSET) & MASK as u32) != 0
        };
        ECER { bits }
    }
    #[doc = "Bits 12:13 - External trigger prescaler"]
    #[inline]
    pub fn etps(&self) -> ETPSR {
        let bits = {
            const MASK: u8 = 3;
            const OFFSET: u8 = 12;
            ((self.bits >> OFFSET) & MASK as u32) as u8
        };
        ETPSR { bits }
    }
    #[doc = "Bits 8:11 - External trigger filter"]
    #[inline]
    pub fn etf(&self) -> ETFR {
        let bits = {
            const MASK: u8 = 15;
            const OFFSET: u8 = 8;
            ((self.bits >> OFFSET) & MASK as u32) as u8
        };
        ETFR { bits }
    }
    #[doc = "Bit 7 - Master/Slave mode"]
    #[inline]
    pub fn msm(&self) -> MSMR {
        let bits = {
            const MASK: bool = true;
            const OFFSET: u8 = 7;
            ((self.bits >> OFFSET) & MASK as u32) != 0
        };
        MSMR { bits }
    }
    #[doc = "Bits 4:6 - Trigger selection"]
    #[inline]
    pub fn ts(&self) -> TSR {
        TSR::_from({
            const MASK: u8 = 7;
            const OFFSET: u8 = 4;
            ((self.bits >> OFFSET) & MASK as u32) as u8
        })
    }
    #[doc = "Bits 0:2 - Slave mode selection"]
    #[inline]
    pub fn sms(&self) -> SMSR {
        SMSR::_from({
            const MASK: u8 = 7;
            const OFFSET: u8 = 0;
            ((self.bits >> OFFSET) & MASK as u32) as u8
        })
    }
}
impl W {
    #[doc = r" Reset value of the register"]
    #[inline]
    pub fn reset_value() -> W {
        W { bits: 0 }
    }
    #[doc = r" Writes raw bits to the register"]
    #[inline]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.bits = bits;
        self
    }
    #[doc = "Bit 15 - External trigger polarity"]
    #[inline]
    pub fn etp(&mut self) -> _ETPW {
        _ETPW { w: self }
    }
    #[doc = "Bit 14 - External clock enable"]
    #[inline]
    pub fn ece(&mut self) -> _ECEW {
        _ECEW { w: self }
    }
    #[doc = "Bits 12:13 - External trigger prescaler"]
    #[inline]
    pub fn etps(&mut self) -> _ETPSW {
        _ETPSW { w: self }
    }
    #[doc = "Bits 8:11 - External trigger filter"]
    #[inline]
    pub fn etf(&mut self) -> _ETFW {
        _ETFW { w: self }
    }
    #[doc = "Bit 7 - Master/Slave mode"]
    #[inline]
    pub fn msm(&mut self) -> _MSMW {
        _MSMW { w: self }
    }
    #[doc = "Bits 4:6 - Trigger selection"]
    #[inline]
    pub fn ts(&mut self) -> _TSW {
        _TSW { w: self }
    }
    #[doc = "Bits 0:2 - Slave mode selection"]
    #[inline]
    pub fn sms(&mut self) -> _SMSW {
        _SMSW { w: self }
    }
}