summaryrefslogtreecommitdiff
path: root/tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/device/device/MK64F12/MK64F12_mpu.h
blob: 15691ba17ba9d8a81dd7422f65c9df64ddf7beb8 (plain)
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
/*
** ###################################################################
**     Compilers:           Keil ARM C/C++ Compiler
**                          Freescale C/C++ for Embedded ARM
**                          GNU C Compiler
**                          IAR ANSI C/C++ Compiler for ARM
**
**     Reference manual:    K64P144M120SF5RM, Rev.2, January 2014
**     Version:             rev. 2.5, 2014-02-10
**     Build:               b140604
**
**     Abstract:
**         Extension to the CMSIS register access layer header.
**
**     Copyright (c) 2014 Freescale Semiconductor, Inc.
**     All rights reserved.
**
**     Redistribution and use in source and binary forms, with or without modification,
**     are permitted provided that the following conditions are met:
**
**     o Redistributions of source code must retain the above copyright notice, this list
**       of conditions and the following disclaimer.
**
**     o Redistributions in binary form must reproduce the above copyright notice, this
**       list of conditions and the following disclaimer in the documentation and/or
**       other materials provided with the distribution.
**
**     o Neither the name of Freescale Semiconductor, Inc. nor the names of its
**       contributors may be used to endorse or promote products derived from this
**       software without specific prior written permission.
**
**     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
**     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
**     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
**     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
**     ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
**     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
**     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
**     ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
**     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
**     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
**     http:                 www.freescale.com
**     mail:                 support@freescale.com
**
**     Revisions:
**     - rev. 1.0 (2013-08-12)
**         Initial version.
**     - rev. 2.0 (2013-10-29)
**         Register accessor macros added to the memory map.
**         Symbols for Processor Expert memory map compatibility added to the memory map.
**         Startup file for gcc has been updated according to CMSIS 3.2.
**         System initialization updated.
**         MCG - registers updated.
**         PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
**     - rev. 2.1 (2013-10-30)
**         Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
**     - rev. 2.2 (2013-12-09)
**         DMA - EARS register removed.
**         AIPS0, AIPS1 - MPRA register updated.
**     - rev. 2.3 (2014-01-24)
**         Update according to reference manual rev. 2
**         ENET, MCG, MCM, SIM, USB - registers updated
**     - rev. 2.4 (2014-02-10)
**         The declaration of clock configurations has been moved to separate header file system_MK64F12.h
**         Update of SystemInit() and SystemCoreClockUpdate() functions.
**     - rev. 2.5 (2014-02-10)
**         The declaration of clock configurations has been moved to separate header file system_MK64F12.h
**         Update of SystemInit() and SystemCoreClockUpdate() functions.
**         Module access macro module_BASES replaced by module_BASE_PTRS.
**
** ###################################################################
*/

/*
 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
 *
 * This file was generated automatically and any changes may be lost.
 */
#ifndef __HW_MPU_REGISTERS_H__
#define __HW_MPU_REGISTERS_H__

#include "MK64F12.h"
#include "fsl_bitaccess.h"

/*
 * MK64F12 MPU
 *
 * Memory protection unit
 *
 * Registers defined in this header file:
 * - HW_MPU_CESR - Control/Error Status Register
 * - HW_MPU_EARn - Error Address Register, slave port n
 * - HW_MPU_EDRn - Error Detail Register, slave port n
 * - HW_MPU_RGDn_WORD0 - Region Descriptor n, Word 0
 * - HW_MPU_RGDn_WORD1 - Region Descriptor n, Word 1
 * - HW_MPU_RGDn_WORD2 - Region Descriptor n, Word 2
 * - HW_MPU_RGDn_WORD3 - Region Descriptor n, Word 3
 * - HW_MPU_RGDAACn - Region Descriptor Alternate Access Control n
 *
 * - hw_mpu_t - Struct containing all module registers.
 */

#define HW_MPU_INSTANCE_COUNT (1U) /*!< Number of instances of the MPU module. */

/*******************************************************************************
 * HW_MPU_CESR - Control/Error Status Register
 ******************************************************************************/

/*!
 * @brief HW_MPU_CESR - Control/Error Status Register (RW)
 *
 * Reset value: 0x00815101U
 */
typedef union _hw_mpu_cesr
{
    uint32_t U;
    struct _hw_mpu_cesr_bitfields
    {
        uint32_t VLD : 1;              /*!< [0] Valid */
        uint32_t RESERVED0 : 7;        /*!< [7:1]  */
        uint32_t NRGD : 4;             /*!< [11:8] Number Of Region Descriptors */
        uint32_t NSP : 4;              /*!< [15:12] Number Of Slave Ports */
        uint32_t HRL : 4;              /*!< [19:16] Hardware Revision Level */
        uint32_t RESERVED1 : 7;        /*!< [26:20]  */
        uint32_t SPERR : 5;            /*!< [31:27] Slave Port n Error */
    } B;
} hw_mpu_cesr_t;

/*!
 * @name Constants and macros for entire MPU_CESR register
 */
/*@{*/
#define HW_MPU_CESR_ADDR(x)      ((x) + 0x0U)

#define HW_MPU_CESR(x)           (*(__IO hw_mpu_cesr_t *) HW_MPU_CESR_ADDR(x))
#define HW_MPU_CESR_RD(x)        (HW_MPU_CESR(x).U)
#define HW_MPU_CESR_WR(x, v)     (HW_MPU_CESR(x).U = (v))
#define HW_MPU_CESR_SET(x, v)    (HW_MPU_CESR_WR(x, HW_MPU_CESR_RD(x) |  (v)))
#define HW_MPU_CESR_CLR(x, v)    (HW_MPU_CESR_WR(x, HW_MPU_CESR_RD(x) & ~(v)))
#define HW_MPU_CESR_TOG(x, v)    (HW_MPU_CESR_WR(x, HW_MPU_CESR_RD(x) ^  (v)))
/*@}*/

/*
 * Constants & macros for individual MPU_CESR bitfields
 */

/*!
 * @name Register MPU_CESR, field VLD[0] (RW)
 *
 * Global enable/disable for the MPU.
 *
 * Values:
 * - 0 - MPU is disabled. All accesses from all bus masters are allowed.
 * - 1 - MPU is enabled
 */
/*@{*/
#define BP_MPU_CESR_VLD      (0U)          /*!< Bit position for MPU_CESR_VLD. */
#define BM_MPU_CESR_VLD      (0x00000001U) /*!< Bit mask for MPU_CESR_VLD. */
#define BS_MPU_CESR_VLD      (1U)          /*!< Bit field size in bits for MPU_CESR_VLD. */

/*! @brief Read current value of the MPU_CESR_VLD field. */
#define BR_MPU_CESR_VLD(x)   (BITBAND_ACCESS32(HW_MPU_CESR_ADDR(x), BP_MPU_CESR_VLD))

/*! @brief Format value for bitfield MPU_CESR_VLD. */
#define BF_MPU_CESR_VLD(v)   ((uint32_t)((uint32_t)(v) << BP_MPU_CESR_VLD) & BM_MPU_CESR_VLD)

/*! @brief Set the VLD field to a new value. */
#define BW_MPU_CESR_VLD(x, v) (BITBAND_ACCESS32(HW_MPU_CESR_ADDR(x), BP_MPU_CESR_VLD) = (v))
/*@}*/

/*!
 * @name Register MPU_CESR, field NRGD[11:8] (RO)
 *
 * Indicates the number of region descriptors implemented in the MPU.
 *
 * Values:
 * - 0000 - 8 region descriptors
 * - 0001 - 12 region descriptors
 * - 0010 - 16 region descriptors
 */
/*@{*/
#define BP_MPU_CESR_NRGD     (8U)          /*!< Bit position for MPU_CESR_NRGD. */
#define BM_MPU_CESR_NRGD     (0x00000F00U) /*!< Bit mask for MPU_CESR_NRGD. */
#define BS_MPU_CESR_NRGD     (4U)          /*!< Bit field size in bits for MPU_CESR_NRGD. */

/*! @brief Read current value of the MPU_CESR_NRGD field. */
#define BR_MPU_CESR_NRGD(x)  (HW_MPU_CESR(x).B.NRGD)
/*@}*/

/*!
 * @name Register MPU_CESR, field NSP[15:12] (RO)
 *
 * Specifies the number of slave ports connected to the MPU.
 */
/*@{*/
#define BP_MPU_CESR_NSP      (12U)         /*!< Bit position for MPU_CESR_NSP. */
#define BM_MPU_CESR_NSP      (0x0000F000U) /*!< Bit mask for MPU_CESR_NSP. */
#define BS_MPU_CESR_NSP      (4U)          /*!< Bit field size in bits for MPU_CESR_NSP. */

/*! @brief Read current value of the MPU_CESR_NSP field. */
#define BR_MPU_CESR_NSP(x)   (HW_MPU_CESR(x).B.NSP)
/*@}*/

/*!
 * @name Register MPU_CESR, field HRL[19:16] (RO)
 *
 * Specifies the MPU's hardware and definition revision level. It can be read by
 * software to determine the functional definition of the module.
 */
/*@{*/
#define BP_MPU_CESR_HRL      (16U)         /*!< Bit position for MPU_CESR_HRL. */
#define BM_MPU_CESR_HRL      (0x000F0000U) /*!< Bit mask for MPU_CESR_HRL. */
#define BS_MPU_CESR_HRL      (4U)          /*!< Bit field size in bits for MPU_CESR_HRL. */

/*! @brief Read current value of the MPU_CESR_HRL field. */
#define BR_MPU_CESR_HRL(x)   (HW_MPU_CESR(x).B.HRL)
/*@}*/

/*!
 * @name Register MPU_CESR, field SPERR[31:27] (W1C)
 *
 * Indicates a captured error in EARn and EDRn. This bit is set when the
 * hardware detects an error and records the faulting address and attributes. It is
 * cleared by writing one to it. If another error is captured at the exact same cycle
 * as the write, the flag remains set. A find-first-one instruction or
 * equivalent can detect the presence of a captured error. The following shows the
 * correspondence between the bit number and slave port number: Bit 31 corresponds to
 * slave port 0. Bit 30 corresponds to slave port 1. Bit 29 corresponds to slave
 * port 2. Bit 28 corresponds to slave port 3. Bit 27 corresponds to slave port 4.
 *
 * Values:
 * - 0 - No error has occurred for slave port n.
 * - 1 - An error has occurred for slave port n.
 */
/*@{*/
#define BP_MPU_CESR_SPERR    (27U)         /*!< Bit position for MPU_CESR_SPERR. */
#define BM_MPU_CESR_SPERR    (0xF8000000U) /*!< Bit mask for MPU_CESR_SPERR. */
#define BS_MPU_CESR_SPERR    (5U)          /*!< Bit field size in bits for MPU_CESR_SPERR. */

