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
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
#[doc = "Reader of register C6"]
pub type R = crate::R<u8, super::C6>;
#[doc = "Writer for register C6"]
pub type W = crate::W<u8, super::C6>;
#[doc = "Register C6 `reset()`'s with value 0"]
impl crate::ResetValue for super::C6 {
    type Type = u8;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Possible values of the field `VDIV0`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum VDIV0_A {
    #[doc = "Multiply Factor is 24"]
    _0,
    #[doc = "Multiply Factor is 25"]
    _1,
    #[doc = "Multiply Factor is 26"]
    _2,
    #[doc = "Multiply Factor is 27"]
    _3,
    #[doc = "Multiply Factor is 28"]
    _4,
    #[doc = "Multiply Factor is 29"]
    _5,
    #[doc = "Multiply Factor is 30"]
    _6,
    #[doc = "Multiply Factor is 31"]
    _7,
    #[doc = "Multiply Factor is 32"]
    _8,
    #[doc = "Multiply Factor is 33"]
    _9,
    #[doc = "Multiply Factor is 34"]
    _10,
    #[doc = "Multiply Factor is 35"]
    _11,
    #[doc = "Multiply Factor is 36"]
    _12,
    #[doc = "Multiply Factor is 37"]
    _13,
    #[doc = "Multiply Factor is 38"]
    _14,
    #[doc = "Multiply Factor is 39"]
    _15,
    #[doc = "Multiply Factor is 40"]
    _16,
    #[doc = "Multiply Factor is 41"]
    _17,
    #[doc = "Multiply Factor is 42"]
    _18,
    #[doc = "Multiply Factor is 43"]
    _19,
    #[doc = "Multiply Factor is 44"]
    _20,
    #[doc = "Multiply Factor is 45"]
    _21,
    #[doc = "Multiply Factor is 46"]
    _22,
    #[doc = "Multiply Factor is 47"]
    _23,
    #[doc = "Multiply Factor is 48"]
    _24,
    #[doc = "Multiply Factor is 49"]
    _25,
    #[doc = "Multiply Factor is 50"]
    _26,
    #[doc = "Multiply Factor is 51"]
    _27,
    #[doc = "Multiply Factor is 52"]
    _28,
    #[doc = "Multiply Factor is 53"]
    _29,
    #[doc = "Multiply Factor is 54"]
    _30,
    #[doc = "Multiply Factor is 55"]
    _31,
}
impl crate::ToBits<u8> for VDIV0_A {
    #[inline(always)]
    fn _bits(&self) -> u8 {
        match *self {
            VDIV0_A::_0 => 0,
            VDIV0_A::_1 => 1,
            VDIV0_A::_2 => 2,
            VDIV0_A::_3 => 3,
            VDIV0_A::_4 => 4,
            VDIV0_A::_5 => 5,
            VDIV0_A::_6 => 6,
            VDIV0_A::_7 => 7,
            VDIV0_A::_8 => 8,
            VDIV0_A::_9 => 9,
            VDIV0_A::_10 => 10,
            VDIV0_A::_11 => 11,
            VDIV0_A::_12 => 12,
            VDIV0_A::_13 => 13,
            VDIV0_A::_14 => 14,
            VDIV0_A::_15 => 15,
            VDIV0_A::_16 => 16,
            VDIV0_A::_17 => 17,
            VDIV0_A::_18 => 18,
            VDIV0_A::_19 => 19,
            VDIV0_A::_20 => 20,
            VDIV0_A::_21 => 21,
            VDIV0_A::_22 => 22,
            VDIV0_A::_23 => 23,
            VDIV0_A::_24 => 24,
            VDIV0_A::_25 => 25,
            VDIV0_A::_26 => 26,
            VDIV0_A::_27 => 27,
            VDIV0_A::_28 => 28,
            VDIV0_A::_29 => 29,
            VDIV0_A::_30 => 30,
            VDIV0_A::_31 => 31,
        }
    }
}
#[doc = "Reader of field `VDIV0`"]
pub type VDIV0_R = crate::R<u8, VDIV0_A>;
impl VDIV0_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VDIV0_A {
        match self.bits {
            0 => VDIV0_A::_0,
            1 => VDIV0_A::_1,
            2 => VDIV0_A::_2,
            3 => VDIV0_A::_3,
            4 => VDIV0_A::_4,
            5 => VDIV0_A::_5,
            6 => VDIV0_A::_6,
            7 => VDIV0_A::_7,
            8 => VDIV0_A::_8,
            9 => VDIV0_A::_9,
            10 => VDIV0_A::_10,
            11 => VDIV0_A::_11,
            12 => VDIV0_A::_12,
            13 => VDIV0_A::_13,
            14 => VDIV0_A::_14,
            15 => VDIV0_A::_15,
            16 => VDIV0_A::_16,
            17 => VDIV0_A::_17,
            18 => VDIV0_A::_18,
            19 => VDIV0_A::_19,
            20 => VDIV0_A::_20,
            21 => VDIV0_A::_21,
            22 => VDIV0_A::_22,
            23 => VDIV0_A::_23,
            24 => VDIV0_A::_24,
            25 => VDIV0_A::_25,
            26 => VDIV0_A::_26,
            27 => VDIV0_A::_27,
            28 => VDIV0_A::_28,
            29 => VDIV0_A::_29,
            30 => VDIV0_A::_30,
            31 => VDIV0_A::_31,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == VDIV0_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == VDIV0_A::_1
    }
    #[doc = "Checks if the value of the field is `_2`"]
    #[inline(always)]
    pub fn is_2(&self) -> bool {
        *self == VDIV0_A::_2
    }
    #[doc = "Checks if the value of the field is `_3`"]
    #[inline(always)]
    pub fn is_3(&self) -> bool {
        *self == VDIV0_A::_3
    }
    #[doc = "Checks if the value of the field is `_4`"]
    #[inline(always)]
    pub fn is_4(&self) -> bool {
        *self == VDIV0_A::_4
    }
    #[doc = "Checks if the value of the field is `_5`"]
    #[inline(always)]
    pub fn is_5(&self) -> bool {
        *self == VDIV0_A::_5
    }
    #[doc = "Checks if the value of the field is `_6`"]
    #[inline(always)]
    pub fn is_6(&self) -> bool {
        *self == VDIV0_A::_6
    }
    #[doc = "Checks if the value of the field is `_7`"]
    #[inline(always)]
    pub fn is_7(&self) -> bool {
        *self == VDIV0_A::_7
    }
    #[doc = "Checks if the value of the field is `_8`"]
    #[inline(always)]
    pub fn is_8(&self) -> bool {
        *self == VDIV0_A::_8
    }
    #[doc = "Checks if the value of the field is `_9`"]
    #[inline(always)]
    pub fn is_9(&self) -> bool {
        *self == VDIV0_A::_9
    }
    #[doc = "Checks if the value of the field is `_10`"]
    #[inline(always)]
    pub fn is_10(&self) -> bool {
        *self == VDIV0_A::_10
    }
    #[doc = "Checks if the value of the field is `_11`"]
    #[inline(always)]
    pub fn is_11(&self) -> bool {
        *self == VDIV0_A::_11
    }
    #[doc = "Checks if the value of the field is `_12`"]
    #[inline(always)]
    pub fn is_12(&self) -> bool {
        *self == VDIV0_A::_12
    }
    #[doc = "Checks if the value of the field is `_13`"]
    #[inline(always)]
    pub fn is_13(&self) -> bool {
        *self == VDIV0_A::_13
    }
    #[doc = "Checks if the value of the field is `_14`"]
    #[inline(always)]
    pub fn is_14(&self) -> bool {
        *self == VDIV0_A::_14
    }
    #[doc = "Checks if the value of the field is `_15`"]
    #[inline(always)]
    pub fn is_15(&self) -> bool {
        *self == VDIV0_A::_15
    }
    #[doc = "Checks if the value of the field is `_16`"]
    #[inline(always)]
    pub fn is_16(&self) -> bool {
        *self == VDIV0_A::_16
    }
    #[doc = "Checks if the value of the field is `_17`"]
    #[inline(always)]
    pub fn is_17(&self) -> bool {
        *self == VDIV0_A::_17
    }
    #[doc = "Checks if the value of the field is `_18`"]
    #[inline(always)]
    pub fn is_18(&self) -> bool {
        *self == VDIV0_A::_18
    }
    #[doc = "Checks if the value of the field is `_19`"]
    #[inline(always)]
    pub fn is_19(&self) -> bool {
        *self == VDIV0_A::_19
    }
    #[doc = "Checks if the value of the field is `_20`"]
    #[inline(always)]
    pub fn is_20(&self) -> bool {
        *self == VDIV0_A::_20
    }
    #[doc = "Checks if the value of the field is `_21`"]
    #[inline(always)]
    pub fn is_21(&self) -> bool {
        *self == VDIV0_A::_21
    }
    #[doc = "Checks if the value of the field is `_22`"]
    #[inline(always)]
    pub fn is_22(&self) -> bool {
        *self == VDIV0_A::_22
    }
    #[doc = "Checks if the value of the field is `_23`"]
    #[inline(always)]
    pub fn is_23(&self) -> bool {
        *self == VDIV0_A::_23
    }
    #[doc = "Checks if the value of the field is `_24`"]
    #[inline(always)]
    pub fn is_24(&self) -> bool {
        *self == VDIV0_A::_24
    }
    #[doc = "Checks if the value of the field is `_25`"]
    #[inline(always)]
    pub fn is_25(&self) -> bool {
        *self == VDIV0_A::_25
    }
    #[doc = "Checks if the value of the field is `_26`"]
    #[inline(always)]
    pub fn is_26(&self) -> bool {
        *self == VDIV0_A::_26
    }
    #[doc = "Checks if the value of the field is `_27`"]
    #[inline(always)]
    pub fn is_27(&self) -> bool {
        *self == VDIV0_A::_27
    }
    #[doc = "Checks if the value of the field is `_28`"]
    #[inline(always)]
    pub fn is_28(&self) -> bool {
        *self == VDIV0_A::_28
    }
    #[doc = "Checks if the value of the field is `_29`"]
    #[inline(always)]
    pub fn is_29(&self) -> bool {
        *self == VDIV0_A::_29
    }
    #[doc = "Checks if the value of the field is `_30`"]
    #[inline(always)]
    pub fn is_30(&self) -> bool {
        *self == VDIV0_A::_30
    }
    #[doc = "Checks if the value of the field is `_31`"]
    #[inline(always)]
    pub fn is_31(&self) -> bool {
        *self == VDIV0_A::_31
    }
}
#[doc = "Write proxy for field `VDIV0`"]
pub struct VDIV0_W<'a> {
    w: &'a mut W,
}
impl<'a> VDIV0_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: VDIV0_A) -> &'a mut W {
        use crate::ToBits;
        {
            self.bits(variant._bits())
        }
    }
    #[doc = "Multiply Factor is 24"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(VDIV0_A::_0)
    }
    #[doc = "Multiply Factor is 25"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(VDIV0_A::_1)
    }
    #[doc = "Multiply Factor is 26"]
    #[inline(always)]
    pub fn _2(self) -> &'a mut W {
        self.variant(VDIV0_A::_2)
    }
    #[doc = "Multiply Factor is 27"]
    #[inline(always)]
    pub fn _3(self) -> &'a mut W {
        self.variant(VDIV0_A::_3)
    }
    #[doc = "Multiply Factor is 28"]
    #[inline(always)]
    pub fn _4(self) -> &'a mut W {
        self.variant(VDIV0_A::_4)
    }
    #[doc = "Multiply Factor is 29"]
    #[inline(always)]
    pub fn _5(self) -> &'a mut W {
        self.variant(VDIV0_A::_5)
    }
    #[doc = "Multiply Factor is 30"]
    #[inline(always)]
    pub fn _6(self) -> &'a mut W {
        self.variant(VDIV0_A::_6)
    }
    #[doc = "Multiply Factor is 31"]
    #[inline(always)]
    pub fn _7(self) -> &'a mut W {
        self.variant(VDIV0_A::_7)
    }
    #[doc = "Multiply Factor is 32"]
    #[inline(always)]
    pub fn _8(self) -> &'a mut W {
        self.variant(VDIV0_A::_8)
    }
    #[doc = "Multiply Factor is 33"]
    #[inline(always)]
    pub fn _9(self) -> &'a mut W {
        self.variant(VDIV0_A::_9)
    }
    #[doc = "Multiply Factor is 34"]
    #[inline(always)]
    pub fn _10(self) -> &'a mut W {
        self.variant(VDIV0_A::_10)
    }
    #[doc = "Multiply Factor is 35"]
    #[inline(always)]
    pub fn _11(self) -> &'a mut W {
        self.variant(VDIV0_A::_11)
    }
    #[doc = "Multiply Factor is 36"]
    #[inline(always)]
    pub fn _12(self) -> &'a mut W {
        self.variant(VDIV0_A::_12)
    }
    #[doc = "Multiply Factor is 37"]
    #[inline(always)]
    pub fn _13(self) -> &'a mut W {
        self.variant(VDIV0_A::_13)
    }
    #[doc = "Multiply Factor is 38"]
    #[inline(always)]
    pub fn _14(self) -> &'a mut W {
        self.variant(VDIV0_A::_14)
    }
    #[doc = "Multiply Factor is 39"]
    #[inline(always)]
    pub fn _15(self) -> &'a mut W {
        self.variant(VDIV0_A::_15)
    }
    #[doc = "Multiply Factor is 40"]
    #[inline(always)]
    pub fn _16(self) -> &'a mut W {
        self.variant(VDIV0_A::_16)
    }
    #[doc = "Multiply Factor is 41"]
    #[inline(always)]
    pub fn _17(self) -> &'a mut W {
        self.variant(VDIV0_A::_17)
    }
    #[doc = "Multiply Factor is 42"]
    #[inline(always)]
    pub fn _18(self) -> &'a mut W {
        self.variant(VDIV0_A::_18)
    }
    #[doc = "Multiply Factor is 43"]
    #[inline(always)]
    pub fn _19(self) -> &'a mut W {
        self.variant(VDIV0_A::_19)
    }
    #[doc = "Multiply Factor is 44"]
    #[inline(always)]
    pub fn _20(self) -> &'a mut W {
        self.variant(VDIV0_A::_20)
    }
    #[doc = "Multiply Factor is 45"]
    #[inline(always)]
    pub fn _21(self) -> &'a mut W {
        self.variant(VDIV0_A::_21)
    }
    #[doc = "Multiply Factor is 46"]
    #[inline(always)]
    pub fn _22(self) -> &'a mut W {
        self.variant(VDIV0_A::_22)
    }
    #[doc = "Multiply Factor is 47"]
    #[inline(always)]
    pub fn _23(self) -> &'a mut W {
        self.variant(VDIV0_A::_23)
    }
    #[doc = "Multiply Factor is 48"]
    #[inline(always)]
    pub fn _24(self) -> &'a mut W {
        self.variant(VDIV0_A::_24)
    }
    #[doc = "Multiply Factor is 49"]
    #[inline(always)]
    pub fn _25(self) -> &'a mut W {
        self.variant(VDIV0_A::_25)
    }
    #[doc = "Multiply Factor is 50"]
    #[inline(always)]
    pub fn _26(self) -> &'a mut W {
        self.variant(VDIV0_A::_26)
    }
    #[doc = "Multiply Factor is 51"]
    #[inline(always)]
    pub fn _27(self) -> &'a mut W {
        self.variant(VDIV0_A::_27)
    }
    #[doc = "Multiply Factor is 52"]
    #[inline(always)]
    pub fn _28(self) -> &'a mut W {
        self.variant(VDIV0_A::_28)
    }
    #[doc = "Multiply Factor is 53"]
    #[inline(always)]
    pub fn _29(self) -> &'a mut W {
        self.variant(VDIV0_A::_29)
    }
    #[doc = "Multiply Factor is 54"]
    #[inline(always)]
    pub fn _30(self) -> &'a mut W {
        self.variant(VDIV0_A::_30)
    }
    #[doc = "Multiply Factor is 55"]
    #[inline(always)]
    pub fn _31(self) -> &'a mut W {
        self.variant(VDIV0_A::_31)
    }
    #[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 & !0x1f) | ((value as u8) & 0x1f);
        self.w
    }
}
#[doc = "Possible values of the field `CME0`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CME0_A {
    #[doc = "External clock monitor is disabled for OSC0."]
    _0,
    #[doc = "External clock monitor is enabled for OSC0."]
    _1,
}
impl crate::ToBits<bool> for CME0_A {
    #[inline(always)]
    fn _bits(&self) -> bool {
        match *self {
            CME0_A::_0 => false,
            CME0_A::_1 => true,
        }
    }
}
#[doc = "Reader of field `CME0`"]
pub type CME0_R = crate::R<bool, CME0_A>;
impl CME0_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CME0_A {
        match self.bits {
            false => CME0_A::_0,
            true => CME0_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == CME0_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == CME0_A::_1
    }
}
#[doc = "Write proxy for field `CME0`"]
pub struct CME0_W<'a> {
    w: &'a mut W,
}
impl<'a> CME0_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CME0_A) -> &'a mut W {
        use crate::ToBits;
        {
            self.bit(variant._bits())
        }
    }
    #[doc = "External clock monitor is disabled for OSC0."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(CME0_A::_0)
    }
    #[doc = "External clock monitor is enabled for OSC0."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(CME0_A::_1)
    }
    #[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 << 5)) | (((value as u8) & 0x01) << 5);
        self.w
    }
}
#[doc = "Possible values of the field `PLLS`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PLLS_A {
    #[doc = "FLL is selected."]
    _0,
    #[doc = "PLL is selected (PRDIV 0 need to be programmed to the correct divider to generate a PLL reference clock in the range of 2-4 MHz prior to setting the PLLS bit)."]
    _1,
}
impl crate::ToBits<bool> for PLLS_A {
    #[inline(always)]
    fn _bits(&self) -> bool {
        match *self {
            PLLS_A::_0 => false,
            PLLS_A::_1 => true,
        }
    }
}
#[doc = "Reader of field `PLLS`"]
pub type PLLS_R = crate::R<bool, PLLS_A>;
impl PLLS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PLLS_A {
        match self.bits {
            false => PLLS_A::_0,
            true => PLLS_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == PLLS_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == PLLS_A::_1
    }
}
#[doc = "Write proxy for field `PLLS`"]
pub struct PLLS_W<'a> {
    w: &'a mut W,
}
impl<'a> PLLS_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: PLLS_A) -> &'a mut W {
        use crate::ToBits;
        {
            self.bit(variant._bits())
        }
    }
    #[doc = "FLL is selected."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(PLLS_A::_0)
    }
    #[doc = "PLL is selected (PRDIV 0 need to be programmed to the correct divider to generate a PLL reference clock in the range of 2-4 MHz prior to setting the PLLS bit)."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(PLLS_A::_1)
    }
    #[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 u8) & 0x01) << 6);
        self.w
    }
}
#[doc = "Possible values of the field `LOLIE0`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LOLIE0_A {
    #[doc = "No interrupt request is generated on loss of lock."]
    _0,
    #[doc = "Generate an interrupt request on loss of lock."]
    _1,
}
impl crate::ToBits<bool> for LOLIE0_A {
    #[inline(always)]
    fn _bits(&self) -> bool {
        match *self {
            LOLIE0_A::_0 => false,
            LOLIE0_A::_1 => true,
        }
    }
}
#[doc = "Reader of field `LOLIE0`"]
pub type LOLIE0_R = crate::R<bool, LOLIE0_A>;
impl LOLIE0_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> LOLIE0_A {
        match self.bits {
            false => LOLIE0_A::_0,
            true => LOLIE0_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == LOLIE0_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == LOLIE0_A::_1
    }
}
#[doc = "Write proxy for field `LOLIE0`"]
pub struct LOLIE0_W<'a> {
    w: &'a mut W,
}
impl<'a> LOLIE0_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: LOLIE0_A) -> &'a mut W {
        use crate::ToBits;
        {
            self.bit(variant._bits())
        }
    }
    #[doc = "No interrupt request is generated on loss of lock."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(LOLIE0_A::_0)
    }
    #[doc = "Generate an interrupt request on loss of lock."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(LOLIE0_A::_1)
    }
    #[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 u8) & 0x01) << 7);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:4 - VCO 0 Divider"]
    #[inline(always)]
    pub fn vdiv0(&self) -> VDIV0_R {
        VDIV0_R::new((self.bits & 0x1f) as u8)
    }
    #[doc = "Bit 5 - Clock Monitor Enable"]
    #[inline(always)]
    pub fn cme0(&self) -> CME0_R {
        CME0_R::new(((self.bits >> 5) & 0x01) != 0)
    }
    #[doc = "Bit 6 - PLL Select"]
    #[inline(always)]
    pub fn plls(&self) -> PLLS_R {
        PLLS_R::new(((self.bits >> 6) & 0x01) != 0)
    }
    #[doc = "Bit 7 - Loss of Lock Interrrupt Enable"]
    #[inline(always)]
    pub fn lolie0(&self) -> LOLIE0_R {
        LOLIE0_R::new(((self.bits >> 7) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 0:4 - VCO 0 Divider"]
    #[inline(always)]
    pub fn vdiv0(&mut self) -> VDIV0_W {
        VDIV0_W { w: self }
    }
    #[doc = "Bit 5 - Clock Monitor Enable"]
    #[inline(always)]
    pub fn cme0(&mut self) -> CME0_W {
        CME0_W { w: self }
    }
    #[doc = "Bit 6 - PLL Select"]
    #[inline(always)]
    pub fn plls(&mut self) -> PLLS_W {
        PLLS_W { w: self }
    }
    #[doc = "Bit 7 - Loss of Lock Interrrupt Enable"]
    #[inline(always)]
    pub fn lolie0(&mut self) -> LOLIE0_W {
        LOLIE0_W { w: self }
    }
}