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
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::identity_op)]
#![allow(clippy::unnecessary_cast)]
#![allow(clippy::erasing_op)]

#[doc = "Digital Video Port."]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Dvp {
    ptr: *mut u8,
}
unsafe impl Send for Dvp {}
unsafe impl Sync for Dvp {}
impl Dvp {
    #[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 = "Digital Video control register. (DVP_CR0)."]
    #[inline(always)]
    pub const fn cr0(self) -> crate::common::Reg<regs::Cr0, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0usize) as _) }
    }
    #[doc = "Digital Video control register. (DVP_CR1)."]
    #[inline(always)]
    pub const fn cr1(self) -> crate::common::Reg<regs::Cr1, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x01usize) as _) }
    }
    #[doc = "Digital Video Interrupt register. (DVP_IER)."]
    #[inline(always)]
    pub const fn ier(self) -> crate::common::Reg<regs::Ier, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x02usize) as _) }
    }
    #[doc = "Image line count configuration register. (DVP_ROW_NUM)."]
    #[inline(always)]
    pub const fn row_num(self) -> crate::common::Reg<regs::RowNum, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x04usize) as _) }
    }
    #[doc = "Image column number configuration register. (DVP_COL_NUM)."]
    #[inline(always)]
    pub const fn col_num(self) -> crate::common::Reg<regs::ColNum, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x06usize) as _) }
    }
    #[doc = "Digital Video DMA address register. (DVP_DMA_BUF0)."]
    #[inline(always)]
    pub const fn dma_buf0(self) -> crate::common::Reg<regs::DmaBuf0, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x08usize) as _) }
    }
    #[doc = "Digital Video DMA address register. (DVP_DMA_BUF1)."]
    #[inline(always)]
    pub const fn dma_buf1(self) -> crate::common::Reg<regs::DmaBuf1, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0cusize) as _) }
    }
    #[doc = "Digital Video Flag register. (DVP_IFR)."]
    #[inline(always)]
    pub const fn ifr(self) -> crate::common::Reg<regs::Ifr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x10usize) as _) }
    }
    #[doc = "Digital Video STATUS register. (DVP_STATUS)."]
    #[inline(always)]
    pub const fn status(self) -> crate::common::Reg<regs::Status, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x11usize) as _) }
    }
    #[doc = "Digital Video line counter register. (DVP_ROW_CNT)."]
    #[inline(always)]
    pub const fn row_cnt(self) -> crate::common::Reg<regs::RowCnt, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x14usize) as _) }
    }
    #[doc = "Digital Video horizontal displacement register. (DVP_HOFFCNT)."]
    #[inline(always)]
    pub const fn hoffcnt(self) -> crate::common::Reg<regs::Hoffcnt, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x18usize) as _) }
    }
    #[doc = "Digital Video line number register. (DVP_VST)."]
    #[inline(always)]
    pub const fn vst(self) -> crate::common::Reg<regs::Vst, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1ausize) as _) }
    }
    #[doc = "Digital Video Capture count register. (DVP_CAPCNT)."]
    #[inline(always)]
    pub const fn capcnt(self) -> crate::common::Reg<regs::Capcnt, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1cusize) as _) }
    }
    #[doc = "Digital Video Vertical line count register. (DVP_VLINE)."]
    #[inline(always)]
    pub const fn vline(self) -> crate::common::Reg<regs::Vline, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1eusize) as _) }
    }
    #[doc = "Digital Video Data register. (DVP_DR)."]
    #[inline(always)]
    pub const fn dr(self) -> crate::common::Reg<regs::Dr, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x20usize) as _) }
    }
}
pub mod regs {
    #[doc = "Digital Video Capture count register. (DVP_CAPCNT)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Capcnt(pub u16);
    impl Capcnt {
        #[doc = "Number of PCLK cycles captured by clipping window."]
        #[inline(always)]
        pub const fn capcnt(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Number of PCLK cycles captured by clipping window."]
        #[inline(always)]
        pub fn set_capcnt(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Capcnt {
        #[inline(always)]
        fn default() -> Capcnt {
            Capcnt(0)
        }
    }
    #[doc = "Image column number configuration register. (DVP_COL_NUM)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct ColNum(pub u16);
    impl ColNum {
        #[doc = "Number of PCLK cycles for row data."]
        #[inline(always)]
        pub const fn col_num(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Number of PCLK cycles for row data."]
        #[inline(always)]
        pub fn set_col_num(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for ColNum {
        #[inline(always)]
        fn default() -> ColNum {
            ColNum(0)
        }
    }
    #[doc = "Digital Video control register. (DVP_CR0)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cr0(pub u8);
    impl Cr0 {
        #[doc = "DVP enable."]
        #[inline(always)]
        pub const fn enable(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "DVP enable."]
        #[inline(always)]
        pub fn set_enable(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "DVP VSYNC polarity control."]
        #[inline(always)]
        pub const fn v_polar(&self) -> super::vals::VsyncPolarity {
            let val = (self.0 >> 1usize) & 0x01;
            super::vals::VsyncPolarity::from_bits(val as u8)
        }
        #[doc = "DVP VSYNC polarity control."]
        #[inline(always)]
        pub fn set_v_polar(&mut self, val: super::vals::VsyncPolarity) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u8) & 0x01) << 1usize);
        }
        #[doc = "DVP HSYNC polarity control."]
        #[inline(always)]
        pub const fn h_polar(&self) -> super::vals::HsyncPolarity {
            let val = (self.0 >> 2usize) & 0x01;
            super::vals::HsyncPolarity::from_bits(val as u8)
        }
        #[doc = "DVP HSYNC polarity control."]
        #[inline(always)]
        pub fn set_h_polar(&mut self, val: super::vals::HsyncPolarity) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val.to_bits() as u8) & 0x01) << 2usize);
        }
        #[doc = "DVP PCLK polarity control."]
        #[inline(always)]
        pub const fn p_polar(&self) -> super::vals::PclkPolarity {
            let val = (self.0 >> 3usize) & 0x01;
            super::vals::PclkPolarity::from_bits(val as u8)
        }
        #[doc = "DVP PCLK polarity control."]
        #[inline(always)]
        pub fn set_p_polar(&mut self, val: super::vals::PclkPolarity) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val.to_bits() as u8) & 0x01) << 3usize);
        }
        #[doc = "DVP data mode."]
        #[inline(always)]
        pub const fn msk_dat_mod(&self) -> super::vals::DataMode {
            let val = (self.0 >> 4usize) & 0x03;
            super::vals::DataMode::from_bits(val as u8)
        }
        #[doc = "DVP data mode."]
        #[inline(always)]
        pub fn set_msk_dat_mod(&mut self, val: super::vals::DataMode) {
            self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u8) & 0x03) << 4usize);
        }
        #[doc = "DVP JPEG mode."]
        #[inline(always)]
        pub const fn jpeg(&self) -> super::vals::CaptureMode {
            let val = (self.0 >> 6usize) & 0x01;
            super::vals::CaptureMode::from_bits(val as u8)
        }
        #[doc = "DVP JPEG mode."]
        #[inline(always)]
        pub fn set_jpeg(&mut self, val: super::vals::CaptureMode) {
            self.0 = (self.0 & !(0x01 << 6usize)) | (((val.to_bits() as u8) & 0x01) << 6usize);
        }
    }
    impl Default for Cr0 {
        #[inline(always)]
        fn default() -> Cr0 {
            Cr0(0)
        }
    }
    #[doc = "Digital Video control register. (DVP_CR1)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cr1(pub u8);
    impl Cr1 {
        #[doc = "DVP dma enable."]
        #[inline(always)]
        pub const fn dma_en(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "DVP dma enable."]
        #[inline(always)]
        pub fn set_dma_en(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "DVP all clear."]
        #[inline(always)]
        pub const fn all_clr(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "DVP all clear."]
        #[inline(always)]
        pub fn set_all_clr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u8) & 0x01) << 1usize);
        }
        #[doc = "DVP receive logic clear."]
        #[inline(always)]
        pub const fn rcv_clr(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "DVP receive logic clear."]
        #[inline(always)]
        pub fn set_rcv_clr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "DVP bug toggle by software."]
        #[inline(always)]
        pub const fn buf_tog(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "DVP bug toggle by software."]
        #[inline(always)]
        pub fn set_buf_tog(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "DVP capture mode."]
        #[inline(always)]
        pub const fn cm(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "DVP capture mode."]
        #[inline(always)]
        pub fn set_cm(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u8) & 0x01) << 4usize);
        }
        #[doc = "DVP Crop feature enable."]
        #[inline(always)]
        pub const fn crop(&self) -> bool {
            let val = (self.0 >> 5usize) & 0x01;
            val != 0
        }
        #[doc = "DVP Crop feature enable."]
        #[inline(always)]
        pub fn set_crop(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u8) & 0x01) << 5usize);
        }
        #[doc = "DVP frame capture rate control."]
        #[inline(always)]
        pub const fn fcrc(&self) -> super::vals::CaptureRate {
            let val = (self.0 >> 6usize) & 0x03;
            super::vals::CaptureRate::from_bits(val as u8)
        }
        #[doc = "DVP frame capture rate control."]
        #[inline(always)]
        pub fn set_fcrc(&mut self, val: super::vals::CaptureRate) {
            self.0 = (self.0 & !(0x03 << 6usize)) | (((val.to_bits() as u8) & 0x03) << 6usize);
        }
    }
    impl Default for Cr1 {
        #[inline(always)]
        fn default() -> Cr1 {
            Cr1(0)
        }
    }
    #[doc = "Digital Video DMA address register. (DVP_DMA_BUF0)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct DmaBuf0(pub u32);
    impl DmaBuf0 {
        #[doc = "DMA receive address 0."]
        #[inline(always)]
        pub const fn dma_buf0(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0x0001_ffff;
            val as u32
        }
        #[doc = "DMA receive address 0."]
        #[inline(always)]
        pub fn set_dma_buf0(&mut self, val: u32) {
            self.0 = (self.0 & !(0x0001_ffff << 0usize)) | (((val as u32) & 0x0001_ffff) << 0usize);
        }
    }
    impl Default for DmaBuf0 {
        #[inline(always)]
        fn default() -> DmaBuf0 {
            DmaBuf0(0)
        }
    }
    #[doc = "Digital Video DMA address register. (DVP_DMA_BUF1)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct DmaBuf1(pub u32);
    impl DmaBuf1 {
        #[doc = "DMA receive address 1."]
        #[inline(always)]
        pub const fn dma_buf1(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0x0001_ffff;
            val as u32
        }
        #[doc = "DMA receive address 1."]
        #[inline(always)]
        pub fn set_dma_buf1(&mut self, val: u32) {
            self.0 = (self.0 & !(0x0001_ffff << 0usize)) | (((val as u32) & 0x0001_ffff) << 0usize);
        }
    }
    impl Default for DmaBuf1 {
        #[inline(always)]
        fn default() -> DmaBuf1 {
            DmaBuf1(0)
        }
    }
    #[doc = "Digital Video Data register. (DVP_DR)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Dr(pub u32);
    impl Dr {
        #[doc = "Prevent DMA overflow."]
        #[inline(always)]
        pub const fn dr(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Prevent DMA overflow."]
        #[inline(always)]
        pub fn set_dr(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Dr {
        #[inline(always)]
        fn default() -> Dr {
            Dr(0)
        }
    }
    #[doc = "Digital Video horizontal displacement register. (DVP_HOFFCNT)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Hoffcnt(pub u16);
    impl Hoffcnt {
        #[doc = "Number of PCLK cycles for row data."]
        #[inline(always)]
        pub const fn hoffcnt(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Number of PCLK cycles for row data."]
        #[inline(always)]
        pub fn set_hoffcnt(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Hoffcnt {
        #[inline(always)]
        fn default() -> Hoffcnt {
            Hoffcnt(0)
        }
    }
    #[doc = "Digital Video Interrupt register. (DVP_IER)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Ier(pub u8);
    impl Ier {
        #[doc = "DVP frame start interrupt enable."]
        #[inline(always)]
        pub const fn ie_str_frm(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "DVP frame start interrupt enable."]
        #[inline(always)]
        pub fn set_ie_str_frm(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "DVP row received done interrupt enable."]
        #[inline(always)]
        pub const fn ie_row_done(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "DVP row received done interrupt enable."]
        #[inline(always)]
        pub fn set_ie_row_done(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u8) & 0x01) << 1usize);
        }
        #[doc = "DVP frame received done interrupt enable."]
        #[inline(always)]
        pub const fn ie_frm_done(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "DVP frame received done interrupt enable."]
        #[inline(always)]
        pub fn set_ie_frm_done(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "DVP receive fifo overflow interrupt enable."]
        #[inline(always)]
        pub const fn ie_fifo_ov(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "DVP receive fifo overflow interrupt enable."]
        #[inline(always)]
        pub fn set_ie_fifo_ov(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "DVP frame stop interrupt enable."]
        #[inline(always)]
        pub const fn ie_stp_frm(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "DVP frame stop interrupt enable."]
        #[inline(always)]
        pub fn set_ie_stp_frm(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u8) & 0x01) << 4usize);
        }
    }
    impl Default for Ier {
        #[inline(always)]
        fn default() -> Ier {
            Ier(0)
        }
    }
    #[doc = "Digital Video Flag register. (DVP_IFR)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Ifr(pub u8);
    impl Ifr {
        #[doc = "DVP frame start interrupt enable."]
        #[inline(always)]
        pub const fn if_str_frm(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "DVP frame start interrupt enable."]
        #[inline(always)]
        pub fn set_if_str_frm(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "DVP row received done interrupt enable."]
        #[inline(always)]
        pub const fn if_row_done(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "DVP row received done interrupt enable."]
        #[inline(always)]
        pub fn set_if_row_done(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u8) & 0x01) << 1usize);
        }
        #[doc = "DVP frame received done interrupt enable."]
        #[inline(always)]
        pub const fn if_frm_done(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "DVP frame received done interrupt enable."]
        #[inline(always)]
        pub fn set_if_frm_done(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "DVP receive fifo overflow interrupt enable."]
        #[inline(always)]
        pub const fn if_fifo_ov(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "DVP receive fifo overflow interrupt enable."]
        #[inline(always)]
        pub fn set_if_fifo_ov(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u8) & 0x01) << 3usize);
        }
        #[doc = "DVP frame stop interrupt enable."]
        #[inline(always)]
        pub const fn if_stp_frm(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "DVP frame stop interrupt enable."]
        #[inline(always)]
        pub fn set_if_stp_frm(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u8) & 0x01) << 4usize);
        }
    }
    impl Default for Ifr {
        #[inline(always)]
        fn default() -> Ifr {
            Ifr(0)
        }
    }
    #[doc = "Digital Video line counter register. (DVP_ROW_CNT)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct RowCnt(pub u16);
    impl RowCnt {
        #[doc = "The number of rows of frame image data."]
        #[inline(always)]
        pub const fn row_cnt(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "The number of rows of frame image data."]
        #[inline(always)]
        pub fn set_row_cnt(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for RowCnt {
        #[inline(always)]
        fn default() -> RowCnt {
            RowCnt(0)
        }
    }
    #[doc = "Image line count configuration register. (DVP_ROW_NUM)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct RowNum(pub u16);
    impl RowNum {
        #[doc = "The number of rows of frame image data."]
        #[inline(always)]
        pub const fn row_num(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "The number of rows of frame image data."]
        #[inline(always)]
        pub fn set_row_num(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for RowNum {
        #[inline(always)]
        fn default() -> RowNum {
            RowNum(0)
        }
    }
    #[doc = "Digital Video STATUS register. (DVP_STATUS)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Status(pub u8);
    impl Status {
        #[doc = "DVP frame start interrupt enable."]
        #[inline(always)]
        pub const fn fifo_rdy(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "DVP frame start interrupt enable."]
        #[inline(always)]
        pub fn set_fifo_rdy(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u8) & 0x01) << 0usize);
        }
        #[doc = "DVP row received done interrupt enable."]
        #[inline(always)]
        pub const fn fifo_full(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "DVP row received done interrupt enable."]
        #[inline(always)]
        pub fn set_fifo_full(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u8) & 0x01) << 1usize);
        }
        #[doc = "DVP frame received done interrupt enable."]
        #[inline(always)]
        pub const fn fifo_ov(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "DVP frame received done interrupt enable."]
        #[inline(always)]
        pub fn set_fifo_ov(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u8) & 0x01) << 2usize);
        }
        #[doc = "DVP receive fifo overflow interrupt enable."]
        #[inline(always)]
        pub const fn msk_fifo_cnt(&self) -> u8 {
            let val = (self.0 >> 4usize) & 0x07;
            val as u8
        }
        #[doc = "DVP receive fifo overflow interrupt enable."]
        #[inline(always)]
        pub fn set_msk_fifo_cnt(&mut self, val: u8) {
            self.0 = (self.0 & !(0x07 << 4usize)) | (((val as u8) & 0x07) << 4usize);
        }
    }
    impl Default for Status {
        #[inline(always)]
        fn default() -> Status {
            Status(0)
        }
    }
    #[doc = "Digital Video Vertical line count register. (DVP_VLINE)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Vline(pub u16);
    impl Vline {
        #[doc = "Crop the number of rows captured by window."]
        #[inline(always)]
        pub const fn vline(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Crop the number of rows captured by window."]
        #[inline(always)]
        pub fn set_vline(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Vline {
        #[inline(always)]
        fn default() -> Vline {
            Vline(0)
        }
    }
    #[doc = "Digital Video line number register. (DVP_VST)."]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Vst(pub u16);
    impl Vst {
        #[doc = "The number of lines captured by the image."]
        #[inline(always)]
        pub const fn vst(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "The number of lines captured by the image."]
        #[inline(always)]
        pub fn set_vst(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u16) & 0xffff) << 0usize);
        }
    }
    impl Default for Vst {
        #[inline(always)]
        fn default() -> Vst {
            Vst(0)
        }
    }
}
pub mod vals {
    #[doc = "Capture mode."]
    #[repr(u8)]
    #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
    pub enum CaptureMode {
        #[doc = "Raw data capture mode."]
        RAW = 0x0,
        #[doc = "JPEG data capture mode."]
        JPEG = 0x01,
    }
    impl CaptureMode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> CaptureMode {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for CaptureMode {
        #[inline(always)]
        fn from(val: u8) -> CaptureMode {
            CaptureMode::from_bits(val)
        }
    }
    impl From<CaptureMode> for u8 {
        #[inline(always)]
        fn from(val: CaptureMode) -> u8 {
            CaptureMode::to_bits(val)
        }
    }
    #[doc = "Capture rate"]
    #[repr(u8)]
    #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
    pub enum CaptureRate {
        #[doc = "Capture all frames."]
        ALL = 0x0,
        #[doc = "One frame per Two Captures."]
        HALF = 0x01,
        #[doc = "One frame per Four Captures."]
        QUARTER = 0x02,
        _RESERVED_3 = 0x03,
    }
    impl CaptureRate {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> CaptureRate {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for CaptureRate {
        #[inline(always)]
        fn from(val: u8) -> CaptureRate {
            CaptureRate::from_bits(val)
        }
    }
    impl From<CaptureRate> for u8 {
        #[inline(always)]
        fn from(val: CaptureRate) -> u8 {
            CaptureRate::to_bits(val)
        }
    }
    #[doc = "Data mode."]
    #[repr(u8)]
    #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
    pub enum DataMode {
        #[doc = "8-bit data mode."]
        _8BIT = 0x0,
        #[doc = "10-bit data mode."]
        _10BIT = 0x01,
        #[doc = "12-bit data mode."]
        _12BIT = 0x02,
        _RESERVED_3 = 0x03,
    }
    impl DataMode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> DataMode {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for DataMode {
        #[inline(always)]
        fn from(val: u8) -> DataMode {
            DataMode::from_bits(val)
        }
    }
    impl From<DataMode> for u8 {
        #[inline(always)]
        fn from(val: DataMode) -> u8 {
            DataMode::to_bits(val)
        }
    }
    #[doc = "HSYNC polarity control."]
    #[repr(u8)]
    #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
    pub enum HsyncPolarity {
        #[doc = "HSYNC active high."]
        ACTIVE_HIGH = 0x0,
        #[doc = "HSYNC active low."]
        ACTIVE_LOW = 0x01,
    }
    impl HsyncPolarity {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> HsyncPolarity {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for HsyncPolarity {
        #[inline(always)]
        fn from(val: u8) -> HsyncPolarity {
            HsyncPolarity::from_bits(val)
        }
    }
    impl From<HsyncPolarity> for u8 {
        #[inline(always)]
        fn from(val: HsyncPolarity) -> u8 {
            HsyncPolarity::to_bits(val)
        }
    }
    #[doc = "PCLK polarity control."]
    #[repr(u8)]
    #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
    pub enum PclkPolarity {
        #[doc = "PCLK rising edge."]
        RISING_EDGE = 0x0,
        #[doc = "PCLK falling edge."]
        FALLING_EDGE = 0x01,
    }
    impl PclkPolarity {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> PclkPolarity {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for PclkPolarity {
        #[inline(always)]
        fn from(val: u8) -> PclkPolarity {
            PclkPolarity::from_bits(val)
        }
    }
    impl From<PclkPolarity> for u8 {
        #[inline(always)]
        fn from(val: PclkPolarity) -> u8 {
            PclkPolarity::to_bits(val)
        }
    }
    #[doc = "VSYNC polarity control."]
    #[repr(u8)]
    #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
    pub enum VsyncPolarity {
        #[doc = "VSYNC active low."]
        ACTIVE_LOW = 0x0,
        #[doc = "VSYNC active high."]
        ACTIVE_HIGH = 0x01,
    }
    impl VsyncPolarity {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> VsyncPolarity {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for VsyncPolarity {
        #[inline(always)]
        fn from(val: u8) -> VsyncPolarity {
            VsyncPolarity::from_bits(val)
        }
    }
    impl From<VsyncPolarity> for u8 {
        #[inline(always)]
        fn from(val: VsyncPolarity) -> u8 {
            VsyncPolarity::to_bits(val)
        }
    }
}