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
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
#[doc = "Reader of register MISC0_SET"]
pub type R = crate::R<u32, super::MISC0_SET>;
#[doc = "Writer for register MISC0_SET"]
pub type W = crate::W<u32, super::MISC0_SET>;
#[doc = "Register MISC0_SET `reset()`'s with value 0x0400_0000"]
impl crate::ResetValue for super::MISC0_SET {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0x0400_0000
    }
}
#[doc = "Reader of field `REFTOP_PWD`"]
pub type REFTOP_PWD_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `REFTOP_PWD`"]
pub struct REFTOP_PWD_W<'a> {
    w: &'a mut W,
}
impl<'a> REFTOP_PWD_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 = "Control bit to disable the self-bias circuit in the analog bandgap\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REFTOP_SELFBIASOFF_A {
    #[doc = "0: Uses coarse bias currents for startup"]
    REFTOP_SELFBIASOFF_0 = 0,
    #[doc = "1: Uses bandgap-based bias currents for best performance."]
    REFTOP_SELFBIASOFF_1 = 1,
}
impl From<REFTOP_SELFBIASOFF_A> for bool {
    #[inline(always)]
    fn from(variant: REFTOP_SELFBIASOFF_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `REFTOP_SELFBIASOFF`"]
pub type REFTOP_SELFBIASOFF_R = crate::R<bool, REFTOP_SELFBIASOFF_A>;
impl REFTOP_SELFBIASOFF_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> REFTOP_SELFBIASOFF_A {
        match self.bits {
            false => REFTOP_SELFBIASOFF_A::REFTOP_SELFBIASOFF_0,
            true => REFTOP_SELFBIASOFF_A::REFTOP_SELFBIASOFF_1,
        }
    }
    #[doc = "Checks if the value of the field is `REFTOP_SELFBIASOFF_0`"]
    #[inline(always)]
    pub fn is_reftop_selfbiasoff_0(&self) -> bool {
        *self == REFTOP_SELFBIASOFF_A::REFTOP_SELFBIASOFF_0
    }
    #[doc = "Checks if the value of the field is `REFTOP_SELFBIASOFF_1`"]
    #[inline(always)]
    pub fn is_reftop_selfbiasoff_1(&self) -> bool {
        *self == REFTOP_SELFBIASOFF_A::REFTOP_SELFBIASOFF_1
    }
}
#[doc = "Write proxy for field `REFTOP_SELFBIASOFF`"]
pub struct REFTOP_SELFBIASOFF_W<'a> {
    w: &'a mut W,
}
impl<'a> REFTOP_SELFBIASOFF_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: REFTOP_SELFBIASOFF_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Uses coarse bias currents for startup"]
    #[inline(always)]
    pub fn reftop_selfbiasoff_0(self) -> &'a mut W {
        self.variant(REFTOP_SELFBIASOFF_A::REFTOP_SELFBIASOFF_0)
    }
    #[doc = "Uses bandgap-based bias currents for best performance."]
    #[inline(always)]
    pub fn reftop_selfbiasoff_1(self) -> &'a mut W {
        self.variant(REFTOP_SELFBIASOFF_A::REFTOP_SELFBIASOFF_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 << 3)) | (((value as u32) & 0x01) << 3);
        self.w
    }
}
#[doc = "Not related to CCM. See Power Management Unit (PMU)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum REFTOP_VBGADJ_A {
    #[doc = "0: Nominal VBG"]
    REFTOP_VBGADJ_0 = 0,
    #[doc = "1: VBG+0.78%"]
    REFTOP_VBGADJ_1 = 1,
    #[doc = "2: VBG+1.56%"]
    REFTOP_VBGADJ_2 = 2,
    #[doc = "3: VBG+2.34%"]
    REFTOP_VBGADJ_3 = 3,
    #[doc = "4: VBG-0.78%"]
    REFTOP_VBGADJ_4 = 4,
    #[doc = "5: VBG-1.56%"]
    REFTOP_VBGADJ_5 = 5,
    #[doc = "6: VBG-2.34%"]
    REFTOP_VBGADJ_6 = 6,
    #[doc = "7: VBG-3.12%"]
    REFTOP_VBGADJ_7 = 7,
}
impl From<REFTOP_VBGADJ_A> for u8 {
    #[inline(always)]
    fn from(variant: REFTOP_VBGADJ_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `REFTOP_VBGADJ`"]
pub type REFTOP_VBGADJ_R = crate::R<u8, REFTOP_VBGADJ_A>;
impl REFTOP_VBGADJ_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> REFTOP_VBGADJ_A {
        match self.bits {
            0 => REFTOP_VBGADJ_A::REFTOP_VBGADJ_0,
            1 => REFTOP_VBGADJ_A::REFTOP_VBGADJ_1,
            2 => REFTOP_VBGADJ_A::REFTOP_VBGADJ_2,
            3 => REFTOP_VBGADJ_A::REFTOP_VBGADJ_3,
            4 => REFTOP_VBGADJ_A::REFTOP_VBGADJ_4,
            5 => REFTOP_VBGADJ_A::REFTOP_VBGADJ_5,
            6 => REFTOP_VBGADJ_A::REFTOP_VBGADJ_6,
            7 => REFTOP_VBGADJ_A::REFTOP_VBGADJ_7,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `REFTOP_VBGADJ_0`"]
    #[inline(always)]
    pub fn is_reftop_vbgadj_0(&self) -> bool {
        *self == REFTOP_VBGADJ_A::REFTOP_VBGADJ_0
    }
    #[doc = "Checks if the value of the field is `REFTOP_VBGADJ_1`"]
    #[inline(always)]
    pub fn is_reftop_vbgadj_1(&self) -> bool {
        *self == REFTOP_VBGADJ_A::REFTOP_VBGADJ_1
    }
    #[doc = "Checks if the value of the field is `REFTOP_VBGADJ_2`"]
    #[inline(always)]
    pub fn is_reftop_vbgadj_2(&self) -> bool {
        *self == REFTOP_VBGADJ_A::REFTOP_VBGADJ_2
    }
    #[doc = "Checks if the value of the field is `REFTOP_VBGADJ_3`"]
    #[inline(always)]
    pub fn is_reftop_vbgadj_3(&self) -> bool {
        *self == REFTOP_VBGADJ_A::REFTOP_VBGADJ_3
    }
    #[doc = "Checks if the value of the field is `REFTOP_VBGADJ_4`"]
    #[inline(always)]
    pub fn is_reftop_vbgadj_4(&self) -> bool {
        *self == REFTOP_VBGADJ_A::REFTOP_VBGADJ_4
    }
    #[doc = "Checks if the value of the field is `REFTOP_VBGADJ_5`"]
    #[inline(always)]
    pub fn is_reftop_vbgadj_5(&self) -> bool {
        *self == REFTOP_VBGADJ_A::REFTOP_VBGADJ_5
    }
    #[doc = "Checks if the value of the field is `REFTOP_VBGADJ_6`"]
    #[inline(always)]
    pub fn is_reftop_vbgadj_6(&self) -> bool {
        *self == REFTOP_VBGADJ_A::REFTOP_VBGADJ_6
    }
    #[doc = "Checks if the value of the field is `REFTOP_VBGADJ_7`"]
    #[inline(always)]
    pub fn is_reftop_vbgadj_7(&self) -> bool {
        *self == REFTOP_VBGADJ_A::REFTOP_VBGADJ_7
    }
}
#[doc = "Write proxy for field `REFTOP_VBGADJ`"]
pub struct REFTOP_VBGADJ_W<'a> {
    w: &'a mut W,
}
impl<'a> REFTOP_VBGADJ_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: REFTOP_VBGADJ_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "Nominal VBG"]
    #[inline(always)]
    pub fn reftop_vbgadj_0(self) -> &'a mut W {
        self.variant(REFTOP_VBGADJ_A::REFTOP_VBGADJ_0)
    }
    #[doc = "VBG+0.78%"]
    #[inline(always)]
    pub fn reftop_vbgadj_1(self) -> &'a mut W {
        self.variant(REFTOP_VBGADJ_A::REFTOP_VBGADJ_1)
    }
    #[doc = "VBG+1.56%"]
    #[inline(always)]
    pub fn reftop_vbgadj_2(self) -> &'a mut W {
        self.variant(REFTOP_VBGADJ_A::REFTOP_VBGADJ_2)
    }
    #[doc = "VBG+2.34%"]
    #[inline(always)]
    pub fn reftop_vbgadj_3(self) -> &'a mut W {
        self.variant(REFTOP_VBGADJ_A::REFTOP_VBGADJ_3)
    }
    #[doc = "VBG-0.78%"]
    #[inline(always)]
    pub fn reftop_vbgadj_4(self) -> &'a mut W {
        self.variant(REFTOP_VBGADJ_A::REFTOP_VBGADJ_4)
    }
    #[doc = "VBG-1.56%"]
    #[inline(always)]
    pub fn reftop_vbgadj_5(self) -> &'a mut W {
        self.variant(REFTOP_VBGADJ_A::REFTOP_VBGADJ_5)
    }
    #[doc = "VBG-2.34%"]
    #[inline(always)]
    pub fn reftop_vbgadj_6(self) -> &'a mut W {
        self.variant(REFTOP_VBGADJ_A::REFTOP_VBGADJ_6)
    }
    #[doc = "VBG-3.12%"]
    #[inline(always)]
    pub fn reftop_vbgadj_7(self) -> &'a mut W {
        self.variant(REFTOP_VBGADJ_A::REFTOP_VBGADJ_7)
    }
    #[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 & !(0x07 << 4)) | (((value as u32) & 0x07) << 4);
        self.w
    }
}
#[doc = "Reader of field `REFTOP_VBGUP`"]
pub type REFTOP_VBGUP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `REFTOP_VBGUP`"]
pub struct REFTOP_VBGUP_W<'a> {
    w: &'a mut W,
}
impl<'a> REFTOP_VBGUP_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 = "Configure the analog behavior in stop mode.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum STOP_MODE_CONFIG_A {
    #[doc = "0: All analog except RTC powered down on stop mode assertion."]
    STOP_MODE_CONFIG_0 = 0,
    #[doc = "1: Beside RTC, analog bandgap, 1p1 and 2p5 regulators are also on."]
    STOP_MODE_CONFIG_1 = 1,
    #[doc = "2: Beside RTC, 1p1 and 2p5 regulators are also on, low-power bandgap is selected so that the normal analog bandgap together with the rest analog is powered down."]
    STOP_MODE_CONFIG_2 = 2,
    #[doc = "3: Beside RTC, low-power bandgap is selected and the rest analog is powered down."]
    STOP_MODE_CONFIG_3 = 3,
}
impl From<STOP_MODE_CONFIG_A> for u8 {
    #[inline(always)]
    fn from(variant: STOP_MODE_CONFIG_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `STOP_MODE_CONFIG`"]
pub type STOP_MODE_CONFIG_R = crate::R<u8, STOP_MODE_CONFIG_A>;
impl STOP_MODE_CONFIG_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> STOP_MODE_CONFIG_A {
        match self.bits {
            0 => STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_0,
            1 => STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_1,
            2 => STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_2,
            3 => STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `STOP_MODE_CONFIG_0`"]
    #[inline(always)]
    pub fn is_stop_mode_config_0(&self) -> bool {
        *self == STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_0
    }
    #[doc = "Checks if the value of the field is `STOP_MODE_CONFIG_1`"]
    #[inline(always)]
    pub fn is_stop_mode_config_1(&self) -> bool {
        *self == STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_1
    }
    #[doc = "Checks if the value of the field is `STOP_MODE_CONFIG_2`"]
    #[inline(always)]
    pub fn is_stop_mode_config_2(&self) -> bool {
        *self == STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_2
    }
    #[doc = "Checks if the value of the field is `STOP_MODE_CONFIG_3`"]
    #[inline(always)]
    pub fn is_stop_mode_config_3(&self) -> bool {
        *self == STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_3
    }
}
#[doc = "Write proxy for field `STOP_MODE_CONFIG`"]
pub struct STOP_MODE_CONFIG_W<'a> {
    w: &'a mut W,
}
impl<'a> STOP_MODE_CONFIG_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: STOP_MODE_CONFIG_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "All analog except RTC powered down on stop mode assertion."]
    #[inline(always)]
    pub fn stop_mode_config_0(self) -> &'a mut W {
        self.variant(STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_0)
    }
    #[doc = "Beside RTC, analog bandgap, 1p1 and 2p5 regulators are also on."]
    #[inline(always)]
    pub fn stop_mode_config_1(self) -> &'a mut W {
        self.variant(STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_1)
    }
    #[doc = "Beside RTC, 1p1 and 2p5 regulators are also on, low-power bandgap is selected so that the normal analog bandgap together with the rest analog is powered down."]
    #[inline(always)]
    pub fn stop_mode_config_2(self) -> &'a mut W {
        self.variant(STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_2)
    }
    #[doc = "Beside RTC, low-power bandgap is selected and the rest analog is powered down."]
    #[inline(always)]
    pub fn stop_mode_config_3(self) -> &'a mut W {
        self.variant(STOP_MODE_CONFIG_A::STOP_MODE_CONFIG_3)
    }
    #[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 << 10)) | (((value as u32) & 0x03) << 10);
        self.w
    }
}
#[doc = "This bit controls a switch from VDD_HIGH_IN to VDD_SNVS_IN.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DISCON_HIGH_SNVS_A {
    #[doc = "0: Turn on the switch"]
    DISCON_HIGH_SNVS_0 = 0,
    #[doc = "1: Turn off the switch"]
    DISCON_HIGH_SNVS_1 = 1,
}
impl From<DISCON_HIGH_SNVS_A> for bool {
    #[inline(always)]
    fn from(variant: DISCON_HIGH_SNVS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `DISCON_HIGH_SNVS`"]
pub type DISCON_HIGH_SNVS_R = crate::R<bool, DISCON_HIGH_SNVS_A>;
impl DISCON_HIGH_SNVS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DISCON_HIGH_SNVS_A {
        match self.bits {
            false => DISCON_HIGH_SNVS_A::DISCON_HIGH_SNVS_0,
            true => DISCON_HIGH_SNVS_A::DISCON_HIGH_SNVS_1,
        }
    }
    #[doc = "Checks if the value of the field is `DISCON_HIGH_SNVS_0`"]
    #[inline(always)]
    pub fn is_discon_high_snvs_0(&self) -> bool {
        *self == DISCON_HIGH_SNVS_A::DISCON_HIGH_SNVS_0
    }
    #[doc = "Checks if the value of the field is `DISCON_HIGH_SNVS_1`"]
    #[inline(always)]
    pub fn is_discon_high_snvs_1(&self) -> bool {
        *self == DISCON_HIGH_SNVS_A::DISCON_HIGH_SNVS_1
    }
}
#[doc = "Write proxy for field `DISCON_HIGH_SNVS`"]
pub struct DISCON_HIGH_SNVS_W<'a> {
    w: &'a mut W,
}
impl<'a> DISCON_HIGH_SNVS_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DISCON_HIGH_SNVS_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Turn on the switch"]
    #[inline(always)]
    pub fn discon_high_snvs_0(self) -> &'a mut W {
        self.variant(DISCON_HIGH_SNVS_A::DISCON_HIGH_SNVS_0)
    }
    #[doc = "Turn off the switch"]
    #[inline(always)]
    pub fn discon_high_snvs_1(self) -> &'a mut W {
        self.variant(DISCON_HIGH_SNVS_A::DISCON_HIGH_SNVS_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 << 12)) | (((value as u32) & 0x01) << 12);
        self.w
    }
}
#[doc = "This field determines the bias current in the 24MHz oscillator\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum OSC_I_A {
    #[doc = "0: Nominal"]
    NOMINAL = 0,
    #[doc = "1: Decrease current by 12.5%"]
    MINUS_12_5_PERCENT = 1,
    #[doc = "2: Decrease current by 25.0%"]
    MINUS_25_PERCENT = 2,
    #[doc = "3: Decrease current by 37.5%"]
    MINUS_37_5_PERCENT = 3,
}
impl From<OSC_I_A> for u8 {
    #[inline(always)]
    fn from(variant: OSC_I_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `OSC_I`"]
pub type OSC_I_R = crate::R<u8, OSC_I_A>;
impl OSC_I_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OSC_I_A {
        match self.bits {
            0 => OSC_I_A::NOMINAL,
            1 => OSC_I_A::MINUS_12_5_PERCENT,
            2 => OSC_I_A::MINUS_25_PERCENT,
            3 => OSC_I_A::MINUS_37_5_PERCENT,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `NOMINAL`"]
    #[inline(always)]
    pub fn is_nominal(&self) -> bool {
        *self == OSC_I_A::NOMINAL
    }
    #[doc = "Checks if the value of the field is `MINUS_12_5_PERCENT`"]
    #[inline(always)]
    pub fn is_minus_12_5_percent(&self) -> bool {
        *self == OSC_I_A::MINUS_12_5_PERCENT
    }
    #[doc = "Checks if the value of the field is `MINUS_25_PERCENT`"]
    #[inline(always)]
    pub fn is_minus_25_percent(&self) -> bool {
        *self == OSC_I_A::MINUS_25_PERCENT
    }
    #[doc = "Checks if the value of the field is `MINUS_37_5_PERCENT`"]
    #[inline(always)]
    pub fn is_minus_37_5_percent(&self) -> bool {
        *self == OSC_I_A::MINUS_37_5_PERCENT
    }
}
#[doc = "Write proxy for field `OSC_I`"]
pub struct OSC_I_W<'a> {
    w: &'a mut W,
}
impl<'a> OSC_I_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OSC_I_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "Nominal"]
    #[inline(always)]
    pub fn nominal(self) -> &'a mut W {
        self.variant(OSC_I_A::NOMINAL)
    }
    #[doc = "Decrease current by 12.5%"]
    #[inline(always)]
    pub fn minus_12_5_percent(self) -> &'a mut W {
        self.variant(OSC_I_A::MINUS_12_5_PERCENT)
    }
    #[doc = "Decrease current by 25.0%"]
    #[inline(always)]
    pub fn minus_25_percent(self) -> &'a mut W {
        self.variant(OSC_I_A::MINUS_25_PERCENT)
    }
    #[doc = "Decrease current by 37.5%"]
    #[inline(always)]
    pub fn minus_37_5_percent(self) -> &'a mut W {
        self.variant(OSC_I_A::MINUS_37_5_PERCENT)
    }
    #[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 << 13)) | (((value as u32) & 0x03) << 13);
        self.w
    }
}
#[doc = "Reader of field `OSC_XTALOK`"]
pub type OSC_XTALOK_R = crate::R<bool, bool>;
#[doc = "Reader of field `OSC_XTALOK_EN`"]
pub type OSC_XTALOK_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `OSC_XTALOK_EN`"]
pub struct OSC_XTALOK_EN_W<'a> {
    w: &'a mut W,
}
impl<'a> OSC_XTALOK_EN_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 << 16)) | (((value as u32) & 0x01) << 16);
        self.w
    }
}
#[doc = "This bit allows disabling the clock gate (always ungated) for the xtal 24MHz clock that clocks the digital logic in the analog block\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CLKGATE_CTRL_A {
    #[doc = "0: Allow the logic to automatically gate the clock when the XTAL is powered down."]
    ALLOW_AUTO_GATE = 0,
    #[doc = "1: Prevent the logic from ever gating off the clock."]
    NO_AUTO_GATE = 1,
}
impl From<CLKGATE_CTRL_A> for bool {
    #[inline(always)]
    fn from(variant: CLKGATE_CTRL_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `CLKGATE_CTRL`"]
pub type CLKGATE_CTRL_R = crate::R<bool, CLKGATE_CTRL_A>;
impl CLKGATE_CTRL_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CLKGATE_CTRL_A {
        match self.bits {
            false => CLKGATE_CTRL_A::ALLOW_AUTO_GATE,
            true => CLKGATE_CTRL_A::NO_AUTO_GATE,
        }
    }
    #[doc = "Checks if the value of the field is `ALLOW_AUTO_GATE`"]
    #[inline(always)]
    pub fn is_allow_auto_gate(&self) -> bool {
        *self == CLKGATE_CTRL_A::ALLOW_AUTO_GATE
    }
    #[doc = "Checks if the value of the field is `NO_AUTO_GATE`"]
    #[inline(always)]
    pub fn is_no_auto_gate(&self) -> bool {
        *self == CLKGATE_CTRL_A::NO_AUTO_GATE
    }
}
#[doc = "Write proxy for field `CLKGATE_CTRL`"]
pub struct CLKGATE_CTRL_W<'a> {
    w: &'a mut W,
}
impl<'a> CLKGATE_CTRL_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CLKGATE_CTRL_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Allow the logic to automatically gate the clock when the XTAL is powered down."]
    #[inline(always)]
    pub fn allow_auto_gate(self) -> &'a mut W {
        self.variant(CLKGATE_CTRL_A::ALLOW_AUTO_GATE)
    }
    #[doc = "Prevent the logic from ever gating off the clock."]
    #[inline(always)]
    pub fn no_auto_gate(self) -> &'a mut W {
        self.variant(CLKGATE_CTRL_A::NO_AUTO_GATE)
    }
    #[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 << 25)) | (((value as u32) & 0x01) << 25);
        self.w
    }
}
#[doc = "This field specifies the delay between powering up the XTAL 24MHz clock and releasing the clock to the digital logic inside the analog block\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CLKGATE_DELAY_A {
    #[doc = "0: 0.5ms"]
    CLKGATE_DELAY_0 = 0,
    #[doc = "1: 1.0ms"]
    CLKGATE_DELAY_1 = 1,
    #[doc = "2: 2.0ms"]
    CLKGATE_DELAY_2 = 2,
    #[doc = "3: 3.0ms"]
    CLKGATE_DELAY_3 = 3,
    #[doc = "4: 4.0ms"]
    CLKGATE_DELAY_4 = 4,
    #[doc = "5: 5.0ms"]
    CLKGATE_DELAY_5 = 5,
    #[doc = "6: 6.0ms"]
    CLKGATE_DELAY_6 = 6,
    #[doc = "7: 7.0ms"]
    CLKGATE_DELAY_7 = 7,
}
impl From<CLKGATE_DELAY_A> for u8 {
    #[inline(always)]
    fn from(variant: CLKGATE_DELAY_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `CLKGATE_DELAY`"]
pub type CLKGATE_DELAY_R = crate::R<u8, CLKGATE_DELAY_A>;
impl CLKGATE_DELAY_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CLKGATE_DELAY_A {
        match self.bits {
            0 => CLKGATE_DELAY_A::CLKGATE_DELAY_0,
            1 => CLKGATE_DELAY_A::CLKGATE_DELAY_1,
            2 => CLKGATE_DELAY_A::CLKGATE_DELAY_2,
            3 => CLKGATE_DELAY_A::CLKGATE_DELAY_3,
            4 => CLKGATE_DELAY_A::CLKGATE_DELAY_4,
            5 => CLKGATE_DELAY_A::CLKGATE_DELAY_5,
            6 => CLKGATE_DELAY_A::CLKGATE_DELAY_6,
            7 => CLKGATE_DELAY_A::CLKGATE_DELAY_7,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `CLKGATE_DELAY_0`"]
    #[inline(always)]
    pub fn is_clkgate_delay_0(&self) -> bool {
        *self == CLKGATE_DELAY_A::CLKGATE_DELAY_0
    }
    #[doc = "Checks if the value of the field is `CLKGATE_DELAY_1`"]
    #[inline(always)]
    pub fn is_clkgate_delay_1(&self) -> bool {
        *self == CLKGATE_DELAY_A::CLKGATE_DELAY_1
    }
    #[doc = "Checks if the value of the field is `CLKGATE_DELAY_2`"]
    #[inline(always)]
    pub fn is_clkgate_delay_2(&self) -> bool {
        *self == CLKGATE_DELAY_A::CLKGATE_DELAY_2
    }
    #[doc = "Checks if the value of the field is `CLKGATE_DELAY_3`"]
    #[inline(always)]
    pub fn is_clkgate_delay_3(&self) -> bool {
        *self == CLKGATE_DELAY_A::CLKGATE_DELAY_3
    }
    #[doc = "Checks if the value of the field is `CLKGATE_DELAY_4`"]
    #[inline(always)]
    pub fn is_clkgate_delay_4(&self) -> bool {
        *self == CLKGATE_DELAY_A::CLKGATE_DELAY_4
    }
    #[doc = "Checks if the value of the field is `CLKGATE_DELAY_5`"]
    #[inline(always)]
    pub fn is_clkgate_delay_5(&self) -> bool {
        *self == CLKGATE_DELAY_A::CLKGATE_DELAY_5
    }
    #[doc = "Checks if the value of the field is `CLKGATE_DELAY_6`"]
    #[inline(always)]
    pub fn is_clkgate_delay_6(&self) -> bool {
        *self == CLKGATE_DELAY_A::CLKGATE_DELAY_6
    }
    #[doc = "Checks if the value of the field is `CLKGATE_DELAY_7`"]
    #[inline(always)]
    pub fn is_clkgate_delay_7(&self) -> bool {
        *self == CLKGATE_DELAY_A::CLKGATE_DELAY_7
    }
}
#[doc = "Write proxy for field `CLKGATE_DELAY`"]
pub struct CLKGATE_DELAY_W<'a> {
    w: &'a mut W,
}
impl<'a> CLKGATE_DELAY_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: CLKGATE_DELAY_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "0.5ms"]
    #[inline(always)]
    pub fn clkgate_delay_0(self) -> &'a mut W {
        self.variant(CLKGATE_DELAY_A::CLKGATE_DELAY_0)
    }
    #[doc = "1.0ms"]
    #[inline(always)]
    pub fn clkgate_delay_1(self) -> &'a mut W {
        self.variant(CLKGATE_DELAY_A::CLKGATE_DELAY_1)
    }
    #[doc = "2.0ms"]
    #[inline(always)]
    pub fn clkgate_delay_2(self) -> &'a mut W {
        self.variant(CLKGATE_DELAY_A::CLKGATE_DELAY_2)
    }
    #[doc = "3.0ms"]
    #[inline(always)]
    pub fn clkgate_delay_3(self) -> &'a mut W {
        self.variant(CLKGATE_DELAY_A::CLKGATE_DELAY_3)
    }
    #[doc = "4.0ms"]
    #[inline(always)]
    pub fn clkgate_delay_4(self) -> &'a mut W {
        self.variant(CLKGATE_DELAY_A::CLKGATE_DELAY_4)
    }
    #[doc = "5.0ms"]
    #[inline(always)]
    pub fn clkgate_delay_5(self) -> &'a mut W {
        self.variant(CLKGATE_DELAY_A::CLKGATE_DELAY_5)
    }
    #[doc = "6.0ms"]
    #[inline(always)]
    pub fn clkgate_delay_6(self) -> &'a mut W {
        self.variant(CLKGATE_DELAY_A::CLKGATE_DELAY_6)
    }
    #[doc = "7.0ms"]
    #[inline(always)]
    pub fn clkgate_delay_7(self) -> &'a mut W {
        self.variant(CLKGATE_DELAY_A::CLKGATE_DELAY_7)
    }
    #[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 & !(0x07 << 26)) | (((value as u32) & 0x07) << 26);
        self.w
    }
}
#[doc = "This field indicates which chip source is being used for the rtc clock\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RTC_XTAL_SOURCE_A {
    #[doc = "0: Internal ring oscillator"]
    RTC_XTAL_SOURCE_0 = 0,
    #[doc = "1: RTC_XTAL"]
    RTC_XTAL_SOURCE_1 = 1,
}
impl From<RTC_XTAL_SOURCE_A> for bool {
    #[inline(always)]
    fn from(variant: RTC_XTAL_SOURCE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `RTC_XTAL_SOURCE`"]
pub type RTC_XTAL_SOURCE_R = crate::R<bool, RTC_XTAL_SOURCE_A>;
impl RTC_XTAL_SOURCE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RTC_XTAL_SOURCE_A {
        match self.bits {
            false => RTC_XTAL_SOURCE_A::RTC_XTAL_SOURCE_0,
            true => RTC_XTAL_SOURCE_A::RTC_XTAL_SOURCE_1,
        }
    }
    #[doc = "Checks if the value of the field is `RTC_XTAL_SOURCE_0`"]
    #[inline(always)]
    pub fn is_rtc_xtal_source_0(&self) -> bool {
        *self == RTC_XTAL_SOURCE_A::RTC_XTAL_SOURCE_0
    }
    #[doc = "Checks if the value of the field is `RTC_XTAL_SOURCE_1`"]
    #[inline(always)]
    pub fn is_rtc_xtal_source_1(&self) -> bool {
        *self == RTC_XTAL_SOURCE_A::RTC_XTAL_SOURCE_1
    }
}
#[doc = "Write proxy for field `RTC_XTAL_SOURCE`"]
pub struct RTC_XTAL_SOURCE_W<'a> {
    w: &'a mut W,
}
impl<'a> RTC_XTAL_SOURCE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: RTC_XTAL_SOURCE_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Internal ring oscillator"]
    #[inline(always)]
    pub fn rtc_xtal_source_0(self) -> &'a mut W {
        self.variant(RTC_XTAL_SOURCE_A::RTC_XTAL_SOURCE_0)
    }
    #[doc = "RTC_XTAL"]
    #[inline(always)]
    pub fn rtc_xtal_source_1(self) -> &'a mut W {
        self.variant(RTC_XTAL_SOURCE_A::RTC_XTAL_SOURCE_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 << 29)) | (((value as u32) & 0x01) << 29);
        self.w
    }
}
#[doc = "Reader of field `XTAL_24M_PWD`"]
pub type XTAL_24M_PWD_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `XTAL_24M_PWD`"]
pub struct XTAL_24M_PWD_W<'a> {
    w: &'a mut W,
}
impl<'a> XTAL_24M_PWD_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 << 30)) | (((value as u32) & 0x01) << 30);
        self.w
    }
}
impl R {
    #[doc = "Bit 0 - Control bit to power-down the analog bandgap reference circuitry"]
    #[inline(always)]
    pub fn reftop_pwd(&self) -> REFTOP_PWD_R {
        REFTOP_PWD_R::new((self.bits & 0x01) != 0)
    }
    #[doc = "Bit 3 - Control bit to disable the self-bias circuit in the analog bandgap"]
    #[inline(always)]
    pub fn reftop_selfbiasoff(&self) -> REFTOP_SELFBIASOFF_R {
        REFTOP_SELFBIASOFF_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bits 4:6 - Not related to CCM. See Power Management Unit (PMU)"]
    #[inline(always)]
    pub fn reftop_vbgadj(&self) -> REFTOP_VBGADJ_R {
        REFTOP_VBGADJ_R::new(((self.bits >> 4) & 0x07) as u8)
    }
    #[doc = "Bit 7 - Status bit that signals the analog bandgap voltage is up and stable"]
    #[inline(always)]
    pub fn reftop_vbgup(&self) -> REFTOP_VBGUP_R {
        REFTOP_VBGUP_R::new(((self.bits >> 7) & 0x01) != 0)
    }
    #[doc = "Bits 10:11 - Configure the analog behavior in stop mode."]
    #[inline(always)]
    pub fn stop_mode_config(&self) -> STOP_MODE_CONFIG_R {
        STOP_MODE_CONFIG_R::new(((self.bits >> 10) & 0x03) as u8)
    }
    #[doc = "Bit 12 - This bit controls a switch from VDD_HIGH_IN to VDD_SNVS_IN."]
    #[inline(always)]
    pub fn discon_high_snvs(&self) -> DISCON_HIGH_SNVS_R {
        DISCON_HIGH_SNVS_R::new(((self.bits >> 12) & 0x01) != 0)
    }
    #[doc = "Bits 13:14 - This field determines the bias current in the 24MHz oscillator"]
    #[inline(always)]
    pub fn osc_i(&self) -> OSC_I_R {
        OSC_I_R::new(((self.bits >> 13) & 0x03) as u8)
    }
    #[doc = "Bit 15 - Status bit that signals that the output of the 24-MHz crystal oscillator is stable"]
    #[inline(always)]
    pub fn osc_xtalok(&self) -> OSC_XTALOK_R {
        OSC_XTALOK_R::new(((self.bits >> 15) & 0x01) != 0)
    }
    #[doc = "Bit 16 - This bit enables the detector that signals when the 24MHz crystal oscillator is stable"]
    #[inline(always)]
    pub fn osc_xtalok_en(&self) -> OSC_XTALOK_EN_R {
        OSC_XTALOK_EN_R::new(((self.bits >> 16) & 0x01) != 0)
    }
    #[doc = "Bit 25 - This bit allows disabling the clock gate (always ungated) for the xtal 24MHz clock that clocks the digital logic in the analog block"]
    #[inline(always)]
    pub fn clkgate_ctrl(&self) -> CLKGATE_CTRL_R {
        CLKGATE_CTRL_R::new(((self.bits >> 25) & 0x01) != 0)
    }
    #[doc = "Bits 26:28 - This field specifies the delay between powering up the XTAL 24MHz clock and releasing the clock to the digital logic inside the analog block"]
    #[inline(always)]
    pub fn clkgate_delay(&self) -> CLKGATE_DELAY_R {
        CLKGATE_DELAY_R::new(((self.bits >> 26) & 0x07) as u8)
    }
    #[doc = "Bit 29 - This field indicates which chip source is being used for the rtc clock"]
    #[inline(always)]
    pub fn rtc_xtal_source(&self) -> RTC_XTAL_SOURCE_R {
        RTC_XTAL_SOURCE_R::new(((self.bits >> 29) & 0x01) != 0)
    }
    #[doc = "Bit 30 - This field powers down the 24M crystal oscillator if set true"]
    #[inline(always)]
    pub fn xtal_24m_pwd(&self) -> XTAL_24M_PWD_R {
        XTAL_24M_PWD_R::new(((self.bits >> 30) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Control bit to power-down the analog bandgap reference circuitry"]
    #[inline(always)]
    pub fn reftop_pwd(&mut self) -> REFTOP_PWD_W {
        REFTOP_PWD_W { w: self }
    }
    #[doc = "Bit 3 - Control bit to disable the self-bias circuit in the analog bandgap"]
    #[inline(always)]
    pub fn reftop_selfbiasoff(&mut self) -> REFTOP_SELFBIASOFF_W {
        REFTOP_SELFBIASOFF_W { w: self }
    }
    #[doc = "Bits 4:6 - Not related to CCM. See Power Management Unit (PMU)"]
    #[inline(always)]
    pub fn reftop_vbgadj(&mut self) -> REFTOP_VBGADJ_W {
        REFTOP_VBGADJ_W { w: self }
    }
    #[doc = "Bit 7 - Status bit that signals the analog bandgap voltage is up and stable"]
    #[inline(always)]
    pub fn reftop_vbgup(&mut self) -> REFTOP_VBGUP_W {
        REFTOP_VBGUP_W { w: self }
    }
    #[doc = "Bits 10:11 - Configure the analog behavior in stop mode."]
    #[inline(always)]
    pub fn stop_mode_config(&mut self) -> STOP_MODE_CONFIG_W {
        STOP_MODE_CONFIG_W { w: self }
    }
    #[doc = "Bit 12 - This bit controls a switch from VDD_HIGH_IN to VDD_SNVS_IN."]
    #[inline(always)]
    pub fn discon_high_snvs(&mut self) -> DISCON_HIGH_SNVS_W {
        DISCON_HIGH_SNVS_W { w: self }
    }
    #[doc = "Bits 13:14 - This field determines the bias current in the 24MHz oscillator"]
    #[inline(always)]
    pub fn osc_i(&mut self) -> OSC_I_W {
        OSC_I_W { w: self }
    }
    #[doc = "Bit 16 - This bit enables the detector that signals when the 24MHz crystal oscillator is stable"]
    #[inline(always)]
    pub fn osc_xtalok_en(&mut self) -> OSC_XTALOK_EN_W {
        OSC_XTALOK_EN_W { w: self }
    }
    #[doc = "Bit 25 - This bit allows disabling the clock gate (always ungated) for the xtal 24MHz clock that clocks the digital logic in the analog block"]
    #[inline(always)]
    pub fn clkgate_ctrl(&mut self) -> CLKGATE_CTRL_W {
        CLKGATE_CTRL_W { w: self }
    }
    #[doc = "Bits 26:28 - This field specifies the delay between powering up the XTAL 24MHz clock and releasing the clock to the digital logic inside the analog block"]
    #[inline(always)]
    pub fn clkgate_delay(&mut self) -> CLKGATE_DELAY_W {
        CLKGATE_DELAY_W { w: self }
    }
    #[doc = "Bit 29 - This field indicates which chip source is being used for the rtc clock"]
    #[inline(always)]
    pub fn rtc_xtal_source(&mut self) -> RTC_XTAL_SOURCE_W {
        RTC_XTAL_SOURCE_W { w: self }
    }
    #[doc = "Bit 30 - This field powers down the 24M crystal oscillator if set true"]
    #[inline(always)]
    pub fn xtal_24m_pwd(&mut self) -> XTAL_24M_PWD_W {
        XTAL_24M_PWD_W { w: self }
    }
}