/*! @brief Read current value of the MPU_CESR_SPERR field. */
#define BR_MPU_CESR_SPERR(x) (HW_MPU_CESR(x).B.SPERR)

/*! @brief Format value for bitfield MPU_CESR_SPERR. */
#define BF_MPU_CESR_SPERR(v) ((uint32_t)((uint32_t)(v) << BP_MPU_CESR_SPERR) & BM_MPU_CESR_SPERR)

/*! @brief Set the SPERR field to a new value. */
#define BW_MPU_CESR_SPERR(x, v) (HW_MPU_CESR_WR(x, (HW_MPU_CESR_RD(x) & ~BM_MPU_CESR_SPERR) | BF_MPU_CESR_SPERR(v)))
/*@}*/

/*******************************************************************************
 * HW_MPU_EARn - Error Address Register, slave port n
 ******************************************************************************/

/*!
 * @brief HW_MPU_EARn - Error Address Register, slave port n (RO)
 *
 * Reset value: 0x00000000U
 *
 * When the MPU detects an access error on slave port n, the 32-bit reference
 * address is captured in this read-only register and the corresponding bit in
 * CESR[SPERR] set. Additional information about the faulting access is captured in
 * the corresponding EDRn at the same time. This register and the corresponding
 * EDRn contain the most recent access error; there are no hardware interlocks with
 * CESR[SPERR], as the error registers are always loaded upon the occurrence of
 * each protection violation.
 */
typedef union _hw_mpu_earn
{
    uint32_t U;
    struct _hw_mpu_earn_bitfields
    {
        uint32_t EADDR : 32;           /*!< [31:0] Error Address */
    } B;
} hw_mpu_earn_t;

/*!
 * @name Constants and macros for entire MPU_EARn register
 */
/*@{*/
#define HW_MPU_EARn_COUNT (5U)

#define HW_MPU_EARn_ADDR(x, n)   ((x) + 0x10U + (0x8U * (n)))

#define HW_MPU_EARn(x, n)        (*(__I hw_mpu_earn_t *) HW_MPU_EARn_ADDR(x, n))
#define HW_MPU_EARn_RD(x, n)     (HW_MPU_EARn(x, n).U)
/*@}*/

/*
 * Constants & macros for individual MPU_EARn bitfields
 */

/*!
 * @name Register MPU_EARn, field EADDR[31:0] (RO)
 *
 * Indicates the reference address from slave port n that generated the access
 * error
 */
/*@{*/
#define BP_MPU_EARn_EADDR    (0U)          /*!< Bit position for MPU_EARn_EADDR. */
#define BM_MPU_EARn_EADDR    (0xFFFFFFFFU) /*!< Bit mask for MPU_EARn_EADDR. */
#define BS_MPU_EARn_EADDR    (32U)         /*!< Bit field size in bits for MPU_EARn_EADDR. */

/*! @brief Read current value of the MPU_EARn_EADDR field. */
#define BR_MPU_EARn_EADDR(x, n) (HW_MPU_EARn(x, n).U)
/*@}*/
/*******************************************************************************
 * HW_MPU_EDRn - Error Detail Register, slave port n
 ******************************************************************************/

/*!
 * @brief HW_MPU_EDRn - Error Detail Register, slave port n (RO)
 *
 * Reset value: 0x00000000U
 *
 * When the MPU detects an access error on slave port n, 32 bits of error detail
 * are captured in this read-only register and the corresponding bit in
 * CESR[SPERR] is set. Information on the faulting address is captured in the
 * corresponding EARn register at the same time. This register and the corresponding EARn
 * register contain the most recent access error; there are no hardware interlocks
 * with CESR[SPERR] as the error registers are always loaded upon the occurrence
 * of each protection violation.
 */
typedef union _hw_mpu_edrn
{
    uint32_t U;
    struct _hw_mpu_edrn_bitfields
    {
        uint32_t ERW : 1;              /*!< [0] Error Read/Write */
        uint32_t EATTR : 3;            /*!< [3:1] Error Attributes */
        uint32_t EMN : 4;              /*!< [7:4] Error Master Number */
        uint32_t EPID : 8;             /*!< [15:8] Error Process Identification */
        uint32_t EACD : 16;            /*!< [31:16] Error Access Control Detail */
    } B;
} hw_mpu_edrn_t;

/*!
 * @name Constants and macros for entire MPU_EDRn register
 */
/*@{*/
#define HW_MPU_EDRn_COUNT (5U)

#define HW_MPU_EDRn_ADDR(x, n)   ((x) + 0x14U + (0x8U * (n)))

#define HW_MPU_EDRn(x, n)        (*(__I hw_mpu_edrn_t *) HW_MPU_EDRn_ADDR(x, n))
#define HW_MPU_EDRn_RD(x, n)     (HW_MPU_EDRn(x, n).U)
/*@}*/

/*
 * Constants & macros for individual MPU_EDRn bitfields
 */

/*!
 * @name Register MPU_EDRn, field ERW[0] (RO)
 *
 * Indicates the access type of the faulting reference.
 *
 * Values:
 * - 0 - Read
 * - 1 - Write
 */
/*@{*/
#define BP_MPU_EDRn_ERW      (0U)          /*!< Bit position for MPU_EDRn_ERW. */
#define BM_MPU_EDRn_ERW      (0x00000001U) /*!< Bit mask for MPU_EDRn_ERW. */
#define BS_MPU_EDRn_ERW      (1U)          /*!< Bit field size in bits for MPU_EDRn_ERW. */

/*! @brief Read current value of the MPU_EDRn_ERW field. */
#define BR_MPU_EDRn_ERW(x, n) (BITBAND_ACCESS32(HW_MPU_EDRn_ADDR(x, n), BP_MPU_EDRn_ERW))
/*@}*/

/*!
 * @name Register MPU_EDRn, field EATTR[3:1] (RO)
 *
 * Indicates attribute information about the faulting reference. All other
 * encodings are reserved.
 *
 * Values:
 * - 000 - User mode, instruction access
 * - 001 - User mode, data access
 * - 010 - Supervisor mode, instruction access
 * - 011 - Supervisor mode, data access
 */
/*@{*/
#define BP_MPU_EDRn_EATTR    (1U)          /*!< Bit position for MPU_EDRn_EATTR. */
#define BM_MPU_EDRn_EATTR    (0x0000000EU) /*!< Bit mask for MPU_EDRn_EATTR. */
#define BS_MPU_EDRn_EATTR    (3U)          /*!< Bit field size in bits for MPU_EDRn_EATTR. */

/*! @brief Read current value of the MPU_EDRn_EATTR field. */
#define BR_MPU_EDRn_EATTR(x, n) (HW_MPU_EDRn(x, n).B.EATTR)
/*@}*/

/*!
 * @name Register MPU_EDRn, field EMN[7:4] (RO)
 *
 * Indicates the bus master that generated the access error.
 */
/*@{*/
#define BP_MPU_EDRn_EMN      (4U)          /*!< Bit position for MPU_EDRn_EMN. */
#define BM_MPU_EDRn_EMN      (0x000000F0U) /*!< Bit mask for MPU_EDRn_EMN. */
#define BS_MPU_EDRn_EMN      (4U)          /*!< Bit field size in bits for MPU_EDRn_EMN. */

/*! @brief Read current value of the MPU_EDRn_EMN field. */
#define BR_MPU_EDRn_EMN(x, n) (HW_MPU_EDRn(x, n).B.EMN)
/*@}*/

/*!
 * @name Register MPU_EDRn, field EPID[15:8] (RO)
 *
 * Records the process identifier of the faulting reference. The process
 * identifier is typically driven only by processor cores; for other bus masters, this
 * field is cleared.
 */
/*@{*/
#define BP_MPU_EDRn_EPID     (8U)          /*!< Bit position for MPU_EDRn_EPID. */
#define BM_MPU_EDRn_EPID     (0x0000FF00U) /*!< Bit mask for MPU_EDRn_EPID. */
#define BS_MPU_EDRn_EPID     (8U)          /*!< Bit field size in bits for MPU_EDRn_EPID. */

/*! @brief Read current value of the MPU_EDRn_EPID field. */
#define BR_MPU_EDRn_EPID(x, n) (HW_MPU_EDRn(x, n).B.EPID)
/*@}*/

/*!
 * @name Register MPU_EDRn, field EACD[31:16] (RO)
 *
 * Indicates the region descriptor with the access error. If EDRn contains a
 * captured error and EACD is cleared, an access did not hit in any region
 * descriptor. If only a single EACD bit is set, the protection error was caused by a
 * single non-overlapping region descriptor. If two or more EACD bits are set, the
 * protection error was caused by an overlapping set of region descriptors.
 */
/*@{*/
#define BP_MPU_EDRn_EACD     (16U)         /*!< Bit position for MPU_EDRn_EACD. */
#define BM_MPU_EDRn_EACD     (0xFFFF0000U) /*!< Bit mask for MPU_EDRn_EACD. */
#define BS_MPU_EDRn_EACD     (16U)         /*!< Bit field size in bits for MPU_EDRn_EACD. */

/*! @brief Read current value of the MPU_EDRn_EACD field. */
#define BR_MPU_EDRn_EACD(x, n) (HW_MPU_EDRn(x, n).B.EACD)
/*@}*/

/*******************************************************************************
 * HW_MPU_RGDn_WORD0 - Region Descriptor n, Word 0
 ******************************************************************************/

/*!
 * @brief HW_MPU_RGDn_WORD0 - Region Descriptor n, Word 0 (RW)
 *
 * Reset value: 0x00000000U
 *
 * The first word of the region descriptor defines the 0-modulo-32 byte start
 * address of the memory region. Writes to this register clear the region
 * descriptor's valid bit (RGDn_WORD3[VLD]).
 */
typedef union _hw_mpu_rgdn_word0
{
    uint32_t U;
    struct _hw_mpu_rgdn_word0_bitfields
    {
        uint32_t RESERVED0 : 5;        /*!< [4:0]  */
        uint32_t SRTADDR : 27;         /*!< [31:5] Start Address */
    } B;
} hw_mpu_rgdn_word0_t;

/*!
 * @name Constants and macros for entire MPU_RGDn_WORD0 register
 */
/*@{*/
#define HW_MPU_RGDn_WORD0_COUNT (12U)

#define HW_MPU_RGDn_WORD0_ADDR(x, n) ((x) + 0x400U + (0x10U * (n)))

