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
#[doc = "Reader of register QEPCTL"]
pub type R = crate::R<u32, super::QEPCTL>;
#[doc = "Writer for register QEPCTL"]
pub type W = crate::W<u32, super::QEPCTL>;
#[doc = "Register QEPCTL `reset()`'s with value 0"]
impl crate::ResetValue for super::QEPCTL {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Reader of field `WDE`"]
pub type WDE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WDE`"]
pub struct WDE_W<'a> {
    w: &'a mut W,
}
impl<'a> WDE_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
        self.w
    }
}
#[doc = "Reader of field `UTE`"]
pub type UTE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `UTE`"]
pub struct UTE_W<'a> {
    w: &'a mut W,
}
impl<'a> UTE_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
        self.w
    }
}
#[doc = "Reader of field `QCLM`"]
pub type QCLM_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `QCLM`"]
pub struct QCLM_W<'a> {
    w: &'a mut W,
}
impl<'a> QCLM_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
        self.w
    }
}
#[doc = "Reader of field `QPEN`"]
pub type QPEN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `QPEN`"]
pub struct QPEN_W<'a> {
    w: &'a mut W,
}
impl<'a> QPEN_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
        self.w
    }
}
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum IEL_A {
    #[doc = "0: no position counter latch"]
    NOLATCH,
    #[doc = "1: latch on index signal posedge"]
    INDPOS,
    #[doc = "2: latch on index signal negedge"]
    INDNEG,
    #[doc = "3: latch on index marker"]
    INDMARK,
}
impl From<IEL_A> for u8 {
    #[inline(always)]
    fn from(variant: IEL_A) -> Self {
        match variant {
            IEL_A::NOLATCH => 0,
            IEL_A::INDPOS => 1,
            IEL_A::INDNEG => 2,
            IEL_A::INDMARK => 3,
        }
    }
}
#[doc = "Reader of field `IEL`"]
pub type IEL_R = crate::R<u8, IEL_A>;
impl IEL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IEL_A {
        match self.bits {
            0 => IEL_A::NOLATCH,
            1 => IEL_A::INDPOS,
            2 => IEL_A::INDNEG,
            3 => IEL_A::INDMARK,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `NOLATCH`"]
    #[inline(always)]
    pub fn is_no_latch(&self) -> bool {
        *self == IEL_A::NOLATCH
    }
    #[doc = "Checks if the value of the field is `INDPOS`"]
    #[inline(always)]
    pub fn is_ind_pos(&self) -> bool {
        *self == IEL_A::INDPOS
    }
    #[doc = "Checks if the value of the field is `INDNEG`"]
    #[inline(always)]
    pub fn is_ind_neg(&self) -> bool {
        *self == IEL_A::INDNEG
    }
    #[doc = "Checks if the value of the field is `INDMARK`"]
    #[inline(always)]
    pub fn is_ind_mark(&self) -> bool {
        *self == IEL_A::INDMARK
    }
}
#[doc = "Write proxy for field `IEL`"]
pub struct IEL_W<'a> {
    w: &'a mut W,
}
impl<'a> IEL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IEL_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "no position counter latch"]
    #[inline(always)]
    pub fn no_latch(self) -> &'a mut W {
        self.variant(IEL_A::NOLATCH)
    }
    #[doc = "latch on index signal posedge"]
    #[inline(always)]
    pub fn ind_pos(self) -> &'a mut W {
        self.variant(IEL_A::INDPOS)
    }
    #[doc = "latch on index signal negedge"]
    #[inline(always)]
    pub fn ind_neg(self) -> &'a mut W {
        self.variant(IEL_A::INDNEG)
    }
    #[doc = "latch on index marker"]
    #[inline(always)]
    pub fn ind_mark(self) -> &'a mut W {
        self.variant(IEL_A::INDMARK)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4);
        self.w
    }
}
#[doc = "Reader of field `SEL`"]
pub type SEL_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SEL`"]
pub struct SEL_W<'a> {
    w: &'a mut W,
}
impl<'a> SEL_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
        self.w
    }
}
#[doc = "Reader of field `SWI`"]
pub type SWI_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SWI`"]
pub struct SWI_W<'a> {
    w: &'a mut W,
}
impl<'a> SWI_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
        self.w
    }
}
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum IEI_A {
    #[doc = "0: no initialization"]
    NOINIT,
    #[doc = "2: init on posedge QEPI"]
    QEPIPOS,
    #[doc = "3: init on negedge QEPI"]
    QEPINEG,
}
impl From<IEI_A> for u8 {
    #[inline(always)]
    fn from(variant: IEI_A) -> Self {
        match variant {
            IEI_A::NOINIT => 0,
            IEI_A::QEPIPOS => 2,
            IEI_A::QEPINEG => 3,
        }
    }
}
#[doc = "Reader of field `IEI`"]
pub type IEI_R = crate::R<u8, IEI_A>;
impl IEI_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, IEI_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(IEI_A::NOINIT),
            2 => Val(IEI_A::QEPIPOS),
            3 => Val(IEI_A::QEPINEG),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `NOINIT`"]
    #[inline(always)]
    pub fn is_no_init(&self) -> bool {
        *self == IEI_A::NOINIT
    }
    #[doc = "Checks if the value of the field is `QEPIPOS`"]
    #[inline(always)]
    pub fn is_qepipos(&self) -> bool {
        *self == IEI_A::QEPIPOS
    }
    #[doc = "Checks if the value of the field is `QEPINEG`"]
    #[inline(always)]
    pub fn is_qepineg(&self) -> bool {
        *self == IEI_A::QEPINEG
    }
}
#[doc = "Write proxy for field `IEI`"]
pub struct IEI_W<'a> {
    w: &'a mut W,
}
impl<'a> IEI_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: IEI_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "no initialization"]
    #[inline(always)]
    pub fn no_init(self) -> &'a mut W {
        self.variant(IEI_A::NOINIT)
    }
    #[doc = "init on posedge QEPI"]
    #[inline(always)]
    pub fn qepipos(self) -> &'a mut W {
        self.variant(IEI_A::QEPIPOS)
    }
    #[doc = "init on negedge QEPI"]
    #[inline(always)]
    pub fn qepineg(self) -> &'a mut W {
        self.variant(IEI_A::QEPINEG)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8);
        self.w
    }
}
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SEI_A {
    #[doc = "0: no initialization"]
    NOINIT,
    #[doc = "2: init on posedge QEPI"]
    QEPSPOS,
    #[doc = "3: init depends on direction - on posedge if direction is up, on negedge if direction is down"]
    QEPSDIR,
}
impl From<SEI_A> for u8 {
    #[inline(always)]
    fn from(variant: SEI_A) -> Self {
        match variant {
            SEI_A::NOINIT => 0,
            SEI_A::QEPSPOS => 2,
            SEI_A::QEPSDIR => 3,
        }
    }
}
#[doc = "Reader of field `SEI`"]
pub type SEI_R = crate::R<u8, SEI_A>;
impl SEI_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, SEI_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(SEI_A::NOINIT),
            2 => Val(SEI_A::QEPSPOS),
            3 => Val(SEI_A::QEPSDIR),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `NOINIT`"]
    #[inline(always)]
    pub fn is_no_init(&self) -> bool {
        *self == SEI_A::NOINIT
    }
    #[doc = "Checks if the value of the field is `QEPSPOS`"]
    #[inline(always)]
    pub fn is_qepspos(&self) -> bool {
        *self == SEI_A::QEPSPOS
    }
    #[doc = "Checks if the value of the field is `QEPSDIR`"]
    #[inline(always)]
    pub fn is_qepsdir(&self) -> bool {
        *self == SEI_A::QEPSDIR
    }
}
#[doc = "Write proxy for field `SEI`"]
pub struct SEI_W<'a> {
    w: &'a mut W,
}
impl<'a> SEI_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: SEI_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "no initialization"]
    #[inline(always)]
    pub fn no_init(self) -> &'a mut W {
        self.variant(SEI_A::NOINIT)
    }
    #[doc = "init on posedge QEPI"]
    #[inline(always)]
    pub fn qepspos(self) -> &'a mut W {
        self.variant(SEI_A::QEPSPOS)
    }
    #[doc = "init depends on direction - on posedge if direction is up, on negedge if direction is down"]
    #[inline(always)]
    pub fn qepsdir(self) -> &'a mut W {
        self.variant(SEI_A::QEPSDIR)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10);
        self.w
    }
}
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PCRM_A {
    #[doc = "0: reset on index"]
    IND,
    #[doc = "1: reset on max position count"]
    POSMAX,
    #[doc = "2: reset on the first index"]
    FIRSTIND,
    #[doc = "3: reset on time counter"]
    TIME,
}
impl From<PCRM_A> for u8 {
    #[inline(always)]
    fn from(variant: PCRM_A) -> Self {
        match variant {
            PCRM_A::IND => 0,
            PCRM_A::POSMAX => 1,
            PCRM_A::FIRSTIND => 2,
            PCRM_A::TIME => 3,
        }
    }
}
#[doc = "Reader of field `PCRM`"]
pub type PCRM_R = crate::R<u8, PCRM_A>;
impl PCRM_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PCRM_A {
        match self.bits {
            0 => PCRM_A::IND,
            1 => PCRM_A::POSMAX,
            2 => PCRM_A::FIRSTIND,
            3 => PCRM_A::TIME,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `IND`"]
    #[inline(always)]
    pub fn is_ind(&self) -> bool {
        *self == PCRM_A::IND
    }
    #[doc = "Checks if the value of the field is `POSMAX`"]
    #[inline(always)]
    pub fn is_pos_max(&self) -> bool {
        *self == PCRM_A::POSMAX
    }
    #[doc = "Checks if the value of the field is `FIRSTIND`"]
    #[inline(always)]
    pub fn is_first_ind(&self) -> bool {
        *self == PCRM_A::FIRSTIND
    }
    #[doc = "Checks if the value of the field is `TIME`"]
    #[inline(always)]
    pub fn is_time(&self) -> bool {
        *self == PCRM_A::TIME
    }
}
#[doc = "Write proxy for field `PCRM`"]
pub struct PCRM_W<'a> {
    w: &'a mut W,
}
impl<'a> PCRM_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: PCRM_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "reset on index"]
    #[inline(always)]
    pub fn ind(self) -> &'a mut W {
        self.variant(PCRM_A::IND)
    }
    #[doc = "reset on max position count"]
    #[inline(always)]
    pub fn pos_max(self) -> &'a mut W {
        self.variant(PCRM_A::POSMAX)
    }
    #[doc = "reset on the first index"]
    #[inline(always)]
    pub fn first_ind(self) -> &'a mut W {
        self.variant(PCRM_A::FIRSTIND)
    }
    #[doc = "reset on time counter"]
    #[inline(always)]
    pub fn time(self) -> &'a mut W {
        self.variant(PCRM_A::TIME)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12);
        self.w
    }
}
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FREE_SOFT_A {
    #[doc = "0: counters are blocked"]
    STOP,
    #[doc = "1: stop after overflow"]
    STOPATOVF,
    #[doc = "2: no count stop in debug mode"]
    FREE,
}
impl From<FREE_SOFT_A> for u8 {
    #[inline(always)]
    fn from(variant: FREE_SOFT_A) -> Self {
        match variant {
            FREE_SOFT_A::STOP => 0,
            FREE_SOFT_A::STOPATOVF => 1,
            FREE_SOFT_A::FREE => 2,
        }
    }
}
#[doc = "Reader of field `FREE_SOFT`"]
pub type FREE_SOFT_R = crate::R<u8, FREE_SOFT_A>;
impl FREE_SOFT_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, FREE_SOFT_A> {
        use crate::Variant::*;
        match self.bits {
            0 => Val(FREE_SOFT_A::STOP),
            1 => Val(FREE_SOFT_A::STOPATOVF),
            2 => Val(FREE_SOFT_A::FREE),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `STOP`"]
    #[inline(always)]
    pub fn is_stop(&self) -> bool {
        *self == FREE_SOFT_A::STOP
    }
    #[doc = "Checks if the value of the field is `STOPATOVF`"]
    #[inline(always)]
    pub fn is_stop_at_ovf(&self) -> bool {
        *self == FREE_SOFT_A::STOPATOVF
    }
    #[doc = "Checks if the value of the field is `FREE`"]
    #[inline(always)]
    pub fn is_free(&self) -> bool {
        *self == FREE_SOFT_A::FREE
    }
}
#[doc = "Write proxy for field `FREE_SOFT`"]
pub struct FREE_SOFT_W<'a> {
    w: &'a mut W,
}
impl<'a> FREE_SOFT_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: FREE_SOFT_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "counters are blocked"]
    #[inline(always)]
    pub fn stop(self) -> &'a mut W {
        self.variant(FREE_SOFT_A::STOP)
    }
    #[doc = "stop after overflow"]
    #[inline(always)]
    pub fn stop_at_ovf(self) -> &'a mut W {
        self.variant(FREE_SOFT_A::STOPATOVF)
    }
    #[doc = "no count stop in debug mode"]
    #[inline(always)]
    pub fn free(self) -> &'a mut W {
        self.variant(FREE_SOFT_A::FREE)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14);
        self.w
    }
}
impl R {
    #[doc = "Bit 0 - enable watchdog timer"]
    #[inline(always)]
    pub fn wde(&self) -> WDE_R {
        WDE_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 1 - enable time reading timer"]
    #[inline(always)]
    pub fn ute(&self) -> UTE_R {
        UTE_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 2 - save countposition meaning"]
    #[inline(always)]
    pub fn qclm(&self) -> QCLM_R {
        QCLM_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bit 3 - reset meaning countposition"]
    #[inline(always)]
    pub fn qpen(&self) -> QPEN_R {
        QPEN_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bits 4:5"]
    #[inline(always)]
    pub fn iel(&self) -> IEL_R {
        IEL_R::new(((self.bits >> 4) & 0x03) as u8)
    }
    #[doc = "Bit 6 - sttobevent"]
    #[inline(always)]
    pub fn sel(&self) -> SEL_R {
        SEL_R::new(((self.bits >> 6) & 0x01) != 0)
    }
    #[doc = "Bit 7 - enable positioncount"]
    #[inline(always)]
    pub fn swi(&self) -> SWI_R {
        SWI_R::new(((self.bits >> 7) & 0x01) != 0)
    }
    #[doc = "Bits 8:9"]
    #[inline(always)]
    pub fn iei(&self) -> IEI_R {
        IEI_R::new(((self.bits >> 8) & 0x03) as u8)
    }
    #[doc = "Bits 10:11"]
    #[inline(always)]
    pub fn sei(&self) -> SEI_R {
        SEI_R::new(((self.bits >> 10) & 0x03) as u8)
    }
    #[doc = "Bits 12:13"]
    #[inline(always)]
    pub fn pcrm(&self) -> PCRM_R {
        PCRM_R::new(((self.bits >> 12) & 0x03) as u8)
    }
    #[doc = "Bits 14:15"]
    #[inline(always)]
    pub fn free_soft(&self) -> FREE_SOFT_R {
        FREE_SOFT_R::new(((self.bits >> 14) & 0x03) as u8)
    }
}
impl W {
    #[doc = "Bit 0 - enable watchdog timer"]
    #[inline(always)]
    pub fn wde(&mut self) -> WDE_W {
        WDE_W { w: self }
    }
    #[doc = "Bit 1 - enable time reading timer"]
    #[inline(always)]
    pub fn ute(&mut self) -> UTE_W {
        UTE_W { w: self }
    }
    #[doc = "Bit 2 - save countposition meaning"]
    #[inline(always)]
    pub fn qclm(&mut self) -> QCLM_W {
        QCLM_W { w: self }
    }
    #[doc = "Bit 3 - reset meaning countposition"]
    #[inline(always)]
    pub fn qpen(&mut self) -> QPEN_W {
        QPEN_W { w: self }
    }
    #[doc = "Bits 4:5"]
    #[inline(always)]
    pub fn iel(&mut self) -> IEL_W {
        IEL_W { w: self }
    }
    #[doc = "Bit 6 - sttobevent"]
    #[inline(always)]
    pub fn sel(&mut self) -> SEL_W {
        SEL_W { w: self }
    }
    #[doc = "Bit 7 - enable positioncount"]
    #[inline(always)]
    pub fn swi(&mut self) -> SWI_W {
        SWI_W { w: self }
    }
    #[doc = "Bits 8:9"]
    #[inline(always)]
    pub fn iei(&mut self) -> IEI_W {
        IEI_W { w: self }
    }
    #[doc = "Bits 10:11"]
    #[inline(always)]
    pub fn sei(&mut self) -> SEI_W {
        SEI_W { w: self }
    }
    #[doc = "Bits 12:13"]
    #[inline(always)]
    pub fn pcrm(&mut self) -> PCRM_W {
        PCRM_W { w: self }
    }
    #[doc = "Bits 14:15"]
    #[inline(always)]
    pub fn free_soft(&mut self) -> FREE_SOFT_W {
        FREE_SOFT_W { w: self }
    }
}