mtb_pac_psoc6_01 0.1.1

Peripheral Access Crate for Infineon CY8C6xx6 and CY8C6xx7 PSOCâ„¢ 6 microcontrollers
Documentation
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
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
/*
(c) (2016-2024), Cypress Semiconductor Corporation (an Infineon company)

    or an affiliate of Cypress Semiconductor Corporation.



    SPDX-License-Identifier: Apache-2.0



    Licensed under the Apache License, Version 2.0 (the "License");

    you may not use this file except in compliance with the License.

    You may obtain a copy of the License at



      http://www.apache.org/licenses/LICENSE-2.0



    Unless required by applicable law or agreed to in writing, software

    distributed under the License is distributed on an "AS IS" BASIS,

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and

    limitations under the License.
*/
// Generated from SVD 1.0, with svd2pac 0.6.0 on Tue, 27 May 2025 19:21:54 +0000

#![allow(clippy::identity_op)]
#![allow(clippy::module_inception)]
#![allow(clippy::derivable_impls)]
#[allow(unused_imports)]
use crate::common::sealed;
#[allow(unused_imports)]
use crate::common::*;
#[doc = r"SRSS Backup Domain"]
unsafe impl ::core::marker::Send for super::Backup {}
unsafe impl ::core::marker::Sync for super::Backup {}
impl super::Backup {
    #[allow(unused)]
    #[inline(always)]
    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
        self.ptr
    }

    #[doc = "Control"]
    #[inline(always)]
    pub const fn ctl(&self) -> &'static crate::common::Reg<self::Ctl_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::Ctl_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(0usize),
            )
        }
    }

    #[doc = "RTC Read Write register"]
    #[inline(always)]
    pub const fn rtc_rw(&self) -> &'static crate::common::Reg<self::RtcRw_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::RtcRw_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(8usize),
            )
        }
    }

    #[doc = "Oscillator calibration for absolute frequency"]
    #[inline(always)]
    pub const fn cal_ctl(
        &self,
    ) -> &'static crate::common::Reg<self::CalCtl_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::CalCtl_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(12usize),
            )
        }
    }

    #[doc = "Status"]
    #[inline(always)]
    pub const fn status(&self) -> &'static crate::common::Reg<self::Status_SPEC, crate::common::R> {
        unsafe {
            crate::common::Reg::<self::Status_SPEC, crate::common::R>::from_ptr(
                self._svd2pac_as_ptr().add(16usize),
            )
        }
    }

    #[doc = "Calendar Seconds, Minutes, Hours, Day of Week"]
    #[inline(always)]
    pub const fn rtc_time(
        &self,
    ) -> &'static crate::common::Reg<self::RtcTime_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::RtcTime_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(20usize),
            )
        }
    }

    #[doc = "Calendar Day of Month, Month,  Year"]
    #[inline(always)]
    pub const fn rtc_date(
        &self,
    ) -> &'static crate::common::Reg<self::RtcDate_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::RtcDate_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(24usize),
            )
        }
    }

    #[doc = "Alarm 1 Seconds, Minute, Hours, Day of Week"]
    #[inline(always)]
    pub const fn alm1_time(
        &self,
    ) -> &'static crate::common::Reg<self::Alm1Time_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::Alm1Time_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(28usize),
            )
        }
    }

    #[doc = "Alarm 1 Day of Month, Month"]
    #[inline(always)]
    pub const fn alm1_date(
        &self,
    ) -> &'static crate::common::Reg<self::Alm1Date_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::Alm1Date_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(32usize),
            )
        }
    }

    #[doc = "Alarm 2 Seconds, Minute, Hours, Day of Week"]
    #[inline(always)]
    pub const fn alm2_time(
        &self,
    ) -> &'static crate::common::Reg<self::Alm2Time_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::Alm2Time_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(36usize),
            )
        }
    }

    #[doc = "Alarm 2 Day of Month, Month"]
    #[inline(always)]
    pub const fn alm2_date(
        &self,
    ) -> &'static crate::common::Reg<self::Alm2Date_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::Alm2Date_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(40usize),
            )
        }
    }

    #[doc = "Interrupt request register"]
    #[inline(always)]
    pub const fn intr(&self) -> &'static crate::common::Reg<self::Intr_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::Intr_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(44usize),
            )
        }
    }

    #[doc = "Interrupt set request register"]
    #[inline(always)]
    pub const fn intr_set(
        &self,
    ) -> &'static crate::common::Reg<self::IntrSet_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::IntrSet_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(48usize),
            )
        }
    }

    #[doc = "Interrupt mask register"]
    #[inline(always)]
    pub const fn intr_mask(
        &self,
    ) -> &'static crate::common::Reg<self::IntrMask_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::IntrMask_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(52usize),
            )
        }
    }

    #[doc = "Interrupt masked request register"]
    #[inline(always)]
    pub const fn intr_masked(
        &self,
    ) -> &'static crate::common::Reg<self::IntrMasked_SPEC, crate::common::R> {
        unsafe {
            crate::common::Reg::<self::IntrMasked_SPEC, crate::common::R>::from_ptr(
                self._svd2pac_as_ptr().add(56usize),
            )
        }
    }

    #[doc = "32kHz oscillator counter"]
    #[inline(always)]
    pub const fn osccnt(&self) -> &'static crate::common::Reg<self::Osccnt_SPEC, crate::common::R> {
        unsafe {
            crate::common::Reg::<self::Osccnt_SPEC, crate::common::R>::from_ptr(
                self._svd2pac_as_ptr().add(60usize),
            )
        }
    }

    #[doc = "128Hz tick counter"]
    #[inline(always)]
    pub const fn ticks(&self) -> &'static crate::common::Reg<self::Ticks_SPEC, crate::common::R> {
        unsafe {
            crate::common::Reg::<self::Ticks_SPEC, crate::common::R>::from_ptr(
                self._svd2pac_as_ptr().add(64usize),
            )
        }
    }

    #[doc = "PMIC control register"]
    #[inline(always)]
    pub const fn pmic_ctl(
        &self,
    ) -> &'static crate::common::Reg<self::PmicCtl_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::PmicCtl_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(68usize),
            )
        }
    }

    #[doc = "Backup reset register"]
    #[inline(always)]
    pub const fn reset(&self) -> &'static crate::common::Reg<self::Reset_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::Reset_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(72usize),
            )
        }
    }

    #[doc = "Backup register region"]
    #[inline(always)]
    pub const fn breg(
        &self,
    ) -> &'static crate::common::ClusterRegisterArray<
        crate::common::Reg<self::Breg_SPEC, crate::common::RW>,
        64,
        0x4,
    > {
        unsafe {
            crate::common::ClusterRegisterArray::from_ptr(self._svd2pac_as_ptr().add(0x1000usize))
        }
    }

    #[doc = "Trim Register"]
    #[inline(always)]
    pub const fn trim(&self) -> &'static crate::common::Reg<self::Trim_SPEC, crate::common::RW> {
        unsafe {
            crate::common::Reg::<self::Trim_SPEC, crate::common::RW>::from_ptr(
                self._svd2pac_as_ptr().add(65280usize),
            )
        }
    }
}
#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ctl_SPEC;
impl crate::sealed::RegSpec for Ctl_SPEC {
    type DataType = u32;
}