#define HW_MPU_RGDn_WORD0(x, n)  (*(__IO hw_mpu_rgdn_word0_t *) HW_MPU_RGDn_WORD0_ADDR(x, n))
#define HW_MPU_RGDn_WORD0_RD(x, n) (HW_MPU_RGDn_WORD0(x, n).U)
#define HW_MPU_RGDn_WORD0_WR(x, n, v) (HW_MPU_RGDn_WORD0(x, n).U = (v))
#define HW_MPU_RGDn_WORD0_SET(x, n, v) (HW_MPU_RGDn_WORD0_WR(x, n, HW_MPU_RGDn_WORD0_RD(x, n) |  (v)))
#define HW_MPU_RGDn_WORD0_CLR(x, n, v) (HW_MPU_RGDn_WORD0_WR(x, n, HW_MPU_RGDn_WORD0_RD(x, n) & ~(v)))
#define HW_MPU_RGDn_WORD0_TOG(x, n, v) (HW_MPU_RGDn_WORD0_WR(x, n, HW_MPU_RGDn_WORD0_RD(x, n) ^  (v)))
/*@}*/

/*
 * Constants & macros for individual MPU_RGDn_WORD0 bitfields
 */

/*!
 * @name Register MPU_RGDn_WORD0, field SRTADDR[31:5] (RW)
 *
 * Defines the most significant bits of the 0-modulo-32 byte start address of
 * the memory region.
 */
/*@{*/
#define BP_MPU_RGDn_WORD0_SRTADDR (5U)     /*!< Bit position for MPU_RGDn_WORD0_SRTADDR. */
#define BM_MPU_RGDn_WORD0_SRTADDR (0xFFFFFFE0U) /*!< Bit mask for MPU_RGDn_WORD0_SRTADDR. */
#define BS_MPU_RGDn_WORD0_SRTADDR (27U)    /*!< Bit field size in bits for MPU_RGDn_WORD0_SRTADDR. */

/*! @brief Read current value of the MPU_RGDn_WORD0_SRTADDR field. */
#define BR_MPU_RGDn_WORD0_SRTADDR(x, n) (HW_MPU_RGDn_WORD0(x, n).B.SRTADDR)

/*! @brief Format value for bitfield MPU_RGDn_WORD0_SRTADDR. */
#define BF_MPU_RGDn_WORD0_SRTADDR(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD0_SRTADDR) & BM_MPU_RGDn_WORD0_SRTADDR)

/*! @brief Set the SRTADDR field to a new value. */
#define BW_MPU_RGDn_WORD0_SRTADDR(x, n, v) (HW_MPU_RGDn_WORD0_WR(x, n, (HW_MPU_RGDn_WORD0_RD(x, n) & ~BM_MPU_RGDn_WORD0_SRTADDR) | BF_MPU_RGDn_WORD0_SRTADDR(v)))
/*@}*/
/*******************************************************************************
 * HW_MPU_RGDn_WORD1 - Region Descriptor n, Word 1
 ******************************************************************************/

/*!
 * @brief HW_MPU_RGDn_WORD1 - Region Descriptor n, Word 1 (RW)
 *
 * Reset value: 0xFFFFFFFFU
 *
 * The second word of the region descriptor defines the 31-modulo-32 byte end
 * address of the memory region. Writes to this register clear the region
 * descriptor's valid bit (RGDn_WORD3[VLD]).
 */
typedef union _hw_mpu_rgdn_word1
{
    uint32_t U;
    struct _hw_mpu_rgdn_word1_bitfields
    {
        uint32_t RESERVED0 : 5;        /*!< [4:0]  */
        uint32_t ENDADDR : 27;         /*!< [31:5] End Address */
    } B;
} hw_mpu_rgdn_word1_t;

/*!
 * @name Constants and macros for entire MPU_RGDn_WORD1 register
 */
/*@{*/
#define HW_MPU_RGDn_WORD1_COUNT (12U)

#define HW_MPU_RGDn_WORD1_ADDR(x, n) ((x) + 0x404U + (0x10U * (n)))

#define HW_MPU_RGDn_WORD1(x, n)  (*(__IO hw_mpu_rgdn_word1_t *) HW_MPU_RGDn_WORD1_ADDR(x, n))
#define HW_MPU_RGDn_WORD1_RD(x, n) (HW_MPU_RGDn_WORD1(x, n).U)
#define HW_MPU_RGDn_WORD1_WR(x, n, v) (HW_MPU_RGDn_WORD1(x, n).U = (v))
#define HW_MPU_RGDn_WORD1_SET(x, n, v) (HW_MPU_RGDn_WORD1_WR(x, n, HW_MPU_RGDn_WORD1_RD(x, n) |  (v)))
#define HW_MPU_RGDn_WORD1_CLR(x, n, v) (HW_MPU_RGDn_WORD1_WR(x, n, HW_MPU_RGDn_WORD1_RD(x, n) & ~(v)))
#define HW_MPU_RGDn_WORD1_TOG(x, n, v) (HW_MPU_RGDn_WORD1_WR(x, n, HW_MPU_RGDn_WORD1_RD(x, n) ^  (v)))
/*@}*/

/*
 * Constants & macros for individual MPU_RGDn_WORD1 bitfields
 */

/*!
 * @name Register MPU_RGDn_WORD1, field ENDADDR[31:5] (RW)
 *
 * Defines the most significant bits of the 31-modulo-32 byte end address of the
 * memory region. The MPU does not verify that ENDADDR >= SRTADDR.
 */
/*@{*/
#define BP_MPU_RGDn_WORD1_ENDADDR (5U)     /*!< Bit position for MPU_RGDn_WORD1_ENDADDR. */
#define BM_MPU_RGDn_WORD1_ENDADDR (0xFFFFFFE0U) /*!< Bit mask for MPU_RGDn_WORD1_ENDADDR. */
#define BS_MPU_RGDn_WORD1_ENDADDR (27U)    /*!< Bit field size in bits for MPU_RGDn_WORD1_ENDADDR. */

/*! @brief Read current value of the MPU_RGDn_WORD1_ENDADDR field. */
#define BR_MPU_RGDn_WORD1_ENDADDR(x, n) (HW_MPU_RGDn_WORD1(x, n).B.ENDADDR)

/*! @brief Format value for bitfield MPU_RGDn_WORD1_ENDADDR. */
#define BF_MPU_RGDn_WORD1_ENDADDR(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD1_ENDADDR) & BM_MPU_RGDn_WORD1_ENDADDR)

/*! @brief Set the ENDADDR field to a new value. */
#define BW_MPU_RGDn_WORD1_ENDADDR(x, n, v) (HW_MPU_RGDn_WORD1_WR(x, n, (HW_MPU_RGDn_WORD1_RD(x, n) & ~BM_MPU_RGDn_WORD1_ENDADDR) | BF_MPU_RGDn_WORD1_ENDADDR(v)))
/*@}*/
/*******************************************************************************
 * HW_MPU_RGDn_WORD2 - Region Descriptor n, Word 2
 ******************************************************************************/

/*!
 * @brief HW_MPU_RGDn_WORD2 - Region Descriptor n, Word 2 (RW)
 *
 * Reset value: 0x0061F7DFU
 *
 * The third word of the region descriptor defines the access control rights of
 * the memory region. The access control privileges depend on two broad
 * classifications of bus masters: Bus masters 0-3 have a 5-bit field defining separate
 * privilege rights for user and supervisor mode accesses, as well as the optional
 * inclusion of a process identification field within the definition. Bus masters
 * 4-7 are limited to separate read and write permissions. For the privilege
 * rights of bus masters 0-3, there are three flags associated with this function:
 * Read (r) refers to accessing the referenced memory address using an operand
 * (data) fetch Write (w) refers to updating the referenced memory address using a
 * store (data) instruction Execute (x) refers to reading the referenced memory
 * address using an instruction fetch Writes to RGDn_WORD2 clear the region
 * descriptor's valid bit (RGDn_WORD3[VLD]). If only updating the access controls, write
 * to RGDAACn instead because stores to these locations do not affect the
 * descriptor's valid bit.
 */
typedef union _hw_mpu_rgdn_word2
{
    uint32_t U;
    struct _hw_mpu_rgdn_word2_bitfields
    {
        uint32_t M0UM : 3;             /*!< [2:0] Bus Master 0 User Mode Access Control */
        uint32_t M0SM : 2;             /*!< [4:3] Bus Master 0 Supervisor Mode Access
                                        * Control */
        uint32_t M0PE : 1;             /*!< [5] Bus Master 0 Process Identifier enable */
        uint32_t M1UM : 3;             /*!< [8:6] Bus Master 1 User Mode Access Control */
        uint32_t M1SM : 2;             /*!< [10:9] Bus Master 1 Supervisor Mode Access
                                        * Control */
        uint32_t M1PE : 1;             /*!< [11] Bus Master 1 Process Identifier enable */
        uint32_t M2UM : 3;             /*!< [14:12] Bus Master 2 User Mode Access control
                                        * */
        uint32_t M2SM : 2;             /*!< [16:15] Bus Master 2 Supervisor Mode Access
                                        * Control */
        uint32_t M2PE : 1;             /*!< [17] Bus Master 2 Process Identifier Enable */
        uint32_t M3UM : 3;             /*!< [20:18] Bus Master 3 User Mode Access Control
                                        * */
        uint32_t M3SM : 2;             /*!< [22:21] Bus Master 3 Supervisor Mode Access
                                        * Control */
        uint32_t M3PE : 1;             /*!< [23] Bus Master 3 Process Identifier Enable */
        uint32_t M4WE : 1;             /*!< [24] Bus Master 4 Write Enable */
        uint32_t M4RE : 1;             /*!< [25] Bus Master 4 Read Enable */
        uint32_t M5WE : 1;             /*!< [26] Bus Master 5 Write Enable */
        uint32_t M5RE : 1;             /*!< [27] Bus Master 5 Read Enable */
        uint32_t M6WE : 1;             /*!< [28] Bus Master 6 Write Enable */
        uint32_t M6RE : 1;             /*!< [29] Bus Master 6 Read Enable */
        uint32_t M7WE : 1;             /*!< [30] Bus Master 7 Write Enable */
        uint32_t M7RE : 1;             /*!< [31] Bus Master 7 Read Enable */
    } B;
} hw_mpu_rgdn_word2_t;

/*!
 * @name Constants and macros for entire MPU_RGDn_WORD2 register
 */
/*@{*/
#define HW_MPU_RGDn_WORD2_COUNT (12U)

#define HW_MPU_RGDn_WORD2_ADDR(x, n) ((x) + 0x408U + (0x10U * (n)))

#define HW_MPU_RGDn_WORD2(x, n)  (*(__IO hw_mpu_rgdn_word2_t *) HW_MPU_RGDn_WORD2_ADDR(x, n))
#define HW_MPU_RGDn_WORD2_RD(x, n) (HW_MPU_RGDn_WORD2(x, n).U)
#define HW_MPU_RGDn_WORD2_WR(x, n, v) (HW_MPU_RGDn_WORD2(x, n).U = (v))
#define HW_MPU_RGDn_WORD2_SET(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, HW_MPU_RGDn_WORD2_RD(x, n) |  (v)))
#define HW_MPU_RGDn_WORD2_CLR(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, HW_MPU_RGDn_WORD2_RD(x, n) & ~(v)))
#define HW_MPU_RGDn_WORD2_TOG(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, HW_MPU_RGDn_WORD2_RD(x, n) ^  (v)))
/*@}*/

