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
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::identity_op)]
#![allow(clippy::unnecessary_cast)]
#![allow(clippy::erasing_op)]

#[doc = "XSPI register block"]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Xspi {
    ptr: *mut u8,
}
unsafe impl Send for Xspi {}
unsafe impl Sync for Xspi {}
impl Xspi {
    #[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 = "XSPI 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 = "XSPI device configuration register 1"]
    #[inline(always)]
    pub const fn dcr1(self) -> crate::common::Reg<regs::Dcr1, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x08usize) as _) }
    }
    #[doc = "XSPI device configuration register 2"]
    #[inline(always)]
    pub const fn dcr2(self) -> crate::common::Reg<regs::Dcr2, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0cusize) as _) }
    }
    #[doc = "XSPI device configuration register 3"]
    #[inline(always)]
    pub const fn dcr3(self) -> crate::common::Reg<regs::Dcr3, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x10usize) as _) }
    }
    #[doc = "XSPI device configuration register 4"]
    #[inline(always)]
    pub const fn dcr4(self) -> crate::common::Reg<regs::Dcr4, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x14usize) as _) }
    }
    #[doc = "XSPI status register"]
    #[inline(always)]
    pub const fn sr(self) -> crate::common::Reg<regs::Sr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x20usize) as _) }
    }
    #[doc = "XSPI flag clear register"]
    #[inline(always)]
    pub const fn fcr(self) -> crate::common::Reg<regs::Fcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x24usize) as _) }
    }
    #[doc = "XSPI data length register"]
    #[inline(always)]
    pub const fn dlr(self) -> crate::common::Reg<regs::Dlr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x40usize) as _) }
    }
    #[doc = "XSPIaddress register"]
    #[inline(always)]
    pub const fn ar(self) -> crate::common::Reg<regs::Ar, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x48usize) as _) }
    }
    #[doc = "XSPI data register"]
    #[inline(always)]
    pub const fn dr(self) -> crate::common::Reg<regs::Dr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x50usize) as _) }
    }
    #[doc = "XSPI polling status mask register"]
    #[inline(always)]
    pub const fn psmkr(self) -> crate::common::Reg<regs::Psmkr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x80usize) as _) }
    }
    #[doc = "XSPI polling status match register"]
    #[inline(always)]
    pub const fn psmar(self) -> crate::common::Reg<regs::Psmar, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x88usize) as _) }
    }
    #[doc = "XSPI polling interval register"]
    #[inline(always)]
    pub const fn pir(self) -> crate::common::Reg<regs::Pir, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x90usize) as _) }
    }
    #[doc = "XSPI communication configuration register"]
    #[inline(always)]
    pub const fn ccr(self) -> crate::common::Reg<regs::Ccr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0100usize) as _) }
    }
    #[doc = "XSPI timing configuration register"]
    #[inline(always)]
    pub const fn tcr(self) -> crate::common::Reg<regs::Tcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0108usize) as _) }
    }
    #[doc = "XSPI instruction register"]
    #[inline(always)]
    pub const fn ir(self) -> crate::common::Reg<regs::Ir, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0110usize) as _) }
    }
    #[doc = "XSPI alternate bytes register"]
    #[inline(always)]
    pub const fn abr(self) -> crate::common::Reg<regs::Abr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0120usize) as _) }
    }
    #[doc = "XSPI low-power timeout register"]
    #[inline(always)]
    pub const fn lptr(self) -> crate::common::Reg<regs::Lptr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0130usize) as _) }
    }
    #[doc = "XSPI wrap communication configuration register"]
    #[inline(always)]
    pub const fn wpccr(self) -> crate::common::Reg<regs::Wpccr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0140usize) as _) }
    }
    #[doc = "XSPI wrap timing configuration register"]
    #[inline(always)]
    pub const fn wptcr(self) -> crate::common::Reg<regs::Wptcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0148usize) as _) }
    }
    #[doc = "XSPI wrap instruction register"]
    #[inline(always)]
    pub const fn wpir(self) -> crate::common::Reg<regs::Wpir, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0150usize) as _) }
    }
    #[doc = "XSPI wrap alternate byte register"]
    #[inline(always)]
    pub const fn wpabr(self) -> crate::common::Reg<regs::Wpabr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0160usize) as _) }
    }
    #[doc = "XSPI write communication configuration register"]
    #[inline(always)]
    pub const fn wccr(self) -> crate::common::Reg<regs::Wccr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0180usize) as _) }
    }
    #[doc = "XSPI write timing configuration register"]
    #[inline(always)]
    pub const fn wtcr(self) -> crate::common::Reg<regs::Wtcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0188usize) as _) }
    }
    #[doc = "XSPI write instruction register"]
    #[inline(always)]
    pub const fn wir(self) -> crate::common::Reg<regs::Wir, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0190usize) as _) }
    }
    #[doc = "XSPI write alternate byte register"]
    #[inline(always)]
    pub const fn wabr(self) -> crate::common::Reg<regs::Wabr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x01a0usize) as _) }
    }
    #[doc = "XSPI HyperBus latency configuration register"]
    #[inline(always)]
    pub const fn hlcr(self) -> crate::common::Reg<regs::Hlcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0200usize) as _) }
    }
    #[doc = "XSPI full-cycle calibration configuration"]
    #[inline(always)]
    pub const fn calfcr(self) -> crate::common::Reg<regs::Calfcr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0210usize) as _) }
    }
    #[doc = "XSPI DLL master calibration configuration"]
    #[inline(always)]
    pub const fn calmr(self) -> crate::common::Reg<regs::Calmr, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0218usize) as _) }
    }
    #[doc = "XSPI DLL slave output calibration configuration"]
    #[inline(always)]
    pub const fn calsor(self) -> crate::common::Reg<regs::Calsor, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0220usize) as _) }
    }
    #[doc = "XSPI DLL slave input calibration configuration"]
    #[inline(always)]
    pub const fn calsir(self) -> crate::common::Reg<regs::Calsir, crate::common::RW> {
        unsafe { crate::common::Reg::from_ptr(self.ptr.add(0x0228usize) as _) }
    }
}
pub mod regs {
    #[doc = "XSPI alternate bytes register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Abr(pub u32);
    impl Abr {
        #[doc = "Alternate bytes Optional data to be sent to the external SPI device right after the address."]
        #[inline(always)]
        pub const fn alternate(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Alternate bytes Optional data to be sent to the external SPI device right after the address."]
        #[inline(always)]
        pub fn set_alternate(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Abr {
        #[inline(always)]
        fn default() -> Abr {
            Abr(0)
        }
    }
    impl core::fmt::Debug for Abr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Abr").field("alternate", &self.alternate()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Abr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Abr {{ alternate: {=u32:?} }}", self.alternate())
        }
    }
    #[doc = "XSPIaddress register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Ar(pub u32);
    impl Ar {
        #[doc = "Address Address to be sent to the external device. In HyperBus protocol, this field must be even as this protocol is 16-bit word oriented. In dual-memory configuration, AR\\[0\\]
is forced to 0. Writes to this field are ignored when BUSY = 1 or when FMODE = 11 (memory-mapped mode). Some memory specifications consider that each address corresponds to a 16-bit value. XSPI considers that each address corresponds to an 8-bit value. So the software needs to multiple the address by two when accessing the memory registers."]
        #[inline(always)]
        pub const fn address(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Address Address to be sent to the external device. In HyperBus protocol, this field must be even as this protocol is 16-bit word oriented. In dual-memory configuration, AR\\[0\\]
is forced to 0. Writes to this field are ignored when BUSY = 1 or when FMODE = 11 (memory-mapped mode). Some memory specifications consider that each address corresponds to a 16-bit value. XSPI considers that each address corresponds to an 8-bit value. So the software needs to multiple the address by two when accessing the memory registers."]
        #[inline(always)]
        pub fn set_address(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Ar {
        #[inline(always)]
        fn default() -> Ar {
            Ar(0)
        }
    }
    impl core::fmt::Debug for Ar {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Ar").field("address", &self.address()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Ar {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Ar {{ address: {=u32:?} }}", self.address())
        }
    }
    #[doc = "XSPI full-cycle calibration configuration"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Calfcr(pub u32);
    impl Calfcr {
        #[doc = "Fine calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub const fn fine(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0x7f;
            val as u8
        }
        #[doc = "Fine calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub fn set_fine(&mut self, val: u8) {
            self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
        }
        #[doc = "Coarse calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub const fn coarse(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0x1f;
            val as u8
        }
        #[doc = "Coarse calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub fn set_coarse(&mut self, val: u8) {
            self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize);
        }
        #[doc = "Max value This bit gets set when the memory-clock period is outside the range of DLL master, in which case XSPI_CALFCR and XSPI_CALSR are updated with the values for the maximum delay."]
        #[inline(always)]
        pub const fn calmax(&self) -> bool {
            let val = (self.0 >> 31usize) & 0x01;
            val != 0
        }
        #[doc = "Max value This bit gets set when the memory-clock period is outside the range of DLL master, in which case XSPI_CALFCR and XSPI_CALSR are updated with the values for the maximum delay."]
        #[inline(always)]
        pub fn set_calmax(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
        }
    }
    impl Default for Calfcr {
        #[inline(always)]
        fn default() -> Calfcr {
            Calfcr(0)
        }
    }
    impl core::fmt::Debug for Calfcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Calfcr")
                .field("fine", &self.fine())
                .field("coarse", &self.coarse())
                .field("calmax", &self.calmax())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Calfcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Calfcr {{ fine: {=u8:?}, coarse: {=u8:?}, calmax: {=bool:?} }}",
                self.fine(),
                self.coarse(),
                self.calmax()
            )
        }
    }
    #[doc = "XSPI DLL master calibration configuration"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Calmr(pub u32);
    impl Calmr {
        #[doc = "Fine calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub const fn fine(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0x7f;
            val as u8
        }
        #[doc = "Fine calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub fn set_fine(&mut self, val: u8) {
            self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
        }
        #[doc = "Coarse calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub const fn coarse(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0x1f;
            val as u8
        }
        #[doc = "Coarse calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub fn set_coarse(&mut self, val: u8) {
            self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize);
        }
    }
    impl Default for Calmr {
        #[inline(always)]
        fn default() -> Calmr {
            Calmr(0)
        }
    }
    impl core::fmt::Debug for Calmr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Calmr")
                .field("fine", &self.fine())
                .field("coarse", &self.coarse())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Calmr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Calmr {{ fine: {=u8:?}, coarse: {=u8:?} }}",
                self.fine(),
                self.coarse()
            )
        }
    }
    #[doc = "XSPI DLL slave input calibration configuration"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Calsir(pub u32);
    impl Calsir {
        #[doc = "Fine calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub const fn fine(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0x7f;
            val as u8
        }
        #[doc = "Fine calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub fn set_fine(&mut self, val: u8) {
            self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
        }
        #[doc = "Coarse calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub const fn coarse(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0x1f;
            val as u8
        }
        #[doc = "Coarse calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub fn set_coarse(&mut self, val: u8) {
            self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize);
        }
    }
    impl Default for Calsir {
        #[inline(always)]
        fn default() -> Calsir {
            Calsir(0)
        }
    }
    impl core::fmt::Debug for Calsir {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Calsir")
                .field("fine", &self.fine())
                .field("coarse", &self.coarse())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Calsir {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Calsir {{ fine: {=u8:?}, coarse: {=u8:?} }}",
                self.fine(),
                self.coarse()
            )
        }
    }
    #[doc = "XSPI DLL slave output calibration configuration"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Calsor(pub u32);
    impl Calsor {
        #[doc = "Fine calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub const fn fine(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0x7f;
            val as u8
        }
        #[doc = "Fine calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub fn set_fine(&mut self, val: u8) {
            self.0 = (self.0 & !(0x7f << 0usize)) | (((val as u32) & 0x7f) << 0usize);
        }
        #[doc = "Coarse calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub const fn coarse(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0x1f;
            val as u8
        }
        #[doc = "Coarse calibration The unitary value of delay for this field depends on product technology (refer to the product datasheet)."]
        #[inline(always)]
        pub fn set_coarse(&mut self, val: u8) {
            self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize);
        }
    }
    impl Default for Calsor {
        #[inline(always)]
        fn default() -> Calsor {
            Calsor(0)
        }
    }
    impl core::fmt::Debug for Calsor {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Calsor")
                .field("fine", &self.fine())
                .field("coarse", &self.coarse())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Calsor {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Calsor {{ fine: {=u8:?}, coarse: {=u8:?} }}",
                self.fine(),
                self.coarse()
            )
        }
    }
    #[doc = "XSPI communication configuration register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Ccr(pub u32);
    impl Ccr {
        #[doc = "Instruction mode This field defines the instruction phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub const fn imode(&self) -> super::vals::CcrImode {
            let val = (self.0 >> 0usize) & 0x07;
            super::vals::CcrImode::from_bits(val as u8)
        }
        #[doc = "Instruction mode This field defines the instruction phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub fn set_imode(&mut self, val: super::vals::CcrImode) {
            self.0 = (self.0 & !(0x07 << 0usize)) | (((val.to_bits() as u32) & 0x07) << 0usize);
        }
        #[doc = "Instruction double transfer rate This bit sets the DTR mode for the instruction phase."]
        #[inline(always)]
        pub const fn idtr(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Instruction double transfer rate This bit sets the DTR mode for the instruction phase."]
        #[inline(always)]
        pub fn set_idtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Instruction size This bit defines instruction size."]
        #[inline(always)]
        pub const fn isize(&self) -> super::vals::CcrIsize {
            let val = (self.0 >> 4usize) & 0x03;
            super::vals::CcrIsize::from_bits(val as u8)
        }
        #[doc = "Instruction size This bit defines instruction size."]
        #[inline(always)]
        pub fn set_isize(&mut self, val: super::vals::CcrIsize) {
            self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
        }
        #[doc = "Address mode This field defines the address phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub const fn admode(&self) -> super::vals::CcrAdmode {
            let val = (self.0 >> 8usize) & 0x07;
            super::vals::CcrAdmode::from_bits(val as u8)
        }
        #[doc = "Address mode This field defines the address phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub fn set_admode(&mut self, val: super::vals::CcrAdmode) {
            self.0 = (self.0 & !(0x07 << 8usize)) | (((val.to_bits() as u32) & 0x07) << 8usize);
        }
        #[doc = "Address double transfer rate This bit sets the DTR mode for the address phase."]
        #[inline(always)]
        pub const fn addtr(&self) -> bool {
            let val = (self.0 >> 11usize) & 0x01;
            val != 0
        }
        #[doc = "Address double transfer rate This bit sets the DTR mode for the address phase."]
        #[inline(always)]
        pub fn set_addtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
        }
        #[doc = "Address size This field defines address size."]
        #[inline(always)]
        pub const fn adsize(&self) -> super::vals::CcrAdsize {
            let val = (self.0 >> 12usize) & 0x03;
            super::vals::CcrAdsize::from_bits(val as u8)
        }
        #[doc = "Address size This field defines address size."]
        #[inline(always)]
        pub fn set_adsize(&mut self, val: super::vals::CcrAdsize) {
            self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
        }
        #[doc = "Alternate-byte mode This field defines the alternate byte phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub const fn abmode(&self) -> super::vals::CcrAbmode {
            let val = (self.0 >> 16usize) & 0x07;
            super::vals::CcrAbmode::from_bits(val as u8)
        }
        #[doc = "Alternate-byte mode This field defines the alternate byte phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub fn set_abmode(&mut self, val: super::vals::CcrAbmode) {
            self.0 = (self.0 & !(0x07 << 16usize)) | (((val.to_bits() as u32) & 0x07) << 16usize);
        }
        #[doc = "Alternate bytes double transfer rate This bit sets the DTR mode for the alternate bytes phase. Note: This field can be written only when BUSY = 0."]
        #[inline(always)]
        pub const fn abdtr(&self) -> bool {
            let val = (self.0 >> 19usize) & 0x01;
            val != 0
        }
        #[doc = "Alternate bytes double transfer rate This bit sets the DTR mode for the alternate bytes phase. Note: This field can be written only when BUSY = 0."]
        #[inline(always)]
        pub fn set_abdtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
        }
        #[doc = "Alternate bytes size This bit defines alternate bytes size."]
        #[inline(always)]
        pub const fn absize(&self) -> super::vals::CcrAbsize {
            let val = (self.0 >> 20usize) & 0x03;
            super::vals::CcrAbsize::from_bits(val as u8)
        }
        #[doc = "Alternate bytes size This bit defines alternate bytes size."]
        #[inline(always)]
        pub fn set_absize(&mut self, val: super::vals::CcrAbsize) {
            self.0 = (self.0 & !(0x03 << 20usize)) | (((val.to_bits() as u32) & 0x03) << 20usize);
        }
        #[doc = "Data mode This field defines the data phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub const fn dmode(&self) -> super::vals::CcrDmode {
            let val = (self.0 >> 24usize) & 0x07;
            super::vals::CcrDmode::from_bits(val as u8)
        }
        #[doc = "Data mode This field defines the data phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub fn set_dmode(&mut self, val: super::vals::CcrDmode) {
            self.0 = (self.0 & !(0x07 << 24usize)) | (((val.to_bits() as u32) & 0x07) << 24usize);
        }
        #[doc = "Data double transfer rate This bit sets the DTR mode for the data phase."]
        #[inline(always)]
        pub const fn ddtr(&self) -> bool {
            let val = (self.0 >> 27usize) & 0x01;
            val != 0
        }
        #[doc = "Data double transfer rate This bit sets the DTR mode for the data phase."]
        #[inline(always)]
        pub fn set_ddtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
        }
        #[doc = "DQS enable This bit enables the data strobe management."]
        #[inline(always)]
        pub const fn dqse(&self) -> bool {
            let val = (self.0 >> 29usize) & 0x01;
            val != 0
        }
        #[doc = "DQS enable This bit enables the data strobe management."]
        #[inline(always)]
        pub fn set_dqse(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
        }
    }
    impl Default for Ccr {
        #[inline(always)]
        fn default() -> Ccr {
            Ccr(0)
        }
    }
    impl core::fmt::Debug for Ccr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Ccr")
                .field("imode", &self.imode())
                .field("idtr", &self.idtr())
                .field("isize", &self.isize())
                .field("admode", &self.admode())
                .field("addtr", &self.addtr())
                .field("adsize", &self.adsize())
                .field("abmode", &self.abmode())
                .field("abdtr", &self.abdtr())
                .field("absize", &self.absize())
                .field("dmode", &self.dmode())
                .field("ddtr", &self.ddtr())
                .field("dqse", &self.dqse())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Ccr {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Ccr {{ imode: {:?}, idtr: {=bool:?}, isize: {:?}, admode: {:?}, addtr: {=bool:?}, adsize: {:?}, abmode: {:?}, abdtr: {=bool:?}, absize: {:?}, dmode: {:?}, ddtr: {=bool:?}, dqse: {=bool:?} }}" , self . imode () , self . idtr () , self . isize () , self . admode () , self . addtr () , self . adsize () , self . abmode () , self . abdtr () , self . absize () , self . dmode () , self . ddtr () , self . dqse ())
        }
    }
    #[doc = "XSPI control register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Cr(pub u32);
    impl Cr {
        #[doc = "Enable This bit enables the XSPI. The DMA request can be aborted without having received the ACK in case this EN bit is cleared during the operation. Note: In case this bit is set to 0 during a DMA transfer, the REQ signal to DMA returns to inactive state without waiting for the ACK signal from DMA to be active."]
        #[inline(always)]
        pub const fn en(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Enable This bit enables the XSPI. The DMA request can be aborted without having received the ACK in case this EN bit is cleared during the operation. Note: In case this bit is set to 0 during a DMA transfer, the REQ signal to DMA returns to inactive state without waiting for the ACK signal from DMA to be active."]
        #[inline(always)]
        pub fn set_en(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Abort request This bit aborts the on-going command sequence. It is automatically reset once the abort is completed. This bit stops the current transfer. Note: This bit is always read as 0."]
        #[inline(always)]
        pub const fn abort(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Abort request This bit aborts the on-going command sequence. It is automatically reset once the abort is completed. This bit stops the current transfer. Note: This bit is always read as 0."]
        #[inline(always)]
        pub fn set_abort(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "DMA enable In indirect mode, the DMA can be used to input or output data via XSPI_DR. DMA transfers are initiated when FTF is set. Note: Resetting the DMAEN bit while a DMA transfer is ongoing, breaks the handshake with the DMA. Do not write this bit during DMA operation."]
        #[inline(always)]
        pub const fn dmaen(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "DMA enable In indirect mode, the DMA can be used to input or output data via XSPI_DR. DMA transfers are initiated when FTF is set. Note: Resetting the DMAEN bit while a DMA transfer is ongoing, breaks the handshake with the DMA. Do not write this bit during DMA operation."]
        #[inline(always)]
        pub fn set_dmaen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "Timeout counter enable This bit is valid only when the memory-mapped mode (FMODE\\[1:0\\]
= 11) is selected. This bit enables the timeout counter. Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub const fn tcen(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Timeout counter enable This bit is valid only when the memory-mapped mode (FMODE\\[1:0\\]
= 11) is selected. This bit enables the timeout counter. Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub fn set_tcen(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Dual-memory configuration This bit activates the dual-memory configuration, where two external devices are used simultaneously to double the throughput and the capacity Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub const fn dmm(&self) -> bool {
            let val = (self.0 >> 6usize) & 0x01;
            val != 0
        }
        #[doc = "Dual-memory configuration This bit activates the dual-memory configuration, where two external devices are used simultaneously to double the throughput and the capacity Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub fn set_dmm(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
        }
        #[doc = "FIFO threshold level This field defines, in indirect mode, the threshold number of bytes in the FIFO that causes the FIFO threshold flag FTF in XSPI_SR, to be set. ... Note: If DMAEN = 1, the DMA controller for the corresponding channel must be disabled before changing the FTHRES\\[5:0\\]
value."]
        #[inline(always)]
        pub const fn fthres(&self) -> super::vals::Fthres {
            let val = (self.0 >> 8usize) & 0x3f;
            super::vals::Fthres::from_bits(val as u8)
        }
        #[doc = "FIFO threshold level This field defines, in indirect mode, the threshold number of bytes in the FIFO that causes the FIFO threshold flag FTF in XSPI_SR, to be set. ... Note: If DMAEN = 1, the DMA controller for the corresponding channel must be disabled before changing the FTHRES\\[5:0\\]
value."]
        #[inline(always)]
        pub fn set_fthres(&mut self, val: super::vals::Fthres) {
            self.0 = (self.0 & !(0x3f << 8usize)) | (((val.to_bits() as u32) & 0x3f) << 8usize);
        }
        #[doc = "Transfer error interrupt enable This bit enables the transfer error interrupt."]
        #[inline(always)]
        pub const fn teie(&self) -> bool {
            let val = (self.0 >> 16usize) & 0x01;
            val != 0
        }
        #[doc = "Transfer error interrupt enable This bit enables the transfer error interrupt."]
        #[inline(always)]
        pub fn set_teie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
        }
        #[doc = "Transfer complete interrupt enable This bit enables the transfer complete interrupt."]
        #[inline(always)]
        pub const fn tcie(&self) -> bool {
            let val = (self.0 >> 17usize) & 0x01;
            val != 0
        }
        #[doc = "Transfer complete interrupt enable This bit enables the transfer complete interrupt."]
        #[inline(always)]
        pub fn set_tcie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
        }
        #[doc = "FIFO threshold interrupt enable This bit enables the FIFO threshold interrupt."]
        #[inline(always)]
        pub const fn ftie(&self) -> bool {
            let val = (self.0 >> 18usize) & 0x01;
            val != 0
        }
        #[doc = "FIFO threshold interrupt enable This bit enables the FIFO threshold interrupt."]
        #[inline(always)]
        pub fn set_ftie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
        }
        #[doc = "Status match interrupt enable This bit enables the status match interrupt."]
        #[inline(always)]
        pub const fn smie(&self) -> bool {
            let val = (self.0 >> 19usize) & 0x01;
            val != 0
        }
        #[doc = "Status match interrupt enable This bit enables the status match interrupt."]
        #[inline(always)]
        pub fn set_smie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
        }
        #[doc = "Timeout interrupt enable This bit enables the timeout interrupt."]
        #[inline(always)]
        pub const fn toie(&self) -> bool {
            let val = (self.0 >> 20usize) & 0x01;
            val != 0
        }
        #[doc = "Timeout interrupt enable This bit enables the timeout interrupt."]
        #[inline(always)]
        pub fn set_toie(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
        }
        #[doc = "Automatic status-polling mode stop This bit determines if the automatic status-polling is stopped after a match. Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub const fn apms(&self) -> super::vals::Apms {
            let val = (self.0 >> 22usize) & 0x01;
            super::vals::Apms::from_bits(val as u8)
        }
        #[doc = "Automatic status-polling mode stop This bit determines if the automatic status-polling is stopped after a match. Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub fn set_apms(&mut self, val: super::vals::Apms) {
            self.0 = (self.0 & !(0x01 << 22usize)) | (((val.to_bits() as u32) & 0x01) << 22usize);
        }
        #[doc = "Polling match mode This bit indicates which method must be used to determine a match during the automatic status-polling mode. Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub const fn pmm(&self) -> super::vals::Pmm {
            let val = (self.0 >> 23usize) & 0x01;
            super::vals::Pmm::from_bits(val as u8)
        }
        #[doc = "Polling match mode This bit indicates which method must be used to determine a match during the automatic status-polling mode. Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub fn set_pmm(&mut self, val: super::vals::Pmm) {
            self.0 = (self.0 & !(0x01 << 23usize)) | (((val.to_bits() as u32) & 0x01) << 23usize);
        }
        #[doc = "chip select selection This bit indicates if the XSPI must activate NCS1 or NCS2. Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub const fn cssel(&self) -> super::vals::Cssel {
            let val = (self.0 >> 24usize) & 0x01;
            super::vals::Cssel::from_bits(val as u8)
        }
        #[doc = "chip select selection This bit indicates if the XSPI must activate NCS1 or NCS2. Note: This bit can be modified only when BUSY = 0."]
        #[inline(always)]
        pub fn set_cssel(&mut self, val: super::vals::Cssel) {
            self.0 = (self.0 & !(0x01 << 24usize)) | (((val.to_bits() as u32) & 0x01) << 24usize);
        }
        #[doc = "Functional mode This field defines the XSPI functional mode of operation. If DMAEN = 1 already, then the DMA controller for the corresponding channel must be disabled before changing the FMODE\\[1:0\\]
