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
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::identity_op)]
#![allow(clippy::unnecessary_cast)]
#![allow(clippy::erasing_op)]

#[doc = "Cluster LAYER%s, containing L?CR, L?WHPCR, L?WVPCR, L?CKCR, L?PFCR, L?CACR, L?DCCR, L?BFCR, L?CFBAR, L?CFBLR, L?CFBLNR, L?CLUTWR"]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Layer {
    ptr: *mut u8,
}
unsafe impl Send for Layer {}
unsafe impl Sync for Layer {}
impl Layer {
    #[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 = "Layerx Control Register"]
    #[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 = "Layerx Window Horizontal Position Configuration Register"]
    #[inline(always)]
    pub const fn whpcr(self) -> crate::common::Reg<regs::Whpcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x04usize) as _) }
    }
    #[doc = "Layerx Window Vertical Position Configuration Register"]
    #[inline(always)]
    pub const fn wvpcr(self) -> crate::common::Reg<regs::Wvpcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x08usize) as _) }
    }
    #[doc = "Layerx Color Keying Configuration Register"]
    #[inline(always)]
    pub const fn ckcr(self) -> crate::common::Reg<regs::Ckcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0cusize) as _) }
    }
    #[doc = "Layerx Pixel Format Configuration Register"]
    #[inline(always)]
    pub const fn pfcr(self) -> crate::common::Reg<regs::Pfcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x10usize) as _) }
    }
    #[doc = "Layerx Constant Alpha Configuration Register"]
    #[inline(always)]
    pub const fn cacr(self) -> crate::common::Reg<regs::Cacr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x14usize) as _) }
    }
    #[doc = "Layerx Default Color Configuration Register"]
    #[inline(always)]
    pub const fn dccr(self) -> crate::common::Reg<regs::Dccr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x18usize) as _) }
    }
    #[doc = "Layerx Blending Factors Configuration Register"]
    #[inline(always)]
    pub const fn bfcr(self) -> crate::common::Reg<regs::Bfcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x1cusize) as _) }
    }
    #[doc = "Layerx Color Frame Buffer Address Register"]
    #[inline(always)]
    pub const fn cfbar(self) -> crate::common::Reg<regs::Cfbar, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x28usize) as _) }
    }
    #[doc = "Layerx Color Frame Buffer Length Register"]
    #[inline(always)]
    pub const fn cfblr(self) -> crate::common::Reg<regs::Cfblr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x2cusize) as _) }
    }
    #[doc = "Layerx ColorFrame Buffer Line Number Register"]
    #[inline(always)]
    pub const fn cfblnr(self) -> crate::common::Reg<regs::Cfblnr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x30usize) as _) }
    }
    #[doc = "Layerx CLUT Write Register"]
    #[inline(always)]
    pub const fn clutwr(self) -> crate::common::Reg<regs::Clutwr, crate::common::W> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x40usize) as _) }
    }
}
#[doc = "LCD-TFT Controller"]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Ltdc {
    ptr: *mut u8,
}
unsafe impl Send for Ltdc {}
unsafe impl Sync for Ltdc {}
impl Ltdc {
    #[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 = "Synchronization Size Configuration Register"]
    #[inline(always)]
    pub const fn sscr(self) -> crate::common::Reg<regs::Sscr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x08usize) as _) }
    }
    #[doc = "Back Porch Configuration Register"]
    #[inline(always)]
    pub const fn bpcr(self) -> crate::common::Reg<regs::Bpcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0cusize) as _) }
    }
    #[doc = "Active Width Configuration Register"]
    #[inline(always)]
    pub const fn awcr(self) -> crate::common::Reg<regs::Awcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x10usize) as _) }
    }
    #[doc = "Total Width Configuration Register"]
    #[inline(always)]
    pub const fn twcr(self) -> crate::common::Reg<regs::Twcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x14usize) as _) }
    }
    #[doc = "Global Control Register"]
    #[inline(always)]
    pub const fn gcr(self) -> crate::common::Reg<regs::Gcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x18usize) as _) }
    }
    #[doc = "Shadow Reload Configuration Register"]
    #[inline(always)]
    pub const fn srcr(self) -> crate::common::Reg<regs::Srcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x24usize) as _) }
    }
    #[doc = "Background Color Configuration Register"]
    #[inline(always)]
    pub const fn bccr(self) -> crate::common::Reg<regs::Bccr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x2cusize) 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(0x34usize) as _) }
    }
    #[doc = "Interrupt Status Register"]
    #[inline(always)]
    pub const fn isr(self) -> crate::common::Reg<regs::Isr, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x38usize) 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(0x3cusize) as _) }
    }
    #[doc = "Line Interrupt Position Configuration Register"]
    #[inline(always)]
    pub const fn lipcr(self) -> crate::common::Reg<regs::Lipcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x40usize) as _) }
    }
    #[doc = "Current Position Status Register"]
    #[inline(always)]
    pub const fn cpsr(self) -> crate::common::Reg<regs::Cpsr, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x44usize) as _) }
    }
    #[doc = "Current Display Status Register"]
    #[inline(always)]
    pub const fn cdsr(self) -> crate::common::Reg<regs::Cdsr, crate::common::R> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x48usize) as _) }
    }
    #[doc = "Cluster LAYER%s, containing L?CR, L?WHPCR, L?WVPCR, L?CKCR, L?PFCR, L?CACR, L?DCCR, L?BFCR, L?CFBAR, L?CFBLR, L?CFBLNR, L?CLUTWR"]
    #[inline(always)]
    pub const fn layer(self, n: usize) -> Layer {
        assert!(n < 2usize);
        unsafe { Layer::from_ptr(self.ptr.add(0x84usize + n * 128usize) as _) }
    }
}
pub mod regs {
    #[doc = "Active Width Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Awcr(pub u32);
    impl Awcr {
        #[doc = "Accumulated Active Height (in units of horizontal scan line)"]
        #[inline(always)]
        pub const fn aah(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x07ff;
            val as u16
        }
        #[doc = "Accumulated Active Height (in units of horizontal scan line)"]
        #[inline(always)]
        pub fn set_aah(&mut self, val: u16) {
            self.0 = (self.0 & !(0x07ff << 0usize)) | (((val as u32) & 0x07ff) << 0usize);
        }
        #[doc = "Accumulated Active Width (in units of pixel clock period)"]
        #[inline(always)]
        pub const fn aaw(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0x0fff;
            val as u16
        }
        #[doc = "Accumulated Active Width (in units of pixel clock period)"]
        #[inline(always)]
        pub fn set_aaw(&mut self, val: u16) {
            self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
        }
    }
    impl Default for Awcr {
        #[inline(always)]
        fn default() -> Awcr {
            Awcr(0)
        }
    }
    impl core::fmt::Debug for Awcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Awcr")
                .field("aah", &self.aah())
                .field("aaw", &self.aaw())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Awcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Awcr {{ aah: {=u16:?}, aaw: {=u16:?} }}", self.aah(), self.aaw())
        }
    }
    #[doc = "Background Color Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Bccr(pub u32);
    impl Bccr {
        #[doc = "Background color blue value"]
        #[inline(always)]
        pub const fn bcblue(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Background color blue value"]
        #[inline(always)]
        pub fn set_bcblue(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Background color green value"]
        #[inline(always)]
        pub const fn bcgreen(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Background color green value"]
        #[inline(always)]
        pub fn set_bcgreen(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Background color red value"]
        #[inline(always)]
        pub const fn bcred(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Background color red value"]
        #[inline(always)]
        pub fn set_bcred(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
    }
    impl Default for Bccr {
        #[inline(always)]
        fn default() -> Bccr {
            Bccr(0)
        }
    }
    impl core::fmt::Debug for Bccr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Bccr")
                .field("bcblue", &self.bcblue())
                .field("bcgreen", &self.bcgreen())
                .field("bcred", &self.bcred())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Bccr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Bccr {{ bcblue: {=u8:?}, bcgreen: {=u8:?}, bcred: {=u8:?} }}",
                self.bcblue(),
                self.bcgreen(),
                self.bcred()
            )
        }
    }
    #[doc = "Layerx Blending Factors Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Bfcr(pub u32);
    impl Bfcr {
        #[doc = "Blending Factor 2"]
        #[inline(always)]
        pub const fn bf2(&self) -> super::vals::Bf2 {
            let val = (self.0 >> 0usize) & 0x07;
            super::vals::Bf2::from_bits(val as u8)
        }
        #[doc = "Blending Factor 2"]
        #[inline(always)]
        pub fn set_bf2(&mut self, val: super::vals::Bf2) {
            self.0 = (self.0 & !(0x07 << 0usize)) | (((val.to_bits() as u32) & 0x07) << 0usize);
        }
        #[doc = "Blending Factor 1"]
        #[inline(always)]
        pub const fn bf1(&self) -> super::vals::Bf1 {
            let val = (self.0 >> 8usize) & 0x07;
            super::vals::Bf1::from_bits(val as u8)
        }
        #[doc = "Blending Factor 1"]
        #[inline(always)]
        pub fn set_bf1(&mut self, val: super::vals::Bf1) {
            self.0 = (self.0 & !(0x07 << 8usize)) | (((val.to_bits() as u32) & 0x07) << 8usize);
        }
    }
    impl Default for Bfcr {
        #[inline(always)]
        fn default() -> Bfcr {
            Bfcr(0)
        }
    }
    impl core::fmt::Debug for Bfcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Bfcr")
                .field("bf2", &self.bf2())
                .field("bf1", &self.bf1())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Bfcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Bfcr {{ bf2: {:?}, bf1: {:?} }}", self.bf2(), self.bf1())
        }
    }
    #[doc = "Back Porch Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Bpcr(pub u32);
    impl Bpcr {
        #[doc = "Accumulated Vertical back porch (in units of horizontal scan line)"]
        #[inline(always)]
        pub const fn avbp(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x07ff;
            val as u16
        }
        #[doc = "Accumulated Vertical back porch (in units of horizontal scan line)"]
        #[inline(always)]
        pub fn set_avbp(&mut self, val: u16) {
            self.0 = (self.0 & !(0x07ff << 0usize)) | (((val as u32) & 0x07ff) << 0usize);
        }
        #[doc = "Accumulated Horizontal back porch (in units of pixel clock period)"]
        #[inline(always)]
        pub const fn ahbp(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0x0fff;
            val as u16
        }
        #[doc = "Accumulated Horizontal back porch (in units of pixel clock period)"]
        #[inline(always)]
        pub fn set_ahbp(&mut self, val: u16) {
            self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
        }
    }
    impl Default for Bpcr {
        #[inline(always)]
        fn default() -> Bpcr {
            Bpcr(0)
        }
    }
    impl core::fmt::Debug for Bpcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Bpcr")
                .field("avbp", &self.avbp())
                .field("ahbp", &self.ahbp())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Bpcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Bpcr {{ avbp: {=u16:?}, ahbp: {=u16:?} }}", self.avbp(), self.ahbp())
        }
    }
    #[doc = "Layerx Constant Alpha Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cacr(pub u32);
    impl Cacr {
        #[doc = "Constant Alpha"]
        #[inline(always)]
        pub const fn consta(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Constant Alpha"]
        #[inline(always)]
        pub fn set_consta(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
    }
    impl Default for Cacr {
        #[inline(always)]
        fn default() -> Cacr {
            Cacr(0)
        }
    }
    impl core::fmt::Debug for Cacr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Cacr").field("consta", &self.consta()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cacr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Cacr {{ consta: {=u8:?} }}", self.consta())
        }
    }
    #[doc = "Current Display Status Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cdsr(pub u32);
    impl Cdsr {
        #[doc = "Vertical Data Enable display Status"]
        #[inline(always)]
        pub const fn vdes(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Vertical Data Enable display Status"]
        #[inline(always)]
        pub fn set_vdes(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Horizontal Data Enable display Status"]
        #[inline(always)]
        pub const fn hdes(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Horizontal Data Enable display Status"]
        #[inline(always)]
        pub fn set_hdes(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Vertical Synchronization display Status"]
        #[inline(always)]
        pub const fn vsyncs(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Vertical Synchronization display Status"]
        #[inline(always)]
        pub fn set_vsyncs(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "Horizontal Synchronization display Status"]
        #[inline(always)]
        pub const fn hsyncs(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Horizontal Synchronization display Status"]
        #[inline(always)]
        pub fn set_hsyncs(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
    }
    impl Default for Cdsr {
        #[inline(always)]
        fn default() -> Cdsr {
            Cdsr(0)
        }
    }
    impl core::fmt::Debug for Cdsr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Cdsr")
                .field("vdes", &self.vdes())
                .field("hdes", &self.hdes())
                .field("vsyncs", &self.vsyncs())
                .field("hsyncs", &self.hsyncs())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cdsr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Cdsr {{ vdes: {=bool:?}, hdes: {=bool:?}, vsyncs: {=bool:?}, hsyncs: {=bool:?} }}",
                self.vdes(),
                self.hdes(),
                self.vsyncs(),
                self.hsyncs()
            )
        }
    }
    #[doc = "Layerx Color Frame Buffer Address Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cfbar(pub u32);
    impl Cfbar {
        #[doc = "Color Frame Buffer Start Address"]
        #[inline(always)]
        pub const fn cfbadd(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Color Frame Buffer Start Address"]
        #[inline(always)]
        pub fn set_cfbadd(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Cfbar {
        #[inline(always)]
        fn default() -> Cfbar {
            Cfbar(0)
        }
    }
    impl core::fmt::Debug for Cfbar {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Cfbar").field("cfbadd", &self.cfbadd()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cfbar {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Cfbar {{ cfbadd: {=u32:?} }}", self.cfbadd())
        }
    }
    #[doc = "Layerx ColorFrame Buffer Line Number Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cfblnr(pub u32);
    impl Cfblnr {
        #[doc = "Frame Buffer Line Number"]
        #[inline(always)]
        pub const fn cfblnbr(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x07ff;
            val as u16
        }
        #[doc = "Frame Buffer Line Number"]
        #[inline(always)]
        pub fn set_cfblnbr(&mut self, val: u16) {
            self.0 = (self.0 & !(0x07ff << 0usize)) | (((val as u32) & 0x07ff) << 0usize);
        }
    }
    impl Default for Cfblnr {
        #[inline(always)]
        fn default() -> Cfblnr {
            Cfblnr(0)
        }
    }
    impl core::fmt::Debug for Cfblnr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Cfblnr").field("cfblnbr", &self.cfblnbr()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cfblnr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Cfblnr {{ cfblnbr: {=u16:?} }}", self.cfblnbr())
        }
    }
    #[doc = "Layerx Color Frame Buffer Length Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cfblr(pub u32);
    impl Cfblr {
        #[doc = "Color Frame Buffer Line Length"]
        #[inline(always)]
        pub const fn cfbll(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x1fff;
            val as u16
        }
        #[doc = "Color Frame Buffer Line Length"]
        #[inline(always)]
        pub fn set_cfbll(&mut self, val: u16) {
            self.0 = (self.0 & !(0x1fff << 0usize)) | (((val as u32) & 0x1fff) << 0usize);
        }
        #[doc = "Color Frame Buffer Pitch in bytes"]
        #[inline(always)]
        pub const fn cfbp(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0x1fff;
            val as u16
        }
        #[doc = "Color Frame Buffer Pitch in bytes"]
        #[inline(always)]
        pub fn set_cfbp(&mut self, val: u16) {
            self.0 = (self.0 & !(0x1fff << 16usize)) | (((val as u32) & 0x1fff) << 16usize);
        }
    }
    impl Default for Cfblr {
        #[inline(always)]
        fn default() -> Cfblr {
            Cfblr(0)
        }
    }
    impl core::fmt::Debug for Cfblr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Cfblr")
                .field("cfbll", &self.cfbll())
                .field("cfbp", &self.cfbp())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cfblr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Cfblr {{ cfbll: {=u16:?}, cfbp: {=u16:?} }}",
                self.cfbll(),
                self.cfbp()
            )
        }
    }
    #[doc = "Layerx Color Keying Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Ckcr(pub u32);
    impl Ckcr {
        #[doc = "Color Key Blue value"]
        #[inline(always)]
        pub const fn ckblue(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Color Key Blue value"]
        #[inline(always)]
        pub fn set_ckblue(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Color Key Green value"]
        #[inline(always)]
        pub const fn ckgreen(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Color Key Green value"]
        #[inline(always)]
        pub fn set_ckgreen(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Color Key Red value"]
        #[inline(always)]
        pub const fn ckred(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Color Key Red value"]
        #[inline(always)]
        pub fn set_ckred(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
    }
    impl Default for Ckcr {
        #[inline(always)]
        fn default() -> Ckcr {
            Ckcr(0)
        }
    }
    impl core::fmt::Debug for Ckcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Ckcr")
                .field("ckblue", &self.ckblue())
                .field("ckgreen", &self.ckgreen())
                .field("ckred", &self.ckred())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Ckcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Ckcr {{ ckblue: {=u8:?}, ckgreen: {=u8:?}, ckred: {=u8:?} }}",
                self.ckblue(),
                self.ckgreen(),
                self.ckred()
            )
        }
    }
    #[doc = "Layerx CLUT Write Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Clutwr(pub u32);
    impl Clutwr {
        #[doc = "Blue value"]
        #[inline(always)]
        pub const fn blue(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Blue value"]
        #[inline(always)]
        pub fn set_blue(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Green value"]
        #[inline(always)]
        pub const fn green(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Green value"]
        #[inline(always)]
        pub fn set_green(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Red value"]
        #[inline(always)]
        pub const fn red(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Red value"]
        #[inline(always)]
        pub fn set_red(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
        #[doc = "CLUT Address"]
        #[inline(always)]
        pub const fn clutadd(&self) -> u8 {
            let val = (self.0 >> 24usize) & 0xff;
            val as u8
        }
        #[doc = "CLUT Address"]
        #[inline(always)]
        pub fn set_clutadd(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
        }
    }
    impl Default for Clutwr {
        #[inline(always)]
        fn default() -> Clutwr {
            Clutwr(0)
        }
    }
    impl core::fmt::Debug for Clutwr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Clutwr")
                .field("blue", &self.blue())
                .field("green", &self.green())
                .field("red", &self.red())
                .field("clutadd", &self.clutadd())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Clutwr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Clutwr {{ blue: {=u8:?}, green: {=u8:?}, red: {=u8:?}, clutadd: {=u8:?} }}",
                self.blue(),
                self.green(),
                self.red(),
                self.clutadd()
            )
        }
    }
    #[doc = "Current Position Status Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cpsr(pub u32);
    impl Cpsr {
        #[doc = "Current Y Position"]
        #[inline(always)]
        pub const fn cypos(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Current Y Position"]
        #[inline(always)]
        pub fn set_cypos(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
        }
        #[doc = "Current X Position"]
        #[inline(always)]
        pub const fn cxpos(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0xffff;
            val as u16
        }
        #[doc = "Current X Position"]
        #[inline(always)]
        pub fn set_cxpos(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
        }
    }
    impl Default for Cpsr {
        #[inline(always)]
        fn default() -> Cpsr {
            Cpsr(0)
        }
    }
    impl core::fmt::Debug for Cpsr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Cpsr")
                .field("cypos", &self.cypos())
                .field("cxpos", &self.cxpos())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cpsr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Cpsr {{ cypos: {=u16:?}, cxpos: {=u16:?} }}",
                self.cypos(),
                self.cxpos()
            )
        }
    }
    #[doc = "Layerx Control Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cr(pub u32);
    impl Cr {
        #[doc = "Layer Enable"]
        #[inline(always)]
        pub const fn len(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Layer Enable"]
        #[inline(always)]
        pub fn set_len(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Color Keying Enable"]
        #[inline(always)]
        pub const fn colken(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Color Keying Enable"]
        #[inline(always)]
        pub fn set_colken(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Color Look-Up Table Enable"]
        #[inline(always)]
        pub const fn cluten(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Color Look-Up Table Enable"]
        #[inline(always)]
        pub fn set_cluten(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
        }
    }
    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("len", &self.len())
                .field("colken", &self.colken())
                .field("cluten", &self.cluten())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Cr {{ len: {=bool:?}, colken: {=bool:?}, cluten: {=bool:?} }}",
                self.len(),
                self.colken(),
                self.cluten()
            )
        }
    }
    #[doc = "Layerx Default Color Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Dccr(pub u32);
    impl Dccr {
        #[doc = "Default Color Blue"]
        #[inline(always)]
        pub const fn dcblue(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Default Color Blue"]
        #[inline(always)]
        pub fn set_dcblue(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Default Color Green"]
        #[inline(always)]
        pub const fn dcgreen(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Default Color Green"]
        #[inline(always)]
        pub fn set_dcgreen(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Default Color Red"]
        #[inline(always)]
        pub const fn dcred(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Default Color Red"]
        #[inline(always)]
        pub fn set_dcred(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
        #[doc = "Default Color Alpha"]
        #[inline(always)]
        pub const fn dcalpha(&self) -> u8 {
            let val = (self.0 >> 24usize) & 0xff;
            val as u8
        }
        #[doc = "Default Color Alpha"]
        #[inline(always)]
        pub fn set_dcalpha(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
        }
    }
    impl Default for Dccr {
        #[inline(always)]
        fn default() -> Dccr {
            Dccr(0)
        }
    }
    impl core::fmt::Debug for Dccr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Dccr")
                .field("dcblue", &self.dcblue())
                .field("dcgreen", &self.dcgreen())
                .field("dcred", &self.dcred())
                .field("dcalpha", &self.dcalpha())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Dccr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Dccr {{ dcblue: {=u8:?}, dcgreen: {=u8:?}, dcred: {=u8:?}, dcalpha: {=u8:?} }}",
                self.dcblue(),
                self.dcgreen(),
                self.dcred(),
                self.dcalpha()
            )
        }
    }
    #[doc = "Global Control Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Gcr(pub u32);
    impl Gcr {
        #[doc = "LCD-TFT controller enable bit"]
        #[inline(always)]
        pub const fn ltdcen(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "LCD-TFT controller enable bit"]
        #[inline(always)]
        pub fn set_ltdcen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Dither Blue Width"]
        #[inline(always)]
        pub const fn dbw(&self) -> u8 {
            let val = (self.0 >> 4usize) & 0x07;
            val as u8
        }
        #[doc = "Dither Blue Width"]
        #[inline(always)]
        pub fn set_dbw(&mut self, val: u8) {
            self.0 = (self.0 & !(0x07 << 4usize)) | (((val as u32) & 0x07) << 4usize);
        }
        #[doc = "Dither Green Width"]
        #[inline(always)]
        pub const fn dgw(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0x07;
            val as u8
        }
        #[doc = "Dither Green Width"]
        #[inline(always)]
        pub fn set_dgw(&mut self, val: u8) {
            self.0 = (self.0 & !(0x07 << 8usize)) | (((val as u32) & 0x07) << 8usize);
        }
        #[doc = "Dither Red Width"]
        #[inline(always)]
        pub const fn drw(&self) -> u8 {
            let val = (self.0 >> 12usize) & 0x07;
            val as u8
        }
        #[doc = "Dither Red Width"]
        #[inline(always)]
        pub fn set_drw(&mut self, val: u8) {
            self.0 = (self.0 & !(0x07 << 12usize)) | (((val as u32) & 0x07) << 12usize);
        }
        #[doc = "Dither Enable"]
        #[inline(always)]
        pub const fn den(&self) -> bool {
            let val = (self.0 >> 16usize) & 0x01;
            val != 0
        }
        #[doc = "Dither Enable"]
        #[inline(always)]
        pub fn set_den(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
        }
        #[doc = "Pixel Clock Polarity"]
        #[inline(always)]
        pub const fn pcpol(&self) -> super::vals::Pcpol {
            let val = (self.0 >> 28usize) & 0x01;
            super::vals::Pcpol::from_bits(val as u8)
        }
        #[doc = "Pixel Clock Polarity"]
        #[inline(always)]
        pub fn set_pcpol(&mut self, val: super::vals::Pcpol) {
            self.0 = (self.0 & !(0x01 << 28usize)) | (((val.to_bits() as u32) & 0x01) << 28usize);
        }
        #[doc = "Data Enable Polarity"]
        #[inline(always)]
        pub const fn depol(&self) -> super::vals::Depol {
            let val = (self.0 >> 29usize) & 0x01;
            super::vals::Depol::from_bits(val as u8)
        }
        #[doc = "Data Enable Polarity"]
        #[inline(always)]
        pub fn set_depol(&mut self, val: super::vals::Depol) {
            self.0 = (self.0 & !(0x01 << 29usize)) | (((val.to_bits() as u32) & 0x01) << 29usize);
        }
        #[doc = "Vertical Synchronization Polarity"]
        #[inline(always)]
        pub const fn vspol(&self) -> super::vals::Vspol {
            let val = (self.0 >> 30usize) & 0x01;
            super::vals::Vspol::from_bits(val as u8)
        }
        #[doc = "Vertical Synchronization Polarity"]
        #[inline(always)]
        pub fn set_vspol(&mut self, val: super::vals::Vspol) {
            self.0 = (self.0 & !(0x01 << 30usize)) | (((val.to_bits() as u32) & 0x01) << 30usize);
        }
        #[doc = "Horizontal Synchronization Polarity"]
        #[inline(always)]
        pub const fn hspol(&self) -> super::vals::Hspol {
            let val = (self.0 >> 31usize) & 0x01;
            super::vals::Hspol::from_bits(val as u8)
        }
        #[doc = "Horizontal Synchronization Polarity"]
        #[inline(always)]
        pub fn set_hspol(&mut self, val: super::vals::Hspol) {
            self.0 = (self.0 & !(0x01 << 31usize)) | (((val.to_bits() as u32) & 0x01) << 31usize);
        }
    }
    impl Default for Gcr {
        #[inline(always)]
        fn default() -> Gcr {
            Gcr(0)
        }
    }
    impl core::fmt::Debug for Gcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Gcr")
                .field("ltdcen", &self.ltdcen())
                .field("dbw", &self.dbw())
                .field("dgw", &self.dgw())
                .field("drw", &self.drw())
                .field("den", &self.den())
                .field("pcpol", &self.pcpol())
                .field("depol", &self.depol())
                .field("vspol", &self.vspol())
                .field("hspol", &self.hspol())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Gcr {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Gcr {{ ltdcen: {=bool:?}, dbw: {=u8:?}, dgw: {=u8:?}, drw: {=u8:?}, den: {=bool:?}, pcpol: {:?}, depol: {:?}, vspol: {:?}, hspol: {:?} }}" , self . ltdcen () , self . dbw () , self . dgw () , self . drw () , self . den () , self . pcpol () , self . depol () , self . vspol () , self . hspol ())
        }
    }
    #[doc = "Interrupt Clear Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Icr(pub u32);
    impl Icr {
        #[doc = "Clears the Line Interrupt Flag"]
        #[inline(always)]
        pub const fn clif(&self) -> super::vals::Clif {
            let val = (self.0 >> 0usize) & 0x01;
            super::vals::Clif::from_bits(val as u8)
        }
        #[doc = "Clears the Line Interrupt Flag"]
        #[inline(always)]
        pub fn set_clif(&mut self, val: super::vals::Clif) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
        }
        #[doc = "Clears the FIFO Underrun Interrupt flag"]
        #[inline(always)]
        pub const fn cfuif(&self) -> super::vals::Cfuif {
            let val = (self.0 >> 1usize) & 0x01;
            super::vals::Cfuif::from_bits(val as u8)
        }
        #[doc = "Clears the FIFO Underrun Interrupt flag"]
        #[inline(always)]
        pub fn set_cfuif(&mut self, val: super::vals::Cfuif) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
        }
        #[doc = "Clears the Transfer Error Interrupt Flag"]
        #[inline(always)]
        pub const fn cterrif(&self) -> super::vals::Cterrif {
            let val = (self.0 >> 2usize) & 0x01;
            super::vals::Cterrif::from_bits(val as u8)
        }
        #[doc = "Clears the Transfer Error Interrupt Flag"]
        #[inline(always)]
        pub fn set_cterrif(&mut self, val: super::vals::Cterrif) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val.to_bits() as u32) & 0x01) << 2usize);
        }
        #[doc = "Clears Register Reload Interrupt Flag"]
        #[inline(always)]
        pub const fn crrif(&self) -> super::vals::Crrif {
            let val = (self.0 >> 3usize) & 0x01;
            super::vals::Crrif::from_bits(val as u8)
        }
        #[doc = "Clears Register Reload Interrupt Flag"]
        #[inline(always)]
        pub fn set_crrif(&mut self, val: super::vals::Crrif) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val.to_bits() as u32) & 0x01) << 3usize);
        }
    }
    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("clif", &self.clif())
                .field("cfuif", &self.cfuif())
                .field("cterrif", &self.cterrif())
                .field("crrif", &self.crrif())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Icr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Icr {{ clif: {:?}, cfuif: {:?}, cterrif: {:?}, crrif: {:?} }}",
                self.clif(),
                self.cfuif(),
                self.cterrif(),
                self.crrif()
            )
        }
    }
    #[doc = "Interrupt Enable Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Ier(pub u32);
    impl Ier {
        #[doc = "Line Interrupt Enable"]
        #[inline(always)]
        pub const fn lie(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Line Interrupt Enable"]
        #[inline(always)]
        pub fn set_lie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "FIFO Underrun Interrupt Enable"]
        #[inline(always)]
        pub const fn fuie(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "FIFO Underrun Interrupt Enable"]
        #[inline(always)]
        pub fn set_fuie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Transfer Error Interrupt Enable"]
        #[inline(always)]
        pub const fn terrie(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Transfer Error Interrupt Enable"]
        #[inline(always)]
        pub fn set_terrie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "Register Reload interrupt enable"]
        #[inline(always)]
        pub const fn rrie(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Register Reload interrupt enable"]
        #[inline(always)]
        pub fn set_rrie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
    }
    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("lie", &self.lie())
                .field("fuie", &self.fuie())
                .field("terrie", &self.terrie())
                .field("rrie", &self.rrie())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Ier {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Ier {{ lie: {=bool:?}, fuie: {=bool:?}, terrie: {=bool:?}, rrie: {=bool:?} }}",
                self.lie(),
                self.fuie(),
                self.terrie(),
                self.rrie()
            )
        }
    }
    #[doc = "Interrupt Status Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Isr(pub u32);
    impl Isr {
        #[doc = "Line Interrupt flag"]
        #[inline(always)]
        pub const fn lif(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Line Interrupt flag"]
        #[inline(always)]
        pub fn set_lif(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "FIFO Underrun Interrupt flag"]
        #[inline(always)]
        pub const fn fuif(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "FIFO Underrun Interrupt flag"]
        #[inline(always)]
        pub fn set_fuif(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Transfer Error interrupt flag"]
        #[inline(always)]
        pub const fn terrif(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "Transfer Error interrupt flag"]
        #[inline(always)]
        pub fn set_terrif(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "Register Reload Interrupt Flag"]
        #[inline(always)]
        pub const fn rrif(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Register Reload Interrupt Flag"]
        #[inline(always)]
        pub fn set_rrif(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
    }
    impl Default for Isr {
        #[inline(always)]
        fn default() -> Isr {
            Isr(0)
        }
    }
    impl core::fmt::Debug for Isr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Isr")
                .field("lif", &self.lif())
                .field("fuif", &self.fuif())
                .field("terrif", &self.terrif())
                .field("rrif", &self.rrif())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Isr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Isr {{ lif: {=bool:?}, fuif: {=bool:?}, terrif: {=bool:?}, rrif: {=bool:?} }}",
                self.lif(),
                self.fuif(),
                self.terrif(),
                self.rrif()
            )
        }
    }
    #[doc = "Line Interrupt Position Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Lipcr(pub u32);
    impl Lipcr {
        #[doc = "Line Interrupt Position"]
        #[inline(always)]
        pub const fn lipos(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x07ff;
            val as u16
        }
        #[doc = "Line Interrupt Position"]
        #[inline(always)]
        pub fn set_lipos(&mut self, val: u16) {
            self.0 = (self.0 & !(0x07ff << 0usize)) | (((val as u32) & 0x07ff) << 0usize);
        }
    }
    impl Default for Lipcr {
        #[inline(always)]
        fn default() -> Lipcr {
            Lipcr(0)
        }
    }
    impl core::fmt::Debug for Lipcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Lipcr").field("lipos", &self.lipos()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Lipcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Lipcr {{ lipos: {=u16:?} }}", self.lipos())
        }
    }
    #[doc = "Layerx Pixel Format Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Pfcr(pub u32);
    impl Pfcr {
        #[doc = "Pixel Format"]
        #[inline(always)]
        pub const fn pf(&self) -> super::vals::Pf {
            let val = (self.0 >> 0usize) & 0x07;
            super::vals::Pf::from_bits(val as u8)
        }
        #[doc = "Pixel Format"]
        #[inline(always)]
        pub fn set_pf(&mut self, val: super::vals::Pf) {
            self.0 = (self.0 & !(0x07 << 0usize)) | (((val.to_bits() as u32) & 0x07) << 0usize);
        }
    }
    impl Default for Pfcr {
        #[inline(always)]
        fn default() -> Pfcr {
            Pfcr(0)
        }
    }
    impl core::fmt::Debug for Pfcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Pfcr").field("pf", &self.pf()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Pfcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Pfcr {{ pf: {:?} }}", self.pf())
        }
    }
    #[doc = "Shadow Reload Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Srcr(pub u32);
    impl Srcr {
        #[doc = "Immediate Reload"]
        #[inline(always)]
        pub const fn imr(&self) -> super::vals::Imr {
            let val = (self.0 >> 0usize) & 0x01;
            super::vals::Imr::from_bits(val as u8)
        }
        #[doc = "Immediate Reload"]
        #[inline(always)]
        pub fn set_imr(&mut self, val: super::vals::Imr) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
        }
        #[doc = "Vertical Blanking Reload"]
        #[inline(always)]
        pub const fn vbr(&self) -> super::vals::Vbr {
            let val = (self.0 >> 1usize) & 0x01;
            super::vals::Vbr::from_bits(val as u8)
        }
        #[doc = "Vertical Blanking Reload"]
        #[inline(always)]
        pub fn set_vbr(&mut self, val: super::vals::Vbr) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
        }
    }
    impl Default for Srcr {
        #[inline(always)]
        fn default() -> Srcr {
            Srcr(0)
        }
    }
    impl core::fmt::Debug for Srcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Srcr")
                .field("imr", &self.imr())
                .field("vbr", &self.vbr())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Srcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Srcr {{ imr: {:?}, vbr: {:?} }}", self.imr(), self.vbr())
        }
    }
    #[doc = "Synchronization Size Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Sscr(pub u32);
    impl Sscr {
        #[doc = "Vertical Synchronization Height (in units of horizontal scan line)"]
        #[inline(always)]
        pub const fn vsh(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x07ff;
            val as u16
        }
        #[doc = "Vertical Synchronization Height (in units of horizontal scan line)"]
        #[inline(always)]
        pub fn set_vsh(&mut self, val: u16) {
            self.0 = (self.0 & !(0x07ff << 0usize)) | (((val as u32) & 0x07ff) << 0usize);
        }
        #[doc = "Horizontal Synchronization Width (in units of pixel clock period)"]
        #[inline(always)]
        pub const fn hsw(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0x0fff;
            val as u16
        }
        #[doc = "Horizontal Synchronization Width (in units of pixel clock period)"]
        #[inline(always)]
        pub fn set_hsw(&mut self, val: u16) {
            self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
        }
    }
    impl Default for Sscr {
        #[inline(always)]
        fn default() -> Sscr {
            Sscr(0)
        }
    }
    impl core::fmt::Debug for Sscr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Sscr")
                .field("vsh", &self.vsh())
                .field("hsw", &self.hsw())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Sscr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Sscr {{ vsh: {=u16:?}, hsw: {=u16:?} }}", self.vsh(), self.hsw())
        }
    }
    #[doc = "Total Width Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Twcr(pub u32);
    impl Twcr {
        #[doc = "Total Height (in units of horizontal scan line)"]
        #[inline(always)]
        pub const fn totalh(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x07ff;
            val as u16
        }
        #[doc = "Total Height (in units of horizontal scan line)"]
        #[inline(always)]
        pub fn set_totalh(&mut self, val: u16) {
            self.0 = (self.0 & !(0x07ff << 0usize)) | (((val as u32) & 0x07ff) << 0usize);
        }
        #[doc = "Total Width (in units of pixel clock period)"]
        #[inline(always)]
        pub const fn totalw(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0x0fff;
            val as u16
        }
        #[doc = "Total Width (in units of pixel clock period)"]
        #[inline(always)]
        pub fn set_totalw(&mut self, val: u16) {
            self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
        }
    }
    impl Default for Twcr {
        #[inline(always)]
        fn default() -> Twcr {
            Twcr(0)
        }
    }
    impl core::fmt::Debug for Twcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Twcr")
                .field("totalh", &self.totalh())
                .field("totalw", &self.totalw())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Twcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Twcr {{ totalh: {=u16:?}, totalw: {=u16:?} }}",
                self.totalh(),
                self.totalw()
            )
        }
    }
    #[doc = "Layerx Window Horizontal Position Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Whpcr(pub u32);
    impl Whpcr {
        #[doc = "Window Horizontal Start Position"]
        #[inline(always)]
        pub const fn whstpos(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x0fff;
            val as u16
        }
        #[doc = "Window Horizontal Start Position"]
        #[inline(always)]
        pub fn set_whstpos(&mut self, val: u16) {
            self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
        }
        #[doc = "Window Horizontal Stop Position"]
        #[inline(always)]
        pub const fn whsppos(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0x0fff;
            val as u16
        }
        #[doc = "Window Horizontal Stop Position"]
        #[inline(always)]
        pub fn set_whsppos(&mut self, val: u16) {
            self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
        }
    }
    impl Default for Whpcr {
        #[inline(always)]
        fn default() -> Whpcr {
            Whpcr(0)
        }
    }
    impl core::fmt::Debug for Whpcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Whpcr")
                .field("whstpos", &self.whstpos())
                .field("whsppos", &self.whsppos())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Whpcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Whpcr {{ whstpos: {=u16:?}, whsppos: {=u16:?} }}",
                self.whstpos(),
                self.whsppos()
            )
        }
    }
    #[doc = "Layerx Window Vertical Position Configuration Register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Wvpcr(pub u32);
    impl Wvpcr {
        #[doc = "Window Vertical Start Position"]
        #[inline(always)]
        pub const fn wvstpos(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0x07ff;
            val as u16
        }
        #[doc = "Window Vertical Start Position"]
        #[inline(always)]
        pub fn set_wvstpos(&mut self, val: u16) {
            self.0 = (self.0 & !(0x07ff << 0usize)) | (((val as u32) & 0x07ff) << 0usize);
        }
        #[doc = "Window Vertical Stop Position"]
        #[inline(always)]
        pub const fn wvsppos(&self) -> u16 {
            let val = (self.0 >> 16usize) & 0x07ff;
            val as u16
        }
        #[doc = "Window Vertical Stop Position"]
        #[inline(always)]
        pub fn set_wvsppos(&mut self, val: u16) {
            self.0 = (self.0 & !(0x07ff << 16usize)) | (((val as u32) & 0x07ff) << 16usize);
        }
    }
    impl Default for Wvpcr {
        #[inline(always)]
        fn default() -> Wvpcr {
            Wvpcr(0)
        }
    }
    impl core::fmt::Debug for Wvpcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Wvpcr")
                .field("wvstpos", &self.wvstpos())
                .field("wvsppos", &self.wvsppos())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Wvpcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Wvpcr {{ wvstpos: {=u16:?}, wvsppos: {=u16:?} }}",
                self.wvstpos(),
                self.wvsppos()
            )
        }
    }
}
pub mod vals {
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Bf1 {
        _RESERVED_0 = 0x0,
        _RESERVED_1 = 0x01,
        _RESERVED_2 = 0x02,
        _RESERVED_3 = 0x03,
        #[doc = "BF1 = constant alpha"]
        CONSTANT = 0x04,
        _RESERVED_5 = 0x05,
        #[doc = "BF1 = pixel alpha * constant alpha"]
        PIXEL = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl Bf1 {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Bf1 {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Bf1 {
        #[inline(always)]
        fn from(val: u8) -> Bf1 {
            Bf1::from_bits(val)
        }
    }
    impl From<Bf1> for u8 {
        #[inline(always)]
        fn from(val: Bf1) -> u8 {
            Bf1::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Bf2 {
        _RESERVED_0 = 0x0,
        _RESERVED_1 = 0x01,
        _RESERVED_2 = 0x02,
        _RESERVED_3 = 0x03,
        _RESERVED_4 = 0x04,
        #[doc = "BF2 = 1 - constant alpha"]
        CONSTANT = 0x05,
        _RESERVED_6 = 0x06,
        #[doc = "BF2 = 1 - pixel alpha * constant alpha"]
        PIXEL = 0x07,
    }
    impl Bf2 {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Bf2 {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Bf2 {
        #[inline(always)]
        fn from(val: u8) -> Bf2 {
            Bf2::from_bits(val)
        }
    }
    impl From<Bf2> for u8 {
        #[inline(always)]
        fn from(val: Bf2) -> u8 {
            Bf2::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Cfuif {
        _RESERVED_0 = 0x0,
        #[doc = "Clears the FUIF flag in the ISR register"]
        CLEAR = 0x01,
    }
    impl Cfuif {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Cfuif {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Cfuif {
        #[inline(always)]
        fn from(val: u8) -> Cfuif {
            Cfuif::from_bits(val)
        }
    }
    impl From<Cfuif> for u8 {
        #[inline(always)]
        fn from(val: Cfuif) -> u8 {
            Cfuif::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Clif {
        _RESERVED_0 = 0x0,
        #[doc = "Clears the LIF flag in the ISR register"]
        CLEAR = 0x01,
    }
    impl Clif {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Clif {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Clif {
        #[inline(always)]
        fn from(val: u8) -> Clif {
            Clif::from_bits(val)
        }
    }
    impl From<Clif> for u8 {
        #[inline(always)]
        fn from(val: Clif) -> u8 {
            Clif::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Crrif {
        _RESERVED_0 = 0x0,
        #[doc = "Clears the RRIF flag in the ISR register"]
        CLEAR = 0x01,
    }
    impl Crrif {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Crrif {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Crrif {
        #[inline(always)]
        fn from(val: u8) -> Crrif {
            Crrif::from_bits(val)
        }
    }
    impl From<Crrif> for u8 {
        #[inline(always)]
        fn from(val: Crrif) -> u8 {
            Crrif::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Cterrif {
        _RESERVED_0 = 0x0,
        #[doc = "Clears the TERRIF flag in the ISR register"]
        CLEAR = 0x01,
    }
    impl Cterrif {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Cterrif {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Cterrif {
        #[inline(always)]
        fn from(val: u8) -> Cterrif {
            Cterrif::from_bits(val)
        }
    }
    impl From<Cterrif> for u8 {
        #[inline(always)]
        fn from(val: Cterrif) -> u8 {
            Cterrif::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Depol {
        #[doc = "Data enable polarity is active low"]
        ACTIVE_LOW = 0x0,
        #[doc = "Data enable polarity is active high"]
        ACTIVE_HIGH = 0x01,
    }
    impl Depol {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Depol {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Depol {
        #[inline(always)]
        fn from(val: u8) -> Depol {
            Depol::from_bits(val)
        }
    }
    impl From<Depol> for u8 {
        #[inline(always)]
        fn from(val: Depol) -> u8 {
            Depol::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Hspol {
        #[doc = "Horizontal synchronization polarity is active low"]
        ACTIVE_LOW = 0x0,
        #[doc = "Horizontal synchronization polarity is active high"]
        ACTIVE_HIGH = 0x01,
    }
    impl Hspol {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Hspol {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Hspol {
        #[inline(always)]
        fn from(val: u8) -> Hspol {
            Hspol::from_bits(val)
        }
    }
    impl From<Hspol> for u8 {
        #[inline(always)]
        fn from(val: Hspol) -> u8 {
            Hspol::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Imr {
        #[doc = "This bit is set by software and cleared only by hardware after reload (it cannot be cleared through register write once it is set)"]
        NO_EFFECT = 0x0,
        #[doc = "The shadow registers are reloaded immediately. This bit is set by software and cleared only by hardware after reload"]
        RELOAD = 0x01,
    }
    impl Imr {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Imr {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Imr {
        #[inline(always)]
        fn from(val: u8) -> Imr {
            Imr::from_bits(val)
        }
    }
    impl From<Imr> for u8 {
        #[inline(always)]
        fn from(val: Imr) -> u8 {
            Imr::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Pcpol {
        #[doc = "Pixel clock on rising edge"]
        RISING_EDGE = 0x0,
        #[doc = "Pixel clock on falling edge"]
        FALLING_EDGE = 0x01,
    }
    impl Pcpol {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Pcpol {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Pcpol {
        #[inline(always)]
        fn from(val: u8) -> Pcpol {
            Pcpol::from_bits(val)
        }
    }
    impl From<Pcpol> for u8 {
        #[inline(always)]
        fn from(val: Pcpol) -> u8 {
            Pcpol::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Pf {
        #[doc = "ARGB8888"]
        ARGB8888 = 0x0,
        #[doc = "RGB888"]
        RGB888 = 0x01,
        #[doc = "RGB565"]
        RGB565 = 0x02,
        #[doc = "ARGB1555"]
        ARGB1555 = 0x03,
        #[doc = "ARGB4444"]
        ARGB4444 = 0x04,
        #[doc = "L8 (8-bit luminance)"]
        L8 = 0x05,
        #[doc = "AL44 (4-bit alpha, 4-bit luminance)"]
        AL44 = 0x06,
        #[doc = "AL88 (8-bit alpha, 8-bit luminance)"]
        AL88 = 0x07,
    }
    impl Pf {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Pf {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Pf {
        #[inline(always)]
        fn from(val: u8) -> Pf {
            Pf::from_bits(val)
        }
    }
    impl From<Pf> for u8 {
        #[inline(always)]
        fn from(val: Pf) -> u8 {
            Pf::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Vbr {
        #[doc = "This bit is set by software and cleared only by hardware after reload (it cannot be cleared through register write once it is set)"]
        NO_EFFECT = 0x0,
        #[doc = "The shadow registers are reloaded during the vertical blanking period (at the beginning of the first line after the active display area)."]
        RELOAD = 0x01,
    }
    impl Vbr {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Vbr {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Vbr {
        #[inline(always)]
        fn from(val: u8) -> Vbr {
            Vbr::from_bits(val)
        }
    }
    impl From<Vbr> for u8 {
        #[inline(always)]
        fn from(val: Vbr) -> u8 {
            Vbr::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Vspol {
        #[doc = "Vertical synchronization polarity is active low"]
        ACTIVE_LOW = 0x0,
        #[doc = "Vertical synchronization polarity is active high"]
        ACTIVE_HIGH = 0x01,
    }
    impl Vspol {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Vspol {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Vspol {
        #[inline(always)]
        fn from(val: u8) -> Vspol {
            Vspol::from_bits(val)
        }
    }
    impl From<Vspol> for u8 {
        #[inline(always)]
        fn from(val: Vspol) -> u8 {
            Vspol::to_bits(val)
        }
    }
}