/*
 * Constants & macros for individual MPU_RGDn_WORD2 bitfields
 */

/*!
 * @name Register MPU_RGDn_WORD2, field M0UM[2:0] (RW)
 *
 * See M3UM description.
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M0UM (0U)        /*!< Bit position for MPU_RGDn_WORD2_M0UM. */
#define BM_MPU_RGDn_WORD2_M0UM (0x00000007U) /*!< Bit mask for MPU_RGDn_WORD2_M0UM. */
#define BS_MPU_RGDn_WORD2_M0UM (3U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M0UM. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M0UM field. */
#define BR_MPU_RGDn_WORD2_M0UM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M0UM)

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M0UM. */
#define BF_MPU_RGDn_WORD2_M0UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M0UM) & BM_MPU_RGDn_WORD2_M0UM)

/*! @brief Set the M0UM field to a new value. */
#define BW_MPU_RGDn_WORD2_M0UM(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, (HW_MPU_RGDn_WORD2_RD(x, n) & ~BM_MPU_RGDn_WORD2_M0UM) | BF_MPU_RGDn_WORD2_M0UM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M0SM[4:3] (RW)
 *
 * See M3SM description.
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M0SM (3U)        /*!< Bit position for MPU_RGDn_WORD2_M0SM. */
#define BM_MPU_RGDn_WORD2_M0SM (0x00000018U) /*!< Bit mask for MPU_RGDn_WORD2_M0SM. */
#define BS_MPU_RGDn_WORD2_M0SM (2U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M0SM. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M0SM field. */
#define BR_MPU_RGDn_WORD2_M0SM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M0SM)

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M0SM. */
#define BF_MPU_RGDn_WORD2_M0SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M0SM) & BM_MPU_RGDn_WORD2_M0SM)

/*! @brief Set the M0SM field to a new value. */
#define BW_MPU_RGDn_WORD2_M0SM(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, (HW_MPU_RGDn_WORD2_RD(x, n) & ~BM_MPU_RGDn_WORD2_M0SM) | BF_MPU_RGDn_WORD2_M0SM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M0PE[5] (RW)
 *
 * See M0PE description.
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M0PE (5U)        /*!< Bit position for MPU_RGDn_WORD2_M0PE. */
#define BM_MPU_RGDn_WORD2_M0PE (0x00000020U) /*!< Bit mask for MPU_RGDn_WORD2_M0PE. */
#define BS_MPU_RGDn_WORD2_M0PE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M0PE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M0PE field. */
#define BR_MPU_RGDn_WORD2_M0PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M0PE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M0PE. */
#define BF_MPU_RGDn_WORD2_M0PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M0PE) & BM_MPU_RGDn_WORD2_M0PE)

/*! @brief Set the M0PE field to a new value. */
#define BW_MPU_RGDn_WORD2_M0PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M0PE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M1UM[8:6] (RW)
 *
 * See M3UM description.
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M1UM (6U)        /*!< Bit position for MPU_RGDn_WORD2_M1UM. */
#define BM_MPU_RGDn_WORD2_M1UM (0x000001C0U) /*!< Bit mask for MPU_RGDn_WORD2_M1UM. */
#define BS_MPU_RGDn_WORD2_M1UM (3U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M1UM. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M1UM field. */
#define BR_MPU_RGDn_WORD2_M1UM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M1UM)

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M1UM. */
#define BF_MPU_RGDn_WORD2_M1UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M1UM) & BM_MPU_RGDn_WORD2_M1UM)

/*! @brief Set the M1UM field to a new value. */
#define BW_MPU_RGDn_WORD2_M1UM(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, (HW_MPU_RGDn_WORD2_RD(x, n) & ~BM_MPU_RGDn_WORD2_M1UM) | BF_MPU_RGDn_WORD2_M1UM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M1SM[10:9] (RW)
 *
 * See M3SM description.
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M1SM (9U)        /*!< Bit position for MPU_RGDn_WORD2_M1SM. */
#define BM_MPU_RGDn_WORD2_M1SM (0x00000600U) /*!< Bit mask for MPU_RGDn_WORD2_M1SM. */
#define BS_MPU_RGDn_WORD2_M1SM (2U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M1SM. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M1SM field. */
#define BR_MPU_RGDn_WORD2_M1SM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M1SM)

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M1SM. */
#define BF_MPU_RGDn_WORD2_M1SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M1SM) & BM_MPU_RGDn_WORD2_M1SM)

/*! @brief Set the M1SM field to a new value. */
#define BW_MPU_RGDn_WORD2_M1SM(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, (HW_MPU_RGDn_WORD2_RD(x, n) & ~BM_MPU_RGDn_WORD2_M1SM) | BF_MPU_RGDn_WORD2_M1SM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M1PE[11] (RW)
 *
 * See M3PE description.
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M1PE (11U)       /*!< Bit position for MPU_RGDn_WORD2_M1PE. */
#define BM_MPU_RGDn_WORD2_M1PE (0x00000800U) /*!< Bit mask for MPU_RGDn_WORD2_M1PE. */
#define BS_MPU_RGDn_WORD2_M1PE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M1PE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M1PE field. */
#define BR_MPU_RGDn_WORD2_M1PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M1PE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M1PE. */
#define BF_MPU_RGDn_WORD2_M1PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M1PE) & BM_MPU_RGDn_WORD2_M1PE)

/*! @brief Set the M1PE field to a new value. */
#define BW_MPU_RGDn_WORD2_M1PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M1PE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M2UM[14:12] (RW)
 *
 * See M3UM description.
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M2UM (12U)       /*!< Bit position for MPU_RGDn_WORD2_M2UM. */
#define BM_MPU_RGDn_WORD2_M2UM (0x00007000U) /*!< Bit mask for MPU_RGDn_WORD2_M2UM. */
#define BS_MPU_RGDn_WORD2_M2UM (3U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M2UM. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M2UM field. */
#define BR_MPU_RGDn_WORD2_M2UM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M2UM)

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M2UM. */
#define BF_MPU_RGDn_WORD2_M2UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M2UM) & BM_MPU_RGDn_WORD2_M2UM)

/*! @brief Set the M2UM field to a new value. */
#define BW_MPU_RGDn_WORD2_M2UM(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, (HW_MPU_RGDn_WORD2_RD(x, n) & ~BM_MPU_RGDn_WORD2_M2UM) | BF_MPU_RGDn_WORD2_M2UM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M2SM[16:15] (RW)
 *
 * See M3SM description.
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M2SM (15U)       /*!< Bit position for MPU_RGDn_WORD2_M2SM. */
#define BM_MPU_RGDn_WORD2_M2SM (0x00018000U) /*!< Bit mask for MPU_RGDn_WORD2_M2SM. */
#define BS_MPU_RGDn_WORD2_M2SM (2U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M2SM. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M2SM field. */
#define BR_MPU_RGDn_WORD2_M2SM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M2SM)

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M2SM. */
#define BF_MPU_RGDn_WORD2_M2SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M2SM) & BM_MPU_RGDn_WORD2_M2SM)

/*! @brief Set the M2SM field to a new value. */
#define BW_MPU_RGDn_WORD2_M2SM(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, (HW_MPU_RGDn_WORD2_RD(x, n) & ~BM_MPU_RGDn_WORD2_M2SM) | BF_MPU_RGDn_WORD2_M2SM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M2PE[17] (RW)
 *
 * See M3PE description.
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M2PE (17U)       /*!< Bit position for MPU_RGDn_WORD2_M2PE. */
#define BM_MPU_RGDn_WORD2_M2PE (0x00020000U) /*!< Bit mask for MPU_RGDn_WORD2_M2PE. */
#define BS_MPU_RGDn_WORD2_M2PE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M2PE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M2PE field. */
#define BR_MPU_RGDn_WORD2_M2PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M2PE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M2PE. */
#define BF_MPU_RGDn_WORD2_M2PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M2PE) & BM_MPU_RGDn_WORD2_M2PE)

/*! @brief Set the M2PE field to a new value. */
#define BW_MPU_RGDn_WORD2_M2PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M2PE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M3UM[20:18] (RW)
 *
 * Defines the access controls for bus master 3 in User mode. M3UM consists of
 * three independent bits, enabling read (r), write (w), and execute (x)
 * permissions.
 *
 * Values:
 * - 0 - An attempted access of that mode may be terminated with an access error
 *     (if not allowed by another descriptor) and the access not performed.
 * - 1 - Allows the given access type to occur
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M3UM (18U)       /*!< Bit position for MPU_RGDn_WORD2_M3UM. */
#define BM_MPU_RGDn_WORD2_M3UM (0x001C0000U) /*!< Bit mask for MPU_RGDn_WORD2_M3UM. */
#define BS_MPU_RGDn_WORD2_M3UM (3U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M3UM. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M3UM field. */
#define BR_MPU_RGDn_WORD2_M3UM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M3UM)

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M3UM. */
#define BF_MPU_RGDn_WORD2_M3UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M3UM) & BM_MPU_RGDn_WORD2_M3UM)

/*! @brief Set the M3UM field to a new value. */
#define BW_MPU_RGDn_WORD2_M3UM(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, (HW_MPU_RGDn_WORD2_RD(x, n) & ~BM_MPU_RGDn_WORD2_M3UM) | BF_MPU_RGDn_WORD2_M3UM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M3SM[22:21] (RW)
 *
 * Defines the access controls for bus master 3 in Supervisor mode.
 *
 * Values:
 * - 00 - r/w/x; read, write and execute allowed
 * - 01 - r/x; read and execute allowed, but no write
 * - 10 - r/w; read and write allowed, but no execute
 * - 11 - Same as User mode defined in M3UM
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M3SM (21U)       /*!< Bit position for MPU_RGDn_WORD2_M3SM. */
#define BM_MPU_RGDn_WORD2_M3SM (0x00600000U) /*!< Bit mask for MPU_RGDn_WORD2_M3SM. */
#define BS_MPU_RGDn_WORD2_M3SM (2U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M3SM. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M3SM field. */
#define BR_MPU_RGDn_WORD2_M3SM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M3SM)

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M3SM. */
#define BF_MPU_RGDn_WORD2_M3SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M3SM) & BM_MPU_RGDn_WORD2_M3SM)

