]> git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/device/device/MK64F12/MK64F12_mpu.h
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[tmk_keyboard.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / hal / TARGET_Freescale / TARGET_KPSDK_MCUS / TARGET_MCU_K64F / device / device / MK64F12 / MK64F12_mpu.h
1 /*
2 ** ###################################################################
3 ** Compilers: Keil ARM C/C++ Compiler
4 ** Freescale C/C++ for Embedded ARM
5 ** GNU C Compiler
6 ** IAR ANSI C/C++ Compiler for ARM
7 **
8 ** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
9 ** Version: rev. 2.5, 2014-02-10
10 ** Build: b140604
11 **
12 ** Abstract:
13 ** Extension to the CMSIS register access layer header.
14 **
15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
16 ** All rights reserved.
17 **
18 ** Redistribution and use in source and binary forms, with or without modification,
19 ** are permitted provided that the following conditions are met:
20 **
21 ** o Redistributions of source code must retain the above copyright notice, this list
22 ** of conditions and the following disclaimer.
23 **
24 ** o Redistributions in binary form must reproduce the above copyright notice, this
25 ** list of conditions and the following disclaimer in the documentation and/or
26 ** other materials provided with the distribution.
27 **
28 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
29 ** contributors may be used to endorse or promote products derived from this
30 ** software without specific prior written permission.
31 **
32 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
36 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
39 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 **
43 ** http: www.freescale.com
44 ** mail: support@freescale.com
45 **
46 ** Revisions:
47 ** - rev. 1.0 (2013-08-12)
48 ** Initial version.
49 ** - rev. 2.0 (2013-10-29)
50 ** Register accessor macros added to the memory map.
51 ** Symbols for Processor Expert memory map compatibility added to the memory map.
52 ** Startup file for gcc has been updated according to CMSIS 3.2.
53 ** System initialization updated.
54 ** MCG - registers updated.
55 ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
56 ** - rev. 2.1 (2013-10-30)
57 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
58 ** - rev. 2.2 (2013-12-09)
59 ** DMA - EARS register removed.
60 ** AIPS0, AIPS1 - MPRA register updated.
61 ** - rev. 2.3 (2014-01-24)
62 ** Update according to reference manual rev. 2
63 ** ENET, MCG, MCM, SIM, USB - registers updated
64 ** - rev. 2.4 (2014-02-10)
65 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
66 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
67 ** - rev. 2.5 (2014-02-10)
68 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
69 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
70 ** Module access macro module_BASES replaced by module_BASE_PTRS.
71 **
72 ** ###################################################################
73 */
74
75 /*
76 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
77 *
78 * This file was generated automatically and any changes may be lost.
79 */
80 #ifndef __HW_MPU_REGISTERS_H__
81 #define __HW_MPU_REGISTERS_H__
82
83 #include "MK64F12.h"
84 #include "fsl_bitaccess.h"
85
86 /*
87 * MK64F12 MPU
88 *
89 * Memory protection unit
90 *
91 * Registers defined in this header file:
92 * - HW_MPU_CESR - Control/Error Status Register
93 * - HW_MPU_EARn - Error Address Register, slave port n
94 * - HW_MPU_EDRn - Error Detail Register, slave port n
95 * - HW_MPU_RGDn_WORD0 - Region Descriptor n, Word 0
96 * - HW_MPU_RGDn_WORD1 - Region Descriptor n, Word 1
97 * - HW_MPU_RGDn_WORD2 - Region Descriptor n, Word 2
98 * - HW_MPU_RGDn_WORD3 - Region Descriptor n, Word 3
99 * - HW_MPU_RGDAACn - Region Descriptor Alternate Access Control n
100 *
101 * - hw_mpu_t - Struct containing all module registers.
102 */
103
104 #define HW_MPU_INSTANCE_COUNT (1U) /*!< Number of instances of the MPU module. */
105
106 /*******************************************************************************
107 * HW_MPU_CESR - Control/Error Status Register
108 ******************************************************************************/
109
110 /*!
111 * @brief HW_MPU_CESR - Control/Error Status Register (RW)
112 *
113 * Reset value: 0x00815101U
114 */
115 typedef union _hw_mpu_cesr
116 {
117 uint32_t U;
118 struct _hw_mpu_cesr_bitfields
119 {
120 uint32_t VLD : 1; /*!< [0] Valid */
121 uint32_t RESERVED0 : 7; /*!< [7:1] */
122 uint32_t NRGD : 4; /*!< [11:8] Number Of Region Descriptors */
123 uint32_t NSP : 4; /*!< [15:12] Number Of Slave Ports */
124 uint32_t HRL : 4; /*!< [19:16] Hardware Revision Level */
125 uint32_t RESERVED1 : 7; /*!< [26:20] */
126 uint32_t SPERR : 5; /*!< [31:27] Slave Port n Error */
127 } B;
128 } hw_mpu_cesr_t;
129
130 /*!
131 * @name Constants and macros for entire MPU_CESR register
132 */
133 /*@{*/
134 #define HW_MPU_CESR_ADDR(x) ((x) + 0x0U)
135
136 #define HW_MPU_CESR(x) (*(__IO hw_mpu_cesr_t *) HW_MPU_CESR_ADDR(x))
137 #define HW_MPU_CESR_RD(x) (HW_MPU_CESR(x).U)
138 #define HW_MPU_CESR_WR(x, v) (HW_MPU_CESR(x).U = (v))
139 #define HW_MPU_CESR_SET(x, v) (HW_MPU_CESR_WR(x, HW_MPU_CESR_RD(x) | (v)))
140 #define HW_MPU_CESR_CLR(x, v) (HW_MPU_CESR_WR(x, HW_MPU_CESR_RD(x) & ~(v)))
141 #define HW_MPU_CESR_TOG(x, v) (HW_MPU_CESR_WR(x, HW_MPU_CESR_RD(x) ^ (v)))
142 /*@}*/
143
144 /*
145 * Constants & macros for individual MPU_CESR bitfields
146 */
147
148 /*!
149 * @name Register MPU_CESR, field VLD[0] (RW)
150 *
151 * Global enable/disable for the MPU.
152 *
153 * Values:
154 * - 0 - MPU is disabled. All accesses from all bus masters are allowed.
155 * - 1 - MPU is enabled
156 */
157 /*@{*/
158 #define BP_MPU_CESR_VLD (0U) /*!< Bit position for MPU_CESR_VLD. */
159 #define BM_MPU_CESR_VLD (0x00000001U) /*!< Bit mask for MPU_CESR_VLD. */
160 #define BS_MPU_CESR_VLD (1U) /*!< Bit field size in bits for MPU_CESR_VLD. */
161
162 /*! @brief Read current value of the MPU_CESR_VLD field. */
163 #define BR_MPU_CESR_VLD(x) (BITBAND_ACCESS32(HW_MPU_CESR_ADDR(x), BP_MPU_CESR_VLD))
164
165 /*! @brief Format value for bitfield MPU_CESR_VLD. */
166 #define BF_MPU_CESR_VLD(v) ((uint32_t)((uint32_t)(v) << BP_MPU_CESR_VLD) & BM_MPU_CESR_VLD)
167
168 /*! @brief Set the VLD field to a new value. */
169 #define BW_MPU_CESR_VLD(x, v) (BITBAND_ACCESS32(HW_MPU_CESR_ADDR(x), BP_MPU_CESR_VLD) = (v))
170 /*@}*/
171
172 /*!
173 * @name Register MPU_CESR, field NRGD[11:8] (RO)
174 *
175 * Indicates the number of region descriptors implemented in the MPU.
176 *
177 * Values:
178 * - 0000 - 8 region descriptors
179 * - 0001 - 12 region descriptors
180 * - 0010 - 16 region descriptors
181 */
182 /*@{*/
183 #define BP_MPU_CESR_NRGD (8U) /*!< Bit position for MPU_CESR_NRGD. */
184 #define BM_MPU_CESR_NRGD (0x00000F00U) /*!< Bit mask for MPU_CESR_NRGD. */
185 #define BS_MPU_CESR_NRGD (4U) /*!< Bit field size in bits for MPU_CESR_NRGD. */
186
187 /*! @brief Read current value of the MPU_CESR_NRGD field. */
188 #define BR_MPU_CESR_NRGD(x) (HW_MPU_CESR(x).B.NRGD)
189 /*@}*/
190
191 /*!
192 * @name Register MPU_CESR, field NSP[15:12] (RO)
193 *
194 * Specifies the number of slave ports connected to the MPU.
195 */
196 /*@{*/
197 #define BP_MPU_CESR_NSP (12U) /*!< Bit position for MPU_CESR_NSP. */
198 #define BM_MPU_CESR_NSP (0x0000F000U) /*!< Bit mask for MPU_CESR_NSP. */
199 #define BS_MPU_CESR_NSP (4U) /*!< Bit field size in bits for MPU_CESR_NSP. */
200
201 /*! @brief Read current value of the MPU_CESR_NSP field. */
202 #define BR_MPU_CESR_NSP(x) (HW_MPU_CESR(x).B.NSP)
203 /*@}*/
204
205 /*!
206 * @name Register MPU_CESR, field HRL[19:16] (RO)
207 *
208 * Specifies the MPU's hardware and definition revision level. It can be read by
209 * software to determine the functional definition of the module.
210 */
211 /*@{*/
212 #define BP_MPU_CESR_HRL (16U) /*!< Bit position for MPU_CESR_HRL. */
213 #define BM_MPU_CESR_HRL (0x000F0000U) /*!< Bit mask for MPU_CESR_HRL. */
214 #define BS_MPU_CESR_HRL (4U) /*!< Bit field size in bits for MPU_CESR_HRL. */
215
216 /*! @brief Read current value of the MPU_CESR_HRL field. */
217 #define BR_MPU_CESR_HRL(x) (HW_MPU_CESR(x).B.HRL)
218 /*@}*/
219
220 /*!
221 * @name Register MPU_CESR, field SPERR[31:27] (W1C)
222 *
223 * Indicates a captured error in EARn and EDRn. This bit is set when the
224 * hardware detects an error and records the faulting address and attributes. It is
225 * cleared by writing one to it. If another error is captured at the exact same cycle
226 * as the write, the flag remains set. A find-first-one instruction or
227 * equivalent can detect the presence of a captured error. The following shows the
228 * correspondence between the bit number and slave port number: Bit 31 corresponds to
229 * slave port 0. Bit 30 corresponds to slave port 1. Bit 29 corresponds to slave
230 * port 2. Bit 28 corresponds to slave port 3. Bit 27 corresponds to slave port 4.
231 *
232 * Values:
233 * - 0 - No error has occurred for slave port n.
234 * - 1 - An error has occurred for slave port n.
235 */
236 /*@{*/
237 #define BP_MPU_CESR_SPERR (27U) /*!< Bit position for MPU_CESR_SPERR. */
238 #define BM_MPU_CESR_SPERR (0xF8000000U) /*!< Bit mask for MPU_CESR_SPERR. */
239 #define BS_MPU_CESR_SPERR (5U) /*!< Bit field size in bits for MPU_CESR_SPERR. */
240
241 /*! @brief Read current value of the MPU_CESR_SPERR field. */
242 #define BR_MPU_CESR_SPERR(x) (HW_MPU_CESR(x).B.SPERR)
243
244 /*! @brief Format value for bitfield MPU_CESR_SPERR. */
245 #define BF_MPU_CESR_SPERR(v) ((uint32_t)((uint32_t)(v) << BP_MPU_CESR_SPERR) & BM_MPU_CESR_SPERR)
246
247 /*! @brief Set the SPERR field to a new value. */
248 #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)))
249 /*@}*/
250
251 /*******************************************************************************
252 * HW_MPU_EARn - Error Address Register, slave port n
253 ******************************************************************************/
254
255 /*!
256 * @brief HW_MPU_EARn - Error Address Register, slave port n (RO)
257 *
258 * Reset value: 0x00000000U
259 *
260 * When the MPU detects an access error on slave port n, the 32-bit reference
261 * address is captured in this read-only register and the corresponding bit in
262 * CESR[SPERR] set. Additional information about the faulting access is captured in
263 * the corresponding EDRn at the same time. This register and the corresponding
264 * EDRn contain the most recent access error; there are no hardware interlocks with
265 * CESR[SPERR], as the error registers are always loaded upon the occurrence of
266 * each protection violation.
267 */
268 typedef union _hw_mpu_earn
269 {
270 uint32_t U;
271 struct _hw_mpu_earn_bitfields
272 {
273 uint32_t EADDR : 32; /*!< [31:0] Error Address */
274 } B;
275 } hw_mpu_earn_t;
276
277 /*!
278 * @name Constants and macros for entire MPU_EARn register
279 */
280 /*@{*/
281 #define HW_MPU_EARn_COUNT (5U)
282
283 #define HW_MPU_EARn_ADDR(x, n) ((x) + 0x10U + (0x8U * (n)))
284
285 #define HW_MPU_EARn(x, n) (*(__I hw_mpu_earn_t *) HW_MPU_EARn_ADDR(x, n))
286 #define HW_MPU_EARn_RD(x, n) (HW_MPU_EARn(x, n).U)
287 /*@}*/
288
289 /*
290 * Constants & macros for individual MPU_EARn bitfields
291 */
292
293 /*!
294 * @name Register MPU_EARn, field EADDR[31:0] (RO)
295 *
296 * Indicates the reference address from slave port n that generated the access
297 * error
298 */
299 /*@{*/
300 #define BP_MPU_EARn_EADDR (0U) /*!< Bit position for MPU_EARn_EADDR. */
301 #define BM_MPU_EARn_EADDR (0xFFFFFFFFU) /*!< Bit mask for MPU_EARn_EADDR. */
302 #define BS_MPU_EARn_EADDR (32U) /*!< Bit field size in bits for MPU_EARn_EADDR. */
303
304 /*! @brief Read current value of the MPU_EARn_EADDR field. */
305 #define BR_MPU_EARn_EADDR(x, n) (HW_MPU_EARn(x, n).U)
306 /*@}*/
307 /*******************************************************************************
308 * HW_MPU_EDRn - Error Detail Register, slave port n
309 ******************************************************************************/
310
311 /*!
312 * @brief HW_MPU_EDRn - Error Detail Register, slave port n (RO)
313 *
314 * Reset value: 0x00000000U
315 *
316 * When the MPU detects an access error on slave port n, 32 bits of error detail
317 * are captured in this read-only register and the corresponding bit in
318 * CESR[SPERR] is set. Information on the faulting address is captured in the
319 * corresponding EARn register at the same time. This register and the corresponding EARn
320 * register contain the most recent access error; there are no hardware interlocks
321 * with CESR[SPERR] as the error registers are always loaded upon the occurrence
322 * of each protection violation.
323 */
324 typedef union _hw_mpu_edrn
325 {
326 uint32_t U;
327 struct _hw_mpu_edrn_bitfields
328 {
329 uint32_t ERW : 1; /*!< [0] Error Read/Write */
330 uint32_t EATTR : 3; /*!< [3:1] Error Attributes */
331 uint32_t EMN : 4; /*!< [7:4] Error Master Number */
332 uint32_t EPID : 8; /*!< [15:8] Error Process Identification */
333 uint32_t EACD : 16; /*!< [31:16] Error Access Control Detail */
334 } B;
335 } hw_mpu_edrn_t;
336
337 /*!
338 * @name Constants and macros for entire MPU_EDRn register
339 */
340 /*@{*/
341 #define HW_MPU_EDRn_COUNT (5U)
342
343 #define HW_MPU_EDRn_ADDR(x, n) ((x) + 0x14U + (0x8U * (n)))
344
345 #define HW_MPU_EDRn(x, n) (*(__I hw_mpu_edrn_t *) HW_MPU_EDRn_ADDR(x, n))
346 #define HW_MPU_EDRn_RD(x, n) (HW_MPU_EDRn(x, n).U)
347 /*@}*/
348
349 /*
350 * Constants & macros for individual MPU_EDRn bitfields
351 */
352
353 /*!
354 * @name Register MPU_EDRn, field ERW[0] (RO)
355 *
356 * Indicates the access type of the faulting reference.
357 *
358 * Values:
359 * - 0 - Read
360 * - 1 - Write
361 */
362 /*@{*/
363 #define BP_MPU_EDRn_ERW (0U) /*!< Bit position for MPU_EDRn_ERW. */
364 #define BM_MPU_EDRn_ERW (0x00000001U) /*!< Bit mask for MPU_EDRn_ERW. */
365 #define BS_MPU_EDRn_ERW (1U) /*!< Bit field size in bits for MPU_EDRn_ERW. */
366
367 /*! @brief Read current value of the MPU_EDRn_ERW field. */
368 #define BR_MPU_EDRn_ERW(x, n) (BITBAND_ACCESS32(HW_MPU_EDRn_ADDR(x, n), BP_MPU_EDRn_ERW))
369 /*@}*/
370
371 /*!
372 * @name Register MPU_EDRn, field EATTR[3:1] (RO)
373 *
374 * Indicates attribute information about the faulting reference. All other
375 * encodings are reserved.
376 *
377 * Values:
378 * - 000 - User mode, instruction access
379 * - 001 - User mode, data access
380 * - 010 - Supervisor mode, instruction access
381 * - 011 - Supervisor mode, data access
382 */
383 /*@{*/
384 #define BP_MPU_EDRn_EATTR (1U) /*!< Bit position for MPU_EDRn_EATTR. */
385 #define BM_MPU_EDRn_EATTR (0x0000000EU) /*!< Bit mask for MPU_EDRn_EATTR. */
386 #define BS_MPU_EDRn_EATTR (3U) /*!< Bit field size in bits for MPU_EDRn_EATTR. */
387
388 /*! @brief Read current value of the MPU_EDRn_EATTR field. */
389 #define BR_MPU_EDRn_EATTR(x, n) (HW_MPU_EDRn(x, n).B.EATTR)
390 /*@}*/
391
392 /*!
393 * @name Register MPU_EDRn, field EMN[7:4] (RO)
394 *
395 * Indicates the bus master that generated the access error.
396 */
397 /*@{*/
398 #define BP_MPU_EDRn_EMN (4U) /*!< Bit position for MPU_EDRn_EMN. */
399 #define BM_MPU_EDRn_EMN (0x000000F0U) /*!< Bit mask for MPU_EDRn_EMN. */
400 #define BS_MPU_EDRn_EMN (4U) /*!< Bit field size in bits for MPU_EDRn_EMN. */
401
402 /*! @brief Read current value of the MPU_EDRn_EMN field. */
403 #define BR_MPU_EDRn_EMN(x, n) (HW_MPU_EDRn(x, n).B.EMN)
404 /*@}*/
405
406 /*!
407 * @name Register MPU_EDRn, field EPID[15:8] (RO)
408 *
409 * Records the process identifier of the faulting reference. The process
410 * identifier is typically driven only by processor cores; for other bus masters, this
411 * field is cleared.
412 */
413 /*@{*/
414 #define BP_MPU_EDRn_EPID (8U) /*!< Bit position for MPU_EDRn_EPID. */
415 #define BM_MPU_EDRn_EPID (0x0000FF00U) /*!< Bit mask for MPU_EDRn_EPID. */
416 #define BS_MPU_EDRn_EPID (8U) /*!< Bit field size in bits for MPU_EDRn_EPID. */
417
418 /*! @brief Read current value of the MPU_EDRn_EPID field. */
419 #define BR_MPU_EDRn_EPID(x, n) (HW_MPU_EDRn(x, n).B.EPID)
420 /*@}*/
421
422 /*!
423 * @name Register MPU_EDRn, field EACD[31:16] (RO)
424 *
425 * Indicates the region descriptor with the access error. If EDRn contains a
426 * captured error and EACD is cleared, an access did not hit in any region
427 * descriptor. If only a single EACD bit is set, the protection error was caused by a
428 * single non-overlapping region descriptor. If two or more EACD bits are set, the
429 * protection error was caused by an overlapping set of region descriptors.
430 */
431 /*@{*/
432 #define BP_MPU_EDRn_EACD (16U) /*!< Bit position for MPU_EDRn_EACD. */
433 #define BM_MPU_EDRn_EACD (0xFFFF0000U) /*!< Bit mask for MPU_EDRn_EACD. */
434 #define BS_MPU_EDRn_EACD (16U) /*!< Bit field size in bits for MPU_EDRn_EACD. */
435
436 /*! @brief Read current value of the MPU_EDRn_EACD field. */
437 #define BR_MPU_EDRn_EACD(x, n) (HW_MPU_EDRn(x, n).B.EACD)
438 /*@}*/
439
440 /*******************************************************************************
441 * HW_MPU_RGDn_WORD0 - Region Descriptor n, Word 0
442 ******************************************************************************/
443
444 /*!
445 * @brief HW_MPU_RGDn_WORD0 - Region Descriptor n, Word 0 (RW)
446 *
447 * Reset value: 0x00000000U
448 *
449 * The first word of the region descriptor defines the 0-modulo-32 byte start
450 * address of the memory region. Writes to this register clear the region
451 * descriptor's valid bit (RGDn_WORD3[VLD]).
452 */
453 typedef union _hw_mpu_rgdn_word0
454 {
455 uint32_t U;
456 struct _hw_mpu_rgdn_word0_bitfields
457 {
458 uint32_t RESERVED0 : 5; /*!< [4:0] */
459 uint32_t SRTADDR : 27; /*!< [31:5] Start Address */
460 } B;
461 } hw_mpu_rgdn_word0_t;
462
463 /*!
464 * @name Constants and macros for entire MPU_RGDn_WORD0 register
465 */
466 /*@{*/
467 #define HW_MPU_RGDn_WORD0_COUNT (12U)
468
469 #define HW_MPU_RGDn_WORD0_ADDR(x, n) ((x) + 0x400U + (0x10U * (n)))
470
471 #define HW_MPU_RGDn_WORD0(x, n) (*(__IO hw_mpu_rgdn_word0_t *) HW_MPU_RGDn_WORD0_ADDR(x, n))
472 #define HW_MPU_RGDn_WORD0_RD(x, n) (HW_MPU_RGDn_WORD0(x, n).U)
473 #define HW_MPU_RGDn_WORD0_WR(x, n, v) (HW_MPU_RGDn_WORD0(x, n).U = (v))
474 #define HW_MPU_RGDn_WORD0_SET(x, n, v) (HW_MPU_RGDn_WORD0_WR(x, n, HW_MPU_RGDn_WORD0_RD(x, n) | (v)))
475 #define HW_MPU_RGDn_WORD0_CLR(x, n, v) (HW_MPU_RGDn_WORD0_WR(x, n, HW_MPU_RGDn_WORD0_RD(x, n) & ~(v)))
476 #define HW_MPU_RGDn_WORD0_TOG(x, n, v) (HW_MPU_RGDn_WORD0_WR(x, n, HW_MPU_RGDn_WORD0_RD(x, n) ^ (v)))
477 /*@}*/
478
479 /*
480 * Constants & macros for individual MPU_RGDn_WORD0 bitfields
481 */
482
483 /*!
484 * @name Register MPU_RGDn_WORD0, field SRTADDR[31:5] (RW)
485 *
486 * Defines the most significant bits of the 0-modulo-32 byte start address of
487 * the memory region.
488 */
489 /*@{*/
490 #define BP_MPU_RGDn_WORD0_SRTADDR (5U) /*!< Bit position for MPU_RGDn_WORD0_SRTADDR. */
491 #define BM_MPU_RGDn_WORD0_SRTADDR (0xFFFFFFE0U) /*!< Bit mask for MPU_RGDn_WORD0_SRTADDR. */
492 #define BS_MPU_RGDn_WORD0_SRTADDR (27U) /*!< Bit field size in bits for MPU_RGDn_WORD0_SRTADDR. */
493
494 /*! @brief Read current value of the MPU_RGDn_WORD0_SRTADDR field. */
495 #define BR_MPU_RGDn_WORD0_SRTADDR(x, n) (HW_MPU_RGDn_WORD0(x, n).B.SRTADDR)
496
497 /*! @brief Format value for bitfield MPU_RGDn_WORD0_SRTADDR. */
498 #define BF_MPU_RGDn_WORD0_SRTADDR(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD0_SRTADDR) & BM_MPU_RGDn_WORD0_SRTADDR)
499
500 /*! @brief Set the SRTADDR field to a new value. */
501 #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)))
502 /*@}*/
503 /*******************************************************************************
504 * HW_MPU_RGDn_WORD1 - Region Descriptor n, Word 1
505 ******************************************************************************/
506
507 /*!
508 * @brief HW_MPU_RGDn_WORD1 - Region Descriptor n, Word 1 (RW)
509 *
510 * Reset value: 0xFFFFFFFFU
511 *
512 * The second word of the region descriptor defines the 31-modulo-32 byte end
513 * address of the memory region. Writes to this register clear the region
514 * descriptor's valid bit (RGDn_WORD3[VLD]).
515 */
516 typedef union _hw_mpu_rgdn_word1
517 {
518 uint32_t U;
519 struct _hw_mpu_rgdn_word1_bitfields
520 {
521 uint32_t RESERVED0 : 5; /*!< [4:0] */
522 uint32_t ENDADDR : 27; /*!< [31:5] End Address */
523 } B;
524 } hw_mpu_rgdn_word1_t;
525
526 /*!
527 * @name Constants and macros for entire MPU_RGDn_WORD1 register
528 */
529 /*@{*/
530 #define HW_MPU_RGDn_WORD1_COUNT (12U)
531
532 #define HW_MPU_RGDn_WORD1_ADDR(x, n) ((x) + 0x404U + (0x10U * (n)))
533
534 #define HW_MPU_RGDn_WORD1(x, n) (*(__IO hw_mpu_rgdn_word1_t *) HW_MPU_RGDn_WORD1_ADDR(x, n))
535 #define HW_MPU_RGDn_WORD1_RD(x, n) (HW_MPU_RGDn_WORD1(x, n).U)
536 #define HW_MPU_RGDn_WORD1_WR(x, n, v) (HW_MPU_RGDn_WORD1(x, n).U = (v))
537 #define HW_MPU_RGDn_WORD1_SET(x, n, v) (HW_MPU_RGDn_WORD1_WR(x, n, HW_MPU_RGDn_WORD1_RD(x, n) | (v)))
538 #define HW_MPU_RGDn_WORD1_CLR(x, n, v) (HW_MPU_RGDn_WORD1_WR(x, n, HW_MPU_RGDn_WORD1_RD(x, n) & ~(v)))
539 #define HW_MPU_RGDn_WORD1_TOG(x, n, v) (HW_MPU_RGDn_WORD1_WR(x, n, HW_MPU_RGDn_WORD1_RD(x, n) ^ (v)))
540 /*@}*/
541
542 /*
543 * Constants & macros for individual MPU_RGDn_WORD1 bitfields
544 */
545
546 /*!
547 * @name Register MPU_RGDn_WORD1, field ENDADDR[31:5] (RW)
548 *
549 * Defines the most significant bits of the 31-modulo-32 byte end address of the
550 * memory region. The MPU does not verify that ENDADDR >= SRTADDR.
551 */
552 /*@{*/
553 #define BP_MPU_RGDn_WORD1_ENDADDR (5U) /*!< Bit position for MPU_RGDn_WORD1_ENDADDR. */
554 #define BM_MPU_RGDn_WORD1_ENDADDR (0xFFFFFFE0U) /*!< Bit mask for MPU_RGDn_WORD1_ENDADDR. */
555 #define BS_MPU_RGDn_WORD1_ENDADDR (27U) /*!< Bit field size in bits for MPU_RGDn_WORD1_ENDADDR. */
556
557 /*! @brief Read current value of the MPU_RGDn_WORD1_ENDADDR field. */
558 #define BR_MPU_RGDn_WORD1_ENDADDR(x, n) (HW_MPU_RGDn_WORD1(x, n).B.ENDADDR)
559
560 /*! @brief Format value for bitfield MPU_RGDn_WORD1_ENDADDR. */
561 #define BF_MPU_RGDn_WORD1_ENDADDR(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD1_ENDADDR) & BM_MPU_RGDn_WORD1_ENDADDR)
562
563 /*! @brief Set the ENDADDR field to a new value. */
564 #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)))
565 /*@}*/
566 /*******************************************************************************
567 * HW_MPU_RGDn_WORD2 - Region Descriptor n, Word 2
568 ******************************************************************************/
569
570 /*!
571 * @brief HW_MPU_RGDn_WORD2 - Region Descriptor n, Word 2 (RW)
572 *
573 * Reset value: 0x0061F7DFU
574 *
575 * The third word of the region descriptor defines the access control rights of
576 * the memory region. The access control privileges depend on two broad
577 * classifications of bus masters: Bus masters 0-3 have a 5-bit field defining separate
578 * privilege rights for user and supervisor mode accesses, as well as the optional
579 * inclusion of a process identification field within the definition. Bus masters
580 * 4-7 are limited to separate read and write permissions. For the privilege
581 * rights of bus masters 0-3, there are three flags associated with this function:
582 * Read (r) refers to accessing the referenced memory address using an operand
583 * (data) fetch Write (w) refers to updating the referenced memory address using a
584 * store (data) instruction Execute (x) refers to reading the referenced memory
585 * address using an instruction fetch Writes to RGDn_WORD2 clear the region
586 * descriptor's valid bit (RGDn_WORD3[VLD]). If only updating the access controls, write
587 * to RGDAACn instead because stores to these locations do not affect the
588 * descriptor's valid bit.
589 */
590 typedef union _hw_mpu_rgdn_word2
591 {
592 uint32_t U;
593 struct _hw_mpu_rgdn_word2_bitfields
594 {
595 uint32_t M0UM : 3; /*!< [2:0] Bus Master 0 User Mode Access Control */
596 uint32_t M0SM : 2; /*!< [4:3] Bus Master 0 Supervisor Mode Access
597 * Control */
598 uint32_t M0PE : 1; /*!< [5] Bus Master 0 Process Identifier enable */
599 uint32_t M1UM : 3; /*!< [8:6] Bus Master 1 User Mode Access Control */
600 uint32_t M1SM : 2; /*!< [10:9] Bus Master 1 Supervisor Mode Access
601 * Control */
602 uint32_t M1PE : 1; /*!< [11] Bus Master 1 Process Identifier enable */
603 uint32_t M2UM : 3; /*!< [14:12] Bus Master 2 User Mode Access control
604 * */
605 uint32_t M2SM : 2; /*!< [16:15] Bus Master 2 Supervisor Mode Access
606 * Control */
607 uint32_t M2PE : 1; /*!< [17] Bus Master 2 Process Identifier Enable */
608 uint32_t M3UM : 3; /*!< [20:18] Bus Master 3 User Mode Access Control
609 * */
610 uint32_t M3SM : 2; /*!< [22:21] Bus Master 3 Supervisor Mode Access
611 * Control */
612 uint32_t M3PE : 1; /*!< [23] Bus Master 3 Process Identifier Enable */
613 uint32_t M4WE : 1; /*!< [24] Bus Master 4 Write Enable */
614 uint32_t M4RE : 1; /*!< [25] Bus Master 4 Read Enable */
615 uint32_t M5WE : 1; /*!< [26] Bus Master 5 Write Enable */
616 uint32_t M5RE : 1; /*!< [27] Bus Master 5 Read Enable */
617 uint32_t M6WE : 1; /*!< [28] Bus Master 6 Write Enable */
618 uint32_t M6RE : 1; /*!< [29] Bus Master 6 Read Enable */
619 uint32_t M7WE : 1; /*!< [30] Bus Master 7 Write Enable */
620 uint32_t M7RE : 1; /*!< [31] Bus Master 7 Read Enable */
621 } B;
622 } hw_mpu_rgdn_word2_t;
623
624 /*!
625 * @name Constants and macros for entire MPU_RGDn_WORD2 register
626 */
627 /*@{*/
628 #define HW_MPU_RGDn_WORD2_COUNT (12U)
629
630 #define HW_MPU_RGDn_WORD2_ADDR(x, n) ((x) + 0x408U + (0x10U * (n)))
631
632 #define HW_MPU_RGDn_WORD2(x, n) (*(__IO hw_mpu_rgdn_word2_t *) HW_MPU_RGDn_WORD2_ADDR(x, n))
633 #define HW_MPU_RGDn_WORD2_RD(x, n) (HW_MPU_RGDn_WORD2(x, n).U)
634 #define HW_MPU_RGDn_WORD2_WR(x, n, v) (HW_MPU_RGDn_WORD2(x, n).U = (v))
635 #define HW_MPU_RGDn_WORD2_SET(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, HW_MPU_RGDn_WORD2_RD(x, n) | (v)))
636 #define HW_MPU_RGDn_WORD2_CLR(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, HW_MPU_RGDn_WORD2_RD(x, n) & ~(v)))
637 #define HW_MPU_RGDn_WORD2_TOG(x, n, v) (HW_MPU_RGDn_WORD2_WR(x, n, HW_MPU_RGDn_WORD2_RD(x, n) ^ (v)))
638 /*@}*/
639
640 /*
641 * Constants & macros for individual MPU_RGDn_WORD2 bitfields
642 */
643
644 /*!
645 * @name Register MPU_RGDn_WORD2, field M0UM[2:0] (RW)
646 *
647 * See M3UM description.
648 */
649 /*@{*/
650 #define BP_MPU_RGDn_WORD2_M0UM (0U) /*!< Bit position for MPU_RGDn_WORD2_M0UM. */
651 #define BM_MPU_RGDn_WORD2_M0UM (0x00000007U) /*!< Bit mask for MPU_RGDn_WORD2_M0UM. */
652 #define BS_MPU_RGDn_WORD2_M0UM (3U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M0UM. */
653
654 /*! @brief Read current value of the MPU_RGDn_WORD2_M0UM field. */
655 #define BR_MPU_RGDn_WORD2_M0UM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M0UM)
656
657 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M0UM. */
658 #define BF_MPU_RGDn_WORD2_M0UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M0UM) & BM_MPU_RGDn_WORD2_M0UM)
659
660 /*! @brief Set the M0UM field to a new value. */
661 #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)))
662 /*@}*/
663
664 /*!
665 * @name Register MPU_RGDn_WORD2, field M0SM[4:3] (RW)
666 *
667 * See M3SM description.
668 */
669 /*@{*/
670 #define BP_MPU_RGDn_WORD2_M0SM (3U) /*!< Bit position for MPU_RGDn_WORD2_M0SM. */
671 #define BM_MPU_RGDn_WORD2_M0SM (0x00000018U) /*!< Bit mask for MPU_RGDn_WORD2_M0SM. */
672 #define BS_MPU_RGDn_WORD2_M0SM (2U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M0SM. */
673
674 /*! @brief Read current value of the MPU_RGDn_WORD2_M0SM field. */
675 #define BR_MPU_RGDn_WORD2_M0SM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M0SM)
676
677 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M0SM. */
678 #define BF_MPU_RGDn_WORD2_M0SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M0SM) & BM_MPU_RGDn_WORD2_M0SM)
679
680 /*! @brief Set the M0SM field to a new value. */
681 #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)))
682 /*@}*/
683
684 /*!
685 * @name Register MPU_RGDn_WORD2, field M0PE[5] (RW)
686 *
687 * See M0PE description.
688 */
689 /*@{*/
690 #define BP_MPU_RGDn_WORD2_M0PE (5U) /*!< Bit position for MPU_RGDn_WORD2_M0PE. */
691 #define BM_MPU_RGDn_WORD2_M0PE (0x00000020U) /*!< Bit mask for MPU_RGDn_WORD2_M0PE. */
692 #define BS_MPU_RGDn_WORD2_M0PE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M0PE. */
693
694 /*! @brief Read current value of the MPU_RGDn_WORD2_M0PE field. */
695 #define BR_MPU_RGDn_WORD2_M0PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M0PE))
696
697 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M0PE. */
698 #define BF_MPU_RGDn_WORD2_M0PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M0PE) & BM_MPU_RGDn_WORD2_M0PE)
699
700 /*! @brief Set the M0PE field to a new value. */
701 #define BW_MPU_RGDn_WORD2_M0PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M0PE) = (v))
702 /*@}*/
703
704 /*!
705 * @name Register MPU_RGDn_WORD2, field M1UM[8:6] (RW)
706 *
707 * See M3UM description.
708 */
709 /*@{*/
710 #define BP_MPU_RGDn_WORD2_M1UM (6U) /*!< Bit position for MPU_RGDn_WORD2_M1UM. */
711 #define BM_MPU_RGDn_WORD2_M1UM (0x000001C0U) /*!< Bit mask for MPU_RGDn_WORD2_M1UM. */
712 #define BS_MPU_RGDn_WORD2_M1UM (3U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M1UM. */
713
714 /*! @brief Read current value of the MPU_RGDn_WORD2_M1UM field. */
715 #define BR_MPU_RGDn_WORD2_M1UM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M1UM)
716
717 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M1UM. */
718 #define BF_MPU_RGDn_WORD2_M1UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M1UM) & BM_MPU_RGDn_WORD2_M1UM)
719
720 /*! @brief Set the M1UM field to a new value. */
721 #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)))
722 /*@}*/
723
724 /*!
725 * @name Register MPU_RGDn_WORD2, field M1SM[10:9] (RW)
726 *
727 * See M3SM description.
728 */
729 /*@{*/
730 #define BP_MPU_RGDn_WORD2_M1SM (9U) /*!< Bit position for MPU_RGDn_WORD2_M1SM. */
731 #define BM_MPU_RGDn_WORD2_M1SM (0x00000600U) /*!< Bit mask for MPU_RGDn_WORD2_M1SM. */
732 #define BS_MPU_RGDn_WORD2_M1SM (2U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M1SM. */
733
734 /*! @brief Read current value of the MPU_RGDn_WORD2_M1SM field. */
735 #define BR_MPU_RGDn_WORD2_M1SM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M1SM)
736
737 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M1SM. */
738 #define BF_MPU_RGDn_WORD2_M1SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M1SM) & BM_MPU_RGDn_WORD2_M1SM)
739
740 /*! @brief Set the M1SM field to a new value. */
741 #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)))
742 /*@}*/
743
744 /*!
745 * @name Register MPU_RGDn_WORD2, field M1PE[11] (RW)
746 *
747 * See M3PE description.
748 */
749 /*@{*/
750 #define BP_MPU_RGDn_WORD2_M1PE (11U) /*!< Bit position for MPU_RGDn_WORD2_M1PE. */
751 #define BM_MPU_RGDn_WORD2_M1PE (0x00000800U) /*!< Bit mask for MPU_RGDn_WORD2_M1PE. */
752 #define BS_MPU_RGDn_WORD2_M1PE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M1PE. */
753
754 /*! @brief Read current value of the MPU_RGDn_WORD2_M1PE field. */
755 #define BR_MPU_RGDn_WORD2_M1PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M1PE))
756
757 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M1PE. */
758 #define BF_MPU_RGDn_WORD2_M1PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M1PE) & BM_MPU_RGDn_WORD2_M1PE)
759
760 /*! @brief Set the M1PE field to a new value. */
761 #define BW_MPU_RGDn_WORD2_M1PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M1PE) = (v))
762 /*@}*/
763
764 /*!
765 * @name Register MPU_RGDn_WORD2, field M2UM[14:12] (RW)
766 *
767 * See M3UM description.
768 */
769 /*@{*/
770 #define BP_MPU_RGDn_WORD2_M2UM (12U) /*!< Bit position for MPU_RGDn_WORD2_M2UM. */
771 #define BM_MPU_RGDn_WORD2_M2UM (0x00007000U) /*!< Bit mask for MPU_RGDn_WORD2_M2UM. */
772 #define BS_MPU_RGDn_WORD2_M2UM (3U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M2UM. */
773
774 /*! @brief Read current value of the MPU_RGDn_WORD2_M2UM field. */
775 #define BR_MPU_RGDn_WORD2_M2UM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M2UM)
776
777 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M2UM. */
778 #define BF_MPU_RGDn_WORD2_M2UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M2UM) & BM_MPU_RGDn_WORD2_M2UM)
779
780 /*! @brief Set the M2UM field to a new value. */
781 #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)))
782 /*@}*/
783
784 /*!
785 * @name Register MPU_RGDn_WORD2, field M2SM[16:15] (RW)
786 *
787 * See M3SM description.
788 */
789 /*@{*/
790 #define BP_MPU_RGDn_WORD2_M2SM (15U) /*!< Bit position for MPU_RGDn_WORD2_M2SM. */
791 #define BM_MPU_RGDn_WORD2_M2SM (0x00018000U) /*!< Bit mask for MPU_RGDn_WORD2_M2SM. */
792 #define BS_MPU_RGDn_WORD2_M2SM (2U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M2SM. */
793
794 /*! @brief Read current value of the MPU_RGDn_WORD2_M2SM field. */
795 #define BR_MPU_RGDn_WORD2_M2SM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M2SM)
796
797 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M2SM. */
798 #define BF_MPU_RGDn_WORD2_M2SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M2SM) & BM_MPU_RGDn_WORD2_M2SM)
799
800 /*! @brief Set the M2SM field to a new value. */
801 #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)))
802 /*@}*/
803
804 /*!
805 * @name Register MPU_RGDn_WORD2, field M2PE[17] (RW)
806 *
807 * See M3PE description.
808 */
809 /*@{*/
810 #define BP_MPU_RGDn_WORD2_M2PE (17U) /*!< Bit position for MPU_RGDn_WORD2_M2PE. */
811 #define BM_MPU_RGDn_WORD2_M2PE (0x00020000U) /*!< Bit mask for MPU_RGDn_WORD2_M2PE. */
812 #define BS_MPU_RGDn_WORD2_M2PE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M2PE. */
813
814 /*! @brief Read current value of the MPU_RGDn_WORD2_M2PE field. */
815 #define BR_MPU_RGDn_WORD2_M2PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M2PE))
816
817 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M2PE. */
818 #define BF_MPU_RGDn_WORD2_M2PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M2PE) & BM_MPU_RGDn_WORD2_M2PE)
819
820 /*! @brief Set the M2PE field to a new value. */
821 #define BW_MPU_RGDn_WORD2_M2PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M2PE) = (v))
822 /*@}*/
823
824 /*!
825 * @name Register MPU_RGDn_WORD2, field M3UM[20:18] (RW)
826 *
827 * Defines the access controls for bus master 3 in User mode. M3UM consists of
828 * three independent bits, enabling read (r), write (w), and execute (x)
829 * permissions.
830 *
831 * Values:
832 * - 0 - An attempted access of that mode may be terminated with an access error
833 * (if not allowed by another descriptor) and the access not performed.
834 * - 1 - Allows the given access type to occur
835 */
836 /*@{*/
837 #define BP_MPU_RGDn_WORD2_M3UM (18U) /*!< Bit position for MPU_RGDn_WORD2_M3UM. */
838 #define BM_MPU_RGDn_WORD2_M3UM (0x001C0000U) /*!< Bit mask for MPU_RGDn_WORD2_M3UM. */
839 #define BS_MPU_RGDn_WORD2_M3UM (3U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M3UM. */
840
841 /*! @brief Read current value of the MPU_RGDn_WORD2_M3UM field. */
842 #define BR_MPU_RGDn_WORD2_M3UM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M3UM)
843
844 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M3UM. */
845 #define BF_MPU_RGDn_WORD2_M3UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M3UM) & BM_MPU_RGDn_WORD2_M3UM)
846
847 /*! @brief Set the M3UM field to a new value. */
848 #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)))
849 /*@}*/
850
851 /*!
852 * @name Register MPU_RGDn_WORD2, field M3SM[22:21] (RW)
853 *
854 * Defines the access controls for bus master 3 in Supervisor mode.
855 *
856 * Values:
857 * - 00 - r/w/x; read, write and execute allowed
858 * - 01 - r/x; read and execute allowed, but no write
859 * - 10 - r/w; read and write allowed, but no execute
860 * - 11 - Same as User mode defined in M3UM
861 */
862 /*@{*/
863 #define BP_MPU_RGDn_WORD2_M3SM (21U) /*!< Bit position for MPU_RGDn_WORD2_M3SM. */
864 #define BM_MPU_RGDn_WORD2_M3SM (0x00600000U) /*!< Bit mask for MPU_RGDn_WORD2_M3SM. */
865 #define BS_MPU_RGDn_WORD2_M3SM (2U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M3SM. */
866
867 /*! @brief Read current value of the MPU_RGDn_WORD2_M3SM field. */
868 #define BR_MPU_RGDn_WORD2_M3SM(x, n) (HW_MPU_RGDn_WORD2(x, n).B.M3SM)
869
870 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M3SM. */
871 #define BF_MPU_RGDn_WORD2_M3SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M3SM) & BM_MPU_RGDn_WORD2_M3SM)
872
873 /*! @brief Set the M3SM field to a new value. */
874 #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)))
875 /*@}*/
876
877 /*!
878 * @name Register MPU_RGDn_WORD2, field M3PE[23] (RW)
879 *
880 * Values:
881 * - 0 - Do not include the process identifier in the evaluation
882 * - 1 - Include the process identifier and mask (RGDn_WORD3) in the region hit
883 * evaluation
884 */
885 /*@{*/
886 #define BP_MPU_RGDn_WORD2_M3PE (23U) /*!< Bit position for MPU_RGDn_WORD2_M3PE. */
887 #define BM_MPU_RGDn_WORD2_M3PE (0x00800000U) /*!< Bit mask for MPU_RGDn_WORD2_M3PE. */
888 #define BS_MPU_RGDn_WORD2_M3PE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M3PE. */
889
890 /*! @brief Read current value of the MPU_RGDn_WORD2_M3PE field. */
891 #define BR_MPU_RGDn_WORD2_M3PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M3PE))
892
893 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M3PE. */
894 #define BF_MPU_RGDn_WORD2_M3PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M3PE) & BM_MPU_RGDn_WORD2_M3PE)
895
896 /*! @brief Set the M3PE field to a new value. */
897 #define BW_MPU_RGDn_WORD2_M3PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M3PE) = (v))
898 /*@}*/
899
900 /*!
901 * @name Register MPU_RGDn_WORD2, field M4WE[24] (RW)
902 *
903 * Values:
904 * - 0 - Bus master 4 writes terminate with an access error and the write is not
905 * performed
906 * - 1 - Bus master 4 writes allowed
907 */
908 /*@{*/
909 #define BP_MPU_RGDn_WORD2_M4WE (24U) /*!< Bit position for MPU_RGDn_WORD2_M4WE. */
910 #define BM_MPU_RGDn_WORD2_M4WE (0x01000000U) /*!< Bit mask for MPU_RGDn_WORD2_M4WE. */
911 #define BS_MPU_RGDn_WORD2_M4WE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M4WE. */
912
913 /*! @brief Read current value of the MPU_RGDn_WORD2_M4WE field. */
914 #define BR_MPU_RGDn_WORD2_M4WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M4WE))
915
916 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M4WE. */
917 #define BF_MPU_RGDn_WORD2_M4WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M4WE) & BM_MPU_RGDn_WORD2_M4WE)
918
919 /*! @brief Set the M4WE field to a new value. */
920 #define BW_MPU_RGDn_WORD2_M4WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M4WE) = (v))
921 /*@}*/
922
923 /*!
924 * @name Register MPU_RGDn_WORD2, field M4RE[25] (RW)
925 *
926 * Values:
927 * - 0 - Bus master 4 reads terminate with an access error and the read is not
928 * performed
929 * - 1 - Bus master 4 reads allowed
930 */
931 /*@{*/
932 #define BP_MPU_RGDn_WORD2_M4RE (25U) /*!< Bit position for MPU_RGDn_WORD2_M4RE. */
933 #define BM_MPU_RGDn_WORD2_M4RE (0x02000000U) /*!< Bit mask for MPU_RGDn_WORD2_M4RE. */
934 #define BS_MPU_RGDn_WORD2_M4RE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M4RE. */
935
936 /*! @brief Read current value of the MPU_RGDn_WORD2_M4RE field. */
937 #define BR_MPU_RGDn_WORD2_M4RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M4RE))
938
939 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M4RE. */
940 #define BF_MPU_RGDn_WORD2_M4RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M4RE) & BM_MPU_RGDn_WORD2_M4RE)
941
942 /*! @brief Set the M4RE field to a new value. */
943 #define BW_MPU_RGDn_WORD2_M4RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M4RE) = (v))
944 /*@}*/
945
946 /*!
947 * @name Register MPU_RGDn_WORD2, field M5WE[26] (RW)
948 *
949 * Values:
950 * - 0 - Bus master 5 writes terminate with an access error and the write is not
951 * performed
952 * - 1 - Bus master 5 writes allowed
953 */
954 /*@{*/
955 #define BP_MPU_RGDn_WORD2_M5WE (26U) /*!< Bit position for MPU_RGDn_WORD2_M5WE. */
956 #define BM_MPU_RGDn_WORD2_M5WE (0x04000000U) /*!< Bit mask for MPU_RGDn_WORD2_M5WE. */
957 #define BS_MPU_RGDn_WORD2_M5WE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M5WE. */
958
959 /*! @brief Read current value of the MPU_RGDn_WORD2_M5WE field. */
960 #define BR_MPU_RGDn_WORD2_M5WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M5WE))
961
962 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M5WE. */
963 #define BF_MPU_RGDn_WORD2_M5WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M5WE) & BM_MPU_RGDn_WORD2_M5WE)
964
965 /*! @brief Set the M5WE field to a new value. */
966 #define BW_MPU_RGDn_WORD2_M5WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M5WE) = (v))
967 /*@}*/
968
969 /*!
970 * @name Register MPU_RGDn_WORD2, field M5RE[27] (RW)
971 *
972 * Values:
973 * - 0 - Bus master 5 reads terminate with an access error and the read is not
974 * performed
975 * - 1 - Bus master 5 reads allowed
976 */
977 /*@{*/
978 #define BP_MPU_RGDn_WORD2_M5RE (27U) /*!< Bit position for MPU_RGDn_WORD2_M5RE. */
979 #define BM_MPU_RGDn_WORD2_M5RE (0x08000000U) /*!< Bit mask for MPU_RGDn_WORD2_M5RE. */
980 #define BS_MPU_RGDn_WORD2_M5RE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M5RE. */
981
982 /*! @brief Read current value of the MPU_RGDn_WORD2_M5RE field. */
983 #define BR_MPU_RGDn_WORD2_M5RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M5RE))
984
985 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M5RE. */
986 #define BF_MPU_RGDn_WORD2_M5RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M5RE) & BM_MPU_RGDn_WORD2_M5RE)
987
988 /*! @brief Set the M5RE field to a new value. */
989 #define BW_MPU_RGDn_WORD2_M5RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M5RE) = (v))
990 /*@}*/
991
992 /*!
993 * @name Register MPU_RGDn_WORD2, field M6WE[28] (RW)
994 *
995 * Values:
996 * - 0 - Bus master 6 writes terminate with an access error and the write is not
997 * performed
998 * - 1 - Bus master 6 writes allowed
999 */
1000 /*@{*/
1001 #define BP_MPU_RGDn_WORD2_M6WE (28U) /*!< Bit position for MPU_RGDn_WORD2_M6WE. */
1002 #define BM_MPU_RGDn_WORD2_M6WE (0x10000000U) /*!< Bit mask for MPU_RGDn_WORD2_M6WE. */
1003 #define BS_MPU_RGDn_WORD2_M6WE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M6WE. */
1004
1005 /*! @brief Read current value of the MPU_RGDn_WORD2_M6WE field. */
1006 #define BR_MPU_RGDn_WORD2_M6WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M6WE))
1007
1008 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M6WE. */
1009 #define BF_MPU_RGDn_WORD2_M6WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M6WE) & BM_MPU_RGDn_WORD2_M6WE)
1010
1011 /*! @brief Set the M6WE field to a new value. */
1012 #define BW_MPU_RGDn_WORD2_M6WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M6WE) = (v))
1013 /*@}*/
1014
1015 /*!
1016 * @name Register MPU_RGDn_WORD2, field M6RE[29] (RW)
1017 *
1018 * Values:
1019 * - 0 - Bus master 6 reads terminate with an access error and the read is not
1020 * performed
1021 * - 1 - Bus master 6 reads allowed
1022 */
1023 /*@{*/
1024 #define BP_MPU_RGDn_WORD2_M6RE (29U) /*!< Bit position for MPU_RGDn_WORD2_M6RE. */
1025 #define BM_MPU_RGDn_WORD2_M6RE (0x20000000U) /*!< Bit mask for MPU_RGDn_WORD2_M6RE. */
1026 #define BS_MPU_RGDn_WORD2_M6RE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M6RE. */
1027
1028 /*! @brief Read current value of the MPU_RGDn_WORD2_M6RE field. */
1029 #define BR_MPU_RGDn_WORD2_M6RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M6RE))
1030
1031 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M6RE. */
1032 #define BF_MPU_RGDn_WORD2_M6RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M6RE) & BM_MPU_RGDn_WORD2_M6RE)
1033
1034 /*! @brief Set the M6RE field to a new value. */
1035 #define BW_MPU_RGDn_WORD2_M6RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M6RE) = (v))
1036 /*@}*/
1037
1038 /*!
1039 * @name Register MPU_RGDn_WORD2, field M7WE[30] (RW)
1040 *
1041 * Values:
1042 * - 0 - Bus master 7 writes terminate with an access error and the write is not
1043 * performed
1044 * - 1 - Bus master 7 writes allowed
1045 */
1046 /*@{*/
1047 #define BP_MPU_RGDn_WORD2_M7WE (30U) /*!< Bit position for MPU_RGDn_WORD2_M7WE. */
1048 #define BM_MPU_RGDn_WORD2_M7WE (0x40000000U) /*!< Bit mask for MPU_RGDn_WORD2_M7WE. */
1049 #define BS_MPU_RGDn_WORD2_M7WE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M7WE. */
1050
1051 /*! @brief Read current value of the MPU_RGDn_WORD2_M7WE field. */
1052 #define BR_MPU_RGDn_WORD2_M7WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M7WE))
1053
1054 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M7WE. */
1055 #define BF_MPU_RGDn_WORD2_M7WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M7WE) & BM_MPU_RGDn_WORD2_M7WE)
1056
1057 /*! @brief Set the M7WE field to a new value. */
1058 #define BW_MPU_RGDn_WORD2_M7WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M7WE) = (v))
1059 /*@}*/
1060
1061 /*!
1062 * @name Register MPU_RGDn_WORD2, field M7RE[31] (RW)
1063 *
1064 * Values:
1065 * - 0 - Bus master 7 reads terminate with an access error and the read is not
1066 * performed
1067 * - 1 - Bus master 7 reads allowed
1068 */
1069 /*@{*/
1070 #define BP_MPU_RGDn_WORD2_M7RE (31U) /*!< Bit position for MPU_RGDn_WORD2_M7RE. */
1071 #define BM_MPU_RGDn_WORD2_M7RE (0x80000000U) /*!< Bit mask for MPU_RGDn_WORD2_M7RE. */
1072 #define BS_MPU_RGDn_WORD2_M7RE (1U) /*!< Bit field size in bits for MPU_RGDn_WORD2_M7RE. */
1073
1074 /*! @brief Read current value of the MPU_RGDn_WORD2_M7RE field. */
1075 #define BR_MPU_RGDn_WORD2_M7RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M7RE))
1076
1077 /*! @brief Format value for bitfield MPU_RGDn_WORD2_M7RE. */
1078 #define BF_MPU_RGDn_WORD2_M7RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD2_M7RE) & BM_MPU_RGDn_WORD2_M7RE)
1079
1080 /*! @brief Set the M7RE field to a new value. */
1081 #define BW_MPU_RGDn_WORD2_M7RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD2_ADDR(x, n), BP_MPU_RGDn_WORD2_M7RE) = (v))
1082 /*@}*/
1083 /*******************************************************************************
1084 * HW_MPU_RGDn_WORD3 - Region Descriptor n, Word 3
1085 ******************************************************************************/
1086
1087 /*!
1088 * @brief HW_MPU_RGDn_WORD3 - Region Descriptor n, Word 3 (RW)
1089 *
1090 * Reset value: 0x00000001U
1091 *
1092 * The fourth word of the region descriptor contains the optional process
1093 * identifier and mask, plus the region descriptor's valid bit.
1094 */
1095 typedef union _hw_mpu_rgdn_word3
1096 {
1097 uint32_t U;
1098 struct _hw_mpu_rgdn_word3_bitfields
1099 {
1100 uint32_t VLD : 1; /*!< [0] Valid */
1101 uint32_t RESERVED0 : 15; /*!< [15:1] */
1102 uint32_t PIDMASK : 8; /*!< [23:16] Process Identifier Mask */
1103 uint32_t PID : 8; /*!< [31:24] Process Identifier */
1104 } B;
1105 } hw_mpu_rgdn_word3_t;
1106
1107 /*!
1108 * @name Constants and macros for entire MPU_RGDn_WORD3 register
1109 */
1110 /*@{*/
1111 #define HW_MPU_RGDn_WORD3_COUNT (12U)
1112
1113 #define HW_MPU_RGDn_WORD3_ADDR(x, n) ((x) + 0x40CU + (0x10U * (n)))
1114
1115 #define HW_MPU_RGDn_WORD3(x, n) (*(__IO hw_mpu_rgdn_word3_t *) HW_MPU_RGDn_WORD3_ADDR(x, n))
1116 #define HW_MPU_RGDn_WORD3_RD(x, n) (HW_MPU_RGDn_WORD3(x, n).U)
1117 #define HW_MPU_RGDn_WORD3_WR(x, n, v) (HW_MPU_RGDn_WORD3(x, n).U = (v))
1118 #define HW_MPU_RGDn_WORD3_SET(x, n, v) (HW_MPU_RGDn_WORD3_WR(x, n, HW_MPU_RGDn_WORD3_RD(x, n) | (v)))
1119 #define HW_MPU_RGDn_WORD3_CLR(x, n, v) (HW_MPU_RGDn_WORD3_WR(x, n, HW_MPU_RGDn_WORD3_RD(x, n) & ~(v)))
1120 #define HW_MPU_RGDn_WORD3_TOG(x, n, v) (HW_MPU_RGDn_WORD3_WR(x, n, HW_MPU_RGDn_WORD3_RD(x, n) ^ (v)))
1121 /*@}*/
1122
1123 /*
1124 * Constants & macros for individual MPU_RGDn_WORD3 bitfields
1125 */
1126
1127 /*!
1128 * @name Register MPU_RGDn_WORD3, field VLD[0] (RW)
1129 *
1130 * Signals the region descriptor is valid. Any write to RGDn_WORD0-2 clears this
1131 * bit.
1132 *
1133 * Values:
1134 * - 0 - Region descriptor is invalid
1135 * - 1 - Region descriptor is valid
1136 */
1137 /*@{*/
1138 #define BP_MPU_RGDn_WORD3_VLD (0U) /*!< Bit position for MPU_RGDn_WORD3_VLD. */
1139 #define BM_MPU_RGDn_WORD3_VLD (0x00000001U) /*!< Bit mask for MPU_RGDn_WORD3_VLD. */
1140 #define BS_MPU_RGDn_WORD3_VLD (1U) /*!< Bit field size in bits for MPU_RGDn_WORD3_VLD. */
1141
1142 /*! @brief Read current value of the MPU_RGDn_WORD3_VLD field. */
1143 #define BR_MPU_RGDn_WORD3_VLD(x, n) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD3_ADDR(x, n), BP_MPU_RGDn_WORD3_VLD))
1144
1145 /*! @brief Format value for bitfield MPU_RGDn_WORD3_VLD. */
1146 #define BF_MPU_RGDn_WORD3_VLD(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD3_VLD) & BM_MPU_RGDn_WORD3_VLD)
1147
1148 /*! @brief Set the VLD field to a new value. */
1149 #define BW_MPU_RGDn_WORD3_VLD(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDn_WORD3_ADDR(x, n), BP_MPU_RGDn_WORD3_VLD) = (v))
1150 /*@}*/
1151
1152 /*!
1153 * @name Register MPU_RGDn_WORD3, field PIDMASK[23:16] (RW)
1154 *
1155 * Provides a masking capability so that multiple process identifiers can be
1156 * included as part of the region hit determination. If a bit in PIDMASK is set,
1157 * then the corresponding PID bit is ignored in the comparison. This field and PID
1158 * are included in the region hit determination if RGDn_WORD2[MxPE] is set. For
1159 * more information on the handling of the PID and PIDMASK, see "Access Evaluation
1160 * - Hit Determination."
1161 */
1162 /*@{*/
1163 #define BP_MPU_RGDn_WORD3_PIDMASK (16U) /*!< Bit position for MPU_RGDn_WORD3_PIDMASK. */
1164 #define BM_MPU_RGDn_WORD3_PIDMASK (0x00FF0000U) /*!< Bit mask for MPU_RGDn_WORD3_PIDMASK. */
1165 #define BS_MPU_RGDn_WORD3_PIDMASK (8U) /*!< Bit field size in bits for MPU_RGDn_WORD3_PIDMASK. */
1166
1167 /*! @brief Read current value of the MPU_RGDn_WORD3_PIDMASK field. */
1168 #define BR_MPU_RGDn_WORD3_PIDMASK(x, n) (HW_MPU_RGDn_WORD3(x, n).B.PIDMASK)
1169
1170 /*! @brief Format value for bitfield MPU_RGDn_WORD3_PIDMASK. */
1171 #define BF_MPU_RGDn_WORD3_PIDMASK(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD3_PIDMASK) & BM_MPU_RGDn_WORD3_PIDMASK)
1172
1173 /*! @brief Set the PIDMASK field to a new value. */
1174 #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)))
1175 /*@}*/
1176
1177 /*!
1178 * @name Register MPU_RGDn_WORD3, field PID[31:24] (RW)
1179 *
1180 * Specifies the process identifier that is included in the region hit
1181 * determination if RGDn_WORD2[MxPE] is set. PIDMASK can mask individual bits in this
1182 * field.
1183 */
1184 /*@{*/
1185 #define BP_MPU_RGDn_WORD3_PID (24U) /*!< Bit position for MPU_RGDn_WORD3_PID. */
1186 #define BM_MPU_RGDn_WORD3_PID (0xFF000000U) /*!< Bit mask for MPU_RGDn_WORD3_PID. */
1187 #define BS_MPU_RGDn_WORD3_PID (8U) /*!< Bit field size in bits for MPU_RGDn_WORD3_PID. */
1188
1189 /*! @brief Read current value of the MPU_RGDn_WORD3_PID field. */
1190 #define BR_MPU_RGDn_WORD3_PID(x, n) (HW_MPU_RGDn_WORD3(x, n).B.PID)
1191
1192 /*! @brief Format value for bitfield MPU_RGDn_WORD3_PID. */
1193 #define BF_MPU_RGDn_WORD3_PID(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDn_WORD3_PID) & BM_MPU_RGDn_WORD3_PID)
1194
1195 /*! @brief Set the PID field to a new value. */
1196 #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)))
1197 /*@}*/
1198
1199 /*******************************************************************************
1200 * HW_MPU_RGDAACn - Region Descriptor Alternate Access Control n
1201 ******************************************************************************/
1202
1203 /*!
1204 * @brief HW_MPU_RGDAACn - Region Descriptor Alternate Access Control n (RW)
1205 *
1206 * Reset value: 0x0061F7DFU
1207 *
1208 * Because software may adjust only the access controls within a region
1209 * descriptor (RGDn_WORD2) as different tasks execute, an alternate programming view of
1210 * this 32-bit entity is available. Writing to this register does not affect the
1211 * descriptor's valid bit.
1212 */
1213 typedef union _hw_mpu_rgdaacn
1214 {
1215 uint32_t U;
1216 struct _hw_mpu_rgdaacn_bitfields
1217 {
1218 uint32_t M0UM : 3; /*!< [2:0] Bus Master 0 User Mode Access Control */
1219 uint32_t M0SM : 2; /*!< [4:3] Bus Master 0 Supervisor Mode Access
1220 * Control */
1221 uint32_t M0PE : 1; /*!< [5] Bus Master 0 Process Identifier Enable */
1222 uint32_t M1UM : 3; /*!< [8:6] Bus Master 1 User Mode Access Control */
1223 uint32_t M1SM : 2; /*!< [10:9] Bus Master 1 Supervisor Mode Access
1224 * Control */
1225 uint32_t M1PE : 1; /*!< [11] Bus Master 1 Process Identifier Enable */
1226 uint32_t M2UM : 3; /*!< [14:12] Bus Master 2 User Mode Access Control
1227 * */
1228 uint32_t M2SM : 2; /*!< [16:15] Bus Master 2 Supervisor Mode Access
1229 * Control */
1230 uint32_t M2PE : 1; /*!< [17] Bus Master 2 Process Identifier Enable */
1231 uint32_t M3UM : 3; /*!< [20:18] Bus Master 3 User Mode Access Control
1232 * */
1233 uint32_t M3SM : 2; /*!< [22:21] Bus Master 3 Supervisor Mode Access
1234 * Control */
1235 uint32_t M3PE : 1; /*!< [23] Bus Master 3 Process Identifier Enable */
1236 uint32_t M4WE : 1; /*!< [24] Bus Master 4 Write Enable */
1237 uint32_t M4RE : 1; /*!< [25] Bus Master 4 Read Enable */
1238 uint32_t M5WE : 1; /*!< [26] Bus Master 5 Write Enable */
1239 uint32_t M5RE : 1; /*!< [27] Bus Master 5 Read Enable */
1240 uint32_t M6WE : 1; /*!< [28] Bus Master 6 Write Enable */
1241 uint32_t M6RE : 1; /*!< [29] Bus Master 6 Read Enable */
1242 uint32_t M7WE : 1; /*!< [30] Bus Master 7 Write Enable */
1243 uint32_t M7RE : 1; /*!< [31] Bus Master 7 Read Enable */
1244 } B;
1245 } hw_mpu_rgdaacn_t;
1246
1247 /*!
1248 * @name Constants and macros for entire MPU_RGDAACn register
1249 */
1250 /*@{*/
1251 #define HW_MPU_RGDAACn_COUNT (12U)
1252
1253 #define HW_MPU_RGDAACn_ADDR(x, n) ((x) + 0x800U + (0x4U * (n)))
1254
1255 #define HW_MPU_RGDAACn(x, n) (*(__IO hw_mpu_rgdaacn_t *) HW_MPU_RGDAACn_ADDR(x, n))
1256 #define HW_MPU_RGDAACn_RD(x, n) (HW_MPU_RGDAACn(x, n).U)
1257 #define HW_MPU_RGDAACn_WR(x, n, v) (HW_MPU_RGDAACn(x, n).U = (v))
1258 #define HW_MPU_RGDAACn_SET(x, n, v) (HW_MPU_RGDAACn_WR(x, n, HW_MPU_RGDAACn_RD(x, n) | (v)))
1259 #define HW_MPU_RGDAACn_CLR(x, n, v) (HW_MPU_RGDAACn_WR(x, n, HW_MPU_RGDAACn_RD(x, n) & ~(v)))
1260 #define HW_MPU_RGDAACn_TOG(x, n, v) (HW_MPU_RGDAACn_WR(x, n, HW_MPU_RGDAACn_RD(x, n) ^ (v)))
1261 /*@}*/
1262
1263 /*
1264 * Constants & macros for individual MPU_RGDAACn bitfields
1265 */
1266
1267 /*!
1268 * @name Register MPU_RGDAACn, field M0UM[2:0] (RW)
1269 *
1270 * See M3UM description.
1271 */
1272 /*@{*/
1273 #define BP_MPU_RGDAACn_M0UM (0U) /*!< Bit position for MPU_RGDAACn_M0UM. */
1274 #define BM_MPU_RGDAACn_M0UM (0x00000007U) /*!< Bit mask for MPU_RGDAACn_M0UM. */
1275 #define BS_MPU_RGDAACn_M0UM (3U) /*!< Bit field size in bits for MPU_RGDAACn_M0UM. */
1276
1277 /*! @brief Read current value of the MPU_RGDAACn_M0UM field. */
1278 #define BR_MPU_RGDAACn_M0UM(x, n) (HW_MPU_RGDAACn(x, n).B.M0UM)
1279
1280 /*! @brief Format value for bitfield MPU_RGDAACn_M0UM. */
1281 #define BF_MPU_RGDAACn_M0UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M0UM) & BM_MPU_RGDAACn_M0UM)
1282
1283 /*! @brief Set the M0UM field to a new value. */
1284 #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)))
1285 /*@}*/
1286
1287 /*!
1288 * @name Register MPU_RGDAACn, field M0SM[4:3] (RW)
1289 *
1290 * See M3SM description.
1291 */
1292 /*@{*/
1293 #define BP_MPU_RGDAACn_M0SM (3U) /*!< Bit position for MPU_RGDAACn_M0SM. */
1294 #define BM_MPU_RGDAACn_M0SM (0x00000018U) /*!< Bit mask for MPU_RGDAACn_M0SM. */
1295 #define BS_MPU_RGDAACn_M0SM (2U) /*!< Bit field size in bits for MPU_RGDAACn_M0SM. */
1296
1297 /*! @brief Read current value of the MPU_RGDAACn_M0SM field. */
1298 #define BR_MPU_RGDAACn_M0SM(x, n) (HW_MPU_RGDAACn(x, n).B.M0SM)
1299
1300 /*! @brief Format value for bitfield MPU_RGDAACn_M0SM. */
1301 #define BF_MPU_RGDAACn_M0SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M0SM) & BM_MPU_RGDAACn_M0SM)
1302
1303 /*! @brief Set the M0SM field to a new value. */
1304 #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)))
1305 /*@}*/
1306
1307 /*!
1308 * @name Register MPU_RGDAACn, field M0PE[5] (RW)
1309 *
1310 * See M3PE description.
1311 */
1312 /*@{*/
1313 #define BP_MPU_RGDAACn_M0PE (5U) /*!< Bit position for MPU_RGDAACn_M0PE. */
1314 #define BM_MPU_RGDAACn_M0PE (0x00000020U) /*!< Bit mask for MPU_RGDAACn_M0PE. */
1315 #define BS_MPU_RGDAACn_M0PE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M0PE. */
1316
1317 /*! @brief Read current value of the MPU_RGDAACn_M0PE field. */
1318 #define BR_MPU_RGDAACn_M0PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M0PE))
1319
1320 /*! @brief Format value for bitfield MPU_RGDAACn_M0PE. */
1321 #define BF_MPU_RGDAACn_M0PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M0PE) & BM_MPU_RGDAACn_M0PE)
1322
1323 /*! @brief Set the M0PE field to a new value. */
1324 #define BW_MPU_RGDAACn_M0PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M0PE) = (v))
1325 /*@}*/
1326
1327 /*!
1328 * @name Register MPU_RGDAACn, field M1UM[8:6] (RW)
1329 *
1330 * See M3UM description.
1331 */
1332 /*@{*/
1333 #define BP_MPU_RGDAACn_M1UM (6U) /*!< Bit position for MPU_RGDAACn_M1UM. */
1334 #define BM_MPU_RGDAACn_M1UM (0x000001C0U) /*!< Bit mask for MPU_RGDAACn_M1UM. */
1335 #define BS_MPU_RGDAACn_M1UM (3U) /*!< Bit field size in bits for MPU_RGDAACn_M1UM. */
1336
1337 /*! @brief Read current value of the MPU_RGDAACn_M1UM field. */
1338 #define BR_MPU_RGDAACn_M1UM(x, n) (HW_MPU_RGDAACn(x, n).B.M1UM)
1339
1340 /*! @brief Format value for bitfield MPU_RGDAACn_M1UM. */
1341 #define BF_MPU_RGDAACn_M1UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M1UM) & BM_MPU_RGDAACn_M1UM)
1342
1343 /*! @brief Set the M1UM field to a new value. */
1344 #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)))
1345 /*@}*/
1346
1347 /*!
1348 * @name Register MPU_RGDAACn, field M1SM[10:9] (RW)
1349 *
1350 * See M3SM description.
1351 */
1352 /*@{*/
1353 #define BP_MPU_RGDAACn_M1SM (9U) /*!< Bit position for MPU_RGDAACn_M1SM. */
1354 #define BM_MPU_RGDAACn_M1SM (0x00000600U) /*!< Bit mask for MPU_RGDAACn_M1SM. */
1355 #define BS_MPU_RGDAACn_M1SM (2U) /*!< Bit field size in bits for MPU_RGDAACn_M1SM. */
1356
1357 /*! @brief Read current value of the MPU_RGDAACn_M1SM field. */
1358 #define BR_MPU_RGDAACn_M1SM(x, n) (HW_MPU_RGDAACn(x, n).B.M1SM)
1359
1360 /*! @brief Format value for bitfield MPU_RGDAACn_M1SM. */
1361 #define BF_MPU_RGDAACn_M1SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M1SM) & BM_MPU_RGDAACn_M1SM)
1362
1363 /*! @brief Set the M1SM field to a new value. */
1364 #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)))
1365 /*@}*/
1366
1367 /*!
1368 * @name Register MPU_RGDAACn, field M1PE[11] (RW)
1369 *
1370 * See M3PE description.
1371 */
1372 /*@{*/
1373 #define BP_MPU_RGDAACn_M1PE (11U) /*!< Bit position for MPU_RGDAACn_M1PE. */
1374 #define BM_MPU_RGDAACn_M1PE (0x00000800U) /*!< Bit mask for MPU_RGDAACn_M1PE. */
1375 #define BS_MPU_RGDAACn_M1PE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M1PE. */
1376
1377 /*! @brief Read current value of the MPU_RGDAACn_M1PE field. */
1378 #define BR_MPU_RGDAACn_M1PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M1PE))
1379
1380 /*! @brief Format value for bitfield MPU_RGDAACn_M1PE. */
1381 #define BF_MPU_RGDAACn_M1PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M1PE) & BM_MPU_RGDAACn_M1PE)
1382
1383 /*! @brief Set the M1PE field to a new value. */
1384 #define BW_MPU_RGDAACn_M1PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M1PE) = (v))
1385 /*@}*/
1386
1387 /*!
1388 * @name Register MPU_RGDAACn, field M2UM[14:12] (RW)
1389 *
1390 * See M3UM description.
1391 */
1392 /*@{*/
1393 #define BP_MPU_RGDAACn_M2UM (12U) /*!< Bit position for MPU_RGDAACn_M2UM. */
1394 #define BM_MPU_RGDAACn_M2UM (0x00007000U) /*!< Bit mask for MPU_RGDAACn_M2UM. */
1395 #define BS_MPU_RGDAACn_M2UM (3U) /*!< Bit field size in bits for MPU_RGDAACn_M2UM. */
1396
1397 /*! @brief Read current value of the MPU_RGDAACn_M2UM field. */
1398 #define BR_MPU_RGDAACn_M2UM(x, n) (HW_MPU_RGDAACn(x, n).B.M2UM)
1399
1400 /*! @brief Format value for bitfield MPU_RGDAACn_M2UM. */
1401 #define BF_MPU_RGDAACn_M2UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M2UM) & BM_MPU_RGDAACn_M2UM)
1402
1403 /*! @brief Set the M2UM field to a new value. */
1404 #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)))
1405 /*@}*/
1406
1407 /*!
1408 * @name Register MPU_RGDAACn, field M2SM[16:15] (RW)
1409 *
1410 * See M3SM description.
1411 */
1412 /*@{*/
1413 #define BP_MPU_RGDAACn_M2SM (15U) /*!< Bit position for MPU_RGDAACn_M2SM. */
1414 #define BM_MPU_RGDAACn_M2SM (0x00018000U) /*!< Bit mask for MPU_RGDAACn_M2SM. */
1415 #define BS_MPU_RGDAACn_M2SM (2U) /*!< Bit field size in bits for MPU_RGDAACn_M2SM. */
1416
1417 /*! @brief Read current value of the MPU_RGDAACn_M2SM field. */
1418 #define BR_MPU_RGDAACn_M2SM(x, n) (HW_MPU_RGDAACn(x, n).B.M2SM)
1419
1420 /*! @brief Format value for bitfield MPU_RGDAACn_M2SM. */
1421 #define BF_MPU_RGDAACn_M2SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M2SM) & BM_MPU_RGDAACn_M2SM)
1422
1423 /*! @brief Set the M2SM field to a new value. */
1424 #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)))
1425 /*@}*/
1426
1427 /*!
1428 * @name Register MPU_RGDAACn, field M2PE[17] (RW)
1429 *
1430 * See M3PE description.
1431 */
1432 /*@{*/
1433 #define BP_MPU_RGDAACn_M2PE (17U) /*!< Bit position for MPU_RGDAACn_M2PE. */
1434 #define BM_MPU_RGDAACn_M2PE (0x00020000U) /*!< Bit mask for MPU_RGDAACn_M2PE. */
1435 #define BS_MPU_RGDAACn_M2PE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M2PE. */
1436
1437 /*! @brief Read current value of the MPU_RGDAACn_M2PE field. */
1438 #define BR_MPU_RGDAACn_M2PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M2PE))
1439
1440 /*! @brief Format value for bitfield MPU_RGDAACn_M2PE. */
1441 #define BF_MPU_RGDAACn_M2PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M2PE) & BM_MPU_RGDAACn_M2PE)
1442
1443 /*! @brief Set the M2PE field to a new value. */
1444 #define BW_MPU_RGDAACn_M2PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M2PE) = (v))
1445 /*@}*/
1446
1447 /*!
1448 * @name Register MPU_RGDAACn, field M3UM[20:18] (RW)
1449 *
1450 * Defines the access controls for bus master 3 in user mode. M3UM consists of
1451 * three independent bits, enabling read (r), write (w), and execute (x)
1452 * permissions.
1453 *
1454 * Values:
1455 * - 0 - An attempted access of that mode may be terminated with an access error
1456 * (if not allowed by another descriptor) and the access not performed.
1457 * - 1 - Allows the given access type to occur
1458 */
1459 /*@{*/
1460 #define BP_MPU_RGDAACn_M3UM (18U) /*!< Bit position for MPU_RGDAACn_M3UM. */
1461 #define BM_MPU_RGDAACn_M3UM (0x001C0000U) /*!< Bit mask for MPU_RGDAACn_M3UM. */
1462 #define BS_MPU_RGDAACn_M3UM (3U) /*!< Bit field size in bits for MPU_RGDAACn_M3UM. */
1463
1464 /*! @brief Read current value of the MPU_RGDAACn_M3UM field. */
1465 #define BR_MPU_RGDAACn_M3UM(x, n) (HW_MPU_RGDAACn(x, n).B.M3UM)
1466
1467 /*! @brief Format value for bitfield MPU_RGDAACn_M3UM. */
1468 #define BF_MPU_RGDAACn_M3UM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M3UM) & BM_MPU_RGDAACn_M3UM)
1469
1470 /*! @brief Set the M3UM field to a new value. */
1471 #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)))
1472 /*@}*/
1473
1474 /*!
1475 * @name Register MPU_RGDAACn, field M3SM[22:21] (RW)
1476 *
1477 * Defines the access controls for bus master 3 in Supervisor mode.
1478 *
1479 * Values:
1480 * - 00 - r/w/x; read, write and execute allowed
1481 * - 01 - r/x; read and execute allowed, but no write
1482 * - 10 - r/w; read and write allowed, but no execute
1483 * - 11 - Same as User mode defined in M3UM
1484 */
1485 /*@{*/
1486 #define BP_MPU_RGDAACn_M3SM (21U) /*!< Bit position for MPU_RGDAACn_M3SM. */
1487 #define BM_MPU_RGDAACn_M3SM (0x00600000U) /*!< Bit mask for MPU_RGDAACn_M3SM. */
1488 #define BS_MPU_RGDAACn_M3SM (2U) /*!< Bit field size in bits for MPU_RGDAACn_M3SM. */
1489
1490 /*! @brief Read current value of the MPU_RGDAACn_M3SM field. */
1491 #define BR_MPU_RGDAACn_M3SM(x, n) (HW_MPU_RGDAACn(x, n).B.M3SM)
1492
1493 /*! @brief Format value for bitfield MPU_RGDAACn_M3SM. */
1494 #define BF_MPU_RGDAACn_M3SM(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M3SM) & BM_MPU_RGDAACn_M3SM)
1495
1496 /*! @brief Set the M3SM field to a new value. */
1497 #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)))
1498 /*@}*/
1499
1500 /*!
1501 * @name Register MPU_RGDAACn, field M3PE[23] (RW)
1502 *
1503 * Values:
1504 * - 0 - Do not include the process identifier in the evaluation
1505 * - 1 - Include the process identifier and mask (RGDn.RGDAAC) in the region hit
1506 * evaluation
1507 */
1508 /*@{*/
1509 #define BP_MPU_RGDAACn_M3PE (23U) /*!< Bit position for MPU_RGDAACn_M3PE. */
1510 #define BM_MPU_RGDAACn_M3PE (0x00800000U) /*!< Bit mask for MPU_RGDAACn_M3PE. */
1511 #define BS_MPU_RGDAACn_M3PE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M3PE. */
1512
1513 /*! @brief Read current value of the MPU_RGDAACn_M3PE field. */
1514 #define BR_MPU_RGDAACn_M3PE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M3PE))
1515
1516 /*! @brief Format value for bitfield MPU_RGDAACn_M3PE. */
1517 #define BF_MPU_RGDAACn_M3PE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M3PE) & BM_MPU_RGDAACn_M3PE)
1518
1519 /*! @brief Set the M3PE field to a new value. */
1520 #define BW_MPU_RGDAACn_M3PE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M3PE) = (v))
1521 /*@}*/
1522
1523 /*!
1524 * @name Register MPU_RGDAACn, field M4WE[24] (RW)
1525 *
1526 * Values:
1527 * - 0 - Bus master 4 writes terminate with an access error and the write is not
1528 * performed
1529 * - 1 - Bus master 4 writes allowed
1530 */
1531 /*@{*/
1532 #define BP_MPU_RGDAACn_M4WE (24U) /*!< Bit position for MPU_RGDAACn_M4WE. */
1533 #define BM_MPU_RGDAACn_M4WE (0x01000000U) /*!< Bit mask for MPU_RGDAACn_M4WE. */
1534 #define BS_MPU_RGDAACn_M4WE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M4WE. */
1535
1536 /*! @brief Read current value of the MPU_RGDAACn_M4WE field. */
1537 #define BR_MPU_RGDAACn_M4WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M4WE))
1538
1539 /*! @brief Format value for bitfield MPU_RGDAACn_M4WE. */
1540 #define BF_MPU_RGDAACn_M4WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M4WE) & BM_MPU_RGDAACn_M4WE)
1541
1542 /*! @brief Set the M4WE field to a new value. */
1543 #define BW_MPU_RGDAACn_M4WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M4WE) = (v))
1544 /*@}*/
1545
1546 /*!
1547 * @name Register MPU_RGDAACn, field M4RE[25] (RW)
1548 *
1549 * Values:
1550 * - 0 - Bus master 4 reads terminate with an access error and the read is not
1551 * performed
1552 * - 1 - Bus master 4 reads allowed
1553 */
1554 /*@{*/
1555 #define BP_MPU_RGDAACn_M4RE (25U) /*!< Bit position for MPU_RGDAACn_M4RE. */
1556 #define BM_MPU_RGDAACn_M4RE (0x02000000U) /*!< Bit mask for MPU_RGDAACn_M4RE. */
1557 #define BS_MPU_RGDAACn_M4RE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M4RE. */
1558
1559 /*! @brief Read current value of the MPU_RGDAACn_M4RE field. */
1560 #define BR_MPU_RGDAACn_M4RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M4RE))
1561
1562 /*! @brief Format value for bitfield MPU_RGDAACn_M4RE. */
1563 #define BF_MPU_RGDAACn_M4RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M4RE) & BM_MPU_RGDAACn_M4RE)
1564
1565 /*! @brief Set the M4RE field to a new value. */
1566 #define BW_MPU_RGDAACn_M4RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M4RE) = (v))
1567 /*@}*/
1568
1569 /*!
1570 * @name Register MPU_RGDAACn, field M5WE[26] (RW)
1571 *
1572 * Values:
1573 * - 0 - Bus master 5 writes terminate with an access error and the write is not
1574 * performed
1575 * - 1 - Bus master 5 writes allowed
1576 */
1577 /*@{*/
1578 #define BP_MPU_RGDAACn_M5WE (26U) /*!< Bit position for MPU_RGDAACn_M5WE. */
1579 #define BM_MPU_RGDAACn_M5WE (0x04000000U) /*!< Bit mask for MPU_RGDAACn_M5WE. */
1580 #define BS_MPU_RGDAACn_M5WE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M5WE. */
1581
1582 /*! @brief Read current value of the MPU_RGDAACn_M5WE field. */
1583 #define BR_MPU_RGDAACn_M5WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M5WE))
1584
1585 /*! @brief Format value for bitfield MPU_RGDAACn_M5WE. */
1586 #define BF_MPU_RGDAACn_M5WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M5WE) & BM_MPU_RGDAACn_M5WE)
1587
1588 /*! @brief Set the M5WE field to a new value. */
1589 #define BW_MPU_RGDAACn_M5WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M5WE) = (v))
1590 /*@}*/
1591
1592 /*!
1593 * @name Register MPU_RGDAACn, field M5RE[27] (RW)
1594 *
1595 * Values:
1596 * - 0 - Bus master 5 reads terminate with an access error and the read is not
1597 * performed
1598 * - 1 - Bus master 5 reads allowed
1599 */
1600 /*@{*/
1601 #define BP_MPU_RGDAACn_M5RE (27U) /*!< Bit position for MPU_RGDAACn_M5RE. */
1602 #define BM_MPU_RGDAACn_M5RE (0x08000000U) /*!< Bit mask for MPU_RGDAACn_M5RE. */
1603 #define BS_MPU_RGDAACn_M5RE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M5RE. */
1604
1605 /*! @brief Read current value of the MPU_RGDAACn_M5RE field. */
1606 #define BR_MPU_RGDAACn_M5RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M5RE))
1607
1608 /*! @brief Format value for bitfield MPU_RGDAACn_M5RE. */
1609 #define BF_MPU_RGDAACn_M5RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M5RE) & BM_MPU_RGDAACn_M5RE)
1610
1611 /*! @brief Set the M5RE field to a new value. */
1612 #define BW_MPU_RGDAACn_M5RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M5RE) = (v))
1613 /*@}*/
1614
1615 /*!
1616 * @name Register MPU_RGDAACn, field M6WE[28] (RW)
1617 *
1618 * Values:
1619 * - 0 - Bus master 6 writes terminate with an access error and the write is not
1620 * performed
1621 * - 1 - Bus master 6 writes allowed
1622 */
1623 /*@{*/
1624 #define BP_MPU_RGDAACn_M6WE (28U) /*!< Bit position for MPU_RGDAACn_M6WE. */
1625 #define BM_MPU_RGDAACn_M6WE (0x10000000U) /*!< Bit mask for MPU_RGDAACn_M6WE. */
1626 #define BS_MPU_RGDAACn_M6WE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M6WE. */
1627
1628 /*! @brief Read current value of the MPU_RGDAACn_M6WE field. */
1629 #define BR_MPU_RGDAACn_M6WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M6WE))
1630
1631 /*! @brief Format value for bitfield MPU_RGDAACn_M6WE. */
1632 #define BF_MPU_RGDAACn_M6WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M6WE) & BM_MPU_RGDAACn_M6WE)
1633
1634 /*! @brief Set the M6WE field to a new value. */
1635 #define BW_MPU_RGDAACn_M6WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M6WE) = (v))
1636 /*@}*/
1637
1638 /*!
1639 * @name Register MPU_RGDAACn, field M6RE[29] (RW)
1640 *
1641 * Values:
1642 * - 0 - Bus master 6 reads terminate with an access error and the read is not
1643 * performed
1644 * - 1 - Bus master 6 reads allowed
1645 */
1646 /*@{*/
1647 #define BP_MPU_RGDAACn_M6RE (29U) /*!< Bit position for MPU_RGDAACn_M6RE. */
1648 #define BM_MPU_RGDAACn_M6RE (0x20000000U) /*!< Bit mask for MPU_RGDAACn_M6RE. */
1649 #define BS_MPU_RGDAACn_M6RE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M6RE. */
1650
1651 /*! @brief Read current value of the MPU_RGDAACn_M6RE field. */
1652 #define BR_MPU_RGDAACn_M6RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M6RE))
1653
1654 /*! @brief Format value for bitfield MPU_RGDAACn_M6RE. */
1655 #define BF_MPU_RGDAACn_M6RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M6RE) & BM_MPU_RGDAACn_M6RE)
1656
1657 /*! @brief Set the M6RE field to a new value. */
1658 #define BW_MPU_RGDAACn_M6RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M6RE) = (v))
1659 /*@}*/
1660
1661 /*!
1662 * @name Register MPU_RGDAACn, field M7WE[30] (RW)
1663 *
1664 * Values:
1665 * - 0 - Bus master 7 writes terminate with an access error and the write is not
1666 * performed
1667 * - 1 - Bus master 7 writes allowed
1668 */
1669 /*@{*/
1670 #define BP_MPU_RGDAACn_M7WE (30U) /*!< Bit position for MPU_RGDAACn_M7WE. */
1671 #define BM_MPU_RGDAACn_M7WE (0x40000000U) /*!< Bit mask for MPU_RGDAACn_M7WE. */
1672 #define BS_MPU_RGDAACn_M7WE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M7WE. */
1673
1674 /*! @brief Read current value of the MPU_RGDAACn_M7WE field. */
1675 #define BR_MPU_RGDAACn_M7WE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M7WE))
1676
1677 /*! @brief Format value for bitfield MPU_RGDAACn_M7WE. */
1678 #define BF_MPU_RGDAACn_M7WE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M7WE) & BM_MPU_RGDAACn_M7WE)
1679
1680 /*! @brief Set the M7WE field to a new value. */
1681 #define BW_MPU_RGDAACn_M7WE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M7WE) = (v))
1682 /*@}*/
1683
1684 /*!
1685 * @name Register MPU_RGDAACn, field M7RE[31] (RW)
1686 *
1687 * Values:
1688 * - 0 - Bus master 7 reads terminate with an access error and the read is not
1689 * performed
1690 * - 1 - Bus master 7 reads allowed
1691 */
1692 /*@{*/
1693 #define BP_MPU_RGDAACn_M7RE (31U) /*!< Bit position for MPU_RGDAACn_M7RE. */
1694 #define BM_MPU_RGDAACn_M7RE (0x80000000U) /*!< Bit mask for MPU_RGDAACn_M7RE. */
1695 #define BS_MPU_RGDAACn_M7RE (1U) /*!< Bit field size in bits for MPU_RGDAACn_M7RE. */
1696
1697 /*! @brief Read current value of the MPU_RGDAACn_M7RE field. */
1698 #define BR_MPU_RGDAACn_M7RE(x, n) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M7RE))
1699
1700 /*! @brief Format value for bitfield MPU_RGDAACn_M7RE. */
1701 #define BF_MPU_RGDAACn_M7RE(v) ((uint32_t)((uint32_t)(v) << BP_MPU_RGDAACn_M7RE) & BM_MPU_RGDAACn_M7RE)
1702
1703 /*! @brief Set the M7RE field to a new value. */
1704 #define BW_MPU_RGDAACn_M7RE(x, n, v) (BITBAND_ACCESS32(HW_MPU_RGDAACn_ADDR(x, n), BP_MPU_RGDAACn_M7RE) = (v))
1705 /*@}*/
1706
1707 /*******************************************************************************
1708 * hw_mpu_t - module struct
1709 ******************************************************************************/
1710 /*!
1711 * @brief All MPU module registers.
1712 */
1713 #pragma pack(1)
1714 typedef struct _hw_mpu
1715 {
1716 __IO hw_mpu_cesr_t CESR; /*!< [0x0] Control/Error Status Register */
1717 uint8_t _reserved0[12];
1718 struct {
1719 __I hw_mpu_earn_t EARn; /*!< [0x10] Error Address Register, slave port n */
1720 __I hw_mpu_edrn_t EDRn; /*!< [0x14] Error Detail Register, slave port n */
1721 } SP[5];
1722 uint8_t _reserved1[968];
1723 struct {
1724 __IO hw_mpu_rgdn_word0_t RGDn_WORD0; /*!< [0x400] Region Descriptor n, Word 0 */
1725 __IO hw_mpu_rgdn_word1_t RGDn_WORD1; /*!< [0x404] Region Descriptor n, Word 1 */
1726 __IO hw_mpu_rgdn_word2_t RGDn_WORD2; /*!< [0x408] Region Descriptor n, Word 2 */
1727 __IO hw_mpu_rgdn_word3_t RGDn_WORD3; /*!< [0x40C] Region Descriptor n, Word 3 */
1728 } RGD[12];
1729 uint8_t _reserved2[832];
1730 __IO hw_mpu_rgdaacn_t RGDAACn[12]; /*!< [0x800] Region Descriptor Alternate Access Control n */
1731 } hw_mpu_t;
1732 #pragma pack()
1733
1734 /*! @brief Macro to access all MPU registers. */
1735 /*! @param x MPU module instance base address. */
1736 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
1737 * use the '&' operator, like <code>&HW_MPU(MPU_BASE)</code>. */
1738 #define HW_MPU(x) (*(hw_mpu_t *)(x))
1739
1740 #endif /* __HW_MPU_REGISTERS_H__ */
1741 /* EOF */
Imprint / Impressum