value. If FMODE\\[1:0\\]
and FTHRES\\[4:0\\]
are wrongly updated while DMAEN = 1, the DMA request signal automatically goes to inactive state. Note: This bitfield can be modified only when BUSY = 0."]
        #[inline(always)]
        pub const fn fmode(&self) -> super::vals::Fmode {
            let val = (self.0 >> 28usize) & 0x03;
            super::vals::Fmode::from_bits(val as u8)
        }
        #[doc = "Functional mode This field defines the XSPI functional mode of operation. If DMAEN = 1 already, then the DMA controller for the corresponding channel must be disabled before changing the FMODE\\[1:0\\]
value. If FMODE\\[1:0\\]
and FTHRES\\[4:0\\]
are wrongly updated while DMAEN = 1, the DMA request signal automatically goes to inactive state. Note: This bitfield can be modified only when BUSY = 0."]
        #[inline(always)]
        pub fn set_fmode(&mut self, val: super::vals::Fmode) {
            self.0 = (self.0 & !(0x03 << 28usize)) | (((val.to_bits() as u32) & 0x03) << 28usize);
        }
        #[doc = "Flash select"]
        #[inline(always)]
        pub const fn msel(&self) -> super::vals::Msel {
            let val = (self.0 >> 30usize) & 0x03;
            super::vals::Msel::from_bits(val as u8)
        }
        #[doc = "Flash select"]
        #[inline(always)]
        pub fn set_msel(&mut self, val: super::vals::Msel) {
            self.0 = (self.0 & !(0x03 << 30usize)) | (((val.to_bits() as u32) & 0x03) << 30usize);
        }
    }
    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("en", &self.en())
                .field("abort", &self.abort())
                .field("dmaen", &self.dmaen())
                .field("tcen", &self.tcen())
                .field("dmm", &self.dmm())
                .field("fthres", &self.fthres())
                .field("teie", &self.teie())
                .field("tcie", &self.tcie())
                .field("ftie", &self.ftie())
                .field("smie", &self.smie())
                .field("toie", &self.toie())
                .field("apms", &self.apms())
                .field("pmm", &self.pmm())
                .field("cssel", &self.cssel())
                .field("fmode", &self.fmode())
                .field("msel", &self.msel())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Cr {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Cr {{ en: {=bool:?}, abort: {=bool:?}, dmaen: {=bool:?}, tcen: {=bool:?}, dmm: {=bool:?}, fthres: {:?}, teie: {=bool:?}, tcie: {=bool:?}, ftie: {=bool:?}, smie: {=bool:?}, toie: {=bool:?}, apms: {:?}, pmm: {:?}, cssel: {:?}, fmode: {:?}, msel: {:?} }}" , self . en () , self . abort () , self . dmaen () , self . tcen () , self . dmm () , self . fthres () , self . teie () , self . tcie () , self . ftie () , self . smie () , self . toie () , self . apms () , self . pmm () , self . cssel () , self . fmode () , self . msel ())
        }
    }
    #[doc = "XSPI device configuration register 1"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Dcr1(pub u32);
    impl Dcr1 {
        #[doc = "clock mode 0/mode 3 This bit indicates the level taken by the CLK between commands (when NCS = 1)."]
        #[inline(always)]
        pub const fn ckmode(&self) -> super::vals::Ckmode {
            let val = (self.0 >> 0usize) & 0x01;
            super::vals::Ckmode::from_bits(val as u8)
        }
        #[doc = "clock mode 0/mode 3 This bit indicates the level taken by the CLK between commands (when NCS = 1)."]
        #[inline(always)]
        pub fn set_ckmode(&mut self, val: super::vals::Ckmode) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
        }
        #[doc = "Free running clock This bit configures the free running clock."]
        #[inline(always)]
        pub const fn frck(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Free running clock This bit configures the free running clock."]
        #[inline(always)]
        pub fn set_frck(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Chip-select high time CSHT + 1 defines the minimum number of CLK cycles where the chip-select (NCS) must remain high between commands issued to the external device. ..."]
        #[inline(always)]
        pub const fn csht(&self) -> super::vals::Csht {
            let val = (self.0 >> 8usize) & 0x3f;
            super::vals::Csht::from_bits(val as u8)
        }
        #[doc = "Chip-select high time CSHT + 1 defines the minimum number of CLK cycles where the chip-select (NCS) must remain high between commands issued to the external device. ..."]
        #[inline(always)]
        pub fn set_csht(&mut self, val: super::vals::Csht) {
            self.0 = (self.0 & !(0x3f << 8usize)) | (((val.to_bits() as u32) & 0x3f) << 8usize);
        }
        #[doc = "Device size This field defines the size of the external device using the following formula: Number of bytes in device = 2<sup>\\[DEVSIZE+1\\]</sup>. DEVSIZE+1 is effectively the number of address bits required to address the external device. The device capacity can be up to 4 Gbytes (addressed using 32-bits) in indirect mode, but the addressable space in memory-mapped mode is limited to 256 Mbytes. In regular-command protocol, if DMM = 1, DEVSIZE\\[4:0\\]
indicates the total capacity of the two devices together."]
        #[inline(always)]
        pub const fn devsize(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0x1f;
            val as u8
        }
        #[doc = "Device size This field defines the size of the external device using the following formula: Number of bytes in device = 2<sup>\\[DEVSIZE+1\\]</sup>. DEVSIZE+1 is effectively the number of address bits required to address the external device. The device capacity can be up to 4 Gbytes (addressed using 32-bits) in indirect mode, but the addressable space in memory-mapped mode is limited to 256 Mbytes. In regular-command protocol, if DMM = 1, DEVSIZE\\[4:0\\]
indicates the total capacity of the two devices together."]
        #[inline(always)]
        pub fn set_devsize(&mut self, val: u8) {
            self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize);
        }
        #[doc = "Memory type This bit indicates the type of memory to be supported. Note: In this mode, DQS signal polarity is inverted with respect to the memory clock signal. This is the default value and care must be taken to change MTYP\\[2:0\\]
for memories different from Micron. Others: Reserved"]
        #[inline(always)]
        pub const fn mtyp(&self) -> super::vals::Mtyp {
            let val = (self.0 >> 24usize) & 0x07;
            super::vals::Mtyp::from_bits(val as u8)
        }
        #[doc = "Memory type This bit indicates the type of memory to be supported. Note: In this mode, DQS signal polarity is inverted with respect to the memory clock signal. This is the default value and care must be taken to change MTYP\\[2:0\\]
for memories different from Micron. Others: Reserved"]
        #[inline(always)]
        pub fn set_mtyp(&mut self, val: super::vals::Mtyp) {
            self.0 = (self.0 & !(0x07 << 24usize)) | (((val.to_bits() as u32) & 0x07) << 24usize);
        }
    }
    impl Default for Dcr1 {
        #[inline(always)]
        fn default() -> Dcr1 {
            Dcr1(0)
        }
    }
    impl core::fmt::Debug for Dcr1 {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Dcr1")
                .field("ckmode", &self.ckmode())
                .field("frck", &self.frck())
                .field("csht", &self.csht())
                .field("devsize", &self.devsize())
                .field("mtyp", &self.mtyp())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Dcr1 {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Dcr1 {{ ckmode: {:?}, frck: {=bool:?}, csht: {:?}, devsize: {=u8:?}, mtyp: {:?} }}",
                self.ckmode(),
                self.frck(),
                self.csht(),
                self.devsize(),
                self.mtyp()
            )
        }
    }
    #[doc = "XSPI device configuration register 2"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Dcr2(pub u32);
    impl Dcr2 {
        #[doc = "Clock prescaler This field defines the scaler factor for generating the CLK based on the kernel clock (value + 1). ... For odd clock division factors, the CLK duty cycle is not 50 %. The clock signal remains low one cycle longer than it stays high. Writing this field automatically starts a new calibration of high-speed interface DLL at the start of next transfer, except in case XSPI_CALOSR or XSPI_CALISR have been written in the meantime. BUSY stays high during the whole calibration execution."]
        #[inline(always)]
        pub const fn prescaler(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0xff;
            val as u8
        }
        #[doc = "Clock prescaler This field defines the scaler factor for generating the CLK based on the kernel clock (value + 1). ... For odd clock division factors, the CLK duty cycle is not 50 %. The clock signal remains low one cycle longer than it stays high. Writing this field automatically starts a new calibration of high-speed interface DLL at the start of next transfer, except in case XSPI_CALOSR or XSPI_CALISR have been written in the meantime. BUSY stays high during the whole calibration execution."]
        #[inline(always)]
        pub fn set_prescaler(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
        }
        #[doc = "Wrap size This field indicates the wrap size to which the memory is configured. For memories which have a separate command for wrapped instructions, this field indicates the wrap-size associated with the command held in XSPI_WPIR. Others: reserved"]
        #[inline(always)]
        pub const fn wrapsize(&self) -> super::vals::Wrapsize {
            let val = (self.0 >> 16usize) & 0x07;
            super::vals::Wrapsize::from_bits(val as u8)
        }
        #[doc = "Wrap size This field indicates the wrap size to which the memory is configured. For memories which have a separate command for wrapped instructions, this field indicates the wrap-size associated with the command held in XSPI_WPIR. Others: reserved"]
        #[inline(always)]
        pub fn set_wrapsize(&mut self, val: super::vals::Wrapsize) {
            self.0 = (self.0 & !(0x07 << 16usize)) | (((val.to_bits() as u32) & 0x07) << 16usize);
        }
    }
    impl Default for Dcr2 {
        #[inline(always)]
        fn default() -> Dcr2 {
            Dcr2(0)
        }
    }
    impl core::fmt::Debug for Dcr2 {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Dcr2")
                .field("prescaler", &self.prescaler())
                .field("wrapsize", &self.wrapsize())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Dcr2 {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Dcr2 {{ prescaler: {=u8:?}, wrapsize: {:?} }}",
                self.prescaler(),
                self.wrapsize()
            )
        }
    }
    #[doc = "XSPI device configuration register 3"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Dcr3(pub u32);
    impl Dcr3 {
        #[doc = "Maximum transfer This field enables the communication regulation feature. The NCS is released every MAXTRAN+1 clock cycles when the other XSPI request the access to the bus. Others: maximum communication is set to MAXTRAN + 1 bytes."]
        #[inline(always)]
        pub const fn maxtran(&self) -> super::vals::Maxtran {
            let val = (self.0 >> 0usize) & 0xff;
            super::vals::Maxtran::from_bits(val as u8)
        }
        #[doc = "Maximum transfer This field enables the communication regulation feature. The NCS is released every MAXTRAN+1 clock cycles when the other XSPI request the access to the bus. Others: maximum communication is set to MAXTRAN + 1 bytes."]
        #[inline(always)]
        pub fn set_maxtran(&mut self, val: super::vals::Maxtran) {
            self.0 = (self.0 & !(0xff << 0usize)) | (((val.to_bits() as u32) & 0xff) << 0usize);
        }
        #[doc = "NCS boundary This field enables the transaction boundary feature. When active, a minimum value of 3 is recommended. The NCS is released on each boundary of 2<sup>CSBOUND</sup> bytes. Others: NCS boundary set to 2<sup>CSBOUND</sup> bytes"]
        #[inline(always)]
        pub const fn csbound(&self) -> super::vals::Csbound {
            let val = (self.0 >> 16usize) & 0x1f;
            super::vals::Csbound::from_bits(val as u8)
        }
        #[doc = "NCS boundary This field enables the transaction boundary feature. When active, a minimum value of 3 is recommended. The NCS is released on each boundary of 2<sup>CSBOUND</sup> bytes. Others: NCS boundary set to 2<sup>CSBOUND</sup> bytes"]
        #[inline(always)]
        pub fn set_csbound(&mut self, val: super::vals::Csbound) {
            self.0 = (self.0 & !(0x1f << 16usize)) | (((val.to_bits() as u32) & 0x1f) << 16usize);
        }
    }
    impl Default for Dcr3 {
        #[inline(always)]
        fn default() -> Dcr3 {
            Dcr3(0)
        }
    }
    impl core::fmt::Debug for Dcr3 {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Dcr3")
                .field("maxtran", &self.maxtran())
                .field("csbound", &self.csbound())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Dcr3 {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Dcr3 {{ maxtran: {:?}, csbound: {:?} }}",
                self.maxtran(),
                self.csbound()
            )
        }
    }
    #[doc = "XSPI device configuration register 4"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Dcr4(pub u32);
    impl Dcr4 {
        #[doc = "Refresh rate This field enables the refresh rate feature. The NCS is released every REFRESH + 1 clock cycles for writes, and REFRESH + 4 clock cycles for reads. Note: These two values can be extended with few clock cycles when refresh occurs during a byte transmission in single-, dual- or quad-SPI mode, because the byte transmission must be completed. Others: maximum communication length is set to REFRESH + 1 clock cycles."]
        #[inline(always)]
        pub const fn refresh(&self) -> super::vals::Refresh {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            super::vals::Refresh::from_bits(val as u32)
        }
        #[doc = "Refresh rate This field enables the refresh rate feature. The NCS is released every REFRESH + 1 clock cycles for writes, and REFRESH + 4 clock cycles for reads. Note: These two values can be extended with few clock cycles when refresh occurs during a byte transmission in single-, dual- or quad-SPI mode, because the byte transmission must be completed. Others: maximum communication length is set to REFRESH + 1 clock cycles."]
        #[inline(always)]
        pub fn set_refresh(&mut self, val: super::vals::Refresh) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val.to_bits() as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Dcr4 {
        #[inline(always)]
        fn default() -> Dcr4 {
            Dcr4(0)
        }
    }
    impl core::fmt::Debug for Dcr4 {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Dcr4").field("refresh", &self.refresh()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Dcr4 {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Dcr4 {{ refresh: {:?} }}", self.refresh())
        }
    }
    #[doc = "XSPI data length register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Dlr(pub u32);
    impl Dlr {
        #[doc = "Data length"]
        #[inline(always)]
        pub const fn dl(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Data length"]
        #[inline(always)]
        pub fn set_dl(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Dlr {
        #[inline(always)]
        fn default() -> Dlr {
            Dlr(0)
        }
    }
    impl core::fmt::Debug for Dlr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Dlr").field("dl", &self.dl()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Dlr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Dlr {{ dl: {=u32:?} }}", self.dl())
        }
    }
    #[doc = "XSPI data register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Dr(pub u32);
    impl Dr {
        #[doc = "Data Data to be sent/received to/from the external SPI device In indirect-write mode, data written to this register is stored on the FIFO before it is sent to the external device during the data phase. If the FIFO is too full, a write operation is stalled until the FIFO has enough space to accept the amount of data being written. In indirect-read mode, reading this register gives (via the FIFO) the data that was received from the external device. If the FIFO does not have as many bytes as requested by the read operation and if BUSY = 1, the read operation is stalled until enough data is present or until the transfer is complete, whichever happens first. In automatic status-polling mode, this register contains the last data read from the external device (without masking). Word, half-word, and byte accesses to this register are supported. In indirect-write mode, a byte write adds 1 byte to the FIFO, a half-word write 2 bytes, and a word write 4 bytes. Similarly, in indirect-read mode, a byte read removes 1 byte from the FIFO, a halfword read 2 bytes, and a word read 4 bytes. Accesses in indirect mode must be aligned to the bottom of this register: A byte read must read DATA\\[7:0\\]
and a half-word read must read DATA\\[15:0\\]."]
        #[inline(always)]
        pub const fn data(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Data Data to be sent/received to/from the external SPI device In indirect-write mode, data written to this register is stored on the FIFO before it is sent to the external device during the data phase. If the FIFO is too full, a write operation is stalled until the FIFO has enough space to accept the amount of data being written. In indirect-read mode, reading this register gives (via the FIFO) the data that was received from the external device. If the FIFO does not have as many bytes as requested by the read operation and if BUSY = 1, the read operation is stalled until enough data is present or until the transfer is complete, whichever happens first. In automatic status-polling mode, this register contains the last data read from the external device (without masking). Word, half-word, and byte accesses to this register are supported. In indirect-write mode, a byte write adds 1 byte to the FIFO, a half-word write 2 bytes, and a word write 4 bytes. Similarly, in indirect-read mode, a byte read removes 1 byte from the FIFO, a halfword read 2 bytes, and a word read 4 bytes. Accesses in indirect mode must be aligned to the bottom of this register: A byte read must read DATA\\[7:0\\]
and a half-word read must read DATA\\[15:0\\]."]
        #[inline(always)]
        pub fn set_data(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Dr {
        #[inline(always)]
        fn default() -> Dr {
            Dr(0)
        }
    }
    impl core::fmt::Debug for Dr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Dr").field("data", &self.data()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Dr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Dr {{ data: {=u32:?} }}", self.data())
        }
    }
    #[doc = "XSPI flag clear register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Fcr(pub u32);
    impl Fcr {
        #[doc = "Clear transfer error flag Writing 1 clears the TEF flag in the XSPI_SR register."]
        #[inline(always)]
        pub const fn ctef(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Clear transfer error flag Writing 1 clears the TEF flag in the XSPI_SR register."]
        #[inline(always)]
        pub fn set_ctef(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Clear transfer complete flag Writing 1 clears the TCF flag in the XSPI_SR register."]
        #[inline(always)]
        pub const fn ctcf(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Clear transfer complete flag Writing 1 clears the TCF flag in the XSPI_SR register."]
        #[inline(always)]
        pub fn set_ctcf(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "Clear status match flag Writing 1 clears the SMF flag in the XSPI_SR register."]
        #[inline(always)]
        pub const fn csmf(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Clear status match flag Writing 1 clears the SMF flag in the XSPI_SR register."]
        #[inline(always)]
        pub fn set_csmf(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Clear timeout flag Writing 1 clears the TOF flag in the XSPI_SR register."]
        #[inline(always)]
        pub const fn ctof(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Clear timeout flag Writing 1 clears the TOF flag in the XSPI_SR register."]
        #[inline(always)]
        pub fn set_ctof(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
        }
    }
    impl Default for Fcr {
        #[inline(always)]
        fn default() -> Fcr {
            Fcr(0)
        }
    }
    impl core::fmt::Debug for Fcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Fcr")
                .field("ctef", &self.ctef())
                .field("ctcf", &self.ctcf())
                .field("csmf", &self.csmf())
                .field("ctof", &self.ctof())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Fcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Fcr {{ ctef: {=bool:?}, ctcf: {=bool:?}, csmf: {=bool:?}, ctof: {=bool:?} }}",
                self.ctef(),
                self.ctcf(),
                self.csmf(),
                self.ctof()
            )
        }
    }
    #[doc = "XSPI HyperBus latency configuration register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Hlcr(pub u32);
    impl Hlcr {
        #[doc = "Latency mode This bit selects the Latency mode. Note: This bit must be set when using the dual-octal HyperBus configuration."]
        #[inline(always)]
        pub const fn lm(&self) -> super::vals::Lm {
            let val = (self.0 >> 0usize) & 0x01;
            super::vals::Lm::from_bits(val as u8)
        }
        #[doc = "Latency mode This bit selects the Latency mode. Note: This bit must be set when using the dual-octal HyperBus configuration."]
        #[inline(always)]
        pub fn set_lm(&mut self, val: super::vals::Lm) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val.to_bits() as u32) & 0x01) << 0usize);
        }
        #[doc = "Write zero latency This bit enables zero latency on write operations."]
        #[inline(always)]
        pub const fn wzl(&self) -> super::vals::Wzl {
            let val = (self.0 >> 1usize) & 0x01;
            super::vals::Wzl::from_bits(val as u8)
        }
        #[doc = "Write zero latency This bit enables zero latency on write operations."]
        #[inline(always)]
        pub fn set_wzl(&mut self, val: super::vals::Wzl) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val.to_bits() as u32) & 0x01) << 1usize);
        }
        #[doc = "Access time Device access time expressed in number of communication clock cycles"]
        #[inline(always)]
        pub const fn tacc(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0xff;
            val as u8
        }
        #[doc = "Access time Device access time expressed in number of communication clock cycles"]
        #[inline(always)]
        pub fn set_tacc(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
        }
        #[doc = "Read write recovery time Device read write recovery time expressed in number of communication clock cycles"]
        #[inline(always)]
        pub const fn trwr(&self) -> u8 {
            let val = (self.0 >> 16usize) & 0xff;
            val as u8
        }
        #[doc = "Read write recovery time Device read write recovery time expressed in number of communication clock cycles"]
        #[inline(always)]
        pub fn set_trwr(&mut self, val: u8) {
            self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
        }
    }
    impl Default for Hlcr {
        #[inline(always)]
        fn default() -> Hlcr {
            Hlcr(0)
        }
    }
    impl core::fmt::Debug for Hlcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Hlcr")
                .field("lm", &self.lm())
                .field("wzl", &self.wzl())
                .field("tacc", &self.tacc())
                .field("trwr", &self.trwr())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Hlcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Hlcr {{ lm: {:?}, wzl: {:?}, tacc: {=u8:?}, trwr: {=u8:?} }}",
                self.lm(),
                self.wzl(),
                self.tacc(),
                self.trwr()
            )
        }
    }
    #[doc = "XSPI instruction register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Ir(pub u32);
    impl Ir {
        #[doc = "Instruction Instruction to be sent to the external SPI device"]
        #[inline(always)]
        pub const fn instruction(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Instruction Instruction to be sent to the external SPI device"]
        #[inline(always)]
        pub fn set_instruction(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Ir {
        #[inline(always)]
        fn default() -> Ir {
            Ir(0)
        }
    }
    impl core::fmt::Debug for Ir {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Ir").field("instruction", &self.instruction()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Ir {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Ir {{ instruction: {=u32:?} }}", self.instruction())
        }
    }
    #[doc = "XSPI low-power timeout register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Lptr(pub u32);
    impl Lptr {
        #[doc = "Timeout period After each access in memory-mapped mode, the XSPI prefetches the subsequent bytes and hold them in the FIFO. This field indicates how many CLK cycles the XSPI waits after the clock becomes inactive and until it raises the NCS, putting the external device in a lower-consumption state."]
        #[inline(always)]
        pub const fn timeout(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Timeout period After each access in memory-mapped mode, the XSPI prefetches the subsequent bytes and hold them in the FIFO. This field indicates how many CLK cycles the XSPI waits after the clock becomes inactive and until it raises the NCS, putting the external device in a lower-consumption state."]
        #[inline(always)]
        pub fn set_timeout(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
        }
    }
    impl Default for Lptr {
        #[inline(always)]
        fn default() -> Lptr {
            Lptr(0)
        }
    }
    impl core::fmt::Debug for Lptr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Lptr").field("timeout", &self.timeout()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Lptr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Lptr {{ timeout: {=u16:?} }}", self.timeout())
        }
    }
    #[doc = "XSPI polling interval register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Pir(pub u32);
    impl Pir {
        #[doc = "Polling interval Number of CLK cycle between a read during the automatic status-polling phases"]
        #[inline(always)]
        pub const fn interval(&self) -> u16 {
            let val = (self.0 >> 0usize) & 0xffff;
            val as u16
        }
        #[doc = "Polling interval Number of CLK cycle between a read during the automatic status-polling phases"]
        #[inline(always)]
        pub fn set_interval(&mut self, val: u16) {
            self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
        }
    }
    impl Default for Pir {
        #[inline(always)]
        fn default() -> Pir {
            Pir(0)
        }
    }
    impl core::fmt::Debug for Pir {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Pir").field("interval", &self.interval()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Pir {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Pir {{ interval: {=u16:?} }}", self.interval())
        }
    }
    #[doc = "XSPI polling status match register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Psmar(pub u32);
    impl Psmar {
        #[doc = "Status match Value to be compared with the masked status register to get a match"]
        #[inline(always)]
        pub const fn match_(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Status match Value to be compared with the masked status register to get a match"]
        #[inline(always)]
        pub fn set_match_(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Psmar {
        #[inline(always)]
        fn default() -> Psmar {
            Psmar(0)
        }
    }
    impl core::fmt::Debug for Psmar {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Psmar").field("match_", &self.match_()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Psmar {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Psmar {{ match_: {=u32:?} }}", self.match_())
        }
    }
    #[doc = "XSPI polling status mask register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Psmkr(pub u32);
    impl Psmkr {
        #[doc = "Status mask Mask to be applied to the status bytes received in automatic status-polling mode For bit n:"]
        #[inline(always)]
        pub const fn mask(&self) -> super::vals::Mask {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            super::vals::Mask::from_bits(val as u32)
        }
        #[doc = "Status mask Mask to be applied to the status bytes received in automatic status-polling mode For bit n:"]
        #[inline(always)]
        pub fn set_mask(&mut self, val: super::vals::Mask) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val.to_bits() as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Psmkr {
        #[inline(always)]
        fn default() -> Psmkr {
            Psmkr(0)
        }
    }
    impl core::fmt::Debug for Psmkr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Psmkr").field("mask", &self.mask()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Psmkr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Psmkr {{ mask: {:?} }}", self.mask())
        }
    }
    #[doc = "XSPI status register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Sr(pub u32);
    impl Sr {
        #[doc = "Transfer error flag This bit is set in indirect mode when an invalid address is being accessed in indirect mode. It is cleared by writing 1 to CTEF."]
        #[inline(always)]
        pub const fn tef(&self) -> bool {
            let val = (self.0 >> 0usize) & 0x01;
            val != 0
        }
        #[doc = "Transfer error flag This bit is set in indirect mode when an invalid address is being accessed in indirect mode. It is cleared by writing 1 to CTEF."]
        #[inline(always)]
        pub fn set_tef(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
        }
        #[doc = "Transfer complete flag This bit is set in indirect mode when the programmed number of data has been transferred or in any mode when the transfer has been aborted.It is cleared by writing 1 to CTCF."]
        #[inline(always)]
        pub const fn tcf(&self) -> bool {
            let val = (self.0 >> 1usize) & 0x01;
            val != 0
        }
        #[doc = "Transfer complete flag This bit is set in indirect mode when the programmed number of data has been transferred or in any mode when the transfer has been aborted.It is cleared by writing 1 to CTCF."]
        #[inline(always)]
        pub fn set_tcf(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
        }
        #[doc = "FIFO threshold flag In indirect mode, this bit is set when the FIFO threshold has been reached, or if there is any data left in the FIFO after the reads from the external device are complete. It is cleared automatically as soon as the threshold condition is no longer true. In automatic status-polling mode this bit is set every time the status register is read, and the bit is cleared when the data register is read."]
        #[inline(always)]
        pub const fn ftf(&self) -> bool {
            let val = (self.0 >> 2usize) & 0x01;
            val != 0
        }
        #[doc = "FIFO threshold flag In indirect mode, this bit is set when the FIFO threshold has been reached, or if there is any data left in the FIFO after the reads from the external device are complete. It is cleared automatically as soon as the threshold condition is no longer true. In automatic status-polling mode this bit is set every time the status register is read, and the bit is cleared when the data register is read."]
        #[inline(always)]
        pub fn set_ftf(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
        }
        #[doc = "Status match flag This bit is set in automatic status-polling mode when the unmasked received data matches the corresponding bits in the match register (XSPI_PSMAR). It is cleared by writing 1 to CSMF."]
        #[inline(always)]
        pub const fn smf(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Status match flag This bit is set in automatic status-polling mode when the unmasked received data matches the corresponding bits in the match register (XSPI_PSMAR). It is cleared by writing 1 to CSMF."]
        #[inline(always)]
        pub fn set_smf(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Timeout flag This bit is set when timeout occurs. It is cleared by writing 1 to CTOF."]
        #[inline(always)]
        pub const fn tof(&self) -> bool {
            let val = (self.0 >> 4usize) & 0x01;
            val != 0
        }
        #[doc = "Timeout flag This bit is set when timeout occurs. It is cleared by writing 1 to CTOF."]
        #[inline(always)]
        pub fn set_tof(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
        }
        #[doc = "Busy This bit is set when an operation is ongoing. It is cleared automatically when the operation with the external device is finished and the FIFO is empty."]
        #[inline(always)]
        pub const fn busy(&self) -> bool {
            let val = (self.0 >> 5usize) & 0x01;
            val != 0
        }
        #[doc = "Busy This bit is set when an operation is ongoing. It is cleared automatically when the operation with the external device is finished and the FIFO is empty."]
        #[inline(always)]
        pub fn set_busy(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
        }
        #[doc = "FIFO level This field gives the number of valid bytes that are being held in the FIFO. FLEVEL = 0 when the FIFO is empty, and 64 when it is full. In automatic-status polling mode, FLEVEL is zero."]
        #[inline(always)]
        pub const fn flevel(&self) -> u8 {
            let val = (self.0 >> 8usize) & 0x7f;
            val as u8
        }
        #[doc = "FIFO level This field gives the number of valid bytes that are being held in the FIFO. FLEVEL = 0 when the FIFO is empty, and 64 when it is full. In automatic-status polling mode, FLEVEL is zero."]
        #[inline(always)]
        pub fn set_flevel(&mut self, val: u8) {
            self.0 = (self.0 & !(0x7f << 8usize)) | (((val as u32) & 0x7f) << 8usize);
        }
    }
    impl Default for Sr {
        #[inline(always)]
        fn default() -> Sr {
            Sr(0)
        }
    }
    impl core::fmt::Debug for Sr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Sr")
                .field("tef", &self.tef())
                .field("tcf", &self.tcf())
                .field("ftf", &self.ftf())
                .field("smf", &self.smf())
                .field("tof", &self.tof())
                .field("busy", &self.busy())
                .field("flevel", &self.flevel())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Sr {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Sr {{ tef: {=bool:?}, tcf: {=bool:?}, ftf: {=bool:?}, smf: {=bool:?}, tof: {=bool:?}, busy: {=bool:?}, flevel: {=u8:?} }}" , self . tef () , self . tcf () , self . ftf () , self . smf () , self . tof () , self . busy () , self . flevel ())
        }
    }
    #[doc = "XSPI timing configuration register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Tcr(pub u32);
    impl Tcr {
        #[doc = "Number of dummy cycles This field defines the duration of the dummy phase. In both SDR and DTR modes, it specifies a number of CLK cycles (0-31)."]
        #[inline(always)]
        pub const fn dcyc(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0x1f;
            val as u8
        }
        #[doc = "Number of dummy cycles This field defines the duration of the dummy phase. In both SDR and DTR modes, it specifies a number of CLK cycles (0-31)."]
        #[inline(always)]
        pub fn set_dcyc(&mut self, val: u8) {
            self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize);
        }
        #[doc = "Delay hold quarter cycle"]
        #[inline(always)]
        pub const fn dhqc(&self) -> bool {
            let val = (self.0 >> 28usize) & 0x01;
            val != 0
        }
        #[doc = "Delay hold quarter cycle"]
        #[inline(always)]
        pub fn set_dhqc(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
        }
        #[doc = "Sample shift By default, the XSPI samples data 1/2 of a CLK cycle after the data is driven by the external device. This bit allows the data to be sampled later in order to consider the external signal delays. The software must ensure that SSHIFT = 0 when the data phase is configured in DTR mode (when DDTR = 1.)"]
        #[inline(always)]
        pub const fn sshift(&self) -> bool {
            let val = (self.0 >> 30usize) & 0x01;
            val != 0
        }
        #[doc = "Sample shift By default, the XSPI samples data 1/2 of a CLK cycle after the data is driven by the external device. This bit allows the data to be sampled later in order to consider the external signal delays. The software must ensure that SSHIFT = 0 when the data phase is configured in DTR mode (when DDTR = 1.)"]
        #[inline(always)]
        pub fn set_sshift(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
        }
    }
    impl Default for Tcr {
        #[inline(always)]
        fn default() -> Tcr {
            Tcr(0)
        }
    }
    impl core::fmt::Debug for Tcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Tcr")
                .field("dcyc", &self.dcyc())
                .field("dhqc", &self.dhqc())
                .field("sshift", &self.sshift())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Tcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Tcr {{ dcyc: {=u8:?}, dhqc: {=bool:?}, sshift: {=bool:?} }}",
                self.dcyc(),
                self.dhqc(),
                self.sshift()
            )
        }
    }
    #[doc = "XSPI write alternate byte register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Wabr(pub u32);
    impl Wabr {
        #[doc = "Alternate bytes Optional data to be sent to the external SPI device right after the address"]
        #[inline(always)]
        pub const fn alternate(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Alternate bytes Optional data to be sent to the external SPI device right after the address"]
        #[inline(always)]
        pub fn set_alternate(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Wabr {
        #[inline(always)]
        fn default() -> Wabr {
            Wabr(0)
        }
    }
    impl core::fmt::Debug for Wabr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Wabr").field("alternate", &self.alternate()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Wabr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Wabr {{ alternate: {=u32:?} }}", self.alternate())
        }
    }
    #[doc = "XSPI write communication configuration register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Wccr(pub u32);
    impl Wccr {
        #[doc = "Instruction mode This field defines the instruction phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub const fn imode(&self) -> super::vals::WccrImode {
            let val = (self.0 >> 0usize) & 0x07;
            super::vals::WccrImode::from_bits(val as u8)
        }
        #[doc = "Instruction mode This field defines the instruction phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub fn set_imode(&mut self, val: super::vals::WccrImode) {
            self.0 = (self.0 & !(0x07 << 0usize)) | (((val.to_bits() as u32) & 0x07) << 0usize);
        }
        #[doc = "Instruction double transfer rate This bit sets the DTR mode for the instruction phase."]
        #[inline(always)]
        pub const fn idtr(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Instruction double transfer rate This bit sets the DTR mode for the instruction phase."]
        #[inline(always)]
        pub fn set_idtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Instruction size This bit defines instruction size:"]
        #[inline(always)]
        pub const fn isize(&self) -> super::vals::WccrIsize {
            let val = (self.0 >> 4usize) & 0x03;
            super::vals::WccrIsize::from_bits(val as u8)
        }
        #[doc = "Instruction size This bit defines instruction size:"]
        #[inline(always)]
        pub fn set_isize(&mut self, val: super::vals::WccrIsize) {
            self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
        }
        #[doc = "Address mode This field defines the address phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub const fn admode(&self) -> super::vals::WccrAdmode {
            let val = (self.0 >> 8usize) & 0x07;
            super::vals::WccrAdmode::from_bits(val as u8)
        }
        #[doc = "Address mode This field defines the address phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub fn set_admode(&mut self, val: super::vals::WccrAdmode) {
            self.0 = (self.0 & !(0x07 << 8usize)) | (((val.to_bits() as u32) & 0x07) << 8usize);
        }
        #[doc = "Address double transfer rate This bit sets the DTR mode for the address phase."]
        #[inline(always)]
        pub const fn addtr(&self) -> bool {
            let val = (self.0 >> 11usize) & 0x01;
            val != 0
        }
        #[doc = "Address double transfer rate This bit sets the DTR mode for the address phase."]
        #[inline(always)]
        pub fn set_addtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
        }
        #[doc = "Address size This field defines address size."]
        #[inline(always)]
        pub const fn adsize(&self) -> super::vals::WccrAdsize {
            let val = (self.0 >> 12usize) & 0x03;
            super::vals::WccrAdsize::from_bits(val as u8)
        }
        #[doc = "Address size This field defines address size."]
        #[inline(always)]
        pub fn set_adsize(&mut self, val: super::vals::WccrAdsize) {
            self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
        }
        #[doc = "Alternate-byte mode This field defines the alternate-byte phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub const fn abmode(&self) -> super::vals::WccrAbmode {
            let val = (self.0 >> 16usize) & 0x07;
            super::vals::WccrAbmode::from_bits(val as u8)
        }
        #[doc = "Alternate-byte mode This field defines the alternate-byte phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub fn set_abmode(&mut self, val: super::vals::WccrAbmode) {
            self.0 = (self.0 & !(0x07 << 16usize)) | (((val.to_bits() as u32) & 0x07) << 16usize);
        }
        #[doc = "Alternate bytes double-transfer rate This bit sets the DTR mode for the alternate-bytes phase."]
        #[inline(always)]
        pub const fn abdtr(&self) -> bool {
            let val = (self.0 >> 19usize) & 0x01;
            val != 0
        }
        #[doc = "Alternate bytes double-transfer rate This bit sets the DTR mode for the alternate-bytes phase."]
        #[inline(always)]
        pub fn set_abdtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
        }
        #[doc = "Alternate bytes size This field defines alternate bytes size:"]
        #[inline(always)]
        pub const fn absize(&self) -> super::vals::WccrAbsize {
            let val = (self.0 >> 20usize) & 0x03;
            super::vals::WccrAbsize::from_bits(val as u8)
        }
        #[doc = "Alternate bytes size This field defines alternate bytes size:"]
        #[inline(always)]
        pub fn set_absize(&mut self, val: super::vals::WccrAbsize) {
            self.0 = (self.0 & !(0x03 << 20usize)) | (((val.to_bits() as u32) & 0x03) << 20usize);
        }
        #[doc = "Data mode This field defines the data phase mode of operation."]
        #[inline(always)]
        pub const fn dmode(&self) -> super::vals::WccrDmode {
            let val = (self.0 >> 24usize) & 0x07;
            super::vals::WccrDmode::from_bits(val as u8)
        }
        #[doc = "Data mode This field defines the data phase mode of operation."]
        #[inline(always)]
        pub fn set_dmode(&mut self, val: super::vals::WccrDmode) {
            self.0 = (self.0 & !(0x07 << 24usize)) | (((val.to_bits() as u32) & 0x07) << 24usize);
        }
        #[doc = "data double transfer rate This bit sets the DTR mode for the data phase."]
        #[inline(always)]
        pub const fn ddtr(&self) -> bool {
            let val = (self.0 >> 27usize) & 0x01;
            val != 0
        }
        #[doc = "data double transfer rate This bit sets the DTR mode for the data phase."]
        #[inline(always)]
        pub fn set_ddtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
        }
        #[doc = "DQS enable This bit enables the data strobe management."]
        #[inline(always)]
        pub const fn dqse(&self) -> bool {
            let val = (self.0 >> 29usize) & 0x01;
            val != 0
        }
        #[doc = "DQS enable This bit enables the data strobe management."]
        #[inline(always)]
        pub fn set_dqse(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
        }
    }
    impl Default for Wccr {
        #[inline(always)]
        fn default() -> Wccr {
            Wccr(0)
        }
    }
    impl core::fmt::Debug for Wccr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Wccr")
                .field("imode", &self.imode())
                .field("idtr", &self.idtr())
                .field("isize", &self.isize())
                .field("admode", &self.admode())
                .field("addtr", &self.addtr())
                .field("adsize", &self.adsize())
                .field("abmode", &self.abmode())
                .field("abdtr", &self.abdtr())
                .field("absize", &self.absize())
                .field("dmode", &self.dmode())
                .field("ddtr", &self.ddtr())
                .field("dqse", &self.dqse())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Wccr {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Wccr {{ imode: {:?}, idtr: {=bool:?}, isize: {:?}, admode: {:?}, addtr: {=bool:?}, adsize: {:?}, abmode: {:?}, abdtr: {=bool:?}, absize: {:?}, dmode: {:?}, ddtr: {=bool:?}, dqse: {=bool:?} }}" , self . imode () , self . idtr () , self . isize () , self . admode () , self . addtr () , self . adsize () , self . abmode () , self . abdtr () , self . absize () , self . dmode () , self . ddtr () , self . dqse ())
        }
    }
    #[doc = "XSPI write instruction register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Wir(pub u32);
    impl Wir {
        #[doc = "Instruction Instruction to be sent to the external SPI device"]
        #[inline(always)]
        pub const fn instruction(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Instruction Instruction to be sent to the external SPI device"]
        #[inline(always)]
        pub fn set_instruction(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Wir {
        #[inline(always)]
        fn default() -> Wir {
            Wir(0)
        }
    }
    impl core::fmt::Debug for Wir {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Wir").field("instruction", &self.instruction()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Wir {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Wir {{ instruction: {=u32:?} }}", self.instruction())
        }
    }
    #[doc = "XSPI wrap alternate byte register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Wpabr(pub u32);
    impl Wpabr {
        #[doc = "Alternate bytes Optional data to be sent to the external SPI device right after the address"]
        #[inline(always)]
        pub const fn alternate(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Alternate bytes Optional data to be sent to the external SPI device right after the address"]
        #[inline(always)]
        pub fn set_alternate(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Wpabr {
        #[inline(always)]
        fn default() -> Wpabr {
            Wpabr(0)
        }
    }
    impl core::fmt::Debug for Wpabr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Wpabr").field("alternate", &self.alternate()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Wpabr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Wpabr {{ alternate: {=u32:?} }}", self.alternate())
        }
    }
    #[doc = "XSPI wrap communication configuration register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Wpccr(pub u32);
    impl Wpccr {
        #[doc = "Instruction mode This field defines the instruction phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub const fn imode(&self) -> super::vals::WpccrImode {
            let val = (self.0 >> 0usize) & 0x07;
            super::vals::WpccrImode::from_bits(val as u8)
        }
        #[doc = "Instruction mode This field defines the instruction phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub fn set_imode(&mut self, val: super::vals::WpccrImode) {
            self.0 = (self.0 & !(0x07 << 0usize)) | (((val.to_bits() as u32) & 0x07) << 0usize);
        }
        #[doc = "Instruction double transfer rate This bit sets the DTR mode for the instruction phase."]
        #[inline(always)]
        pub const fn idtr(&self) -> bool {
            let val = (self.0 >> 3usize) & 0x01;
            val != 0
        }
        #[doc = "Instruction double transfer rate This bit sets the DTR mode for the instruction phase."]
        #[inline(always)]
        pub fn set_idtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
        }
        #[doc = "Instruction size This field defines instruction size."]
        #[inline(always)]
        pub const fn isize(&self) -> super::vals::WpccrIsize {
            let val = (self.0 >> 4usize) & 0x03;
            super::vals::WpccrIsize::from_bits(val as u8)
        }
        #[doc = "Instruction size This field defines instruction size."]
        #[inline(always)]
        pub fn set_isize(&mut self, val: super::vals::WpccrIsize) {
            self.0 = (self.0 & !(0x03 << 4usize)) | (((val.to_bits() as u32) & 0x03) << 4usize);
        }
        #[doc = "Address mode This field defines the address phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub const fn admode(&self) -> super::vals::WpccrAdmode {
            let val = (self.0 >> 8usize) & 0x07;
            super::vals::WpccrAdmode::from_bits(val as u8)
        }
        #[doc = "Address mode This field defines the address phase mode of operation. Others: reserved"]
        #[inline(always)]
        pub fn set_admode(&mut self, val: super::vals::WpccrAdmode) {
            self.0 = (self.0 & !(0x07 << 8usize)) | (((val.to_bits() as u32) & 0x07) << 8usize);
        }
        #[doc = "Address double transfer rate This bit sets the DTR mode for the address phase."]
        #[inline(always)]
        pub const fn addtr(&self) -> bool {
            let val = (self.0 >> 11usize) & 0x01;
            val != 0
        }
        #[doc = "Address double transfer rate This bit sets the DTR mode for the address phase."]
        #[inline(always)]
        pub fn set_addtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
        }
        #[doc = "Address size This field defines address size."]
        #[inline(always)]
        pub const fn adsize(&self) -> super::vals::WpccrAdsize {
            let val = (self.0 >> 12usize) & 0x03;
            super::vals::WpccrAdsize::from_bits(val as u8)
        }
        #[doc = "Address size This field defines address size."]
        #[inline(always)]
        pub fn set_adsize(&mut self, val: super::vals::WpccrAdsize) {
            self.0 = (self.0 & !(0x03 << 12usize)) | (((val.to_bits() as u32) & 0x03) << 12usize);
        }
        #[doc = "Alternate-byte mode This field defines the alternate byte phase mode of operation."]
        #[inline(always)]
        pub const fn abmode(&self) -> super::vals::WpccrAbmode {
            let val = (self.0 >> 16usize) & 0x07;
            super::vals::WpccrAbmode::from_bits(val as u8)
        }
        #[doc = "Alternate-byte mode This field defines the alternate byte phase mode of operation."]
        #[inline(always)]
        pub fn set_abmode(&mut self, val: super::vals::WpccrAbmode) {
            self.0 = (self.0 & !(0x07 << 16usize)) | (((val.to_bits() as u32) & 0x07) << 16usize);
        }
        #[doc = "Alternate bytes double transfer rate This bit sets the DTR mode for the alternate bytes phase."]
        #[inline(always)]
        pub const fn abdtr(&self) -> bool {
            let val = (self.0 >> 19usize) & 0x01;
            val != 0
        }
        #[doc = "Alternate bytes double transfer rate This bit sets the DTR mode for the alternate bytes phase."]
        #[inline(always)]
        pub fn set_abdtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
        }
        #[doc = "Alternate bytes size This bit defines alternate bytes size."]
        #[inline(always)]
        pub const fn absize(&self) -> super::vals::WpccrAbsize {
            let val = (self.0 >> 20usize) & 0x03;
            super::vals::WpccrAbsize::from_bits(val as u8)
        }
        #[doc = "Alternate bytes size This bit defines alternate bytes size."]
        #[inline(always)]
        pub fn set_absize(&mut self, val: super::vals::WpccrAbsize) {
            self.0 = (self.0 & !(0x03 << 20usize)) | (((val.to_bits() as u32) & 0x03) << 20usize);
        }
        #[doc = "Data mode This field defines the data phase mode of operation. 101; data on 16 lines Others: reserved"]
        #[inline(always)]
        pub const fn dmode(&self) -> super::vals::WpccrDmode {
            let val = (self.0 >> 24usize) & 0x07;
            super::vals::WpccrDmode::from_bits(val as u8)
        }
        #[doc = "Data mode This field defines the data phase mode of operation. 101; data on 16 lines Others: reserved"]
        #[inline(always)]
        pub fn set_dmode(&mut self, val: super::vals::WpccrDmode) {
            self.0 = (self.0 & !(0x07 << 24usize)) | (((val.to_bits() as u32) & 0x07) << 24usize);
        }
        #[doc = "Data double transfer rate This bit sets the DTR mode for the data phase."]
        #[inline(always)]
        pub const fn ddtr(&self) -> bool {
            let val = (self.0 >> 27usize) & 0x01;
            val != 0
        }
        #[doc = "Data double transfer rate This bit sets the DTR mode for the data phase."]
        #[inline(always)]
        pub fn set_ddtr(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
        }
        #[doc = "DQS enable This bit enables the data strobe management."]
        #[inline(always)]
        pub const fn dqse(&self) -> bool {
            let val = (self.0 >> 29usize) & 0x01;
            val != 0
        }
        #[doc = "DQS enable This bit enables the data strobe management."]
        #[inline(always)]
        pub fn set_dqse(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
        }
    }
    impl Default for Wpccr {
        #[inline(always)]
        fn default() -> Wpccr {
            Wpccr(0)
        }
    }
    impl core::fmt::Debug for Wpccr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Wpccr")
                .field("imode", &self.imode())
                .field("idtr", &self.idtr())
                .field("isize", &self.isize())
                .field("admode", &self.admode())
                .field("addtr", &self.addtr())
                .field("adsize", &self.adsize())
                .field("abmode", &self.abmode())
                .field("abdtr", &self.abdtr())
                .field("absize", &self.absize())
                .field("dmode", &self.dmode())
                .field("ddtr", &self.ddtr())
                .field("dqse", &self.dqse())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Wpccr {
        fn format(&self, f: defmt::Formatter) {
            defmt :: write ! (f , "Wpccr {{ imode: {:?}, idtr: {=bool:?}, isize: {:?}, admode: {:?}, addtr: {=bool:?}, adsize: {:?}, abmode: {:?}, abdtr: {=bool:?}, absize: {:?}, dmode: {:?}, ddtr: {=bool:?}, dqse: {=bool:?} }}" , self . imode () , self . idtr () , self . isize () , self . admode () , self . addtr () , self . adsize () , self . abmode () , self . abdtr () , self . absize () , self . dmode () , self . ddtr () , self . dqse ())
        }
    }
    #[doc = "XSPI wrap instruction register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Wpir(pub u32);
    impl Wpir {
        #[doc = "Instruction Instruction to be sent to the external SPI device"]
        #[inline(always)]
        pub const fn instruction(&self) -> u32 {
            let val = (self.0 >> 0usize) & 0xffff_ffff;
            val as u32
        }
        #[doc = "Instruction Instruction to be sent to the external SPI device"]
        #[inline(always)]
        pub fn set_instruction(&mut self, val: u32) {
            self.0 = (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
        }
    }
    impl Default for Wpir {
        #[inline(always)]
        fn default() -> Wpir {
            Wpir(0)
        }
    }
    impl core::fmt::Debug for Wpir {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Wpir")
                .field("instruction", &self.instruction())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Wpir {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Wpir {{ instruction: {=u32:?} }}", self.instruction())
        }
    }
    #[doc = "XSPI wrap timing configuration register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Wptcr(pub u32);
    impl Wptcr {
        #[doc = "Number of dummy cycles This field defines the duration of the dummy phase. In both SDR and DTR modes, it specifies a number of CLK cycles (0-31)."]
        #[inline(always)]
        pub const fn dcyc(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0x1f;
            val as u8
        }
        #[doc = "Number of dummy cycles This field defines the duration of the dummy phase. In both SDR and DTR modes, it specifies a number of CLK cycles (0-31)."]
        #[inline(always)]
        pub fn set_dcyc(&mut self, val: u8) {
            self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize);
        }
        #[doc = "Delay hold quarter cycle Add a quarter cycle delay on the outputs in DTR communication to match hold requirement."]
        #[inline(always)]
        pub const fn dhqc(&self) -> bool {
            let val = (self.0 >> 28usize) & 0x01;
            val != 0
        }
        #[doc = "Delay hold quarter cycle Add a quarter cycle delay on the outputs in DTR communication to match hold requirement."]
        #[inline(always)]
        pub fn set_dhqc(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
        }
        #[doc = "Sample shift By default, the XSPI samples data 1/2 of a CLK cycle after the data is driven by the external device. This bit allows the data to be sampled later in order to consider the external signal delays. The firmware must assure that SSHIFT=0 when the data phase is configured in DTR mode (when DDTR = 1)."]
        #[inline(always)]
        pub const fn sshift(&self) -> bool {
            let val = (self.0 >> 30usize) & 0x01;
            val != 0
        }
        #[doc = "Sample shift By default, the XSPI samples data 1/2 of a CLK cycle after the data is driven by the external device. This bit allows the data to be sampled later in order to consider the external signal delays. The firmware must assure that SSHIFT=0 when the data phase is configured in DTR mode (when DDTR = 1)."]
        #[inline(always)]
        pub fn set_sshift(&mut self, val: bool) {
            self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
        }
    }
    impl Default for Wptcr {
        #[inline(always)]
        fn default() -> Wptcr {
            Wptcr(0)
        }
    }
    impl core::fmt::Debug for Wptcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Wptcr")
                .field("dcyc", &self.dcyc())
                .field("dhqc", &self.dhqc())
                .field("sshift", &self.sshift())
                .finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Wptcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(
                f,
                "Wptcr {{ dcyc: {=u8:?}, dhqc: {=bool:?}, sshift: {=bool:?} }}",
                self.dcyc(),
                self.dhqc(),
                self.sshift()
            )
        }
    }
    #[doc = "XSPI write timing configuration register"]
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq)]
    pub struct Wtcr(pub u32);
    impl Wtcr {
        #[doc = "Number of dummy cycles This field defines the duration of the dummy phase. In both SDR and DTR modes, it specifies a number of CLK cycles (0-31). It is recommended to have at least 5 dummy cycles when using memories with DQS activated."]
        #[inline(always)]
        pub const fn dcyc(&self) -> u8 {
            let val = (self.0 >> 0usize) & 0x1f;
            val as u8
        }
        #[doc = "Number of dummy cycles This field defines the duration of the dummy phase. In both SDR and DTR modes, it specifies a number of CLK cycles (0-31). It is recommended to have at least 5 dummy cycles when using memories with DQS activated."]
        #[inline(always)]
        pub fn set_dcyc(&mut self, val: u8) {
            self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize);
        }
    }
    impl Default for Wtcr {
        #[inline(always)]
        fn default() -> Wtcr {
            Wtcr(0)
        }
    }
    impl core::fmt::Debug for Wtcr {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            f.debug_struct("Wtcr").field("dcyc", &self.dcyc()).finish()
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Wtcr {
        fn format(&self, f: defmt::Formatter) {
            defmt::write!(f, "Wtcr {{ dcyc: {=u8:?} }}", self.dcyc())
        }
    }
}
pub mod vals {
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Apms {
        #[doc = "Automatic status-polling mode is stopped only by abort or by disabling the XSPI."]
        B_0X0 = 0x0,
        #[doc = "Automatic status-polling mode stops as soon as there is a match."]
        B_0X1 = 0x01,
    }
    impl Apms {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Apms {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Apms {
        #[inline(always)]
        fn from(val: u8) -> Apms {
            Apms::from_bits(val)
        }
    }
    impl From<Apms> for u8 {
        #[inline(always)]
        fn from(val: Apms) -> u8 {
            Apms::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum CcrAbmode {
        #[doc = "no alternate bytes"]
        B_0X0 = 0x0,
        #[doc = "alternate bytes on a single line"]
        B_0X1 = 0x01,
        #[doc = "alternate bytes on two lines"]
        B_0X2 = 0x02,
        #[doc = "alternate bytes on four lines"]
        B_0X3 = 0x03,
        _RESERVED_4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl CcrAbmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> CcrAbmode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for CcrAbmode {
        #[inline(always)]
        fn from(val: u8) -> CcrAbmode {
            CcrAbmode::from_bits(val)
        }
    }
    impl From<CcrAbmode> for u8 {
        #[inline(always)]
        fn from(val: CcrAbmode) -> u8 {
            CcrAbmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum CcrAbsize {
        #[doc = "8-bit alternate bytes"]
        B_0X0 = 0x0,
        #[doc = "16-bit alternate bytes"]
        B_0X1 = 0x01,
        #[doc = "24-bit alternate bytes"]
        B_0X2 = 0x02,
        #[doc = "32-bit alternate bytes"]
        B_0X3 = 0x03,
    }
    impl CcrAbsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> CcrAbsize {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for CcrAbsize {
        #[inline(always)]
        fn from(val: u8) -> CcrAbsize {
            CcrAbsize::from_bits(val)
        }
    }
    impl From<CcrAbsize> for u8 {
        #[inline(always)]
        fn from(val: CcrAbsize) -> u8 {
            CcrAbsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum CcrAdmode {
        #[doc = "no address"]
        B_0X0 = 0x0,
        #[doc = "address on a single line"]
        B_0X1 = 0x01,
        #[doc = "address on two lines"]
        B_0X2 = 0x02,
        #[doc = "address on four lines"]
        B_0X3 = 0x03,
        #[doc = "address on eight lines"]
        B_0X4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl CcrAdmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> CcrAdmode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for CcrAdmode {
        #[inline(always)]
        fn from(val: u8) -> CcrAdmode {
            CcrAdmode::from_bits(val)
        }
    }
    impl From<CcrAdmode> for u8 {
        #[inline(always)]
        fn from(val: CcrAdmode) -> u8 {
            CcrAdmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum CcrAdsize {
        #[doc = "8-bit address"]
        B_0X0 = 0x0,
        #[doc = "16-bit address"]
        B_0X1 = 0x01,
        #[doc = "24-bit address"]
        B_0X2 = 0x02,
        #[doc = "32-bit address"]
        B_0X3 = 0x03,
    }
    impl CcrAdsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> CcrAdsize {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for CcrAdsize {
        #[inline(always)]
        fn from(val: u8) -> CcrAdsize {
            CcrAdsize::from_bits(val)
        }
    }
    impl From<CcrAdsize> for u8 {
        #[inline(always)]
        fn from(val: CcrAdsize) -> u8 {
            CcrAdsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum CcrDmode {
        #[doc = "no data"]
        B_0X0 = 0x0,
        #[doc = "data on a single line"]
        B_0X1 = 0x01,
        #[doc = "data on two lines"]
        B_0X2 = 0x02,
        #[doc = "data on four lines"]
        B_0X3 = 0x03,
        #[doc = "data on eight lines"]
        B_0X4 = 0x04,
        #[doc = "data on 16 lines"]
        B_0X5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl CcrDmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> CcrDmode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for CcrDmode {
        #[inline(always)]
        fn from(val: u8) -> CcrDmode {
            CcrDmode::from_bits(val)
        }
    }
    impl From<CcrDmode> for u8 {
        #[inline(always)]
        fn from(val: CcrDmode) -> u8 {
            CcrDmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum CcrImode {
        #[doc = "no instruction"]
        B_0X0 = 0x0,
        #[doc = "instruction on a single line"]
        B_0X1 = 0x01,
        #[doc = "instruction on two lines"]
        B_0X2 = 0x02,
        #[doc = "instruction on four lines"]
        B_0X3 = 0x03,
        #[doc = "instruction on eight lines"]
        B_0X4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl CcrImode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> CcrImode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for CcrImode {
        #[inline(always)]
        fn from(val: u8) -> CcrImode {
            CcrImode::from_bits(val)
        }
    }
    impl From<CcrImode> for u8 {
        #[inline(always)]
        fn from(val: CcrImode) -> u8 {
            CcrImode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum CcrIsize {
        #[doc = "8-bit instruction"]
        B_0X0 = 0x0,
        #[doc = "16-bit instruction"]
        B_0X1 = 0x01,
        #[doc = "24-bit instruction"]
        B_0X2 = 0x02,
        #[doc = "32-bit instruction"]
        B_0X3 = 0x03,
    }
    impl CcrIsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> CcrIsize {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for CcrIsize {
        #[inline(always)]
        fn from(val: u8) -> CcrIsize {
            CcrIsize::from_bits(val)
        }
    }
    impl From<CcrIsize> for u8 {
        #[inline(always)]
        fn from(val: CcrIsize) -> u8 {
            CcrIsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Ckmode {
        #[doc = "CLK must stay low while NCS is high (chip-select released), referred to as clock mode 0."]
        B_0X0 = 0x0,
        #[doc = "CLK must stay high while NCS is high (chip-select released), referred to as clock mode 3."]
        B_0X1 = 0x01,
    }
    impl Ckmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Ckmode {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Ckmode {
        #[inline(always)]
        fn from(val: u8) -> Ckmode {
            Ckmode::from_bits(val)
        }
    }
    impl From<Ckmode> for u8 {
        #[inline(always)]
        fn from(val: Ckmode) -> u8 {
            Ckmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Csbound {
        #[doc = "NCS boundary disabled"]
        B_0X0 = 0x0,
        _RESERVED_1 = 0x01,
        _RESERVED_2 = 0x02,
        _RESERVED_3 = 0x03,
        _RESERVED_4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
        _RESERVED_8 = 0x08,
        _RESERVED_9 = 0x09,
        _RESERVED_a = 0x0a,
        _RESERVED_b = 0x0b,
        _RESERVED_c = 0x0c,
        _RESERVED_d = 0x0d,
        _RESERVED_e = 0x0e,
        _RESERVED_f = 0x0f,
        _RESERVED_10 = 0x10,
        _RESERVED_11 = 0x11,
        _RESERVED_12 = 0x12,
        _RESERVED_13 = 0x13,
        _RESERVED_14 = 0x14,
        _RESERVED_15 = 0x15,
        _RESERVED_16 = 0x16,
        _RESERVED_17 = 0x17,
        _RESERVED_18 = 0x18,
        _RESERVED_19 = 0x19,
        _RESERVED_1a = 0x1a,
        _RESERVED_1b = 0x1b,
        _RESERVED_1c = 0x1c,
        _RESERVED_1d = 0x1d,
        _RESERVED_1e = 0x1e,
        _RESERVED_1f = 0x1f,
    }
    impl Csbound {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Csbound {
            unsafe { core::mem::transmute(val & 0x1f) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Csbound {
        #[inline(always)]
        fn from(val: u8) -> Csbound {
            Csbound::from_bits(val)
        }
    }
    impl From<Csbound> for u8 {
        #[inline(always)]
        fn from(val: Csbound) -> u8 {
            Csbound::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Csht {
        #[doc = "NCS stays high for at least 1 cycle between external device commands."]
        B_0X0 = 0x0,
        #[doc = "NCS stays high for at least 2 cycles between external device commands."]
        B_0X1 = 0x01,
        _RESERVED_2 = 0x02,
        _RESERVED_3 = 0x03,
        _RESERVED_4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
        _RESERVED_8 = 0x08,
        _RESERVED_9 = 0x09,
        _RESERVED_a = 0x0a,
        _RESERVED_b = 0x0b,
        _RESERVED_c = 0x0c,
        _RESERVED_d = 0x0d,
        _RESERVED_e = 0x0e,
        _RESERVED_f = 0x0f,
        _RESERVED_10 = 0x10,
        _RESERVED_11 = 0x11,
        _RESERVED_12 = 0x12,
        _RESERVED_13 = 0x13,
        _RESERVED_14 = 0x14,
        _RESERVED_15 = 0x15,
        _RESERVED_16 = 0x16,
        _RESERVED_17 = 0x17,
        _RESERVED_18 = 0x18,
        _RESERVED_19 = 0x19,
        _RESERVED_1a = 0x1a,
        _RESERVED_1b = 0x1b,
        _RESERVED_1c = 0x1c,
        _RESERVED_1d = 0x1d,
        _RESERVED_1e = 0x1e,
        _RESERVED_1f = 0x1f,
        _RESERVED_20 = 0x20,
        _RESERVED_21 = 0x21,
        _RESERVED_22 = 0x22,
        _RESERVED_23 = 0x23,
        _RESERVED_24 = 0x24,
        _RESERVED_25 = 0x25,
        _RESERVED_26 = 0x26,
        _RESERVED_27 = 0x27,
        _RESERVED_28 = 0x28,
        _RESERVED_29 = 0x29,
        _RESERVED_2a = 0x2a,
        _RESERVED_2b = 0x2b,
        _RESERVED_2c = 0x2c,
        _RESERVED_2d = 0x2d,
        _RESERVED_2e = 0x2e,
        _RESERVED_2f = 0x2f,
        _RESERVED_30 = 0x30,
        _RESERVED_31 = 0x31,
        _RESERVED_32 = 0x32,
        _RESERVED_33 = 0x33,
        _RESERVED_34 = 0x34,
        _RESERVED_35 = 0x35,
        _RESERVED_36 = 0x36,
        _RESERVED_37 = 0x37,
        _RESERVED_38 = 0x38,
        _RESERVED_39 = 0x39,
        _RESERVED_3a = 0x3a,
        _RESERVED_3b = 0x3b,
        _RESERVED_3c = 0x3c,
        _RESERVED_3d = 0x3d,
        _RESERVED_3e = 0x3e,
        #[doc = "NCS stays high for at least 64 cycles between external device commands."]
        B_0X3F = 0x3f,
    }
    impl Csht {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Csht {
            unsafe { core::mem::transmute(val & 0x3f) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Csht {
        #[inline(always)]
        fn from(val: u8) -> Csht {
            Csht::from_bits(val)
        }
    }
    impl From<Csht> for u8 {
        #[inline(always)]
        fn from(val: Csht) -> u8 {
            Csht::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Cssel {
        #[doc = "NCS1 active"]
        B_0X0 = 0x0,
        #[doc = "NCS2 active"]
        B_0X1 = 0x01,
    }
    impl Cssel {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Cssel {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Cssel {
        #[inline(always)]
        fn from(val: u8) -> Cssel {
            Cssel::from_bits(val)
        }
    }
    impl From<Cssel> for u8 {
        #[inline(always)]
        fn from(val: Cssel) -> u8 {
            Cssel::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Fmode {
        #[doc = "indirect-write mode"]
        B_0X0 = 0x0,
        #[doc = "indirect-read mode"]
        B_0X1 = 0x01,
        #[doc = "automatic status-polling mode"]
        B_0X2 = 0x02,
        #[doc = "memory-mapped mode"]
        B_0X3 = 0x03,
    }
    impl Fmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Fmode {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Fmode {
        #[inline(always)]
        fn from(val: u8) -> Fmode {
            Fmode::from_bits(val)
        }
    }
    impl From<Fmode> for u8 {
        #[inline(always)]
        fn from(val: Fmode) -> u8 {
            Fmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Fthres {
        #[doc = "FTF is set if there are one or more free bytes available to be written to in the FIFO"]
        B_0X0 = 0x0,
        #[doc = "FTF is set if there are two or more free bytes available to be written to in the FIFO"]
        B_0X1 = 0x01,
        _RESERVED_2 = 0x02,
        _RESERVED_3 = 0x03,
        _RESERVED_4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
        _RESERVED_8 = 0x08,
        _RESERVED_9 = 0x09,
        _RESERVED_a = 0x0a,
        _RESERVED_b = 0x0b,
        _RESERVED_c = 0x0c,
        _RESERVED_d = 0x0d,
        _RESERVED_e = 0x0e,
        _RESERVED_f = 0x0f,
        _RESERVED_10 = 0x10,
        _RESERVED_11 = 0x11,
        _RESERVED_12 = 0x12,
        _RESERVED_13 = 0x13,
        _RESERVED_14 = 0x14,
        _RESERVED_15 = 0x15,
        _RESERVED_16 = 0x16,
        _RESERVED_17 = 0x17,
        _RESERVED_18 = 0x18,
        _RESERVED_19 = 0x19,
        _RESERVED_1a = 0x1a,
        _RESERVED_1b = 0x1b,
        _RESERVED_1c = 0x1c,
        _RESERVED_1d = 0x1d,
        _RESERVED_1e = 0x1e,
        _RESERVED_1f = 0x1f,
        _RESERVED_20 = 0x20,
        _RESERVED_21 = 0x21,
        _RESERVED_22 = 0x22,
        _RESERVED_23 = 0x23,
        _RESERVED_24 = 0x24,
        _RESERVED_25 = 0x25,
        _RESERVED_26 = 0x26,
        _RESERVED_27 = 0x27,
        _RESERVED_28 = 0x28,
        _RESERVED_29 = 0x29,
        _RESERVED_2a = 0x2a,
        _RESERVED_2b = 0x2b,
        _RESERVED_2c = 0x2c,
        _RESERVED_2d = 0x2d,
        _RESERVED_2e = 0x2e,
        _RESERVED_2f = 0x2f,
        _RESERVED_30 = 0x30,
        _RESERVED_31 = 0x31,
        _RESERVED_32 = 0x32,
        _RESERVED_33 = 0x33,
        _RESERVED_34 = 0x34,
        _RESERVED_35 = 0x35,
        _RESERVED_36 = 0x36,
        _RESERVED_37 = 0x37,
        _RESERVED_38 = 0x38,
        _RESERVED_39 = 0x39,
        _RESERVED_3a = 0x3a,
        _RESERVED_3b = 0x3b,
        _RESERVED_3c = 0x3c,
        _RESERVED_3d = 0x3d,
        _RESERVED_3e = 0x3e,
        #[doc = "FTF is set if there are 64 free bytes available to be written to in the FIFO"]
        B_0X3F = 0x3f,
    }
    impl Fthres {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Fthres {
            unsafe { core::mem::transmute(val & 0x3f) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Fthres {
        #[inline(always)]
        fn from(val: u8) -> Fthres {
            Fthres::from_bits(val)
        }
    }
    impl From<Fthres> for u8 {
        #[inline(always)]
        fn from(val: Fthres) -> u8 {
            Fthres::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Lm {
        #[doc = "Variable initial latency"]
        B_0X0 = 0x0,
        #[doc = "Fixed latency"]
        B_0X1 = 0x01,
    }
    impl Lm {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Lm {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Lm {
        #[inline(always)]
        fn from(val: u8) -> Lm {
            Lm::from_bits(val)
        }
    }
    impl From<Lm> for u8 {
        #[inline(always)]
        fn from(val: Lm) -> u8 {
            Lm::to_bits(val)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
    pub struct Mask(u32);
    impl Mask {
        #[doc = "bit n of the data received in automatic status-polling mode is masked and its value is not considered in the matching logic."]
        pub const B_0X0: Self = Self(0x0);
        #[doc = "bit n of the data received in automatic status-polling mode is unmasked and its value is considered in the matching logic."]
        pub const B_0X1: Self = Self(0x01);
    }
    impl Mask {
        pub const fn from_bits(val: u32) -> Mask {
            Self(val & 0xffff_ffff)
        }
        pub const fn to_bits(self) -> u32 {
            self.0
        }
    }
    impl core::fmt::Debug for Mask {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            match self.0 {
                0x0 => f.write_str("B_0X0"),
                0x01 => f.write_str("B_0X1"),
                other => core::write!(f, "0x{:02X}", other),
            }
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Mask {
        fn format(&self, f: defmt::Formatter) {
            match self.0 {
                0x0 => defmt::write!(f, "B_0X0"),
                0x01 => defmt::write!(f, "B_0X1"),
                other => defmt::write!(f, "0x{:02X}", other),
            }
        }
    }
    impl From<u32> for Mask {
        #[inline(always)]
        fn from(val: u32) -> Mask {
            Mask::from_bits(val)
        }
    }
    impl From<Mask> for u32 {
        #[inline(always)]
        fn from(val: Mask) -> u32 {
            Mask::to_bits(val)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
    pub struct Maxtran(u8);
    impl Maxtran {
        #[doc = "maximum communication disabled"]
        pub const B_0X0: Self = Self(0x0);
    }
    impl Maxtran {
        pub const fn from_bits(val: u8) -> Maxtran {
            Self(val & 0xff)
        }
        pub const fn to_bits(self) -> u8 {
            self.0
        }
    }
    impl core::fmt::Debug for Maxtran {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            match self.0 {
                0x0 => f.write_str("B_0X0"),
                other => core::write!(f, "0x{:02X}", other),
            }
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Maxtran {
        fn format(&self, f: defmt::Formatter) {
            match self.0 {
                0x0 => defmt::write!(f, "B_0X0"),
                other => defmt::write!(f, "0x{:02X}", other),
            }
        }
    }
    impl From<u8> for Maxtran {
        #[inline(always)]
        fn from(val: u8) -> Maxtran {
            Maxtran::from_bits(val)
        }
    }
    impl From<Maxtran> for u8 {
        #[inline(always)]
        fn from(val: Maxtran) -> u8 {
            Maxtran::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Msel {
        #[doc = "data exchanged over IO\\[3:0\\]"]
        B_0X0 = 0x0,
        #[doc = "data exchanged over IO\\[7:4\\]"]
        B_0X1 = 0x01,
        #[doc = "data exchanged over IO\\[11:8\\]"]
        B_0X2 = 0x02,
        #[doc = "data exchanged over IO\\[15:12\\]"]
        B_0X3 = 0x03,
    }
    impl Msel {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Msel {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Msel {
        #[inline(always)]
        fn from(val: u8) -> Msel {
            Msel::from_bits(val)
        }
    }
    impl From<Msel> for u8 {
        #[inline(always)]
        fn from(val: Msel) -> u8 {
            Msel::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Mtyp {
        #[doc = "Micron mode, D0/D1 ordering in DTR 8-data-bit mode. Regular-command protocol in single-, dual-, quad-, and octal-SPI modes."]
        B_0X0 = 0x0,
        #[doc = "Macronix mode, D1/D0 ordering in DTR 8-data-bit mode. Regular-command protocol in single-, dual-, quad-, and octal-SPI modes."]
        B_0X1 = 0x01,
        #[doc = "Standard mode"]
        B_0X2 = 0x02,
        #[doc = "Macronix RAM mode, D1/D0 ordering in DTR 8-data-bit mode. Regular-command protocol in single-, dual-, quad-, and octal-SPI modes with dedicated address mapping."]
        B_0X3 = 0x03,
        #[doc = "HyperBus memory mode, the protocol follows the HyperBus<sup> </sup>specification. 8-data-bit DTR mode must be selected."]
        B_0X4 = 0x04,
        #[doc = "HyperBus register mode, addressing register space. The memory-mapped accesses in this mode must be non-cacheable, or indirect read/write modes must be used."]
        B_0X5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl Mtyp {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Mtyp {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Mtyp {
        #[inline(always)]
        fn from(val: u8) -> Mtyp {
            Mtyp::from_bits(val)
        }
    }
    impl From<Mtyp> for u8 {
        #[inline(always)]
        fn from(val: Mtyp) -> u8 {
            Mtyp::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Pmm {
        #[doc = "AND-match mode, SMF is set if all the unmasked bits received from the device match the corresponding bits in the match register."]
        B_0X0 = 0x0,
        #[doc = "OR-match mode, SMF is set if any of the unmasked bits received from the device matches its corresponding bit in the match register."]
        B_0X1 = 0x01,
    }
    impl Pmm {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Pmm {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Pmm {
        #[inline(always)]
        fn from(val: u8) -> Pmm {
            Pmm::from_bits(val)
        }
    }
    impl From<Pmm> for u8 {
        #[inline(always)]
        fn from(val: Pmm) -> u8 {
            Pmm::to_bits(val)
        }
    }
    #[repr(transparent)]
    #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
    pub struct Refresh(u32);
    impl Refresh {
        #[doc = "refresh disabled"]
        pub const B_0X0: Self = Self(0x0);
    }
    impl Refresh {
        pub const fn from_bits(val: u32) -> Refresh {
            Self(val & 0xffff_ffff)
        }
        pub const fn to_bits(self) -> u32 {
            self.0
        }
    }
    impl core::fmt::Debug for Refresh {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
            match self.0 {
                0x0 => f.write_str("B_0X0"),
                other => core::write!(f, "0x{:02X}", other),
            }
        }
    }
    #[cfg(feature = "defmt")]
    impl defmt::Format for Refresh {
        fn format(&self, f: defmt::Formatter) {
            match self.0 {
                0x0 => defmt::write!(f, "B_0X0"),
                other => defmt::write!(f, "0x{:02X}", other),
            }
        }
    }
    impl From<u32> for Refresh {
        #[inline(always)]
        fn from(val: u32) -> Refresh {
            Refresh::from_bits(val)
        }
    }
    impl From<Refresh> for u32 {
        #[inline(always)]
        fn from(val: Refresh) -> u32 {
            Refresh::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WccrAbmode {
        #[doc = "no alternate bytes"]
        B_0X0 = 0x0,
        #[doc = "alternate bytes on a single line"]
        B_0X1 = 0x01,
        #[doc = "alternate bytes on two lines"]
        B_0X2 = 0x02,
        #[doc = "alternate bytes on four lines"]
        B_0X3 = 0x03,
        #[doc = "alternate bytes on eight lines"]
        B_0X4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl WccrAbmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WccrAbmode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WccrAbmode {
        #[inline(always)]
        fn from(val: u8) -> WccrAbmode {
            WccrAbmode::from_bits(val)
        }
    }
    impl From<WccrAbmode> for u8 {
        #[inline(always)]
        fn from(val: WccrAbmode) -> u8 {
            WccrAbmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WccrAbsize {
        #[doc = "8-bit alternate bytes"]
        B_0X0 = 0x0,
        #[doc = "16-bit alternate bytes"]
        B_0X1 = 0x01,
        #[doc = "24-bit alternate bytes"]
        B_0X2 = 0x02,
        #[doc = "32-bit alternate bytes"]
        B_0X3 = 0x03,
    }
    impl WccrAbsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WccrAbsize {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WccrAbsize {
        #[inline(always)]
        fn from(val: u8) -> WccrAbsize {
            WccrAbsize::from_bits(val)
        }
    }
    impl From<WccrAbsize> for u8 {
        #[inline(always)]
        fn from(val: WccrAbsize) -> u8 {
            WccrAbsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WccrAdmode {
        #[doc = "no address"]
        B_0X0 = 0x0,
        #[doc = "address on a single line"]
        B_0X1 = 0x01,
        #[doc = "address on two lines"]
        B_0X2 = 0x02,
        #[doc = "address on four lines"]
        B_0X3 = 0x03,
        #[doc = "address on eight lines"]
        B_0X4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl WccrAdmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WccrAdmode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WccrAdmode {
        #[inline(always)]
        fn from(val: u8) -> WccrAdmode {
            WccrAdmode::from_bits(val)
        }
    }
    impl From<WccrAdmode> for u8 {
        #[inline(always)]
        fn from(val: WccrAdmode) -> u8 {
            WccrAdmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WccrAdsize {
        #[doc = "8-bit address"]
        B_0X0 = 0x0,
        #[doc = "16-bit address"]
        B_0X1 = 0x01,
        #[doc = "24-bit address"]
        B_0X2 = 0x02,
        #[doc = "32-bit address"]
        B_0X3 = 0x03,
    }
    impl WccrAdsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WccrAdsize {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WccrAdsize {
        #[inline(always)]
        fn from(val: u8) -> WccrAdsize {
            WccrAdsize::from_bits(val)
        }
    }
    impl From<WccrAdsize> for u8 {
        #[inline(always)]
        fn from(val: WccrAdsize) -> u8 {
            WccrAdsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WccrDmode {
        #[doc = "no data"]
        B_0X0 = 0x0,
        #[doc = "data on a single line"]
        B_0X1 = 0x01,
        #[doc = "data on two lines"]
        B_0X2 = 0x02,
        #[doc = "data on four lines"]
        B_0X3 = 0x03,
        #[doc = "data on eight lines"]
        B_0X4 = 0x04,
        #[doc = "Data on 16 lines"]
        B_0X5 = 0x05,
        _RESERVED_6 = 0x06,
        #[doc = "DATA reserved"]
        B_0X7 = 0x07,
    }
    impl WccrDmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WccrDmode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WccrDmode {
        #[inline(always)]
        fn from(val: u8) -> WccrDmode {
            WccrDmode::from_bits(val)
        }
    }
    impl From<WccrDmode> for u8 {
        #[inline(always)]
        fn from(val: WccrDmode) -> u8 {
            WccrDmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WccrImode {
        #[doc = "no instruction"]
        B_0X0 = 0x0,
        #[doc = "instruction on a single line"]
        B_0X1 = 0x01,
        #[doc = "instruction on two lines"]
        B_0X2 = 0x02,
        #[doc = "instruction on four lines"]
        B_0X3 = 0x03,
        #[doc = "instruction on eight lines"]
        B_0X4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl WccrImode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WccrImode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WccrImode {
        #[inline(always)]
        fn from(val: u8) -> WccrImode {
            WccrImode::from_bits(val)
        }
    }
    impl From<WccrImode> for u8 {
        #[inline(always)]
        fn from(val: WccrImode) -> u8 {
            WccrImode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WccrIsize {
        #[doc = "8-bit instruction"]
        B_0X0 = 0x0,
        #[doc = "16-bit instruction"]
        B_0X1 = 0x01,
        #[doc = "24-bit instruction"]
        B_0X2 = 0x02,
        #[doc = "32-bit instruction"]
        B_0X3 = 0x03,
    }
    impl WccrIsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WccrIsize {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WccrIsize {
        #[inline(always)]
        fn from(val: u8) -> WccrIsize {
            WccrIsize::from_bits(val)
        }
    }
    impl From<WccrIsize> for u8 {
        #[inline(always)]
        fn from(val: WccrIsize) -> u8 {
            WccrIsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WpccrAbmode {
        #[doc = "no alternate bytes"]
        B_0X0 = 0x0,
        #[doc = "alternate bytes on a single line"]
        B_0X1 = 0x01,
        #[doc = "alternate bytes on two lines"]
        B_0X2 = 0x02,
        #[doc = "alternate bytes on four lines"]
        B_0X3 = 0x03,
        #[doc = "alternate bytes on eight lines"]
        B_0X4 = 0x04,
        #[doc = "alternate bytes on 16 lines"]
        B_0X5 = 0x05,
        _RESERVED_6 = 0x06,
        #[doc = "DATA reserved"]
        B_0X7 = 0x07,
    }
    impl WpccrAbmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WpccrAbmode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WpccrAbmode {
        #[inline(always)]
        fn from(val: u8) -> WpccrAbmode {
            WpccrAbmode::from_bits(val)
        }
    }
    impl From<WpccrAbmode> for u8 {
        #[inline(always)]
        fn from(val: WpccrAbmode) -> u8 {
            WpccrAbmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WpccrAbsize {
        #[doc = "8-bit alternate bytes"]
        B_0X0 = 0x0,
        #[doc = "16-bit alternate bytes"]
        B_0X1 = 0x01,
        #[doc = "24-bit alternate bytes"]
        B_0X2 = 0x02,
        #[doc = "32-bit alternate bytes"]
        B_0X3 = 0x03,
    }
    impl WpccrAbsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WpccrAbsize {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WpccrAbsize {
        #[inline(always)]
        fn from(val: u8) -> WpccrAbsize {
            WpccrAbsize::from_bits(val)
        }
    }
    impl From<WpccrAbsize> for u8 {
        #[inline(always)]
        fn from(val: WpccrAbsize) -> u8 {
            WpccrAbsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WpccrAdmode {
        #[doc = "no address"]
        B_0X0 = 0x0,
        #[doc = "address on a single line"]
        B_0X1 = 0x01,
        #[doc = "address on two lines"]
        B_0X2 = 0x02,
        #[doc = "address on four lines"]
        B_0X3 = 0x03,
        #[doc = "address on eight lines"]
        B_0X4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl WpccrAdmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WpccrAdmode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WpccrAdmode {
        #[inline(always)]
        fn from(val: u8) -> WpccrAdmode {
            WpccrAdmode::from_bits(val)
        }
    }
    impl From<WpccrAdmode> for u8 {
        #[inline(always)]
        fn from(val: WpccrAdmode) -> u8 {
            WpccrAdmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WpccrAdsize {
        #[doc = "8-bit address"]
        B_0X0 = 0x0,
        #[doc = "16-bit address"]
        B_0X1 = 0x01,
        #[doc = "24-bit address"]
        B_0X2 = 0x02,
        #[doc = "32-bit address"]
        B_0X3 = 0x03,
    }
    impl WpccrAdsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WpccrAdsize {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WpccrAdsize {
        #[inline(always)]
        fn from(val: u8) -> WpccrAdsize {
            WpccrAdsize::from_bits(val)
        }
    }
    impl From<WpccrAdsize> for u8 {
        #[inline(always)]
        fn from(val: WpccrAdsize) -> u8 {
            WpccrAdsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WpccrDmode {
        #[doc = "no data"]
        B_0X0 = 0x0,
        #[doc = "data on a single line"]
        B_0X1 = 0x01,
        #[doc = "data on two lines"]
        B_0X2 = 0x02,
        #[doc = "data on four lines"]
        B_0X3 = 0x03,
        #[doc = "data on eight lines"]
        B_0X4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl WpccrDmode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WpccrDmode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WpccrDmode {
        #[inline(always)]
        fn from(val: u8) -> WpccrDmode {
            WpccrDmode::from_bits(val)
        }
    }
    impl From<WpccrDmode> for u8 {
        #[inline(always)]
        fn from(val: WpccrDmode) -> u8 {
            WpccrDmode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WpccrImode {
        #[doc = "no instruction"]
        B_0X0 = 0x0,
        #[doc = "instruction on a single line"]
        B_0X1 = 0x01,
        #[doc = "instruction on two lines"]
        B_0X2 = 0x02,
        #[doc = "instruction on four lines"]
        B_0X3 = 0x03,
        #[doc = "instruction on eight lines"]
        B_0X4 = 0x04,
        _RESERVED_5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl WpccrImode {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WpccrImode {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WpccrImode {
        #[inline(always)]
        fn from(val: u8) -> WpccrImode {
            WpccrImode::from_bits(val)
        }
    }
    impl From<WpccrImode> for u8 {
        #[inline(always)]
        fn from(val: WpccrImode) -> u8 {
            WpccrImode::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum WpccrIsize {
        #[doc = "8-bit instruction"]
        B_0X0 = 0x0,
        #[doc = "16-bit instruction"]
        B_0X1 = 0x01,
        #[doc = "24-bit instruction"]
        B_0X2 = 0x02,
        #[doc = "32-bit instruction"]
        B_0X3 = 0x03,
    }
    impl WpccrIsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> WpccrIsize {
            unsafe { core::mem::transmute(val & 0x03) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for WpccrIsize {
        #[inline(always)]
        fn from(val: u8) -> WpccrIsize {
            WpccrIsize::from_bits(val)
        }
    }
    impl From<WpccrIsize> for u8 {
        #[inline(always)]
        fn from(val: WpccrIsize) -> u8 {
            WpccrIsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Wrapsize {
        #[doc = "wrapped reads are not supported by the memory."]
        B_0X0 = 0x0,
        _RESERVED_1 = 0x01,
        #[doc = "external memory supports wrap size of 16 bytes."]
        B_0X2 = 0x02,
        #[doc = "external memory supports wrap size of 32 bytes."]
        B_0X3 = 0x03,
        #[doc = "external memory supports wrap size of 64 bytes."]
        B_0X4 = 0x04,
        #[doc = "external memory supports wrap size of 128 bytes."]
        B_0X5 = 0x05,
        _RESERVED_6 = 0x06,
        _RESERVED_7 = 0x07,
    }
    impl Wrapsize {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Wrapsize {
            unsafe { core::mem::transmute(val & 0x07) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Wrapsize {
        #[inline(always)]
        fn from(val: u8) -> Wrapsize {
            Wrapsize::from_bits(val)
        }
    }
    impl From<Wrapsize> for u8 {
        #[inline(always)]
        fn from(val: Wrapsize) -> u8 {
            Wrapsize::to_bits(val)
        }
    }
    #[repr(u8)]
    #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
    #[cfg_attr(feature = "defmt", derive(defmt::Format))]
    pub enum Wzl {
        #[doc = "latency on write accesses"]
        B_0X0 = 0x0,
        #[doc = "no latency on write accesses"]
        B_0X1 = 0x01,
    }
    impl Wzl {
        #[inline(always)]
        pub const fn from_bits(val: u8) -> Wzl {
            unsafe { core::mem::transmute(val & 0x01) }
        }
        #[inline(always)]
        pub const fn to_bits(self) -> u8 {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl From<u8> for Wzl {
        #[inline(always)]
        fn from(val: u8) -> Wzl {
            Wzl::from_bits(val)
        }
    }
    impl From<Wzl> for u8 {
        #[inline(always)]
        fn from(val: Wzl) -> u8 {
            Wzl::to_bits(val)
        }
    }
}