/*! @brief Set the M3SM field to a new value. */
#define BW_MPU_RGDn_WORD2_M3SM(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, (HW_MPU_RGDn_WORD2_RD(x, n) & ~BM_MPU_RGDn_WORD2_M3SM) | BF_MPU_RGDn_WORD2_M3SM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M3PE[23] (RW)
 *
 * Values:
 * - 0 - Do not include the process identifier in the evaluation
 * - 1 - Include the process identifier and mask (RGDn_WORD3) in the region hit
 *     evaluation
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M3PE (23U)       /*!< Bit position for MPU_RGDn_WORD2_M3PE. */
#define BM_MPU_RGDn_WORD2_M3PE (0x00800000U) /*!< Bit mask for MPU_RGDn_WORD2_M3PE. */
#define BS_MPU_RGDn_WORD2_M3PE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M3PE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M3PE field. */
#define BR_MPU_RGDn_WORD2_M3PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M3PE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M3PE. */
#define BF_MPU_RGDn_WORD2_M3PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M3PE) & BM_MPU_RGDn_WORD2_M3PE)

/*! @brief Set the M3PE field to a new value. */
#define BW_MPU_RGDn_WORD2_M3PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M3PE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M4WE[24] (RW)
 *
 * Values:
 * - 0 - Bus master 4 writes terminate with an access error and the write is not
 *     performed
 * - 1 - Bus master 4 writes allowed
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M4WE (24U)       /*!< Bit position for MPU_RGDn_WORD2_M4WE. */
#define BM_MPU_RGDn_WORD2_M4WE (0x01000000U) /*!< Bit mask for MPU_RGDn_WORD2_M4WE. */
#define BS_MPU_RGDn_WORD2_M4WE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M4WE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M4WE field. */
#define BR_MPU_RGDn_WORD2_M4WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M4WE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M4WE. */
#define BF_MPU_RGDn_WORD2_M4WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M4WE) & BM_MPU_RGDn_WORD2_M4WE)

/*! @brief Set the M4WE field to a new value. */
#define BW_MPU_RGDn_WORD2_M4WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M4WE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M4RE[25] (RW)
 *
 * Values:
 * - 0 - Bus master 4 reads terminate with an access error and the read is not
 *     performed
 * - 1 - Bus master 4 reads allowed
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M4RE (25U)       /*!< Bit position for MPU_RGDn_WORD2_M4RE. */
#define BM_MPU_RGDn_WORD2_M4RE (0x02000000U) /*!< Bit mask for MPU_RGDn_WORD2_M4RE. */
#define BS_MPU_RGDn_WORD2_M4RE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M4RE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M4RE field. */
#define BR_MPU_RGDn_WORD2_M4RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M4RE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M4RE. */
#define BF_MPU_RGDn_WORD2_M4RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M4RE) & BM_MPU_RGDn_WORD2_M4RE)

/*! @brief Set the M4RE field to a new value. */
#define BW_MPU_RGDn_WORD2_M4RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M4RE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M5WE[26] (RW)
 *
 * Values:
 * - 0 - Bus master 5 writes terminate with an access error and the write is not
 *     performed
 * - 1 - Bus master 5 writes allowed
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M5WE (26U)       /*!< Bit position for MPU_RGDn_WORD2_M5WE. */
#define BM_MPU_RGDn_WORD2_M5WE (0x04000000U) /*!< Bit mask for MPU_RGDn_WORD2_M5WE. */
#define BS_MPU_RGDn_WORD2_M5WE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M5WE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M5WE field. */
#define BR_MPU_RGDn_WORD2_M5WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M5WE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M5WE. */
#define BF_MPU_RGDn_WORD2_M5WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M5WE) & BM_MPU_RGDn_WORD2_M5WE)

/*! @brief Set the M5WE field to a new value. */
#define BW_MPU_RGDn_WORD2_M5WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M5WE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M5RE[27] (RW)
 *
 * Values:
 * - 0 - Bus master 5 reads terminate with an access error and the read is not
 *     performed
 * - 1 - Bus master 5 reads allowed
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M5RE (27U)       /*!< Bit position for MPU_RGDn_WORD2_M5RE. */
#define BM_MPU_RGDn_WORD2_M5RE (0x08000000U) /*!< Bit mask for MPU_RGDn_WORD2_M5RE. */
#define BS_MPU_RGDn_WORD2_M5RE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M5RE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M5RE field. */
#define BR_MPU_RGDn_WORD2_M5RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M5RE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M5RE. */
#define BF_MPU_RGDn_WORD2_M5RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M5RE) & BM_MPU_RGDn_WORD2_M5RE)

/*! @brief Set the M5RE field to a new value. */
#define BW_MPU_RGDn_WORD2_M5RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M5RE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M6WE[28] (RW)
 *
 * Values:
 * - 0 - Bus master 6 writes terminate with an access error and the write is not
 *     performed
 * - 1 - Bus master 6 writes allowed
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M6WE (28U)       /*!< Bit position for MPU_RGDn_WORD2_M6WE. */
#define BM_MPU_RGDn_WORD2_M6WE (0x10000000U) /*!< Bit mask for MPU_RGDn_WORD2_M6WE. */
#define BS_MPU_RGDn_WORD2_M6WE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M6WE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M6WE field. */
#define BR_MPU_RGDn_WORD2_M6WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M6WE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M6WE. */
#define BF_MPU_RGDn_WORD2_M6WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M6WE) & BM_MPU_RGDn_WORD2_M6WE)

/*! @brief Set the M6WE field to a new value. */
#define BW_MPU_RGDn_WORD2_M6WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M6WE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M6RE[29] (RW)
 *
 * Values:
 * - 0 - Bus master 6 reads terminate with an access error and the read is not
 *     performed
 * - 1 - Bus master 6 reads allowed
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M6RE (29U)       /*!< Bit position for MPU_RGDn_WORD2_M6RE. */
#define BM_MPU_RGDn_WORD2_M6RE (0x20000000U) /*!< Bit mask for MPU_RGDn_WORD2_M6RE. */
#define BS_MPU_RGDn_WORD2_M6RE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M6RE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M6RE field. */
#define BR_MPU_RGDn_WORD2_M6RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M6RE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M6RE. */
#define BF_MPU_RGDn_WORD2_M6RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M6RE) & BM_MPU_RGDn_WORD2_M6RE)

/*! @brief Set the M6RE field to a new value. */
#define BW_MPU_RGDn_WORD2_M6RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M6RE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M7WE[30] (RW)
 *
 * Values:
 * - 0 - Bus master 7 writes terminate with an access error and the write is not
 *     performed
 * - 1 - Bus master 7 writes allowed
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M7WE (30U)       /*!< Bit position for MPU_RGDn_WORD2_M7WE. */
#define BM_MPU_RGDn_WORD2_M7WE (0x40000000U) /*!< Bit mask for MPU_RGDn_WORD2_M7WE. */
#define BS_MPU_RGDn_WORD2_M7WE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M7WE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M7WE field. */
#define BR_MPU_RGDn_WORD2_M7WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M7WE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M7WE. */
#define BF_MPU_RGDn_WORD2_M7WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M7WE) & BM_MPU_RGDn_WORD2_M7WE)

/*! @brief Set the M7WE field to a new value. */
#define BW_MPU_RGDn_WORD2_M7WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M7WE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD2, field M7RE[31] (RW)
 *
 * Values:
 * - 0 - Bus master 7 reads terminate with an access error and the read is not
 *     performed
 * - 1 - Bus master 7 reads allowed
 */
/*@{*/
#define BP_MPU_RGDn_WORD2_M7RE (31U)       /*!< Bit position for MPU_RGDn_WORD2_M7RE. */
#define BM_MPU_RGDn_WORD2_M7RE (0x80000000U) /*!< Bit mask for MPU_RGDn_WORD2_M7RE. */
#define BS_MPU_RGDn_WORD2_M7RE (1U)        /*!< Bit field size in bits for MPU_RGDn_WORD2_M7RE. */

/*! @brief Read current value of the MPU_RGDn_WORD2_M7RE field. */
#define BR_MPU_RGDn_WORD2_M7RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M7RE))

/*! @brief Format value for bitfield MPU_RGDn_WORD2_M7RE. */
#define BF_MPU_RGDn_WORD2_M7RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M7RE) & BM_MPU_RGDn_WORD2_M7RE)

/*! @brief Set the M7RE field to a new value. */
#define BW_MPU_RGDn_WORD2_M7RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M7RE) = (v))
/*@}*/
/*******************************************************************************
 * HW_MPU_RGDn_WORD3 - Region Descriptor n, Word 3
 ******************************************************************************/

/*!
 * @brief HW_MPU_RGDn_WORD3 - Region Descriptor n, Word 3 (RW)
 *
 * Reset value: 0x00000001U
 *
 * The fourth word of the region descriptor contains the optional process
 * identifier and mask, plus the region descriptor's valid bit.
 */
typedef union _hw_mpu_rgdn_word3
{
    uint32_t U;
    struct _hw_mpu_rgdn_word3_bitfields
    {
        uint32_t VLD : 1;              /*!< [0] Valid */
        uint32_t RESERVED0 : 15;       /*!< [15:1]  */
        uint32_t PIDMASK : 8;          /*!< [23:16] Process Identifier Mask */
        uint32_t PID : 8;              /*!< [31:24] Process Identifier */
    } B;
} hw_mpu_rgdn_word3_t;

/*!
 * @name Constants and macros for entire MPU_RGDn_WORD3 register
 */
/*@{*/
#define HW_MPU_RGDn_WORD3_COUNT (12U)

#define HW_MPU_RGDn_WORD3_ADDR(x, n) ((x) + 0x40CU + (0x10U * (n)))

#define HW_MPU_RGDn_WORD3(x, n)  (*(__IO hw_mpu_rgdn_word3_t *) HW_MPU_RGDn_WORD3_ADDR(x, n))
#define HW_MPU_RGDn_WORD3_RD(x, n) (HW_MPU_RGDn_WORD3(x, n).U)
#define HW_MPU_RGDn_WORD3_WR(x, n, v) (HW_MPU_RGDn_WORD3(x, n).U = (v))
#define HW_MPU_RGDn_WORD3_SET(x, n, v) (HW_MPU_RGDn_WORD3_WR(x, n, HW_MPU_RGDn_WORD3_RD(x, n) |  (v)))
#define HW_MPU_RGDn_WORD3_CLR(x, n, v) (HW_MPU_RGDn_WORD3_WR(x, n, HW_MPU_RGDn_WORD3_RD(x, n) & ~(v)))
#define HW_MPU_RGDn_WORD3_TOG(x, n, v) (HW_MPU_RGDn_WORD3_WR(x, n, HW_MPU_RGDn_WORD3_RD(x, n) ^  (v)))
/*@}*/

/*
 * Constants & macros for individual MPU_RGDn_WORD3 bitfields
 */

/*!
 * @name Register MPU_RGDn_WORD3, field VLD[0] (RW)
 *
 * Signals the region descriptor is valid. Any write to RGDn_WORD0-2 clears this
 * bit.
 *
 * Values:
 * - 0 - Region descriptor is invalid
 * - 1 - Region descriptor is valid
 */