#[doc = "Control"]
pub type Ctl = crate::RegValueT<Ctl_SPEC>;

impl Ctl {
    #[doc = "Watch-crystal oscillator (WCO) enable.  If there is a write in progress when this bit is cleared, the WCO will be internally kept on until the write completes.\nAfter enabling the WCO software must wait until STATUS.WCO_OK=1 before configuring any component that depends on clk_lf/clk_bak, like for example RTC or WDTs.  Follow the procedure in BACKUP_RTC_RW to access this bit."]
    #[inline(always)]
    pub fn wco_en(self) -> crate::common::RegisterFieldBool<3, 1, 0, Ctl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<3, 1, 0, Ctl_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Clock select for BAK clock"]
    #[inline(always)]
    pub fn clk_sel(
        self,
    ) -> crate::common::RegisterField<
        8,
        0x3,
        1,
        0,
        ctl::ClkSel,
        ctl::ClkSel,
        Ctl_SPEC,
        crate::common::RW,
    > {
        crate::common::RegisterField::<
            8,
            0x3,
            1,
            0,
            ctl::ClkSel,
            ctl::ClkSel,
            Ctl_SPEC,
            crate::common::RW,
        >::from_register(self, 0)
    }

    #[doc = "N/A"]
    #[inline(always)]
    pub fn prescaler(
        self,
    ) -> crate::common::RegisterField<12, 0x3, 1, 0, u8, u8, Ctl_SPEC, crate::common::RW> {
        crate::common::RegisterField::<12,0x3,1,0,u8,u8,Ctl_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Configures the WCO for different board-level connections to the WCO pins.  For example, this can be used to connect an external watch crystal oscillator instead of a watch crystal.   In all cases, the two related GPIO pins (WCO input and output pins) must be configured as analog connections using GPIO registers, and they must be hooked at the board level as described below.  Configure this field before enabling the WCO, and do not change this setting when WCO_EN=1.\n0: Watch crystal.  Connect a 32.768 kHz watch crystal between WCO input and output pins.\n1: Clock signal, either a square wave or sine wave.  See PRESCALER field for connection information."]
    #[inline(always)]
    pub fn wco_bypass(
        self,
    ) -> crate::common::RegisterFieldBool<16, 1, 0, Ctl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<16, 1, 0, Ctl_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Controls the behavior of the switch that generates vddbak from vbackup or vddd.\n0: automatically select vddd if its brownout detector says it is valid.  If the brownout says its not valid, then use vmax which is the highest of vddd or vbackup.\n1,2,3: force vddbak and vmax to select vbackup, regardless of its voltage."]
    #[inline(always)]
    pub fn vddbak_ctl(
        self,
    ) -> crate::common::RegisterField<17, 0x3, 1, 0, u8, u8, Ctl_SPEC, crate::common::RW> {
        crate::common::RegisterField::<17,0x3,1,0,u8,u8,Ctl_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Connect vbackup supply to the vbackup_meas output for measurement by an ADC attached to amuxbusa_adft_vddd.  The vbackup_meas signal is scaled to 10 percent of vbackup, so it is within the supply range of the ADC."]
    #[inline(always)]
    pub fn vbackup_meas(
        self,
    ) -> crate::common::RegisterFieldBool<19, 1, 0, Ctl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<19, 1, 0, Ctl_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "When set to 3C, the supercap charger circuit is enabled.  Any other code disables the supercap charger.  THIS CHARGING CIRCUIT IS FOR A SUPERCAP ONLY AND CANNOT SAFELY CHARGE A BATTERY.  DO NOT WRITE THIS KEY WHEN VBACKUP IS CONNECTED TO A BATTERY."]
    #[inline(always)]
    pub fn en_charge_key(
        self,
    ) -> crate::common::RegisterField<24, 0xff, 1, 0, u8, u8, Ctl_SPEC, crate::common::RW> {
        crate::common::RegisterField::<24,0xff,1,0,u8,u8,Ctl_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for Ctl {
    #[inline(always)]
    fn default() -> Ctl {
        <crate::RegValueT<Ctl_SPEC> as RegisterValue<_>>::new(0)
    }
}
pub mod ctl {

    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
    pub struct ClkSel_SPEC;
    pub type ClkSel = crate::EnumBitfieldStruct<u8, ClkSel_SPEC>;
    impl ClkSel {
        #[doc = "Watch-crystal oscillator input."]
        pub const WCO: Self = Self::new(0);

        #[doc = "This allows to use the LFCLK selection as an alternate backup domain clock.  Note that LFCLK is not available in all power modes, and clock glitches can propagate into the backup logic when the clock is stopped.  For this reason, if the WCO is intended as the clock source then choose it directly instead of routing through LFCLK."]
        pub const ALTBAK: Self = Self::new(1);
    }
}
#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct RtcRw_SPEC;
impl crate::sealed::RegSpec for RtcRw_SPEC {
    type DataType = u32;
}

#[doc = "RTC Read Write register"]
pub type RtcRw = crate::RegValueT<RtcRw_SPEC>;

impl RtcRw {
    #[doc = "Read bit\nWhen this bit is set the RTC registers will be copied to user registers and frozen so that a coherent RTC value can safely be read. The RTC will keep on running.\nDo not set the read bit if the RTC is still busy with a previous update (see RTC_BUSY bit) or if the Write bit is set. Do not set the Read bit at the same time that the Write bit is cleared."]
    #[inline(always)]
    pub fn read(self) -> crate::common::RegisterFieldBool<0, 1, 0, RtcRw_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<0, 1, 0, RtcRw_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Write bit\nOnly when this bit is set can the RTC registers be written to (otherwise writes are ignored). This bit cannot be set if the RTC is still busy with a previous update (see RTC_BUSY bit) or if the Read bit is set or getting set. \nThe user writes to the RTC user registers, when the Write bit is cleared by the user then the user registers content is copied to the actual RTC registers. \nOnly user RTC registers that were written to will get copied, others will not be affected. \nWhen the SECONDS field is updated then TICKS will also be reset (WDT is not affected).\nWhen the Write bit is cleared by a reset (brown out/DeepSleep) then the RTC update will be ignored/lost.\nDo not set the Write bit if the RTC if the RTC is still busy with a previous update (see RTC_BUSY).  Do not set the Write bit at the same time that the Read bit is cleared."]
    #[inline(always)]
    pub fn write(self) -> crate::common::RegisterFieldBool<1, 1, 0, RtcRw_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<1, 1, 0, RtcRw_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }
}
impl ::core::default::Default for RtcRw {
    #[inline(always)]
    fn default() -> RtcRw {
        <crate::RegValueT<RtcRw_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct CalCtl_SPEC;
impl crate::sealed::RegSpec for CalCtl_SPEC {
    type DataType = u32;
}

#[doc = "Oscillator calibration for absolute frequency"]
pub type CalCtl = crate::RegValueT<CalCtl_SPEC>;

impl CalCtl {
    #[doc = "Calibration value for absolute frequency (at a fixed temperature).  Each step causes 128 ticks to be added or removed each hour.  Effectively that means that each step is 1.085ppm (= 128/(60*60*32,768)).\nPositive values 0x01-0x3c (1..60) add pulses, negative values remove pulses, thus giving a range of +/-65.1 ppm (limited by 60 minutes per hour, not the range of this field)\n\nCalibration is performed hourly, starting at 59 minutes and 59 seconds, and applied as 64 ticks every 30 seconds until there have been 2*CALIB_VAL adjustments."]
    #[inline(always)]
    pub fn calib_val(
        self,
    ) -> crate::common::RegisterField<0, 0x3f, 1, 0, u8, u8, CalCtl_SPEC, crate::common::RW> {
        crate::common::RegisterField::<0,0x3f,1,0,u8,u8,CalCtl_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Calibration sign:\n0= Negative sign: remove pulses (it takes more clock ticks to count one second)\n1= Positive sign: add pulses (it takes less clock ticks to count one second)"]
    #[inline(always)]
    pub fn calib_sign(
        self,
    ) -> crate::common::RegisterFieldBool<6, 1, 0, CalCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<6, 1, 0, CalCtl_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Output enable for 512Hz signal for calibration and allow CALIB_VAL to be written. Note that calibration does not affect the 512Hz output signal."]
    #[inline(always)]
    pub fn cal_out(
        self,
    ) -> crate::common::RegisterFieldBool<31, 1, 0, CalCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<31, 1, 0, CalCtl_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }
}
impl ::core::default::Default for CalCtl {
    #[inline(always)]
    fn default() -> CalCtl {
        <crate::RegValueT<CalCtl_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Status_SPEC;
impl crate::sealed::RegSpec for Status_SPEC {
    type DataType = u32;
}

#[doc = "Status"]
pub type Status = crate::RegValueT<Status_SPEC>;

impl Status {
    #[doc = "pending RTC write"]
    #[inline(always)]
    pub fn rtc_busy(
        self,
    ) -> crate::common::RegisterFieldBool<0, 1, 0, Status_SPEC, crate::common::R> {
        crate::common::RegisterFieldBool::<0, 1, 0, Status_SPEC, crate::common::R>::from_register(
            self, 0,
        )
    }

    #[doc = "Indicates that output has transitioned."]
    #[inline(always)]
    pub fn wco_ok(
        self,
    ) -> crate::common::RegisterFieldBool<2, 1, 0, Status_SPEC, crate::common::R> {
        crate::common::RegisterFieldBool::<2, 1, 0, Status_SPEC, crate::common::R>::from_register(
            self, 0,
        )
    }
}
impl ::core::default::Default for Status {
    #[inline(always)]
    fn default() -> Status {
        <crate::RegValueT<Status_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct RtcTime_SPEC;
impl crate::sealed::RegSpec for RtcTime_SPEC {
    type DataType = u32;
}

#[doc = "Calendar Seconds, Minutes, Hours, Day of Week"]
pub type RtcTime = crate::RegValueT<RtcTime_SPEC>;

impl RtcTime {
    #[doc = "Calendar seconds in BCD, 0-59"]
    #[inline(always)]
    pub fn rtc_sec(
        self,
    ) -> crate::common::RegisterField<0, 0x7f, 1, 0, u8, u8, RtcTime_SPEC, crate::common::RW> {
        crate::common::RegisterField::<0,0x7f,1,0,u8,u8,RtcTime_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Calendar minutes in BCD, 0-59"]
    #[inline(always)]
    pub fn rtc_min(
        self,
    ) -> crate::common::RegisterField<8, 0x7f, 1, 0, u8, u8, RtcTime_SPEC, crate::common::RW> {
        crate::common::RegisterField::<8,0x7f,1,0,u8,u8,RtcTime_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Calendar hours in BCD, value depending on 12/24HR mode\n0=24HR: \\[21:16\\]=0-23\n1=12HR: \\[21\\]:0=AM, 1=PM, \\[20:16\\]=1-12"]
    #[inline(always)]
    pub fn rtc_hour(
        self,
    ) -> crate::common::RegisterField<16, 0x3f, 1, 0, u8, u8, RtcTime_SPEC, crate::common::RW> {
        crate::common::RegisterField::<16,0x3f,1,0,u8,u8,RtcTime_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Select 12/24HR mode: 1=12HR, 0=24HR"]
    #[inline(always)]
    pub fn ctrl_12hr(
        self,
    ) -> crate::common::RegisterFieldBool<22, 1, 0, RtcTime_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<22, 1, 0, RtcTime_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Calendar Day of the week in BCD, 1-7\nIt is up to the user to define the meaning of the values, but 1=Monday is recommended"]
    #[inline(always)]
    pub fn rtc_day(
        self,
    ) -> crate::common::RegisterField<24, 0x7, 1, 0, u8, u8, RtcTime_SPEC, crate::common::RW> {
        crate::common::RegisterField::<24,0x7,1,0,u8,u8,RtcTime_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for RtcTime {
    #[inline(always)]
    fn default() -> RtcTime {
        <crate::RegValueT<RtcTime_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct RtcDate_SPEC;
impl crate::sealed::RegSpec for RtcDate_SPEC {
    type DataType = u32;
}

#[doc = "Calendar Day of Month, Month,  Year"]
pub type RtcDate = crate::RegValueT<RtcDate_SPEC>;

impl RtcDate {
    #[doc = "Calendar Day of the Month in BCD, 1-31\nAutomatic Leap Year Correction"]
    #[inline(always)]
    pub fn rtc_date(
        self,
    ) -> crate::common::RegisterField<0, 0x3f, 1, 0, u8, u8, RtcDate_SPEC, crate::common::RW> {
        crate::common::RegisterField::<0,0x3f,1,0,u8,u8,RtcDate_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Calendar Month in BCD, 1-12"]
    #[inline(always)]
    pub fn rtc_mon(
        self,
    ) -> crate::common::RegisterField<8, 0x1f, 1, 0, u8, u8, RtcDate_SPEC, crate::common::RW> {
        crate::common::RegisterField::<8,0x1f,1,0,u8,u8,RtcDate_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Calendar year in BCD, 0-99"]
    #[inline(always)]
    pub fn rtc_year(
        self,
    ) -> crate::common::RegisterField<16, 0xff, 1, 0, u8, u8, RtcDate_SPEC, crate::common::RW> {
        crate::common::RegisterField::<16,0xff,1,0,u8,u8,RtcDate_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for RtcDate {
    #[inline(always)]
    fn default() -> RtcDate {
        <crate::RegValueT<RtcDate_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Alm1Time_SPEC;
impl crate::sealed::RegSpec for Alm1Time_SPEC {
    type DataType = u32;
}

#[doc = "Alarm 1 Seconds, Minute, Hours, Day of Week"]
pub type Alm1Time = crate::RegValueT<Alm1Time_SPEC>;

impl Alm1Time {
    #[doc = "Alarm seconds in BCD, 0-59"]
    #[inline(always)]
    pub fn alm_sec(
        self,
    ) -> crate::common::RegisterField<0, 0x7f, 1, 0, u8, u8, Alm1Time_SPEC, crate::common::RW> {
        crate::common::RegisterField::<0,0x7f,1,0,u8,u8,Alm1Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm second enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_sec_en(
        self,
    ) -> crate::common::RegisterFieldBool<7, 1, 0, Alm1Time_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<7, 1, 0, Alm1Time_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Alarm minutes in BCD, 0-59"]
    #[inline(always)]
    pub fn alm_min(
        self,
    ) -> crate::common::RegisterField<8, 0x7f, 1, 0, u8, u8, Alm1Time_SPEC, crate::common::RW> {
        crate::common::RegisterField::<8,0x7f,1,0,u8,u8,Alm1Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm minutes enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_min_en(
        self,
    ) -> crate::common::RegisterFieldBool<15, 1, 0, Alm1Time_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<15,1,0,Alm1Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm hours in BCD, value depending on 12/24HR mode\n12HR: \\[5\\]:0=AM, 1=PM, \\[4:0\\]=1-12\n24HR: \\[5:0\\]=0-23"]
    #[inline(always)]
    pub fn alm_hour(
        self,
    ) -> crate::common::RegisterField<16, 0x3f, 1, 0, u8, u8, Alm1Time_SPEC, crate::common::RW>
    {
        crate::common::RegisterField::<16,0x3f,1,0,u8,u8,Alm1Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm hour enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_hour_en(
        self,
    ) -> crate::common::RegisterFieldBool<23, 1, 0, Alm1Time_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<23,1,0,Alm1Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm Day of the week in BCD, 1-7\nIt is up to the user to define the meaning of the values, but 1=Monday is recommended"]
    #[inline(always)]
    pub fn alm_day(
        self,
    ) -> crate::common::RegisterField<24, 0x7, 1, 0, u8, u8, Alm1Time_SPEC, crate::common::RW> {
        crate::common::RegisterField::<24,0x7,1,0,u8,u8,Alm1Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm Day of the Week enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_day_en(
        self,
    ) -> crate::common::RegisterFieldBool<31, 1, 0, Alm1Time_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<31,1,0,Alm1Time_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for Alm1Time {
    #[inline(always)]
    fn default() -> Alm1Time {
        <crate::RegValueT<Alm1Time_SPEC> as RegisterValue<_>>::new(16777216)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Alm1Date_SPEC;
impl crate::sealed::RegSpec for Alm1Date_SPEC {
    type DataType = u32;
}

#[doc = "Alarm 1 Day of Month, Month"]
pub type Alm1Date = crate::RegValueT<Alm1Date_SPEC>;

impl Alm1Date {
    #[doc = "Alarm Day of the Month in BCD, 1-31\nLeap Year corrected"]
    #[inline(always)]
    pub fn alm_date(
        self,
    ) -> crate::common::RegisterField<0, 0x3f, 1, 0, u8, u8, Alm1Date_SPEC, crate::common::RW> {
        crate::common::RegisterField::<0,0x3f,1,0,u8,u8,Alm1Date_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm Day of the Month enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_date_en(
        self,
    ) -> crate::common::RegisterFieldBool<7, 1, 0, Alm1Date_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<7, 1, 0, Alm1Date_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Alarm Month in BCD, 1-12"]
    #[inline(always)]
    pub fn alm_mon(
        self,
    ) -> crate::common::RegisterField<8, 0x1f, 1, 0, u8, u8, Alm1Date_SPEC, crate::common::RW> {
        crate::common::RegisterField::<8,0x1f,1,0,u8,u8,Alm1Date_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm Month enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_mon_en(
        self,
    ) -> crate::common::RegisterFieldBool<15, 1, 0, Alm1Date_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<15,1,0,Alm1Date_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Master enable for alarm 1.\n0: Alarm 1 is disabled.  Fields for date and time are ignored.\n1: Alarm 1 is enabled.  Alarm triggers whenever the new date and time matches all the enabled date and time fields, which can happen more than once depending on configuration.  If none of the date and time fields are enabled, then this alarm triggers once every second."]
    #[inline(always)]
    pub fn alm_en(
        self,
    ) -> crate::common::RegisterFieldBool<31, 1, 0, Alm1Date_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<31,1,0,Alm1Date_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for Alm1Date {
    #[inline(always)]
    fn default() -> Alm1Date {
        <crate::RegValueT<Alm1Date_SPEC> as RegisterValue<_>>::new(257)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Alm2Time_SPEC;
impl crate::sealed::RegSpec for Alm2Time_SPEC {
    type DataType = u32;
}

#[doc = "Alarm 2 Seconds, Minute, Hours, Day of Week"]
pub type Alm2Time = crate::RegValueT<Alm2Time_SPEC>;

impl Alm2Time {
    #[doc = "Alarm seconds in BCD, 0-59"]
    #[inline(always)]
    pub fn alm_sec(
        self,
    ) -> crate::common::RegisterField<0, 0x7f, 1, 0, u8, u8, Alm2Time_SPEC, crate::common::RW> {
        crate::common::RegisterField::<0,0x7f,1,0,u8,u8,Alm2Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm second enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_sec_en(
        self,
    ) -> crate::common::RegisterFieldBool<7, 1, 0, Alm2Time_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<7, 1, 0, Alm2Time_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Alarm minutes in BCD, 0-59"]
    #[inline(always)]
    pub fn alm_min(
        self,
    ) -> crate::common::RegisterField<8, 0x7f, 1, 0, u8, u8, Alm2Time_SPEC, crate::common::RW> {
        crate::common::RegisterField::<8,0x7f,1,0,u8,u8,Alm2Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm minutes enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_min_en(
        self,
    ) -> crate::common::RegisterFieldBool<15, 1, 0, Alm2Time_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<15,1,0,Alm2Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm hours in BCD, value depending on 12/24HR mode\n12HR: \\[5\\]:0=AM, 1=PM, \\[4:0\\]=1-12\n24HR: \\[5:0\\]=0-23"]
    #[inline(always)]
    pub fn alm_hour(
        self,
    ) -> crate::common::RegisterField<16, 0x3f, 1, 0, u8, u8, Alm2Time_SPEC, crate::common::RW>
    {
        crate::common::RegisterField::<16,0x3f,1,0,u8,u8,Alm2Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm hour enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_hour_en(
        self,
    ) -> crate::common::RegisterFieldBool<23, 1, 0, Alm2Time_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<23,1,0,Alm2Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm Day of the week in BCD, 1-7\nIt is up to the user to define the meaning of the values, but 1=Monday is recommended"]
    #[inline(always)]
    pub fn alm_day(
        self,
    ) -> crate::common::RegisterField<24, 0x7, 1, 0, u8, u8, Alm2Time_SPEC, crate::common::RW> {
        crate::common::RegisterField::<24,0x7,1,0,u8,u8,Alm2Time_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm Day of the Week enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_day_en(
        self,
    ) -> crate::common::RegisterFieldBool<31, 1, 0, Alm2Time_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<31,1,0,Alm2Time_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for Alm2Time {
    #[inline(always)]
    fn default() -> Alm2Time {
        <crate::RegValueT<Alm2Time_SPEC> as RegisterValue<_>>::new(16777216)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Alm2Date_SPEC;
impl crate::sealed::RegSpec for Alm2Date_SPEC {
    type DataType = u32;
}

#[doc = "Alarm 2 Day of Month, Month"]
pub type Alm2Date = crate::RegValueT<Alm2Date_SPEC>;

impl Alm2Date {
    #[doc = "Alarm Day of the Month in BCD, 1-31\nLeap Year corrected"]
    #[inline(always)]
    pub fn alm_date(
        self,
    ) -> crate::common::RegisterField<0, 0x3f, 1, 0, u8, u8, Alm2Date_SPEC, crate::common::RW> {
        crate::common::RegisterField::<0,0x3f,1,0,u8,u8,Alm2Date_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm Day of the Month enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_date_en(
        self,
    ) -> crate::common::RegisterFieldBool<7, 1, 0, Alm2Date_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<7, 1, 0, Alm2Date_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Alarm Month in BCD, 1-12"]
    #[inline(always)]
    pub fn alm_mon(
        self,
    ) -> crate::common::RegisterField<8, 0x1f, 1, 0, u8, u8, Alm2Date_SPEC, crate::common::RW> {
        crate::common::RegisterField::<8,0x1f,1,0,u8,u8,Alm2Date_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Alarm Month enable: 0=ignore, 1=match"]
    #[inline(always)]
    pub fn alm_mon_en(
        self,
    ) -> crate::common::RegisterFieldBool<15, 1, 0, Alm2Date_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<15,1,0,Alm2Date_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "Master enable for alarm 2.\n0: Alarm 2 is disabled.  Fields for date and time are ignored.\n1: Alarm 2 is enabled.  Alarm triggers whenever the new date and time matches all the enabled date and time fields, which can happen more than once depending on configuration.  If none of the date and time fields are enabled, then this alarm triggers once every second."]
    #[inline(always)]
    pub fn alm_en(
        self,
    ) -> crate::common::RegisterFieldBool<31, 1, 0, Alm2Date_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<31,1,0,Alm2Date_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for Alm2Date {
    #[inline(always)]
    fn default() -> Alm2Date {
        <crate::RegValueT<Alm2Date_SPEC> as RegisterValue<_>>::new(257)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Intr_SPEC;
impl crate::sealed::RegSpec for Intr_SPEC {
    type DataType = u32;
}

#[doc = "Interrupt request register"]
pub type Intr = crate::RegValueT<Intr_SPEC>;

impl Intr {
    #[doc = "Alarm 1 Interrupt"]
    #[inline(always)]
    pub fn alarm1(self) -> crate::common::RegisterFieldBool<0, 1, 0, Intr_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<0, 1, 0, Intr_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Alarm 2 Interrupt"]
    #[inline(always)]
    pub fn alarm2(self) -> crate::common::RegisterFieldBool<1, 1, 0, Intr_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<1, 1, 0, Intr_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Century overflow interrupt"]
    #[inline(always)]
    pub fn century(
        self,
    ) -> crate::common::RegisterFieldBool<2, 1, 0, Intr_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<2, 1, 0, Intr_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }
}
impl ::core::default::Default for Intr {
    #[inline(always)]
    fn default() -> Intr {
        <crate::RegValueT<Intr_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct IntrSet_SPEC;
impl crate::sealed::RegSpec for IntrSet_SPEC {
    type DataType = u32;
}

#[doc = "Interrupt set request register"]
pub type IntrSet = crate::RegValueT<IntrSet_SPEC>;

impl IntrSet {
    #[doc = "Write with \'1\' to set corresponding bit in interrupt request register."]
    #[inline(always)]
    pub fn alarm1(
        self,
    ) -> crate::common::RegisterFieldBool<0, 1, 0, IntrSet_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<0, 1, 0, IntrSet_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Write with \'1\' to set corresponding bit in interrupt request register."]
    #[inline(always)]
    pub fn alarm2(
        self,
    ) -> crate::common::RegisterFieldBool<1, 1, 0, IntrSet_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<1, 1, 0, IntrSet_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Write with \'1\' to set corresponding bit in interrupt request register."]
    #[inline(always)]
    pub fn century(
        self,
    ) -> crate::common::RegisterFieldBool<2, 1, 0, IntrSet_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<2, 1, 0, IntrSet_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }
}
impl ::core::default::Default for IntrSet {
    #[inline(always)]
    fn default() -> IntrSet {
        <crate::RegValueT<IntrSet_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct IntrMask_SPEC;
impl crate::sealed::RegSpec for IntrMask_SPEC {
    type DataType = u32;
}

#[doc = "Interrupt mask register"]
pub type IntrMask = crate::RegValueT<IntrMask_SPEC>;

impl IntrMask {
    #[doc = "Mask bit for corresponding bit in interrupt request register."]
    #[inline(always)]
    pub fn alarm1(
        self,
    ) -> crate::common::RegisterFieldBool<0, 1, 0, IntrMask_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<0, 1, 0, IntrMask_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Mask bit for corresponding bit in interrupt request register."]
    #[inline(always)]
    pub fn alarm2(
        self,
    ) -> crate::common::RegisterFieldBool<1, 1, 0, IntrMask_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<1, 1, 0, IntrMask_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Mask bit for corresponding bit in interrupt request register."]
    #[inline(always)]
    pub fn century(
        self,
    ) -> crate::common::RegisterFieldBool<2, 1, 0, IntrMask_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<2, 1, 0, IntrMask_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }
}
impl ::core::default::Default for IntrMask {
    #[inline(always)]
    fn default() -> IntrMask {
        <crate::RegValueT<IntrMask_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct IntrMasked_SPEC;
impl crate::sealed::RegSpec for IntrMasked_SPEC {
    type DataType = u32;
}

#[doc = "Interrupt masked request register"]
pub type IntrMasked = crate::RegValueT<IntrMasked_SPEC>;

impl IntrMasked {
    #[doc = "Logical and of corresponding request and mask bits."]
    #[inline(always)]
    pub fn alarm1(
        self,
    ) -> crate::common::RegisterFieldBool<0, 1, 0, IntrMasked_SPEC, crate::common::R> {
        crate::common::RegisterFieldBool::<0,1,0,IntrMasked_SPEC,crate::common::R>::from_register(self,0)
    }

    #[doc = "Logical and of corresponding request and mask bits."]
    #[inline(always)]
    pub fn alarm2(
        self,
    ) -> crate::common::RegisterFieldBool<1, 1, 0, IntrMasked_SPEC, crate::common::R> {
        crate::common::RegisterFieldBool::<1,1,0,IntrMasked_SPEC,crate::common::R>::from_register(self,0)
    }

    #[doc = "Logical and of corresponding request and mask bits."]
    #[inline(always)]
    pub fn century(
        self,
    ) -> crate::common::RegisterFieldBool<2, 1, 0, IntrMasked_SPEC, crate::common::R> {
        crate::common::RegisterFieldBool::<2,1,0,IntrMasked_SPEC,crate::common::R>::from_register(self,0)
    }
}
impl ::core::default::Default for IntrMasked {
    #[inline(always)]
    fn default() -> IntrMasked {
        <crate::RegValueT<IntrMasked_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Osccnt_SPEC;
impl crate::sealed::RegSpec for Osccnt_SPEC {
    type DataType = u32;
}

#[doc = "32kHz oscillator counter"]
pub type Osccnt = crate::RegValueT<Osccnt_SPEC>;

impl Osccnt {
    #[doc = "32kHz oscillator count (msb=128Hz), calibration can cause bit 6 to skip.  Reset when RTC_TIME.RTC_SEC fields is written."]
    #[inline(always)]
    pub fn cnt32khz(
        self,
    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Osccnt_SPEC, crate::common::R> {
        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Osccnt_SPEC,crate::common::R>::from_register(self,0)
    }
}
impl ::core::default::Default for Osccnt {
    #[inline(always)]
    fn default() -> Osccnt {
        <crate::RegValueT<Osccnt_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ticks_SPEC;
impl crate::sealed::RegSpec for Ticks_SPEC {
    type DataType = u32;
}

#[doc = "128Hz tick counter"]
pub type Ticks = crate::RegValueT<Ticks_SPEC>;

impl Ticks {
    #[doc = "128Hz counter (msb=2Hz)\nWhen SECONDS is written this field will be reset."]
    #[inline(always)]
    pub fn cnt128hz(
        self,
    ) -> crate::common::RegisterField<0, 0x3f, 1, 0, u8, u8, Ticks_SPEC, crate::common::R> {
        crate::common::RegisterField::<0,0x3f,1,0,u8,u8,Ticks_SPEC,crate::common::R>::from_register(self,0)
    }
}
impl ::core::default::Default for Ticks {
    #[inline(always)]
    fn default() -> Ticks {
        <crate::RegValueT<Ticks_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct PmicCtl_SPEC;
impl crate::sealed::RegSpec for PmicCtl_SPEC {
    type DataType = u32;
}

#[doc = "PMIC control register"]
pub type PmicCtl = crate::RegValueT<PmicCtl_SPEC>;

impl PmicCtl {
    #[doc = "This byte must be set to 0x3A for PMIC to be disabled.  When the UNLOCK code is not present: writes to PMIC_EN field are ignored and the hardware ignores the value in PMIC_EN.  Do not change PMIC_EN in the same write cycle as setting/clearing the UNLOCK code; do these in separate write cycles."]
    #[inline(always)]
    pub fn unlock(
        self,
    ) -> crate::common::RegisterField<8, 0xff, 1, 0, u8, u8, PmicCtl_SPEC, crate::common::RW> {
        crate::common::RegisterField::<8,0xff,1,0,u8,u8,PmicCtl_SPEC,crate::common::RW>::from_register(self,0)
    }

    #[doc = "N/A"]
    #[inline(always)]
    pub fn polarity(
        self,
    ) -> crate::common::RegisterFieldBool<16, 1, 0, PmicCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<16, 1, 0, PmicCtl_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Output enable for the output driver in the PMIC_EN pad.\n0: Output pad is tristate for PMIC_EN pin.  This can allow this pin to be used for another purpose. Tristate condition is kept only if the UNLOCK key (0x3A) is present\n1: Output pad is enabled for PMIC_EN pin."]
    #[inline(always)]
    pub fn pmic_en_outen(
        self,
    ) -> crate::common::RegisterFieldBool<29, 1, 0, PmicCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<29, 1, 0, PmicCtl_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Override normal PMIC controls to prevent accidentally turning off the PMIC by errant firmware.\n0: Normal operation, PMIC_EN and PMIC_OUTEN work as described\n1: PMIC_EN and PMIC_OUTEN are ignored and the output pad is forced enabled.\nNote: This bit is a write-once bit until the next backup reset."]
    #[inline(always)]
    pub fn pmic_alwaysen(
        self,
    ) -> crate::common::RegisterFieldBool<30, 1, 0, PmicCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<30, 1, 0, PmicCtl_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }

    #[doc = "Enable for external PMIC that supplies vddd (if present).  This bit will only clear if UNLOCK was written correctly in a previous write operation and PMIC_ALWAYSEN=0.  When PMIC_EN=0, the system functions normally until vddd is no longer present (OFF w/Backup mode).  Firmware can set this bit, if it does so before vddd is actually removed.  This bit is also set by any RTC alarm or PMIC pin wakeup event regardless of UNLOCK setting."]
    #[inline(always)]
    pub fn pmic_en(
        self,
    ) -> crate::common::RegisterFieldBool<31, 1, 0, PmicCtl_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<31, 1, 0, PmicCtl_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }
}
impl ::core::default::Default for PmicCtl {
    #[inline(always)]
    fn default() -> PmicCtl {
        <crate::RegValueT<PmicCtl_SPEC> as RegisterValue<_>>::new(2684354560)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Reset_SPEC;
impl crate::sealed::RegSpec for Reset_SPEC {
    type DataType = u32;
}

#[doc = "Backup reset register"]
pub type Reset = crate::RegValueT<Reset_SPEC>;

impl Reset {
    #[doc = "Writing 1 to this register resets the backup logic.  Hardware clears it when the reset is complete.  After setting this register, firmware should confirm it reads as 0 before attempting to write other backup registers."]
    #[inline(always)]
    pub fn reset(
        self,
    ) -> crate::common::RegisterFieldBool<31, 1, 0, Reset_SPEC, crate::common::RW> {
        crate::common::RegisterFieldBool::<31, 1, 0, Reset_SPEC, crate::common::RW>::from_register(
            self, 0,
        )
    }
}
impl ::core::default::Default for Reset {
    #[inline(always)]
    fn default() -> Reset {
        <crate::RegValueT<Reset_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Breg_SPEC;
impl crate::sealed::RegSpec for Breg_SPEC {
    type DataType = u32;
}

#[doc = "Backup register region"]
pub type Breg = crate::RegValueT<Breg_SPEC>;

impl Breg {
    #[doc = "Backup memory that contains application-specific data.  Memory is retained on vbackup supply."]
    #[inline(always)]
    pub fn breg(
        self,
    ) -> crate::common::RegisterField<0, 0xffffffff, 1, 0, u32, u32, Breg_SPEC, crate::common::RW>
    {
        crate::common::RegisterField::<0,0xffffffff,1,0,u32,u32,Breg_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for Breg {
    #[inline(always)]
    fn default() -> Breg {
        <crate::RegValueT<Breg_SPEC> as RegisterValue<_>>::new(0)
    }
}

#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Trim_SPEC;
impl crate::sealed::RegSpec for Trim_SPEC {
    type DataType = u32;
}

#[doc = "Trim Register"]
pub type Trim = crate::RegValueT<Trim_SPEC>;

impl Trim {
    #[doc = "WCO trim"]
    #[inline(always)]
    pub fn trim(
        self,
    ) -> crate::common::RegisterField<0, 0x3f, 1, 0, u8, u8, Trim_SPEC, crate::common::RW> {
        crate::common::RegisterField::<0,0x3f,1,0,u8,u8,Trim_SPEC,crate::common::RW>::from_register(self,0)
    }
}
impl ::core::default::Default for Trim {
    #[inline(always)]
    fn default() -> Trim {
        <crate::RegValueT<Trim_SPEC> as RegisterValue<_>>::new(0)
    }
}