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
#[doc = "Register `dbi_ctl_0` reader"]
pub struct R(crate::R<DBI_CTL_0_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<DBI_CTL_0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<DBI_CTL_0_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<DBI_CTL_0_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `dbi_ctl_0` writer"]
pub struct W(crate::W<DBI_CTL_0_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<DBI_CTL_0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<DBI_CTL_0_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<DBI_CTL_0_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `vi_src_type` reader - Video Source Type"]
pub type VI_SRC_TYPE_R = crate::BitReader<VI_SRC_TYPE_A>;
#[doc = "Video Source Type\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VI_SRC_TYPE_A {
    #[doc = "0: `0`"]
    RGB32 = 0,
    #[doc = "1: `1`"]
    RGB16 = 1,
}
impl From<VI_SRC_TYPE_A> for bool {
    #[inline(always)]
    fn from(variant: VI_SRC_TYPE_A) -> Self {
        variant as u8 != 0
    }
}
impl VI_SRC_TYPE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> VI_SRC_TYPE_A {
        match self.bits {
            false => VI_SRC_TYPE_A::RGB32,
            true => VI_SRC_TYPE_A::RGB16,
        }
    }
    #[doc = "Checks if the value of the field is `RGB32`"]
    #[inline(always)]
    pub fn is_rgb32(&self) -> bool {
        *self == VI_SRC_TYPE_A::RGB32
    }
    #[doc = "Checks if the value of the field is `RGB16`"]
    #[inline(always)]
    pub fn is_rgb16(&self) -> bool {
        *self == VI_SRC_TYPE_A::RGB16
    }
}
#[doc = "Field `vi_src_type` writer - Video Source Type"]
pub type VI_SRC_TYPE_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, DBI_CTL_0_SPEC, VI_SRC_TYPE_A, O>;
impl<'a, const O: u8> VI_SRC_TYPE_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn rgb32(self) -> &'a mut W {
        self.variant(VI_SRC_TYPE_A::RGB32)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn rgb16(self) -> &'a mut W {
        self.variant(VI_SRC_TYPE_A::RGB16)
    }
}
#[doc = "Field `element_a_pos` reader - Element A Position"]
pub type ELEMENT_A_POS_R = crate::BitReader<ELEMENT_A_POS_A>;
#[doc = "Element A Position\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ELEMENT_A_POS_A {
    #[doc = "0: `0`"]
    _31_24 = 0,
    #[doc = "1: `1`"]
    _7_0 = 1,
}
impl From<ELEMENT_A_POS_A> for bool {
    #[inline(always)]
    fn from(variant: ELEMENT_A_POS_A) -> Self {
        variant as u8 != 0
    }
}
impl ELEMENT_A_POS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ELEMENT_A_POS_A {
        match self.bits {
            false => ELEMENT_A_POS_A::_31_24,
            true => ELEMENT_A_POS_A::_7_0,
        }
    }
    #[doc = "Checks if the value of the field is `_31_24`"]
    #[inline(always)]
    pub fn is_31_24(&self) -> bool {
        *self == ELEMENT_A_POS_A::_31_24
    }
    #[doc = "Checks if the value of the field is `_7_0`"]
    #[inline(always)]
    pub fn is_7_0(&self) -> bool {
        *self == ELEMENT_A_POS_A::_7_0
    }
}
#[doc = "Field `element_a_pos` writer - Element A Position"]
pub type ELEMENT_A_POS_W<'a, const O: u8> =
    crate::BitWriter<'a, u32, DBI_CTL_0_SPEC, ELEMENT_A_POS_A, O>;