/*@{*/
#define BP_MPU_RGDn_WORD3_VLD (0U)         /*!< Bit position for MPU_RGDn_WORD3_VLD. */
#define BM_MPU_RGDn_WORD3_VLD (0x00000001U) /*!< Bit mask for MPU_RGDn_WORD3_VLD. */
#define BS_MPU_RGDn_WORD3_VLD (1U)         /*!< Bit field size in bits for MPU_RGDn_WORD3_VLD. */

/*! @brief Read current value of the MPU_RGDn_WORD3_VLD field. */
#define BR_MPU_RGDn_WORD3_VLD(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD3_ADDR(x, n), BP_MPU_RGDn_WORD3_VLD))

/*! @brief Format value for bitfield MPU_RGDn_WORD3_VLD. */
#define BF_MPU_RGDn_WORD3_VLD(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD3_VLD) & BM_MPU_RGDn_WORD3_VLD)

/*! @brief Set the VLD field to a new value. */
#define BW_MPU_RGDn_WORD3_VLD(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD3_ADDR(x, n), BP_MPU_RGDn_WORD3_VLD) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD3, field PIDMASK[23:16] (RW)
 *
 * Provides a masking capability so that multiple process identifiers can be
 * included as part of the region hit determination. If a bit in PIDMASK is set,
 * then the corresponding PID bit is ignored in the comparison. This field and PID
 * are included in the region hit determination if RGDn_WORD2[MxPE] is set. For
 * more information on the handling of the PID and PIDMASK, see "Access Evaluation
 * - Hit Determination."
 */
/*@{*/
#define BP_MPU_RGDn_WORD3_PIDMASK (16U)    /*!< Bit position for MPU_RGDn_WORD3_PIDMASK. */
#define BM_MPU_RGDn_WORD3_PIDMASK (0x00FF0000U) /*!< Bit mask for MPU_RGDn_WORD3_PIDMASK. */
#define BS_MPU_RGDn_WORD3_PIDMASK (8U)     /*!< Bit field size in bits for MPU_RGDn_WORD3_PIDMASK. */

/*! @brief Read current value of the MPU_RGDn_WORD3_PIDMASK field. */
#define BR_MPU_RGDn_WORD3_PIDMASK(x, n) (HW_MPU_RGDn_WORD3(x, n).B.PIDMASK)

/*! @brief Format value for bitfield MPU_RGDn_WORD3_PIDMASK. */
#define BF_MPU_RGDn_WORD3_PIDMASK(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD3_PIDMASK) & BM_MPU_RGDn_WORD3_PIDMASK)

/*! @brief Set the PIDMASK field to a new value. */
#define BW_MPU_RGDn_WORD3_PIDMASK(x, n, v) (HW_MPU_RGDn_WORD3_WR(x, n, (HW_MPU_RGDn_WORD3_RD(x, n) & ~BM_MPU_RGDn_WORD3_PIDMASK) | BF_MPU_RGDn_WORD3_PIDMASK(v)))
/*@}*/

/*!
 * @name Register MPU_RGDn_WORD3, field PID[31:24] (RW)
 *
 * Specifies the process identifier that is included in the region hit
 * determination if RGDn_WORD2[MxPE] is set. PIDMASK can mask individual bits in this
 * field.
 */
/*@{*/
#define BP_MPU_RGDn_WORD3_PID (24U)        /*!< Bit position for MPU_RGDn_WORD3_PID. */
#define BM_MPU_RGDn_WORD3_PID (0xFF000000U) /*!< Bit mask for MPU_RGDn_WORD3_PID. */
#define BS_MPU_RGDn_WORD3_PID (8U)         /*!< Bit field size in bits for MPU_RGDn_WORD3_PID. */

/*! @brief Read current value of the MPU_RGDn_WORD3_PID field. */
#define BR_MPU_RGDn_WORD3_PID(x, n) (HW_MPU_RGDn_WORD3(x, n).B.PID)

/*! @brief Format value for bitfield MPU_RGDn_WORD3_PID. */
#define BF_MPU_RGDn_WORD3_PID(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD3_PID) & BM_MPU_RGDn_WORD3_PID)

/*! @brief Set the PID field to a new value. */
#define BW_MPU_RGDn_WORD3_PID(x, n, v) (HW_MPU_RGDn_WORD3_WR(x, n, (HW_MPU_RGDn_WORD3_RD(x, n) & ~BM_MPU_RGDn_WORD3_PID) | BF_MPU_RGDn_WORD3_PID(v)))
/*@}*/

/*******************************************************************************
 * HW_MPU_RGDAACn - Region Descriptor Alternate Access Control n
 ******************************************************************************/

/*!
 * @brief HW_MPU_RGDAACn - Region Descriptor Alternate Access Control n (RW)
 *
 * Reset value: 0x0061F7DFU
 *
 * Because software may adjust only the access controls within a region
 * descriptor (RGDn_WORD2) as different tasks execute, an alternate programming view of
 * this 32-bit entity is available. Writing to this register does not affect the
 * descriptor's valid bit.
 */
typedef union _hw_mpu_rgdaacn
{
    uint32_t U;
    struct _hw_mpu_rgdaacn_bitfields
    {
        uint32_t M0UM : 3;             /*!< [2:0] Bus Master 0 User Mode Access Control */
        uint32_t M0SM : 2;             /*!< [4:3] Bus Master 0 Supervisor Mode Access
                                        * Control */
        uint32_t M0PE : 1;             /*!< [5] Bus Master 0 Process Identifier Enable */
        uint32_t M1UM : 3;             /*!< [8:6] Bus Master 1 User Mode Access Control */
        uint32_t M1SM : 2;             /*!< [10:9] Bus Master 1 Supervisor Mode Access
                                        * Control */
        uint32_t M1PE : 1;             /*!< [11] Bus Master 1 Process Identifier Enable */
        uint32_t M2UM : 3;             /*!< [14:12] Bus Master 2 User Mode Access Control
                                        * */
        uint32_t M2SM : 2;             /*!< [16:15] Bus Master 2 Supervisor Mode Access
                                        * Control */
        uint32_t M2PE : 1;             /*!< [17] Bus Master 2 Process Identifier Enable */
        uint32_t M3UM : 3;             /*!< [20:18] Bus Master 3 User Mode Access Control
                                        * */
        uint32_t M3SM : 2;             /*!< [22:21] Bus Master 3 Supervisor Mode Access
                                        * Control */
        uint32_t M3PE : 1;             /*!< [23] Bus Master 3 Process Identifier Enable */
        uint32_t M4WE : 1;             /*!< [24] Bus Master 4 Write Enable */
        uint32_t M4RE : 1;             /*!< [25] Bus Master 4 Read Enable */
        uint32_t M5WE : 1;             /*!< [26] Bus Master 5 Write Enable */
        uint32_t M5RE : 1;             /*!< [27] Bus Master 5 Read Enable */
        uint32_t M6WE : 1;             /*!< [28] Bus Master 6 Write Enable */
        uint32_t M6RE : 1;             /*!< [29] Bus Master 6 Read Enable */
        uint32_t M7WE : 1;             /*!< [30] Bus Master 7 Write Enable */
        uint32_t M7RE : 1;             /*!< [31] Bus Master 7 Read Enable */
    } B;
} hw_mpu_rgdaacn_t;

/*!
 * @name Constants and macros for entire MPU_RGDAACn register
 */
/*@{*/
#define HW_MPU_RGDAACn_COUNT (12U)

#define HW_MPU_RGDAACn_ADDR(x, n) ((x) + 0x800U + (0x4U * (n)))

#define HW_MPU_RGDAACn(x, n)     (*(__IO hw_mpu_rgdaacn_t *) HW_MPU_RGDAACn_ADDR(x, n))
#define HW_MPU_RGDAACn_RD(x, n)  (HW_MPU_RGDAACn(x, n).U)
#define HW_MPU_RGDAACn_WR(x, n, v) (HW_MPU_RGDAACn(x, n).U = (v))
#define HW_MPU_RGDAACn_SET(x, n, v) (HW_MPU_RGDAACn_WR(x, n, HW_MPU_RGDAACn_RD(x, n) |  (v)))
#define HW_MPU_RGDAACn_CLR(x, n, v) (HW_MPU_RGDAACn_WR(x, n, HW_MPU_RGDAACn_RD(x, n) & ~(v)))
#define HW_MPU_RGDAACn_TOG(x, n, v) (HW_MPU_RGDAACn_WR(x, n, HW_MPU_RGDAACn_RD(x, n) ^  (v)))
/*@}*/

/*
 * Constants & macros for individual MPU_RGDAACn bitfields
 */

/*!
 * @name Register MPU_RGDAACn, field M0UM[2:0] (RW)
 *
 * See M3UM description.
 */
/*@{*/
#define BP_MPU_RGDAACn_M0UM  (0U)          /*!< Bit position for MPU_RGDAACn_M0UM. */
#define BM_MPU_RGDAACn_M0UM  (0x00000007U) /*!< Bit mask for MPU_RGDAACn_M0UM. */
#define BS_MPU_RGDAACn_M0UM  (3U)          /*!< Bit field size in bits for MPU_RGDAACn_M0UM. */

/*! @brief Read current value of the MPU_RGDAACn_M0UM field. */
#define BR_MPU_RGDAACn_M0UM(x, n) (HW_MPU_RGDAACn(x, n).B.M0UM)

/*! @brief Format value for bitfield MPU_RGDAACn_M0UM. */
#define BF_MPU_RGDAACn_M0UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M0UM) & BM_MPU_RGDAACn_M0UM)

/*! @brief Set the M0UM field to a new value. */
#define BW_MPU_RGDAACn_M0UM(x, n, v) (HW_MPU_RGDAACn_WR(x, n, (HW_MPU_RGDAACn_RD(x, n) & ~BM_MPU_RGDAACn_M0UM) | BF_MPU_RGDAACn_M0UM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M0SM[4:3] (RW)
 *
 * See M3SM description.
 */
/*@{*/
#define BP_MPU_RGDAACn_M0SM  (3U)          /*!< Bit position for MPU_RGDAACn_M0SM. */
#define BM_MPU_RGDAACn_M0SM  (0x00000018U) /*!< Bit mask for MPU_RGDAACn_M0SM. */
#define BS_MPU_RGDAACn_M0SM  (2U)          /*!< Bit field size in bits for MPU_RGDAACn_M0SM. */

/*! @brief Read current value of the MPU_RGDAACn_M0SM field. */
#define BR_MPU_RGDAACn_M0SM(x, n) (HW_MPU_RGDAACn(x, n).B.M0SM)

/*! @brief Format value for bitfield MPU_RGDAACn_M0SM. */
#define BF_MPU_RGDAACn_M0SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M0SM) & BM_MPU_RGDAACn_M0SM)

/*! @brief Set the M0SM field to a new value. */
#define BW_MPU_RGDAACn_M0SM(x, n, v) (HW_MPU_RGDAACn_WR(x, n, (HW_MPU_RGDAACn_RD(x, n) & ~BM_MPU_RGDAACn_M0SM) | BF_MPU_RGDAACn_M0SM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M0PE[5] (RW)
 *
 * See M3PE description.
 */
