stm32-metapac 18.0.0

Peripheral Access Crate (PAC) for all STM32 chips, including metadata.
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
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::identity_op)]
#![allow(clippy::unnecessary_cast)]
#![allow(clippy::erasing_op)]

#[doc = "Digital camera interface"]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Dcmi {
    ptr: *mut u8,
}
unsafe impl Send for Dcmi {}
unsafe impl Sync for Dcmi {}
impl Dcmi {
    #[inline(always)]
    pub const unsafe fn from_ptr(ptr: *mut ()) -> Self {
        Self { ptr: ptr as _ }
    }
    #[inline(always)]
    pub const fn as_ptr(&self) -> *mut () {
        self.ptr as _
    }
    #[doc = "control register 1"]
    #[inline(always)]
    pub const fn cr(self) -> crate::common::Reg<regs::Cr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0usize) as _) }
    }
    #[doc = "status register"]
    #[inline(always)]
    pub const fn sr(self) -> crate::common::Reg<regs::Sr, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x04usize) as _) }
    }
    #[doc = "raw interrupt status register"]
    #[inline(always)]
    pub const fn ris(self) -> crate::common::Reg<regs::Ris, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x08usize) as _) }
    }
    #[doc = "interrupt enable register"]
    #[inline(always)]
    pub const fn ier(self) -> crate::common::Reg<regs::Ier, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0cusize) as _) }
    }
    #[doc = "masked interrupt status register"]
    #[inline(always)]
    pub const fn mis(self) -> crate::common::Reg<regs::Mis, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x10usize) as _) }
    }
    #[doc = "interrupt clear register"]
    #[inline(always)]
    pub const fn icr(self) -> crate::common::Reg<regs::Icr, crate::common::W> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x14usize) as _) }
    }
    #[doc = "embedded synchronization code register"]
    #[inline(always)]
    pub const fn escr(self) -> crate::common::Reg<regs::Escr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x18usize) as _) }
    }
    #[doc = "embedded synchronization unmask register"]
    #[inline(always)]
    pub const fn esur(self) -> crate::common::Reg<regs::Esur, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1cusize) as _) }
    }
    #[doc = "crop window start"]
    #[inline(always)]
    pub const fn cwstrt(self) -> crate::common::Reg<regs::Cwstrt, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x20usize) as _) }
    }
    #[doc = "crop window size"]
    #[inline(always)]
    pub const fn cwsize(self) -> crate::common::Reg<regs::Cwsize, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x24usize) as _) }
    }
    #[doc = "data register"]
    #[inline(always)]
    pub const fn dr(self) -> crate::common::Reg<regs::Dr, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x28usize) as _) }
    }
}
pub mod regs {
    #[doc = "control register 1"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cr(pub u32);
    impl Cr {
        #[doc = "Capture enable"]
        #[inline(always)]
        pub const fn capture(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Capture enable"]
        #[inline(always)]
        pub fn set_capture(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Capture mode"]
        #[inline(always)]
        pub const fn cm(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Capture mode"]
        #[inline(always)]
        pub fn set_cm(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Crop feature"]
        #[inline(always)]
        pub const fn crop(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Crop feature"]
        #[inline(always)]
        pub fn set_crop(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "JPEG format"]
        #[inline(always)]
        pub const fn jpeg(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "JPEG format"]
        #[inline(always)]
        pub fn set_jpeg(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Embedded synchronization select"]
        #[inline(always)]
        pub const fn ess(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Embedded synchronization select"]
        #[inline(always)]
        pub fn set_ess(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
        }
        #[doc = "Pixel clock polarity"]
        #[inline(always)]
        pub const fn pckpol(&self) -> bool {
            let val = (self.0 >> 5usize) & 0x01;
            val != 0
        }
        #[doc = "Pixel clock polarity"]
        #[inline(always)]
        pub fn set_pckpol(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
        }
        #[doc = "Horizontal synchronization polarity"]
        #[inline(always)]
        pub const fn hspol(&self) -> bool {
            let val = (self.0 >> 6usize) & 0x01;
            val != 0
        }
        #[doc = "Horizontal synchronization polarity"]
        #[inline(always)]
        pub fn set_hspol(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
        }
        #[doc = "Vertical synchronization polarity"]
        #[inline(always)]
        pub const fn vspol(&self) -> bool {
            let val = (self.0 >> 7usize) & 0x01;
            val != 0
        }
        #[doc = "Vertical synchronization polarity"]
        #[inline(always)]
        pub fn set_vspol(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
        }
        #[doc = "Frame capture rate control"]
        #[inline(always)]
        pub const fn fcrc(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0x03;
            val as u8
        }
        #[doc = "Frame capture rate control"]
        #[inline(always)]
        pub fn set_fcrc(&mut self, val: u8) {
            self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize);
        }
        #[doc = "Extended data mode"]
        #[inline(always)]
        pub const fn edm(&self) -> u8 {
            let val = (self.0 >> 10usize) & 0x03;
            val as u8
        }
        #[doc = "Extended data mode"]
        #[inline(always)]
        pub fn set_edm(&mut self, val: u8) {
            self.0 = (self.0 & !(0x03 << 10usize)) | (((val as u32) & 0x03) << 10usize);
        }
        #[doc = "DCMI enable"]
        #[inline(always)]
        pub const fn enable(&self) -> bool {
            let val = (self.0 >> 14usize) & 0x01;
            val != 0
        }
        #[doc = "DCMI enable"]
        #[inline(always)]
        pub fn set_enable(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
        }
    }
    impl Default for Cr {
        #[inline(always)]
        fn default() -> Cr {
            Cr(0)
        }
    }
    impl core::fmt::Debug for Cr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Cr")
                .field("capture", &self.capture())
                .field("cm", &self.cm())
                .field("crop", &self.crop())
                .field("jpeg", &self.jpeg())
                .field("ess", &self.ess())
                .field("pckpol", &self.pckpol())
                .field("hspol", &self.hspol())
                .field("vspol", &self.vspol())
                .field("fcrc", &self.fcrc())
                .field("edm", &self.edm())
                .field("enable", &self.enable())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cr {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Cr {{ capture: {=bool:?}, cm: {=bool:?}, crop: {=bool:?}, jpeg: {=bool:?}, ess: {=bool:?}, pckpol: {=bool:?}, hspol: {=bool:?}, vspol: {=bool:?}, fcrc: {=u8:?}, edm: {=u8:?}, enable: {=bool:?} }}" , self . capture () , self . cm () , self . crop () , self . jpeg () , self . ess () , self . pckpol () , self . hspol () , self . vspol () , self . fcrc () , self . edm () , self . enable ())
        }
    }
    #[doc = "crop window size"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cwsize(pub u32);
    impl Cwsize {
        #[doc = "Capture count"]
        #[inline(always)]
        pub const fn capcnt(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x3fff;
            val as u16
        }
        #[doc = "Capture count"]
        #[inline(always)]
        pub fn set_capcnt(&mut self, val: u16) {
            self.0 = (self.0 & !(0x3fff << 0usize)) | (((val as u32) & 0x3fff) << 0usize);
        }
        #[doc = "Vertical line count"]
        #[inline(always)]
        pub const fn vline(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0x3fff;
            val as u16
        }
        #[doc = "Vertical line count"]
        #[inline(always)]
        pub fn set_vline(&mut self, val: u16) {
            self.0 = (self.0 & !(0x3fff << 16usize)) | (((val as u32) & 0x3fff) << 16usize);
        }
    }
    impl Default for Cwsize {
        #[inline(always)]
        fn default() -> Cwsize {
            Cwsize(0)
        }
    }
    impl core::fmt::Debug for Cwsize {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Cwsize")
                .field("capcnt", &self.capcnt())
                .field("vline", &self.vline())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cwsize {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Cwsize {{ capcnt: {=u16:?}, vline: {=u16:?} }}",
                self.capcnt(),
                self.vline()
            )
        }
    }
    #[doc = "crop window start"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cwstrt(pub u32);
    impl Cwstrt {
        #[doc = "Horizontal offset count"]
        #[inline(always)]
        pub const fn hoffcnt(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x3fff;
            val as u16
        }
        #[doc = "Horizontal offset count"]
        #[inline(always)]
        pub fn set_hoffcnt(&mut self, val: u16) {
            self.0 = (self.0 & !(0x3fff << 0usize)) | (((val as u32) & 0x3fff) << 0usize);
        }
        #[doc = "Vertical start line count"]
        #[inline(always)]
        pub const fn vst(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0x1fff;
            val as u16
        }
        #[doc = "Vertical start line count"]
        #[inline(always)]
        pub fn set_vst(&mut self, val: u16) {
            self.0 = (self.0 & !(0x1fff << 16usize)) | (((val as u32) & 0x1fff) << 16usize);
        }
    }
    impl Default for Cwstrt {
        #[inline(always)]
        fn default() -> Cwstrt {
            Cwstrt(0)
        }
    }
    impl core::fmt::Debug for Cwstrt {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Cwstrt")
                .field("hoffcnt", &self.hoffcnt())
                .field("vst", &self.vst())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cwstrt {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Cwstrt {{ hoffcnt: {=u16:?}, vst: {=u16:?} }}",
                self.hoffcnt(),
                self.vst()
            )
        }
    }
    #[doc = "data register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Dr(pub u32);
    impl Dr {
        #[doc = "Data byte 0"]
        #[inline(always)]
        pub const fn byte0(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Data byte 0"]
        #[inline(always)]
        pub fn set_byte0(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Data byte 1"]
        #[inline(always)]
        pub const fn byte1(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Data byte 1"]
        #[inline(always)]
        pub fn set_byte1(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Data byte 2"]
        #[inline(always)]
        pub const fn byte2(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Data byte 2"]
        #[inline(always)]
        pub fn set_byte2(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
        #[doc = "Data byte 3"]
        #[inline(always)]
        pub const fn byte3(&self) -> u8 {
            let val = (self.0 >> 24usize) & 0xff;
            val as u8
        }
        #[doc = "Data byte 3"]
        #[inline(always)]
        pub fn set_byte3(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
        }
    }
    impl Default for Dr {
        #[inline(always)]
        fn default() -> Dr {
            Dr(0)
        }
    }
    impl core::fmt::Debug for Dr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Dr")
                .field("byte0", &self.byte0())
                .field("byte1", &self.byte1())
                .field("byte2", &self.byte2())
                .field("byte3", &self.byte3())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Dr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Dr {{ byte0: {=u8:?}, byte1: {=u8:?}, byte2: {=u8:?}, byte3: {=u8:?} }}",
                self.byte0(),
                self.byte1(),
                self.byte2(),
                self.byte3()
            )
        }
    }
    #[doc = "embedded synchronization code register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Escr(pub u32);
    impl Escr {
        #[doc = "Frame start delimiter code"]
        #[inline(always)]
        pub const fn fsc(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Frame start delimiter code"]
        #[inline(always)]
        pub fn set_fsc(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Line start delimiter code"]
        #[inline(always)]
        pub const fn lsc(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Line start delimiter code"]
        #[inline(always)]
        pub fn set_lsc(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Line end delimiter code"]
        #[inline(always)]
        pub const fn lec(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Line end delimiter code"]
        #[inline(always)]
        pub fn set_lec(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
        #[doc = "Frame end delimiter code"]
        #[inline(always)]
        pub const fn fec(&self) -> u8 {
            let val = (self.0 >> 24usize) & 0xff;
            val as u8
        }
        #[doc = "Frame end delimiter code"]
        #[inline(always)]
        pub fn set_fec(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
        }
    }
    impl Default for Escr {
        #[inline(always)]
        fn default() -> Escr {
            Escr(0)
        }
    }
    impl core::fmt::Debug for Escr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Escr")
                .field("fsc", &self.fsc())
                .field("lsc", &self.lsc())
                .field("lec", &self.lec())
                .field("fec", &self.fec())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Escr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Escr {{ fsc: {=u8:?}, lsc: {=u8:?}, lec: {=u8:?}, fec: {=u8:?} }}",
                self.fsc(),
                self.lsc(),
                self.lec(),
                self.fec()
            )
        }
    }
    #[doc = "embedded synchronization unmask register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Esur(pub u32);
    impl Esur {
        #[doc = "Frame start delimiter unmask"]
        #[inline(always)]
        pub const fn fsu(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Frame start delimiter unmask"]
        #[inline(always)]
        pub fn set_fsu(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Line start delimiter unmask"]
        #[inline(always)]
        pub const fn lsu(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Line start delimiter unmask"]
        #[inline(always)]
        pub fn set_lsu(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Line end delimiter unmask"]
        #[inline(always)]
        pub const fn leu(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Line end delimiter unmask"]
        #[inline(always)]
        pub fn set_leu(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
        #[doc = "Frame end delimiter unmask"]
        #[inline(always)]
        pub const fn feu(&self) -> u8 {
            let val = (self.0 >> 24usize) & 0xff;
            val as u8
        }
        #[doc = "Frame end delimiter unmask"]
        #[inline(always)]
        pub fn set_feu(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
        }
    }
    impl Default for Esur {
        #[inline(always)]
        fn default() -> Esur {
            Esur(0)
        }
    }
    impl core::fmt::Debug for Esur {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Esur")
                .field("fsu", &self.fsu())
                .field("lsu", &self.lsu())
                .field("leu", &self.leu())
                .field("feu", &self.feu())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Esur {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Esur {{ fsu: {=u8:?}, lsu: {=u8:?}, leu: {=u8:?}, feu: {=u8:?} }}",
                self.fsu(),
                self.lsu(),
                self.leu(),
                self.feu()
            )
        }
    }
    #[doc = "interrupt clear register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Icr(pub u32);
    impl Icr {
        #[doc = "Capture complete interrupt status clear"]
        #[inline(always)]
        pub const fn frame_isc(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Capture complete interrupt status clear"]
        #[inline(always)]
        pub fn set_frame_isc(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Overrun interrupt status clear"]
        #[inline(always)]
        pub const fn ovr_isc(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Overrun interrupt status clear"]
        #[inline(always)]
        pub fn set_ovr_isc(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Synchronization error interrupt status clear"]
        #[inline(always)]
        pub const fn err_isc(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Synchronization error interrupt status clear"]
        #[inline(always)]
        pub fn set_err_isc(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "Vertical synch interrupt status clear"]
        #[inline(always)]
        pub const fn vsync_isc(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Vertical synch interrupt status clear"]
        #[inline(always)]
        pub fn set_vsync_isc(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "line interrupt status clear"]
        #[inline(always)]
        pub const fn line_isc(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "line interrupt status clear"]
        #[inline(always)]
        pub fn set_line_isc(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
        }
    }
    impl Default for Icr {
        #[inline(always)]
        fn default() -> Icr {
            Icr(0)
        }
    }
    impl core::fmt::Debug for Icr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Icr")
                .field("frame_isc", &self.frame_isc())
                .field("ovr_isc", &self.ovr_isc())
                .field("err_isc", &self.err_isc())
                .field("vsync_isc", &self.vsync_isc())
                .field("line_isc", &self.line_isc())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Icr {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Icr {{ frame_isc: {=bool:?}, ovr_isc: {=bool:?}, err_isc: {=bool:?}, vsync_isc: {=bool:?}, line_isc: {=bool:?} }}" , self . frame_isc () , self . ovr_isc () , self . err_isc () , self . vsync_isc () , self . line_isc ())
        }
    }
    #[doc = "interrupt enable register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Ier(pub u32);
    impl Ier {
        #[doc = "Capture complete interrupt enable"]
        #[inline(always)]
        pub const fn frame_ie(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Capture complete interrupt enable"]
        #[inline(always)]
        pub fn set_frame_ie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Overrun interrupt enable"]
        #[inline(always)]
        pub const fn ovr_ie(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Overrun interrupt enable"]
        #[inline(always)]
        pub fn set_ovr_ie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Synchronization error interrupt enable"]
        #[inline(always)]
        pub const fn err_ie(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Synchronization error interrupt enable"]
        #[inline(always)]
        pub fn set_err_ie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "VSYNC interrupt enable"]
        #[inline(always)]
        pub const fn vsync_ie(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "VSYNC interrupt enable"]
        #[inline(always)]
        pub fn set_vsync_ie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Line interrupt enable"]
        #[inline(always)]
        pub const fn line_ie(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Line interrupt enable"]
        #[inline(always)]
        pub fn set_line_ie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
        }
    }
    impl Default for Ier {
        #[inline(always)]
        fn default() -> Ier {
            Ier(0)
        }
    }
    impl core::fmt::Debug for Ier {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Ier")
                .field("frame_ie", &self.frame_ie())
                .field("ovr_ie", &self.ovr_ie())
                .field("err_ie", &self.err_ie())
                .field("vsync_ie", &self.vsync_ie())
                .field("line_ie", &self.line_ie())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Ier {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Ier {{ frame_ie: {=bool:?}, ovr_ie: {=bool:?}, err_ie: {=bool:?}, vsync_ie: {=bool:?}, line_ie: {=bool:?} }}" , self . frame_ie () , self . ovr_ie () , self . err_ie () , self . vsync_ie () , self . line_ie ())
        }
    }
    #[doc = "masked interrupt status register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Mis(pub u32);
    impl Mis {
        #[doc = "Capture complete masked interrupt status"]
        #[inline(always)]
        pub const fn frame_mis(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Capture complete masked interrupt status"]
        #[inline(always)]
        pub fn set_frame_mis(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Overrun masked interrupt status"]
        #[inline(always)]
        pub const fn ovr_mis(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Overrun masked interrupt status"]
        #[inline(always)]
        pub fn set_ovr_mis(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Synchronization error masked interrupt status"]
        #[inline(always)]
        pub const fn err_mis(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Synchronization error masked interrupt status"]
        #[inline(always)]
        pub fn set_err_mis(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "VSYNC masked interrupt status"]
        #[inline(always)]
        pub const fn vsync_mis(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "VSYNC masked interrupt status"]
        #[inline(always)]
        pub fn set_vsync_mis(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Line masked interrupt status"]
        #[inline(always)]
        pub const fn line_mis(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Line masked interrupt status"]
        #[inline(always)]
        pub fn set_line_mis(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
        }
    }
    impl Default for Mis {
        #[inline(always)]
        fn default() -> Mis {
            Mis(0)
        }
    }
    impl core::fmt::Debug for Mis {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Mis")
                .field("frame_mis", &self.frame_mis())
                .field("ovr_mis", &self.ovr_mis())
                .field("err_mis", &self.err_mis())
                .field("vsync_mis", &self.vsync_mis())
                .field("line_mis", &self.line_mis())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Mis {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Mis {{ frame_mis: {=bool:?}, ovr_mis: {=bool:?}, err_mis: {=bool:?}, vsync_mis: {=bool:?}, line_mis: {=bool:?} }}" , self . frame_mis () , self . ovr_mis () , self . err_mis () , self . vsync_mis () , self . line_mis ())
        }
    }
    #[doc = "raw interrupt status register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Ris(pub u32);
    impl Ris {
        #[doc = "Capture complete raw interrupt status"]
        #[inline(always)]
        pub const fn frame_ris(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Capture complete raw interrupt status"]
        #[inline(always)]
        pub fn set_frame_ris(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Overrun raw interrupt status"]
        #[inline(always)]
        pub const fn ovr_ris(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Overrun raw interrupt status"]
        #[inline(always)]
        pub fn set_ovr_ris(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Synchronization error raw interrupt status"]
        #[inline(always)]
        pub const fn err_ris(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Synchronization error raw interrupt status"]
        #[inline(always)]
        pub fn set_err_ris(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "VSYNC raw interrupt status"]
        #[inline(always)]
        pub const fn vsync_ris(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "VSYNC raw interrupt status"]
        #[inline(always)]
        pub fn set_vsync_ris(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Line raw interrupt status"]
        #[inline(always)]
        pub const fn line_ris(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Line raw interrupt status"]
        #[inline(always)]
        pub fn set_line_ris(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
        }
    }
    impl Default for Ris {
        #[inline(always)]
        fn default() -> Ris {
            Ris(0)
        }
    }
    impl core::fmt::Debug for Ris {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Ris")
                .field("frame_ris", &self.frame_ris())
                .field("ovr_ris", &self.ovr_ris())
                .field("err_ris", &self.err_ris())
                .field("vsync_ris", &self.vsync_ris())
                .field("line_ris", &self.line_ris())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Ris {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Ris {{ frame_ris: {=bool:?}, ovr_ris: {=bool:?}, err_ris: {=bool:?}, vsync_ris: {=bool:?}, line_ris: {=bool:?} }}" , self . frame_ris () , self . ovr_ris () , self . err_ris () , self . vsync_ris () , self . line_ris ())
        }
    }
    #[doc = "status register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Sr(pub u32);
    impl Sr {
        #[doc = "HSYNC"]
        #[inline(always)]
        pub const fn hsync(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "HSYNC"]
        #[inline(always)]
        pub fn set_hsync(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "VSYNC"]
        #[inline(always)]
        pub const fn vsync(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "VSYNC"]
        #[inline(always)]
        pub fn set_vsync(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "FIFO not empty"]
        #[inline(always)]
        pub const fn fne(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "FIFO not empty"]
        #[inline(always)]
        pub fn set_fne(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
    }
    impl Default for Sr {
        #[inline(always)]
        fn default() -> Sr {
            Sr(0)
        }
    }
    impl core::fmt::Debug for Sr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Sr")
                .field("hsync", &self.hsync())
                .field("vsync", &self.vsync())
                .field("fne", &self.fne())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Sr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Sr {{ hsync: {=bool:?}, vsync: {=bool:?}, fne: {=bool:?} }}",
                self.hsync(),
                self.vsync(),
                self.fne()
            )
        }
    }
}