impl<'a, const O: u8> ELEMENT_A_POS_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn _31_24(self) -> &'a mut W {
        self.variant(ELEMENT_A_POS_A::_31_24)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn _7_0(self) -> &'a mut W {
        self.variant(ELEMENT_A_POS_A::_7_0)
    }
}
#[doc = "Field `rgb_bo` reader - RGB Bit Order"]
pub type RGB_BO_R = crate::BitReader<RGB_BO_A>;
#[doc = "RGB Bit Order\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RGB_BO_A {
    #[doc = "0: `0`"]
    DATA = 0,
    #[doc = "1: `1`"]
    SWAP = 1,
}
impl From<RGB_BO_A> for bool {
    #[inline(always)]
    fn from(variant: RGB_BO_A) -> Self {
        variant as u8 != 0
    }
}
impl RGB_BO_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RGB_BO_A {
        match self.bits {
            false => RGB_BO_A::DATA,
            true => RGB_BO_A::SWAP,
        }
    }
    #[doc = "Checks if the value of the field is `DATA`"]
    #[inline(always)]
    pub fn is_data(&self) -> bool {
        *self == RGB_BO_A::DATA
    }
    #[doc = "Checks if the value of the field is `SWAP`"]
    #[inline(always)]
    pub fn is_swap(&self) -> bool {
        *self == RGB_BO_A::SWAP
    }
}
#[doc = "Field `rgb_bo` writer - RGB Bit Order"]
pub type RGB_BO_W<'a, const O: u8> = crate::BitWriter<'a, u32, DBI_CTL_0_SPEC, RGB_BO_A, O>;
impl<'a, const O: u8> RGB_BO_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn data(self) -> &'a mut W {
        self.variant(RGB_BO_A::DATA)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn swap(self) -> &'a mut W {
        self.variant(RGB_BO_A::SWAP)
    }
}
#[doc = "Field `dum_val` reader - Dummy Cycle Value"]
pub type DUM_VAL_R = crate::BitReader<bool>;
#[doc = "Field `dum_val` writer - Dummy Cycle Value"]
pub type DUM_VAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DBI_CTL_0_SPEC, bool, O>;
#[doc = "Field `rgb_src_fmt` reader - RGB Source Format"]
pub type RGB_SRC_FMT_R = crate::FieldReader<u8, RGB_SRC_FMT_A>;
#[doc = "RGB Source Format\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RGB_SRC_FMT_A {
    #[doc = "0: `0`"]
    RGB = 0,
    #[doc = "1: `1`"]
    RBG = 1,
    #[doc = "2: `10`"]
    GRB = 2,
    #[doc = "3: `11`"]
    GBR = 3,
    #[doc = "4: `100`"]
    BRG = 4,
    #[doc = "5: `101`"]
    BGR = 5,
    #[doc = "6: `110`"]
    GRBG_0 = 6,
    #[doc = "7: `111`"]
    GBRG_0 = 7,
    #[doc = "8: `1000`"]
    GRBG_1 = 8,
    #[doc = "9: `1001`"]
    GBRG_1 = 9,
}
impl From<RGB_SRC_FMT_A> for u8 {
    #[inline(always)]
    fn from(variant: RGB_SRC_FMT_A) -> Self {
        variant as _
    }
}
impl RGB_SRC_FMT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<RGB_SRC_FMT_A> {
        match self.bits {
            0 => Some(RGB_SRC_FMT_A::RGB),
            1 => Some(RGB_SRC_FMT_A::RBG),
            2 => Some(RGB_SRC_FMT_A::GRB),
            3 => Some(RGB_SRC_FMT_A::GBR),
            4 => Some(RGB_SRC_FMT_A::BRG),
            5 => Some(RGB_SRC_FMT_A::BGR),
            6 => Some(RGB_SRC_FMT_A::GRBG_0),
            7 => Some(RGB_SRC_FMT_A::GBRG_0),
            8 => Some(RGB_SRC_FMT_A::GRBG_1),
            9 => Some(RGB_SRC_FMT_A::GBRG_1),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `RGB`"]
    #[inline(always)]
    pub fn is_rgb(&self) -> bool {
        *self == RGB_SRC_FMT_A::RGB
    }
    #[doc = "Checks if the value of the field is `RBG`"]
    #[inline(always)]
    pub fn is_rbg(&self) -> bool {
        *self == RGB_SRC_FMT_A::RBG
    }
    #[doc = "Checks if the value of the field is `GRB`"]
    #[inline(always)]
    pub fn is_grb(&self) -> bool {
        *self == RGB_SRC_FMT_A::GRB
    }
    #[doc = "Checks if the value of the field is `GBR`"]
    #[inline(always)]
    pub fn is_gbr(&self) -> bool {
        *self == RGB_SRC_FMT_A::GBR
    }
    #[doc = "Checks if the value of the field is `BRG`"]
    #[inline(always)]
    pub fn is_brg(&self) -> bool {
        *self == RGB_SRC_FMT_A::BRG
    }
    #[doc = "Checks if the value of the field is `BGR`"]
    #[inline(always)]
    pub fn is_bgr(&self) -> bool {
        *self == RGB_SRC_FMT_A::BGR
    }
    #[doc = "Checks if the value of the field is `GRBG_0`"]
    #[inline(always)]
    pub fn is_grbg_0(&self) -> bool {
        *self == RGB_SRC_FMT_A::GRBG_0
    }
    #[doc = "Checks if the value of the field is `GBRG_0`"]
    #[inline(always)]
    pub fn is_gbrg_0(&self) -> bool {
        *self == RGB_SRC_FMT_A::GBRG_0
    }
    #[doc = "Checks if the value of the field is `GRBG_1`"]
    #[inline(always)]
    pub fn is_grbg_1(&self) -> bool {
        *self == RGB_SRC_FMT_A::GRBG_1
    }
    #[doc = "Checks if the value of the field is `GBRG_1`"]
    #[inline(always)]
    pub fn is_gbrg_1(&self) -> bool {
        *self == RGB_SRC_FMT_A::GBRG_1
    }
}
#[doc = "Field `rgb_src_fmt` writer - RGB Source Format"]
pub type RGB_SRC_FMT_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, DBI_CTL_0_SPEC, u8, RGB_SRC_FMT_A, 4, O>;
impl<'a, const O: u8> RGB_SRC_FMT_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn rgb(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::RGB)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn rbg(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::RBG)
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn grb(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::GRB)
    }
    #[doc = "`11`"]
    #[inline(always)]
    pub fn gbr(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::GBR)
    }
    #[doc = "`100`"]
    #[inline(always)]
    pub fn brg(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::BRG)
    }
    #[doc = "`101`"]
    #[inline(always)]
    pub fn bgr(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::BGR)
    }
    #[doc = "`110`"]
    #[inline(always)]
    pub fn grbg_0(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::GRBG_0)
    }
    #[doc = "`111`"]
    #[inline(always)]
    pub fn gbrg_0(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::GBRG_0)
    }
    #[doc = "`1000`"]
    #[inline(always)]
    pub fn grbg_1(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::GRBG_1)
    }
    #[doc = "`1001`"]
    #[inline(always)]
    pub fn gbrg_1(self) -> &'a mut W {
        self.variant(RGB_SRC_FMT_A::GBRG_1)
    }
}
#[doc = "Field `dbi_interface` reader - "]
pub type DBI_INTERFACE_R = crate::FieldReader<u8, DBI_INTERFACE_A>;
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DBI_INTERFACE_A {
    #[doc = "0: 3 Line Interface I"]
    L3I1 = 0,
    #[doc = "1: 3 Line Interface II"]
    L3I2 = 1,
    #[doc = "2: 4 Line Interface I"]
    L4I1 = 2,
    #[doc = "3: 4 Line Interface II"]
    L4I2 = 3,
    #[doc = "4: 2 Data Lane Interface"]
    D2LI = 4,
}
impl From<DBI_INTERFACE_A> for u8 {
    #[inline(always)]
    fn from(variant: DBI_INTERFACE_A) -> Self {
        variant as _
    }
}
impl DBI_INTERFACE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<DBI_INTERFACE_A> {
        match self.bits {
            0 => Some(DBI_INTERFACE_A::L3I1),
            1 => Some(DBI_INTERFACE_A::L3I2),
            2 => Some(DBI_INTERFACE_A::L4I1),
            3 => Some(DBI_INTERFACE_A::L4I2),
            4 => Some(DBI_INTERFACE_A::D2LI),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `L3I1`"]
    #[inline(always)]
    pub fn is_l3i1(&self) -> bool {
        *self == DBI_INTERFACE_A::L3I1
    }
    #[doc = "Checks if the value of the field is `L3I2`"]
    #[inline(always)]
    pub fn is_l3i2(&self) -> bool {
        *self == DBI_INTERFACE_A::L3I2
    }
    #[doc = "Checks if the value of the field is `L4I1`"]
    #[inline(always)]
    pub fn is_l4i1(&self) -> bool {
        *self == DBI_INTERFACE_A::L4I1
    }
    #[doc = "Checks if the value of the field is `L4I2`"]
    #[inline(always)]
    pub fn is_l4i2(&self) -> bool {
        *self == DBI_INTERFACE_A::L4I2
    }
    #[doc = "Checks if the value of the field is `D2LI`"]
    #[inline(always)]
    pub fn is_d2li(&self) -> bool {
        *self == DBI_INTERFACE_A::D2LI
    }
}
#[doc = "Field `dbi_interface` writer - "]
pub type DBI_INTERFACE_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, DBI_CTL_0_SPEC, u8, DBI_INTERFACE_A, 3, O>;
impl<'a, const O: u8> DBI_INTERFACE_W<'a, O> {
    #[doc = "3 Line Interface I"]
    #[inline(always)]
    pub fn l3i1(self) -> &'a mut W {
        self.variant(DBI_INTERFACE_A::L3I1)
    }
    #[doc = "3 Line Interface II"]
    #[inline(always)]
    pub fn l3i2(self) -> &'a mut W {
        self.variant(DBI_INTERFACE_A::L3I2)
    }
    #[doc = "4 Line Interface I"]
    #[inline(always)]
    pub fn l4i1(self) -> &'a mut W {
        self.variant(DBI_INTERFACE_A::L4I1)
    }
    #[doc = "4 Line Interface II"]
    #[inline(always)]
    pub fn l4i2(self) -> &'a mut W {
        self.variant(DBI_INTERFACE_A::L4I2)
    }
    #[doc = "2 Data Lane Interface"]
    #[inline(always)]
    pub fn d2li(self) -> &'a mut W {
        self.variant(DBI_INTERFACE_A::D2LI)
    }
}
#[doc = "Field `dat_fmt` reader - Output Data Format"]
pub type DAT_FMT_R = crate::FieldReader<u8, DAT_FMT_A>;
#[doc = "Output Data Format\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DAT_FMT_A {
    #[doc = "0: `0`"]
    RGB111 = 0,
    #[doc = "1: `1`"]
    RGB444 = 1,
    #[doc = "2: `10`"]
    RGB565 = 2,
    #[doc = "3: `11`"]
    RGB666 = 3,
    #[doc = "4: `100`"]
    RGB888 = 4,
}
impl From<DAT_FMT_A> for u8 {
    #[inline(always)]
    fn from(variant: DAT_FMT_A) -> Self {
        variant as _
    }
}
impl DAT_FMT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<DAT_FMT_A> {
        match self.bits {
            0 => Some(DAT_FMT_A::RGB111),
            1 => Some(DAT_FMT_A::RGB444),
            2 => Some(DAT_FMT_A::RGB565),
            3 => Some(DAT_FMT_A::RGB666),
            4 => Some(DAT_FMT_A::RGB888),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `RGB111`"]
    #[inline(always)]
    pub fn is_rgb111(&self) -> bool {
        *self == DAT_FMT_A::RGB111
    }
    #[doc = "Checks if the value of the field is `RGB444`"]
    #[inline(always)]
    pub fn is_rgb444(&self) -> bool {
        *self == DAT_FMT_A::RGB444
    }
    #[doc = "Checks if the value of the field is `RGB565`"]
    #[inline(always)]
    pub fn is_rgb565(&self) -> bool {
        *self == DAT_FMT_A::RGB565
    }
    #[doc = "Checks if the value of the field is `RGB666`"]
    #[inline(always)]
    pub fn is_rgb666(&self) -> bool {
        *self == DAT_FMT_A::RGB666
    }
    #[doc = "Checks if the value of the field is `RGB888`"]
    #[inline(always)]
    pub fn is_rgb888(&self) -> bool {
        *self == DAT_FMT_A::RGB888
    }
}
#[doc = "Field `dat_fmt` writer - Output Data Format"]
pub type DAT_FMT_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, DBI_CTL_0_SPEC, u8, DAT_FMT_A, 3, O>;
impl<'a, const O: u8> DAT_FMT_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn rgb111(self) -> &'a mut W {
        self.variant(DAT_FMT_A::RGB111)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn rgb444(self) -> &'a mut W {
        self.variant(DAT_FMT_A::RGB444)
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn rgb565(self) -> &'a mut W {
        self.variant(DAT_FMT_A::RGB565)
    }
    #[doc = "`11`"]
    #[inline(always)]
    pub fn rgb666(self) -> &'a mut W {
        self.variant(DAT_FMT_A::RGB666)
    }
    #[doc = "`100`"]
    #[inline(always)]
    pub fn rgb888(self) -> &'a mut W {
        self.variant(DAT_FMT_A::RGB888)
    }
}
#[doc = "Field `tran_mod` reader - Transmit Mode"]
pub type TRAN_MOD_R = crate::BitReader<TRAN_MOD_A>;
#[doc = "Transmit Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TRAN_MOD_A {
    #[doc = "0: `0`"]
    COMMAND_PARAMETER = 0,
    #[doc = "1: `1`"]
    VIDEO = 1,
}
impl From<TRAN_MOD_A> for bool {
    #[inline(always)]
    fn from(variant: TRAN_MOD_A) -> Self {
        variant as u8 != 0
    }
}
impl TRAN_MOD_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TRAN_MOD_A {
        match self.bits {
            false => TRAN_MOD_A::COMMAND_PARAMETER,
            true => TRAN_MOD_A::VIDEO,
        }
    }
    #[doc = "Checks if the value of the field is `COMMAND_PARAMETER`"]
    #[inline(always)]
    pub fn is_command_parameter(&self) -> bool {
        *self == TRAN_MOD_A::COMMAND_PARAMETER
    }
    #[doc = "Checks if the value of the field is `VIDEO`"]
    #[inline(always)]
    pub fn is_video(&self) -> bool {
        *self == TRAN_MOD_A::VIDEO
    }
}
#[doc = "Field `tran_mod` writer - Transmit Mode"]
pub type TRAN_MOD_W<'a, const O: u8> = crate::BitWriter<'a, u32, DBI_CTL_0_SPEC, TRAN_MOD_A, O>;
impl<'a, const O: u8> TRAN_MOD_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn command_parameter(self) -> &'a mut W {
        self.variant(TRAN_MOD_A::COMMAND_PARAMETER)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn video(self) -> &'a mut W {
        self.variant(TRAN_MOD_A::VIDEO)
    }
}
#[doc = "Field `rgb_seq` reader - Output RGB Sequence"]
pub type RGB_SEQ_R = crate::FieldReader<u8, RGB_SEQ_A>;
#[doc = "Output RGB Sequence\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RGB_SEQ_A {
    #[doc = "0: `0`"]
    RGB = 0,
    #[doc = "1: `1`"]
    RBG = 1,
    #[doc = "2: `10`"]
    GRB = 2,
    #[doc = "3: `11`"]
    GBR = 3,
    #[doc = "4: `100`"]
    BRG = 4,
    #[doc = "5: `101`"]
    BGR = 5,
}
impl From<RGB_SEQ_A> for u8 {
    #[inline(always)]
    fn from(variant: RGB_SEQ_A) -> Self {
        variant as _
    }
}
impl RGB_SEQ_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<RGB_SEQ_A> {
        match self.bits {
            0 => Some(RGB_SEQ_A::RGB),
            1 => Some(RGB_SEQ_A::RBG),
            2 => Some(RGB_SEQ_A::GRB),
            3 => Some(RGB_SEQ_A::GBR),
            4 => Some(RGB_SEQ_A::BRG),
            5 => Some(RGB_SEQ_A::BGR),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `RGB`"]
    #[inline(always)]
    pub fn is_rgb(&self) -> bool {
        *self == RGB_SEQ_A::RGB
    }
    #[doc = "Checks if the value of the field is `RBG`"]
    #[inline(always)]
    pub fn is_rbg(&self) -> bool {
        *self == RGB_SEQ_A::RBG
    }
    #[doc = "Checks if the value of the field is `GRB`"]
    #[inline(always)]
    pub fn is_grb(&self) -> bool {
        *self == RGB_SEQ_A::GRB
    }
    #[doc = "Checks if the value of the field is `GBR`"]
    #[inline(always)]
    pub fn is_gbr(&self) -> bool {
        *self == RGB_SEQ_A::GBR
    }
    #[doc = "Checks if the value of the field is `BRG`"]
    #[inline(always)]
    pub fn is_brg(&self) -> bool {
        *self == RGB_SEQ_A::BRG
    }
    #[doc = "Checks if the value of the field is `BGR`"]
    #[inline(always)]
    pub fn is_bgr(&self) -> bool {
        *self == RGB_SEQ_A::BGR
    }
}
#[doc = "Field `rgb_seq` writer - Output RGB Sequence"]
pub type RGB_SEQ_W<'a, const O: u8> =
    crate::FieldWriter<'a, u32, DBI_CTL_0_SPEC, u8, RGB_SEQ_A, 3, O>;
impl<'a, const O: u8> RGB_SEQ_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn rgb(self) -> &'a mut W {
        self.variant(RGB_SEQ_A::RGB)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn rbg(self) -> &'a mut W {
        self.variant(RGB_SEQ_A::RBG)
    }
    #[doc = "`10`"]
    #[inline(always)]
    pub fn grb(self) -> &'a mut W {
        self.variant(RGB_SEQ_A::GRB)
    }
    #[doc = "`11`"]
    #[inline(always)]
    pub fn gbr(self) -> &'a mut W {
        self.variant(RGB_SEQ_A::GBR)
    }
    #[doc = "`100`"]
    #[inline(always)]
    pub fn brg(self) -> &'a mut W {
        self.variant(RGB_SEQ_A::BRG)
    }
    #[doc = "`101`"]
    #[inline(always)]
    pub fn bgr(self) -> &'a mut W {
        self.variant(RGB_SEQ_A::BGR)
    }
}
#[doc = "Field `dat_seq` reader - Output Data Sequence"]
pub type DAT_SEQ_R = crate::BitReader<DAT_SEQ_A>;
#[doc = "Output Data Sequence\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DAT_SEQ_A {
    #[doc = "0: `0`"]
    MSB = 0,
    #[doc = "1: `1`"]
    LSB = 1,
}
impl From<DAT_SEQ_A> for bool {
    #[inline(always)]
    fn from(variant: DAT_SEQ_A) -> Self {
        variant as u8 != 0
    }
}
impl DAT_SEQ_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DAT_SEQ_A {
        match self.bits {
            false => DAT_SEQ_A::MSB,
            true => DAT_SEQ_A::LSB,
        }
    }
    #[doc = "Checks if the value of the field is `MSB`"]
    #[inline(always)]
    pub fn is_msb(&self) -> bool {
        *self == DAT_SEQ_A::MSB
    }
    #[doc = "Checks if the value of the field is `LSB`"]
    #[inline(always)]
    pub fn is_lsb(&self) -> bool {
        *self == DAT_SEQ_A::LSB
    }
}
#[doc = "Field `dat_seq` writer - Output Data Sequence"]
pub type DAT_SEQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, DBI_CTL_0_SPEC, DAT_SEQ_A, O>;
impl<'a, const O: u8> DAT_SEQ_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn msb(self) -> &'a mut W {
        self.variant(DAT_SEQ_A::MSB)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn lsb(self) -> &'a mut W {
        self.variant(DAT_SEQ_A::LSB)
    }
}
#[doc = "Field `wcdc` reader - Write Command Dummy Cycles"]
pub type WCDC_R = crate::FieldReader<u16, u16>;
#[doc = "Field `wcdc` writer - Write Command Dummy Cycles"]
pub type WCDC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DBI_CTL_0_SPEC, u16, u16, 11, O>;
#[doc = "Field `cmdt` reader - Command Type"]
pub type CMDT_R = crate::BitReader<CMDT_A>;
#[doc = "Command Type\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CMDT_A {
    #[doc = "0: `0`"]
    WRITE = 0,
    #[doc = "1: `1`"]
    READ = 1,
}
impl From<CMDT_A> for bool {
    #[inline(always)]
    fn from(variant: CMDT_A) -> Self {
        variant as u8 != 0
    }
}
impl CMDT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CMDT_A {
        match self.bits {
            false => CMDT_A::WRITE,
            true => CMDT_A::READ,
        }
    }
    #[doc = "Checks if the value of the field is `WRITE`"]
    #[inline(always)]
    pub fn is_write(&self) -> bool {
        *self == CMDT_A::WRITE
    }
    #[doc = "Checks if the value of the field is `READ`"]
    #[inline(always)]
    pub fn is_read(&self) -> bool {
        *self == CMDT_A::READ
    }
}
#[doc = "Field `cmdt` writer - Command Type"]
pub type CMDT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DBI_CTL_0_SPEC, CMDT_A, O>;
impl<'a, const O: u8> CMDT_W<'a, O> {
    #[doc = "`0`"]
    #[inline(always)]
    pub fn write(self) -> &'a mut W {
        self.variant(CMDT_A::WRITE)
    }
    #[doc = "`1`"]
    #[inline(always)]
    pub fn read(self) -> &'a mut W {
        self.variant(CMDT_A::READ)
    }
}
impl R {
    #[doc = "Bit 0 - Video Source Type"]
    #[inline(always)]
    pub fn vi_src_type(&self) -> VI_SRC_TYPE_R {
        VI_SRC_TYPE_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Element A Position"]
    #[inline(always)]
    pub fn element_a_pos(&self) -> ELEMENT_A_POS_R {
        ELEMENT_A_POS_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - RGB Bit Order"]
    #[inline(always)]
    pub fn rgb_bo(&self) -> RGB_BO_R {
        RGB_BO_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Dummy Cycle Value"]
    #[inline(always)]
    pub fn dum_val(&self) -> DUM_VAL_R {
        DUM_VAL_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bits 4:7 - RGB Source Format"]
    #[inline(always)]
    pub fn rgb_src_fmt(&self) -> RGB_SRC_FMT_R {
        RGB_SRC_FMT_R::new(((self.bits >> 4) & 0x0f) as u8)
    }
    #[doc = "Bits 8:10"]
    #[inline(always)]
    pub fn dbi_interface(&self) -> DBI_INTERFACE_R {
        DBI_INTERFACE_R::new(((self.bits >> 8) & 7) as u8)
    }
    #[doc = "Bits 12:14 - Output Data Format"]
    #[inline(always)]
    pub fn dat_fmt(&self) -> DAT_FMT_R {
        DAT_FMT_R::new(((self.bits >> 12) & 7) as u8)
    }
    #[doc = "Bit 15 - Transmit Mode"]
    #[inline(always)]
    pub fn tran_mod(&self) -> TRAN_MOD_R {
        TRAN_MOD_R::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bits 16:18 - Output RGB Sequence"]
    #[inline(always)]
    pub fn rgb_seq(&self) -> RGB_SEQ_R {
        RGB_SEQ_R::new(((self.bits >> 16) & 7) as u8)
    }
    #[doc = "Bit 19 - Output Data Sequence"]
    #[inline(always)]
    pub fn dat_seq(&self) -> DAT_SEQ_R {
        DAT_SEQ_R::new(((self.bits >> 19) & 1) != 0)
    }
    #[doc = "Bits 20:30 - Write Command Dummy Cycles"]
    #[inline(always)]
    pub fn wcdc(&self) -> WCDC_R {
        WCDC_R::new(((self.bits >> 20) & 0x07ff) as u16)
    }
    #[doc = "Bit 31 - Command Type"]
    #[inline(always)]
    pub fn cmdt(&self) -> CMDT_R {
        CMDT_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Video Source Type"]
    #[inline(always)]
    #[must_use]
    pub fn vi_src_type(&mut self) -> VI_SRC_TYPE_W<0> {
        VI_SRC_TYPE_W::new(self)
    }
    #[doc = "Bit 1 - Element A Position"]
    #[inline(always)]
    #[must_use]
    pub fn element_a_pos(&mut self) -> ELEMENT_A_POS_W<1> {
        ELEMENT_A_POS_W::new(self)
    }
    #[doc = "Bit 2 - RGB Bit Order"]
    #[inline(always)]
    #[must_use]
    pub fn rgb_bo(&mut self) -> RGB_BO_W<2> {
        RGB_BO_W::new(self)
    }
    #[doc = "Bit 3 - Dummy Cycle Value"]
    #[inline(always)]
    #[must_use]
    pub fn dum_val(&mut self) -> DUM_VAL_W<3> {
        DUM_VAL_W::new(self)
    }
    #[doc = "Bits 4:7 - RGB Source Format"]
    #[inline(always)]
    #[must_use]
    pub fn rgb_src_fmt(&mut self) -> RGB_SRC_FMT_W<4> {
        RGB_SRC_FMT_W::new(self)
    }
    #[doc = "Bits 8:10"]
    #[inline(always)]
    #[must_use]
    pub fn dbi_interface(&mut self) -> DBI_INTERFACE_W<8> {
        DBI_INTERFACE_W::new(self)
    }
    #[doc = "Bits 12:14 - Output Data Format"]
    #[inline(always)]
    #[must_use]
    pub fn dat_fmt(&mut self) -> DAT_FMT_W<12> {
        DAT_FMT_W::new(self)
    }
    #[doc = "Bit 15 - Transmit Mode"]
    #[inline(always)]
    #[must_use]
    pub fn tran_mod(&mut self) -> TRAN_MOD_W<15> {
        TRAN_MOD_W::new(self)
    }
    #[doc = "Bits 16:18 - Output RGB Sequence"]
    #[inline(always)]
    #[must_use]
    pub fn rgb_seq(&mut self) -> RGB_SEQ_W<16> {
        RGB_SEQ_W::new(self)
    }
    #[doc = "Bit 19 - Output Data Sequence"]
    #[inline(always)]
    #[must_use]
    pub fn dat_seq(&mut self) -> DAT_SEQ_W<19> {
        DAT_SEQ_W::new(self)
    }
    #[doc = "Bits 20:30 - Write Command Dummy Cycles"]
    #[inline(always)]
    #[must_use]
    pub fn wcdc(&mut self) -> WCDC_W<20> {
        WCDC_W::new(self)
    }
    #[doc = "Bit 31 - Command Type"]
    #[inline(always)]
    #[must_use]
    pub fn cmdt(&mut self) -> CMDT_W<31> {
        CMDT_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "DBI Control Register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dbi_ctl_0](index.html) module"]
pub struct DBI_CTL_0_SPEC;
impl crate::RegisterSpec for DBI_CTL_0_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [dbi_ctl_0::R](R) reader structure"]
impl crate::Readable for DBI_CTL_0_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [dbi_ctl_0::W](W) writer structure"]
impl crate::Writable for DBI_CTL_0_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets dbi_ctl_0 to value 0"]
impl crate::Resettable for DBI_CTL_0_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}