/*@{*/
#define BP_MPU_RGDAACn_M0PE  (5U)          /*!< Bit position for MPU_RGDAACn_M0PE. */
#define BM_MPU_RGDAACn_M0PE  (0x00000020U) /*!< Bit mask for MPU_RGDAACn_M0PE. */
#define BS_MPU_RGDAACn_M0PE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M0PE. */

/*! @brief Read current value of the MPU_RGDAACn_M0PE field. */
#define BR_MPU_RGDAACn_M0PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M0PE))

/*! @brief Format value for bitfield MPU_RGDAACn_M0PE. */
#define BF_MPU_RGDAACn_M0PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M0PE) & BM_MPU_RGDAACn_M0PE)

/*! @brief Set the M0PE field to a new value. */
#define BW_MPU_RGDAACn_M0PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M0PE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M1UM[8:6] (RW)
 *
 * See M3UM description.
 */
/*@{*/
#define BP_MPU_RGDAACn_M1UM  (6U)          /*!< Bit position for MPU_RGDAACn_M1UM. */
#define BM_MPU_RGDAACn_M1UM  (0x000001C0U) /*!< Bit mask for MPU_RGDAACn_M1UM. */
#define BS_MPU_RGDAACn_M1UM  (3U)          /*!< Bit field size in bits for MPU_RGDAACn_M1UM. */

/*! @brief Read current value of the MPU_RGDAACn_M1UM field. */
#define BR_MPU_RGDAACn_M1UM(x, n) (HW_MPU_RGDAACn(x, n).B.M1UM)

/*! @brief Format value for bitfield MPU_RGDAACn_M1UM. */
#define BF_MPU_RGDAACn_M1UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M1UM) & BM_MPU_RGDAACn_M1UM)

/*! @brief Set the M1UM field to a new value. */
#define BW_MPU_RGDAACn_M1UM(x, n, v) (HW_MPU_RGDAACn_WR(x, n, (HW_MPU_RGDAACn_RD(x, n) & ~BM_MPU_RGDAACn_M1UM) | BF_MPU_RGDAACn_M1UM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M1SM[10:9] (RW)
 *
 * See M3SM description.
 */
/*@{*/
#define BP_MPU_RGDAACn_M1SM  (9U)          /*!< Bit position for MPU_RGDAACn_M1SM. */
#define BM_MPU_RGDAACn_M1SM  (0x00000600U) /*!< Bit mask for MPU_RGDAACn_M1SM. */
#define BS_MPU_RGDAACn_M1SM  (2U)          /*!< Bit field size in bits for MPU_RGDAACn_M1SM. */

/*! @brief Read current value of the MPU_RGDAACn_M1SM field. */
#define BR_MPU_RGDAACn_M1SM(x, n) (HW_MPU_RGDAACn(x, n).B.M1SM)

/*! @brief Format value for bitfield MPU_RGDAACn_M1SM. */
#define BF_MPU_RGDAACn_M1SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M1SM) & BM_MPU_RGDAACn_M1SM)

/*! @brief Set the M1SM field to a new value. */
#define BW_MPU_RGDAACn_M1SM(x, n, v) (HW_MPU_RGDAACn_WR(x, n, (HW_MPU_RGDAACn_RD(x, n) & ~BM_MPU_RGDAACn_M1SM) | BF_MPU_RGDAACn_M1SM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M1PE[11] (RW)
 *
 * See M3PE description.
 */
/*@{*/
#define BP_MPU_RGDAACn_M1PE  (11U)         /*!< Bit position for MPU_RGDAACn_M1PE. */
#define BM_MPU_RGDAACn_M1PE  (0x00000800U) /*!< Bit mask for MPU_RGDAACn_M1PE. */
#define BS_MPU_RGDAACn_M1PE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M1PE. */

/*! @brief Read current value of the MPU_RGDAACn_M1PE field. */
#define BR_MPU_RGDAACn_M1PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M1PE))

/*! @brief Format value for bitfield MPU_RGDAACn_M1PE. */
#define BF_MPU_RGDAACn_M1PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M1PE) & BM_MPU_RGDAACn_M1PE)

/*! @brief Set the M1PE field to a new value. */
#define BW_MPU_RGDAACn_M1PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M1PE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M2UM[14:12] (RW)
 *
 * See M3UM description.
 */
/*@{*/
#define BP_MPU_RGDAACn_M2UM  (12U)         /*!< Bit position for MPU_RGDAACn_M2UM. */
#define BM_MPU_RGDAACn_M2UM  (0x00007000U) /*!< Bit mask for MPU_RGDAACn_M2UM. */
#define BS_MPU_RGDAACn_M2UM  (3U)          /*!< Bit field size in bits for MPU_RGDAACn_M2UM. */

/*! @brief Read current value of the MPU_RGDAACn_M2UM field. */
#define BR_MPU_RGDAACn_M2UM(x, n) (HW_MPU_RGDAACn(x, n).B.M2UM)

/*! @brief Format value for bitfield MPU_RGDAACn_M2UM. */
#define BF_MPU_RGDAACn_M2UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M2UM) & BM_MPU_RGDAACn_M2UM)

/*! @brief Set the M2UM field to a new value. */
#define BW_MPU_RGDAACn_M2UM(x, n, v) (HW_MPU_RGDAACn_WR(x, n, (HW_MPU_RGDAACn_RD(x, n) & ~BM_MPU_RGDAACn_M2UM) | BF_MPU_RGDAACn_M2UM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M2SM[16:15] (RW)
 *
 * See M3SM description.
 */
/*@{*/
#define BP_MPU_RGDAACn_M2SM  (15U)         /*!< Bit position for MPU_RGDAACn_M2SM. */
#define BM_MPU_RGDAACn_M2SM  (0x00018000U) /*!< Bit mask for MPU_RGDAACn_M2SM. */
#define BS_MPU_RGDAACn_M2SM  (2U)          /*!< Bit field size in bits for MPU_RGDAACn_M2SM. */

/*! @brief Read current value of the MPU_RGDAACn_M2SM field. */
#define BR_MPU_RGDAACn_M2SM(x, n) (HW_MPU_RGDAACn(x, n).B.M2SM)

/*! @brief Format value for bitfield MPU_RGDAACn_M2SM. */
#define BF_MPU_RGDAACn_M2SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M2SM) & BM_MPU_RGDAACn_M2SM)

/*! @brief Set the M2SM field to a new value. */
#define BW_MPU_RGDAACn_M2SM(x, n, v) (HW_MPU_RGDAACn_WR(x, n, (HW_MPU_RGDAACn_RD(x, n) & ~BM_MPU_RGDAACn_M2SM) | BF_MPU_RGDAACn_M2SM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M2PE[17] (RW)
 *
 * See M3PE description.
 */
/*@{*/
#define BP_MPU_RGDAACn_M2PE  (17U)         /*!< Bit position for MPU_RGDAACn_M2PE. */
#define BM_MPU_RGDAACn_M2PE  (0x00020000U) /*!< Bit mask for MPU_RGDAACn_M2PE. */
#define BS_MPU_RGDAACn_M2PE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M2PE. */

/*! @brief Read current value of the MPU_RGDAACn_M2PE field. */
#define BR_MPU_RGDAACn_M2PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M2PE))

/*! @brief Format value for bitfield MPU_RGDAACn_M2PE. */
#define BF_MPU_RGDAACn_M2PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M2PE) & BM_MPU_RGDAACn_M2PE)

/*! @brief Set the M2PE field to a new value. */
#define BW_MPU_RGDAACn_M2PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M2PE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M3UM[20:18] (RW)
 *
 * Defines the access controls for bus master 3 in user mode. M3UM consists of
 * three independent bits, enabling read (r), write (w), and execute (x)
 * permissions.
 *
 * Values:
 * - 0 - An attempted access of that mode may be terminated with an access error
 *     (if not allowed by another descriptor) and the access not performed.
 * - 1 - Allows the given access type to occur
 */
/*@{*/
#define BP_MPU_RGDAACn_M3UM  (18U)         /*!< Bit position for MPU_RGDAACn_M3UM. */
#define BM_MPU_RGDAACn_M3UM  (0x001C0000U) /*!< Bit mask for MPU_RGDAACn_M3UM. */
#define BS_MPU_RGDAACn_M3UM  (3U)          /*!< Bit field size in bits for MPU_RGDAACn_M3UM. */

/*! @brief Read current value of the MPU_RGDAACn_M3UM field. */
#define BR_MPU_RGDAACn_M3UM(x, n) (HW_MPU_RGDAACn(x, n).B.M3UM)

/*! @brief Format value for bitfield MPU_RGDAACn_M3UM. */
#define BF_MPU_RGDAACn_M3UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M3UM) & BM_MPU_RGDAACn_M3UM)

/*! @brief Set the M3UM field to a new value. */
#define BW_MPU_RGDAACn_M3UM(x, n, v) (HW_MPU_RGDAACn_WR(x, n, (HW_MPU_RGDAACn_RD(x, n) & ~BM_MPU_RGDAACn_M3UM) | BF_MPU_RGDAACn_M3UM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M3SM[22:21] (RW)
 *
 * Defines the access controls for bus master 3 in Supervisor mode.
 *
 * Values:
 * - 00 - r/w/x; read, write and execute allowed
 * - 01 - r/x; read and execute allowed, but no write
 * - 10 - r/w; read and write allowed, but no execute
 * - 11 - Same as User mode defined in M3UM
 */
/*@{*/
#define BP_MPU_RGDAACn_M3SM  (21U)         /*!< Bit position for MPU_RGDAACn_M3SM. */
#define BM_MPU_RGDAACn_M3SM  (0x00600000U) /*!< Bit mask for MPU_RGDAACn_M3SM. */
#define BS_MPU_RGDAACn_M3SM  (2U)          /*!< Bit field size in bits for MPU_RGDAACn_M3SM. */

/*! @brief Read current value of the MPU_RGDAACn_M3SM field. */
#define BR_MPU_RGDAACn_M3SM(x, n) (HW_MPU_RGDAACn(x, n).B.M3SM)

/*! @brief Format value for bitfield MPU_RGDAACn_M3SM. */
#define BF_MPU_RGDAACn_M3SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M3SM) & BM_MPU_RGDAACn_M3SM)

/*! @brief Set the M3SM field to a new value. */
#define BW_MPU_RGDAACn_M3SM(x, n, v) (HW_MPU_RGDAACn_WR(x, n, (HW_MPU_RGDAACn_RD(x, n) & ~BM_MPU_RGDAACn_M3SM) | BF_MPU_RGDAACn_M3SM(v)))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M3PE[23] (RW)
 *
 * Values:
 * - 0 - Do not include the process identifier in the evaluation
 * - 1 - Include the process identifier and mask (RGDn.RGDAAC) in the region hit
 *     evaluation
 */
/*@{*/
#define BP_MPU_RGDAACn_M3PE  (23U)         /*!< Bit position for MPU_RGDAACn_M3PE. */
#define BM_MPU_RGDAACn_M3PE  (0x00800000U) /*!< Bit mask for MPU_RGDAACn_M3PE. */
#define BS_MPU_RGDAACn_M3PE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M3PE. */

/*! @brief Read current value of the MPU_RGDAACn_M3PE field. */
#define BR_MPU_RGDAACn_M3PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M3PE))

/*! @brief Format value for bitfield MPU_RGDAACn_M3PE. */
#define BF_MPU_RGDAACn_M3PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M3PE) & BM_MPU_RGDAACn_M3PE)

/*! @brief Set the M3PE field to a new value. */
#define BW_MPU_RGDAACn_M3PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M3PE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M4WE[24] (RW)
 *
 * Values:
 * - 0 - Bus master 4 writes terminate with an access error and the write is not
 *     performed
 * - 1 - Bus master 4 writes allowed
 */
/*@{*/
#define BP_MPU_RGDAACn_M4WE  (24U)         /*!< Bit position for MPU_RGDAACn_M4WE. */
#define BM_MPU_RGDAACn_M4WE  (0x01000000U) /*!< Bit mask for MPU_RGDAACn_M4WE. */
#define BS_MPU_RGDAACn_M4WE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M4WE. */

/*! @brief Read current value of the MPU_RGDAACn_M4WE field. */
#define BR_MPU_RGDAACn_M4WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M4WE))

/*! @brief Format value for bitfield MPU_RGDAACn_M4WE. */
#define BF_MPU_RGDAACn_M4WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M4WE) & BM_MPU_RGDAACn_M4WE)

/*! @brief Set the M4WE field to a new value. */
#define BW_MPU_RGDAACn_M4WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M4WE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M4RE[25] (RW)
 *
 * Values:
 * - 0 - Bus master 4 reads terminate with an access error and the read is not
 *     performed
 * - 1 - Bus master 4 reads allowed
 */
/*@{*/
#define BP_MPU_RGDAACn_M4RE  (25U)         /*!< Bit position for MPU_RGDAACn_M4RE. */
#define BM_MPU_RGDAACn_M4RE  (0x02000000U) /*!< Bit mask for MPU_RGDAACn_M4RE. */
#define BS_MPU_RGDAACn_M4RE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M4RE. */

/*! @brief Read current value of the MPU_RGDAACn_M4RE field. */
#define BR_MPU_RGDAACn_M4RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M4RE))

/*! @brief Format value for bitfield MPU_RGDAACn_M4RE. */
#define BF_MPU_RGDAACn_M4RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M4RE) & BM_MPU_RGDAACn_M4RE)

/*! @brief Set the M4RE field to a new value. */
#define BW_MPU_RGDAACn_M4RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M4RE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M5WE[26] (RW)
 *
 * Values:
 * - 0 - Bus master 5 writes terminate with an access error and the write is not
 *     performed
 * - 1 - Bus master 5 writes allowed
 */
/*@{*/
#define BP_MPU_RGDAACn_M5WE  (26U)         /*!< Bit position for MPU_RGDAACn_M5WE. */
#define BM_MPU_RGDAACn_M5WE  (0x04000000U) /*!< Bit mask for MPU_RGDAACn_M5WE. */
#define BS_MPU_RGDAACn_M5WE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M5WE. */

/*! @brief Read current value of the MPU_RGDAACn_M5WE field. */
#define BR_MPU_RGDAACn_M5WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M5WE))

/*! @brief Format value for bitfield MPU_RGDAACn_M5WE. */
#define BF_MPU_RGDAACn_M5WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M5WE) & BM_MPU_RGDAACn_M5WE)

/*! @brief Set the M5WE field to a new value. */
#define BW_MPU_RGDAACn_M5WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M5WE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M5RE[27] (RW)
 *
 * Values:
 * - 0 - Bus master 5 reads terminate with an access error and the read is not
 *     performed
 * - 1 - Bus master 5 reads allowed
 */
/*@{*/
#define BP_MPU_RGDAACn_M5RE  (27U)         /*!< Bit position for MPU_RGDAACn_M5RE. */
#define BM_MPU_RGDAACn_M5RE  (0x08000000U) /*!< Bit mask for MPU_RGDAACn_M5RE. */
#define BS_MPU_RGDAACn_M5RE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M5RE. */

/*! @brief Read current value of the MPU_RGDAACn_M5RE field. */
#define BR_MPU_RGDAACn_M5RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M5RE))

/*! @brief Format value for bitfield MPU_RGDAACn_M5RE. */
#define BF_MPU_RGDAACn_M5RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M5RE) & BM_MPU_RGDAACn_M5RE)

/*! @brief Set the M5RE field to a new value. */
#define BW_MPU_RGDAACn_M5RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M5RE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M6WE[28] (RW)
 *
 * Values:
 * - 0 - Bus master 6 writes terminate with an access error and the write is not
 *     performed
 * - 1 - Bus master 6 writes allowed
 */
/*@{*/
#define BP_MPU_RGDAACn_M6WE  (28U)         /*!< Bit position for MPU_RGDAACn_M6WE. */
#define BM_MPU_RGDAACn_M6WE  (0x10000000U) /*!< Bit mask for MPU_RGDAACn_M6WE. */
#define BS_MPU_RGDAACn_M6WE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M6WE. */

/*! @brief Read current value of the MPU_RGDAACn_M6WE field. */
#define BR_MPU_RGDAACn_M6WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M6WE))

/*! @brief Format value for bitfield MPU_RGDAACn_M6WE. */
#define BF_MPU_RGDAACn_M6WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M6WE) & BM_MPU_RGDAACn_M6WE)

/*! @brief Set the M6WE field to a new value. */
#define BW_MPU_RGDAACn_M6WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M6WE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M6RE[29] (RW)
 *
 * Values:
 * - 0 - Bus master 6 reads terminate with an access error and the read is not
 *     performed
 * - 1 - Bus master 6 reads allowed
 */
/*@{*/
#define BP_MPU_RGDAACn_M6RE  (29U)         /*!< Bit position for MPU_RGDAACn_M6RE. */
#define BM_MPU_RGDAACn_M6RE  (0x20000000U) /*!< Bit mask for MPU_RGDAACn_M6RE. */
#define BS_MPU_RGDAACn_M6RE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M6RE. */

/*! @brief Read current value of the MPU_RGDAACn_M6RE field. */
#define BR_MPU_RGDAACn_M6RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M6RE))

/*! @brief Format value for bitfield MPU_RGDAACn_M6RE. */
#define BF_MPU_RGDAACn_M6RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M6RE) & BM_MPU_RGDAACn_M6RE)

/*! @brief Set the M6RE field to a new value. */
#define BW_MPU_RGDAACn_M6RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M6RE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M7WE[30] (RW)
 *
 * Values:
 * - 0 - Bus master 7 writes terminate with an access error and the write is not
 *     performed
 * - 1 - Bus master 7 writes allowed
 */
/*@{*/
#define BP_MPU_RGDAACn_M7WE  (30U)         /*!< Bit position for MPU_RGDAACn_M7WE. */
#define BM_MPU_RGDAACn_M7WE  (0x40000000U) /*!< Bit mask for MPU_RGDAACn_M7WE. */
#define BS_MPU_RGDAACn_M7WE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M7WE. */

/*! @brief Read current value of the MPU_RGDAACn_M7WE field. */
#define BR_MPU_RGDAACn_M7WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M7WE))

/*! @brief Format value for bitfield MPU_RGDAACn_M7WE. */
#define BF_MPU_RGDAACn_M7WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M7WE) & BM_MPU_RGDAACn_M7WE)

/*! @brief Set the M7WE field to a new value. */
#define BW_MPU_RGDAACn_M7WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M7WE) = (v))
/*@}*/

/*!
 * @name Register MPU_RGDAACn, field M7RE[31] (RW)
 *
 * Values:
 * - 0 - Bus master 7 reads terminate with an access error and the read is not
 *     performed
 * - 1 - Bus master 7 reads allowed
 */
/*@{*/
#define BP_MPU_RGDAACn_M7RE  (31U)         /*!< Bit position for MPU_RGDAACn_M7RE. */
#define BM_MPU_RGDAACn_M7RE  (0x80000000U) /*!< Bit mask for MPU_RGDAACn_M7RE. */
#define BS_MPU_RGDAACn_M7RE  (1U)          /*!< Bit field size in bits for MPU_RGDAACn_M7RE. */

/*! @brief Read current value of the MPU_RGDAACn_M7RE field. */
#define BR_MPU_RGDAACn_M7RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M7RE))

/*! @brief Format value for bitfield MPU_RGDAACn_M7RE. */
#define BF_MPU_RGDAACn_M7RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M7RE) & BM_MPU_RGDAACn_M7RE)

/*! @brief Set the M7RE field to a new value. */
#define BW_MPU_RGDAACn_M7RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M7RE) = (v))
/*@}*/

/*******************************************************************************
 * hw_mpu_t - module struct
 ******************************************************************************/
/*!
 * @brief All MPU module registers.
 */
#pragma pack(1)
typedef struct _hw_mpu
{
    __IO hw_mpu_cesr_t CESR;               /*!< [0x0] Control/Error Status Register */
    uint8_t _reserved0[12];
    struct {
        __I hw_mpu_earn_t EARn;            /*!< [0x10] Error Address Register, slave port n */
        __I hw_mpu_edrn_t EDRn;            /*!< [0x14] Error Detail Register, slave port n */
    } SP[5];
    uint8_t _reserved1[968];
    struct {
        __IO hw_mpu_rgdn_word0_t RGDn_WORD0; /*!< [0x400] Region Descriptor n, Word 0 */
        __IO hw_mpu_rgdn_word1_t RGDn_WORD1; /*!< [0x404] Region Descriptor n, Word 1 */
        __IO hw_mpu_rgdn_word2_t RGDn_WORD2; /*!< [0x408] Region Descriptor n, Word 2 */
        __IO hw_mpu_rgdn_word3_t RGDn_WORD3; /*!< [0x40C] Region Descriptor n, Word 3 */
    } RGD[12];
    uint8_t _reserved2[832];
    __IO hw_mpu_rgdaacn_t RGDAACn[12];     /*!< [0x800] Region Descriptor Alternate Access Control n */
} hw_mpu_t;
#pragma pack()

/*! @brief Macro to access all MPU registers. */
/*! @param x MPU module instance base address. */
/*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
 *     use the '&' operator, like <code>&HW_MPU(MPU_BASE)</code>. */
#define HW_MPU(x)      (*(hw_mpu_t *)(x))

#endif /* __HW_MPU_REGISTERS_H__ */
/* EOF */