2 ** ###################################################################
3 ** Compilers: Keil ARM C/C++ Compiler
4 ** Freescale C/C++ for Embedded ARM
6 ** IAR ANSI C/C++ Compiler for ARM
8 ** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
9 ** Version: rev. 2.5, 2014-02-10
13 ** Extension to the CMSIS register access layer header.
15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
16 ** All rights reserved.
18 ** Redistribution and use in source and binary forms, with or without modification,
19 ** are permitted provided that the following conditions are met:
21 ** o Redistributions of source code must retain the above copyright notice, this list
22 ** of conditions and the following disclaimer.
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.
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.
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.
43 ** http: www.freescale.com
44 ** mail: support@freescale.com
47 ** - rev. 1.0 (2013-08-12)
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.
72 ** ###################################################################
76 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
78 * This file was generated automatically and any changes may be lost.
80 #ifndef __HW_FB_REGISTERS_H__
81 #define __HW_FB_REGISTERS_H__
84 #include "fsl_bitaccess.h"
89 * FlexBus external bus interface
91 * Registers defined in this header file:
92 * - HW_FB_CSARn - Chip Select Address Register
93 * - HW_FB_CSMRn - Chip Select Mask Register
94 * - HW_FB_CSCRn - Chip Select Control Register
95 * - HW_FB_CSPMCR - Chip Select port Multiplexing Control Register
97 * - hw_fb_t - Struct containing all module registers.
100 #define HW_FB_INSTANCE_COUNT (1U) /*!< Number of instances of the FB module. */
102 /*******************************************************************************
103 * HW_FB_CSARn - Chip Select Address Register
104 ******************************************************************************/
107 * @brief HW_FB_CSARn - Chip Select Address Register (RW)
109 * Reset value: 0x00000000U
111 * Specifies the associated chip-select's base address.
113 typedef union _hw_fb_csarn
116 struct _hw_fb_csarn_bitfields
118 uint32_t RESERVED0 : 16; /*!< [15:0] */
119 uint32_t BA : 16; /*!< [31:16] Base Address */
124 * @name Constants and macros for entire FB_CSARn register
127 #define HW_FB_CSARn_COUNT (6U)
129 #define HW_FB_CSARn_ADDR(x, n) ((x) + 0x0U + (0xCU * (n)))
131 #define HW_FB_CSARn(x, n) (*(__IO hw_fb_csarn_t *) HW_FB_CSARn_ADDR(x, n))
132 #define HW_FB_CSARn_RD(x, n) (HW_FB_CSARn(x, n).U)
133 #define HW_FB_CSARn_WR(x, n, v) (HW_FB_CSARn(x, n).U = (v))
134 #define HW_FB_CSARn_SET(x, n, v) (HW_FB_CSARn_WR(x, n, HW_FB_CSARn_RD(x, n) | (v)))
135 #define HW_FB_CSARn_CLR(x, n, v) (HW_FB_CSARn_WR(x, n, HW_FB_CSARn_RD(x, n) & ~(v)))
136 #define HW_FB_CSARn_TOG(x, n, v) (HW_FB_CSARn_WR(x, n, HW_FB_CSARn_RD(x, n) ^ (v)))
140 * Constants & macros for individual FB_CSARn bitfields
144 * @name Register FB_CSARn, field BA[31:16] (RW)
146 * Defines the base address for memory dedicated to the associated chip-select.
147 * BA is compared to bits 31-16 on the internal address bus to determine if the
148 * associated chip-select's memory is being accessed. Because the FlexBus module
149 * is one of the slaves connected to the crossbar switch, it is only accessible
150 * within a certain memory range. See the chip memory map for the applicable
151 * FlexBus "expansion" address range for which the chip-selects can be active. Set the
152 * CSARn and CSMRn registers appropriately before accessing this region.
155 #define BP_FB_CSARn_BA (16U) /*!< Bit position for FB_CSARn_BA. */
156 #define BM_FB_CSARn_BA (0xFFFF0000U) /*!< Bit mask for FB_CSARn_BA. */
157 #define BS_FB_CSARn_BA (16U) /*!< Bit field size in bits for FB_CSARn_BA. */
159 /*! @brief Read current value of the FB_CSARn_BA field. */
160 #define BR_FB_CSARn_BA(x, n) (HW_FB_CSARn(x, n).B.BA)
162 /*! @brief Format value for bitfield FB_CSARn_BA. */
163 #define BF_FB_CSARn_BA(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSARn_BA) & BM_FB_CSARn_BA)
165 /*! @brief Set the BA field to a new value. */
166 #define BW_FB_CSARn_BA(x, n, v) (HW_FB_CSARn_WR(x, n, (HW_FB_CSARn_RD(x, n) & ~BM_FB_CSARn_BA) | BF_FB_CSARn_BA(v)))
168 /*******************************************************************************
169 * HW_FB_CSMRn - Chip Select Mask Register
170 ******************************************************************************/
173 * @brief HW_FB_CSMRn - Chip Select Mask Register (RW)
175 * Reset value: 0x00000000U
177 * Specifies the address mask and allowable access types for the associated
180 typedef union _hw_fb_csmrn
183 struct _hw_fb_csmrn_bitfields
185 uint32_t V : 1; /*!< [0] Valid */
186 uint32_t RESERVED0 : 7; /*!< [7:1] */
187 uint32_t WP : 1; /*!< [8] Write Protect */
188 uint32_t RESERVED1 : 7; /*!< [15:9] */
189 uint32_t BAM : 16; /*!< [31:16] Base Address Mask */
194 * @name Constants and macros for entire FB_CSMRn register
197 #define HW_FB_CSMRn_COUNT (6U)
199 #define HW_FB_CSMRn_ADDR(x, n) ((x) + 0x4U + (0xCU * (n)))
201 #define HW_FB_CSMRn(x, n) (*(__IO hw_fb_csmrn_t *) HW_FB_CSMRn_ADDR(x, n))
202 #define HW_FB_CSMRn_RD(x, n) (HW_FB_CSMRn(x, n).U)
203 #define HW_FB_CSMRn_WR(x, n, v) (HW_FB_CSMRn(x, n).U = (v))
204 #define HW_FB_CSMRn_SET(x, n, v) (HW_FB_CSMRn_WR(x, n, HW_FB_CSMRn_RD(x, n) | (v)))
205 #define HW_FB_CSMRn_CLR(x, n, v) (HW_FB_CSMRn_WR(x, n, HW_FB_CSMRn_RD(x, n) & ~(v)))
206 #define HW_FB_CSMRn_TOG(x, n, v) (HW_FB_CSMRn_WR(x, n, HW_FB_CSMRn_RD(x, n) ^ (v)))
210 * Constants & macros for individual FB_CSMRn bitfields
214 * @name Register FB_CSMRn, field V[0] (RW)
216 * Specifies whether the corresponding CSAR, CSMR, and CSCR contents are valid.
217 * Programmed chip-selects do not assert until the V bit is 1b (except for
218 * FB_CS0, which acts as the global chip-select). At reset, FB_CS0 will fire for any
219 * access to the FlexBus memory region. CSMR0[V] must be set as part of the chip
220 * select initialization sequence to allow other chip selects to function as
224 * - 0 - Chip-select is invalid.
225 * - 1 - Chip-select is valid.
228 #define BP_FB_CSMRn_V (0U) /*!< Bit position for FB_CSMRn_V. */
229 #define BM_FB_CSMRn_V (0x00000001U) /*!< Bit mask for FB_CSMRn_V. */
230 #define BS_FB_CSMRn_V (1U) /*!< Bit field size in bits for FB_CSMRn_V. */
232 /*! @brief Read current value of the FB_CSMRn_V field. */
233 #define BR_FB_CSMRn_V(x, n) (BITBAND_ACCESS32(HW_FB_CSMRn_ADDR(x, n), BP_FB_CSMRn_V))
235 /*! @brief Format value for bitfield FB_CSMRn_V. */
236 #define BF_FB_CSMRn_V(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSMRn_V) & BM_FB_CSMRn_V)
238 /*! @brief Set the V field to a new value. */
239 #define BW_FB_CSMRn_V(x, n, v) (BITBAND_ACCESS32(HW_FB_CSMRn_ADDR(x, n), BP_FB_CSMRn_V) = (v))
243 * @name Register FB_CSMRn, field WP[8] (RW)
245 * Controls write accesses to the address range in the corresponding CSAR.
248 * - 0 - Write accesses are allowed.
249 * - 1 - Write accesses are not allowed. Attempting to write to the range of
250 * addresses for which the WP bit is set results in a bus error termination of
251 * the internal cycle and no external cycle.
254 #define BP_FB_CSMRn_WP (8U) /*!< Bit position for FB_CSMRn_WP. */
255 #define BM_FB_CSMRn_WP (0x00000100U) /*!< Bit mask for FB_CSMRn_WP. */
256 #define BS_FB_CSMRn_WP (1U) /*!< Bit field size in bits for FB_CSMRn_WP. */
258 /*! @brief Read current value of the FB_CSMRn_WP field. */
259 #define BR_FB_CSMRn_WP(x, n) (BITBAND_ACCESS32(HW_FB_CSMRn_ADDR(x, n), BP_FB_CSMRn_WP))
261 /*! @brief Format value for bitfield FB_CSMRn_WP. */
262 #define BF_FB_CSMRn_WP(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSMRn_WP) & BM_FB_CSMRn_WP)
264 /*! @brief Set the WP field to a new value. */
265 #define BW_FB_CSMRn_WP(x, n, v) (BITBAND_ACCESS32(HW_FB_CSMRn_ADDR(x, n), BP_FB_CSMRn_WP) = (v))
269 * @name Register FB_CSMRn, field BAM[31:16] (RW)
271 * Defines the associated chip-select's block size by masking address bits.
274 * - 0 - The corresponding address bit in CSAR is used in the chip-select decode.
275 * - 1 - The corresponding address bit in CSAR is a don't care in the
276 * chip-select decode.
279 #define BP_FB_CSMRn_BAM (16U) /*!< Bit position for FB_CSMRn_BAM. */
280 #define BM_FB_CSMRn_BAM (0xFFFF0000U) /*!< Bit mask for FB_CSMRn_BAM. */
281 #define BS_FB_CSMRn_BAM (16U) /*!< Bit field size in bits for FB_CSMRn_BAM. */
283 /*! @brief Read current value of the FB_CSMRn_BAM field. */
284 #define BR_FB_CSMRn_BAM(x, n) (HW_FB_CSMRn(x, n).B.BAM)
286 /*! @brief Format value for bitfield FB_CSMRn_BAM. */
287 #define BF_FB_CSMRn_BAM(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSMRn_BAM) & BM_FB_CSMRn_BAM)
289 /*! @brief Set the BAM field to a new value. */
290 #define BW_FB_CSMRn_BAM(x, n, v) (HW_FB_CSMRn_WR(x, n, (HW_FB_CSMRn_RD(x, n) & ~BM_FB_CSMRn_BAM) | BF_FB_CSMRn_BAM(v)))
292 /*******************************************************************************
293 * HW_FB_CSCRn - Chip Select Control Register
294 ******************************************************************************/
297 * @brief HW_FB_CSCRn - Chip Select Control Register (RW)
299 * Reset value: 0x003FFC00U
301 * Controls the auto-acknowledge, address setup and hold times, port size, burst
302 * capability, and number of wait states for the associated chip select. To
303 * support the global chip-select (FB_CS0), the CSCR0 reset values differ from the
304 * other CSCRs. The reset value of CSCR0 is as follows: Bits 31-24 are 0b Bit 23-3
305 * are chip-dependent Bits 3-0 are 0b See the chip configuration details for your
306 * particular chip for information on the exact CSCR0 reset value.
308 typedef union _hw_fb_cscrn
311 struct _hw_fb_cscrn_bitfields
313 uint32_t RESERVED0 : 3; /*!< [2:0] */
314 uint32_t BSTW : 1; /*!< [3] Burst-Write Enable */
315 uint32_t BSTR : 1; /*!< [4] Burst-Read Enable */
316 uint32_t BEM : 1; /*!< [5] Byte-Enable Mode */
317 uint32_t PS : 2; /*!< [7:6] Port Size */
318 uint32_t AA : 1; /*!< [8] Auto-Acknowledge Enable */
319 uint32_t BLS : 1; /*!< [9] Byte-Lane Shift */
320 uint32_t WS : 6; /*!< [15:10] Wait States */
321 uint32_t WRAH : 2; /*!< [17:16] Write Address Hold or Deselect */
322 uint32_t RDAH : 2; /*!< [19:18] Read Address Hold or Deselect */
323 uint32_t ASET : 2; /*!< [21:20] Address Setup */
324 uint32_t EXTS : 1; /*!< [22] */
325 uint32_t SWSEN : 1; /*!< [23] Secondary Wait State Enable */
326 uint32_t RESERVED1 : 2; /*!< [25:24] */
327 uint32_t SWS : 6; /*!< [31:26] Secondary Wait States */
332 * @name Constants and macros for entire FB_CSCRn register
335 #define HW_FB_CSCRn_COUNT (6U)
337 #define HW_FB_CSCRn_ADDR(x, n) ((x) + 0x8U + (0xCU * (n)))
339 #define HW_FB_CSCRn(x, n) (*(__IO hw_fb_cscrn_t *) HW_FB_CSCRn_ADDR(x, n))
340 #define HW_FB_CSCRn_RD(x, n) (HW_FB_CSCRn(x, n).U)
341 #define HW_FB_CSCRn_WR(x, n, v) (HW_FB_CSCRn(x, n).U = (v))
342 #define HW_FB_CSCRn_SET(x, n, v) (HW_FB_CSCRn_WR(x, n, HW_FB_CSCRn_RD(x, n) | (v)))
343 #define HW_FB_CSCRn_CLR(x, n, v) (HW_FB_CSCRn_WR(x, n, HW_FB_CSCRn_RD(x, n) & ~(v)))
344 #define HW_FB_CSCRn_TOG(x, n, v) (HW_FB_CSCRn_WR(x, n, HW_FB_CSCRn_RD(x, n) ^ (v)))
348 * Constants & macros for individual FB_CSCRn bitfields
352 * @name Register FB_CSCRn, field BSTW[3] (RW)
354 * Specifies whether burst writes are enabled for memory associated with each
358 * - 0 - Disabled. Data exceeding the specified port size is broken into
359 * individual, port-sized, non-burst writes. For example, a 32-bit write to an 8-bit
360 * port takes four byte writes.
361 * - 1 - Enabled. Enables burst write of data larger than the specified port
362 * size, including 32-bit writes to 8- and 16-bit ports, 16-bit writes to 8-bit
363 * ports, and line writes to 8-, 16-, and 32-bit ports.
366 #define BP_FB_CSCRn_BSTW (3U) /*!< Bit position for FB_CSCRn_BSTW. */
367 #define BM_FB_CSCRn_BSTW (0x00000008U) /*!< Bit mask for FB_CSCRn_BSTW. */
368 #define BS_FB_CSCRn_BSTW (1U) /*!< Bit field size in bits for FB_CSCRn_BSTW. */
370 /*! @brief Read current value of the FB_CSCRn_BSTW field. */
371 #define BR_FB_CSCRn_BSTW(x, n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_BSTW))
373 /*! @brief Format value for bitfield FB_CSCRn_BSTW. */
374 #define BF_FB_CSCRn_BSTW(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_BSTW) & BM_FB_CSCRn_BSTW)
376 /*! @brief Set the BSTW field to a new value. */
377 #define BW_FB_CSCRn_BSTW(x, n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_BSTW) = (v))
381 * @name Register FB_CSCRn, field BSTR[4] (RW)
383 * Specifies whether burst reads are enabled for memory associated with each
387 * - 0 - Disabled. Data exceeding the specified port size is broken into
388 * individual, port-sized, non-burst reads. For example, a 32-bit read from an 8-bit
389 * port is broken into four 8-bit reads.
390 * - 1 - Enabled. Enables data burst reads larger than the specified port size,
391 * including 32-bit reads from 8- and 16-bit ports, 16-bit reads from 8-bit
392 * ports, and line reads from 8-, 16-, and 32-bit ports.
395 #define BP_FB_CSCRn_BSTR (4U) /*!< Bit position for FB_CSCRn_BSTR. */
396 #define BM_FB_CSCRn_BSTR (0x00000010U) /*!< Bit mask for FB_CSCRn_BSTR. */
397 #define BS_FB_CSCRn_BSTR (1U) /*!< Bit field size in bits for FB_CSCRn_BSTR. */
399 /*! @brief Read current value of the FB_CSCRn_BSTR field. */
400 #define BR_FB_CSCRn_BSTR(x, n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_BSTR))
402 /*! @brief Format value for bitfield FB_CSCRn_BSTR. */
403 #define BF_FB_CSCRn_BSTR(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_BSTR) & BM_FB_CSCRn_BSTR)
405 /*! @brief Set the BSTR field to a new value. */
406 #define BW_FB_CSCRn_BSTR(x, n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_BSTR) = (v))
410 * @name Register FB_CSCRn, field BEM[5] (RW)
412 * Specifies whether the corresponding FB_BE is asserted for read accesses.
413 * Certain memories have byte enables that must be asserted during reads and writes.
414 * Write 1b to the BEM bit in the relevant CSCR to provide the appropriate mode
415 * of byte enable support for these SRAMs.
418 * - 0 - FB_BE is asserted for data write only.
419 * - 1 - FB_BE is asserted for data read and write accesses.
422 #define BP_FB_CSCRn_BEM (5U) /*!< Bit position for FB_CSCRn_BEM. */
423 #define BM_FB_CSCRn_BEM (0x00000020U) /*!< Bit mask for FB_CSCRn_BEM. */
424 #define BS_FB_CSCRn_BEM (1U) /*!< Bit field size in bits for FB_CSCRn_BEM. */
426 /*! @brief Read current value of the FB_CSCRn_BEM field. */
427 #define BR_FB_CSCRn_BEM(x, n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_BEM))
429 /*! @brief Format value for bitfield FB_CSCRn_BEM. */
430 #define BF_FB_CSCRn_BEM(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_BEM) & BM_FB_CSCRn_BEM)
432 /*! @brief Set the BEM field to a new value. */
433 #define BW_FB_CSCRn_BEM(x, n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_BEM) = (v))
437 * @name Register FB_CSCRn, field PS[7:6] (RW)
439 * Specifies the data port width of the associated chip-select, and determines
440 * where data is driven during write cycles and where data is sampled during read
444 * - 00 - 32-bit port size. Valid data is sampled and driven on FB_D[31:0].
445 * - 01 - 8-bit port size. Valid data is sampled and driven on FB_D[31:24] when
446 * BLS is 0b, or FB_D[7:0] when BLS is 1b.
449 #define BP_FB_CSCRn_PS (6U) /*!< Bit position for FB_CSCRn_PS. */
450 #define BM_FB_CSCRn_PS (0x000000C0U) /*!< Bit mask for FB_CSCRn_PS. */
451 #define BS_FB_CSCRn_PS (2U) /*!< Bit field size in bits for FB_CSCRn_PS. */
453 /*! @brief Read current value of the FB_CSCRn_PS field. */
454 #define BR_FB_CSCRn_PS(x, n) (HW_FB_CSCRn(x, n).B.PS)
456 /*! @brief Format value for bitfield FB_CSCRn_PS. */
457 #define BF_FB_CSCRn_PS(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_PS) & BM_FB_CSCRn_PS)
459 /*! @brief Set the PS field to a new value. */
460 #define BW_FB_CSCRn_PS(x, n, v) (HW_FB_CSCRn_WR(x, n, (HW_FB_CSCRn_RD(x, n) & ~BM_FB_CSCRn_PS) | BF_FB_CSCRn_PS(v)))
464 * @name Register FB_CSCRn, field AA[8] (RW)
466 * Asserts the internal transfer acknowledge for accesses specified by the
467 * chip-select address. If AA is 1b for a corresponding FB_CSn and the external system
468 * asserts an external FB_TA before the wait-state countdown asserts the
469 * internal FB_TA, the cycle is terminated. Burst cycles increment the address bus
470 * between each internal termination. This field must be 1b if CSPMCR disables FB_TA.
473 * - 0 - Disabled. No internal transfer acknowledge is asserted and the cycle is
474 * terminated externally.
475 * - 1 - Enabled. Internal transfer acknowledge is asserted as specified by WS.
478 #define BP_FB_CSCRn_AA (8U) /*!< Bit position for FB_CSCRn_AA. */
479 #define BM_FB_CSCRn_AA (0x00000100U) /*!< Bit mask for FB_CSCRn_AA. */
480 #define BS_FB_CSCRn_AA (1U) /*!< Bit field size in bits for FB_CSCRn_AA. */
482 /*! @brief Read current value of the FB_CSCRn_AA field. */
483 #define BR_FB_CSCRn_AA(x, n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_AA))
485 /*! @brief Format value for bitfield FB_CSCRn_AA. */
486 #define BF_FB_CSCRn_AA(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_AA) & BM_FB_CSCRn_AA)
488 /*! @brief Set the AA field to a new value. */
489 #define BW_FB_CSCRn_AA(x, n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_AA) = (v))
493 * @name Register FB_CSCRn, field BLS[9] (RW)
495 * Specifies if data on FB_AD appears left-aligned or right-aligned during the
496 * data phase of a FlexBus access.
499 * - 0 - Not shifted. Data is left-aligned on FB_AD.
500 * - 1 - Shifted. Data is right-aligned on FB_AD.
503 #define BP_FB_CSCRn_BLS (9U) /*!< Bit position for FB_CSCRn_BLS. */
504 #define BM_FB_CSCRn_BLS (0x00000200U) /*!< Bit mask for FB_CSCRn_BLS. */
505 #define BS_FB_CSCRn_BLS (1U) /*!< Bit field size in bits for FB_CSCRn_BLS. */
507 /*! @brief Read current value of the FB_CSCRn_BLS field. */
508 #define BR_FB_CSCRn_BLS(x, n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_BLS))
510 /*! @brief Format value for bitfield FB_CSCRn_BLS. */
511 #define BF_FB_CSCRn_BLS(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_BLS) & BM_FB_CSCRn_BLS)
513 /*! @brief Set the BLS field to a new value. */
514 #define BW_FB_CSCRn_BLS(x, n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_BLS) = (v))
518 * @name Register FB_CSCRn, field WS[15:10] (RW)
520 * Specifies the number of wait states inserted after FlexBus asserts the
521 * associated chip-select and before an internal transfer acknowledge is generated (WS
522 * = 00h inserts 0 wait states, ..., WS = 3Fh inserts 63 wait states).
525 #define BP_FB_CSCRn_WS (10U) /*!< Bit position for FB_CSCRn_WS. */
526 #define BM_FB_CSCRn_WS (0x0000FC00U) /*!< Bit mask for FB_CSCRn_WS. */
527 #define BS_FB_CSCRn_WS (6U) /*!< Bit field size in bits for FB_CSCRn_WS. */
529 /*! @brief Read current value of the FB_CSCRn_WS field. */
530 #define BR_FB_CSCRn_WS(x, n) (HW_FB_CSCRn(x, n).B.WS)
532 /*! @brief Format value for bitfield FB_CSCRn_WS. */
533 #define BF_FB_CSCRn_WS(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_WS) & BM_FB_CSCRn_WS)
535 /*! @brief Set the WS field to a new value. */
536 #define BW_FB_CSCRn_WS(x, n, v) (HW_FB_CSCRn_WR(x, n, (HW_FB_CSCRn_RD(x, n) & ~BM_FB_CSCRn_WS) | BF_FB_CSCRn_WS(v)))
540 * @name Register FB_CSCRn, field WRAH[17:16] (RW)
542 * Controls the address, data, and attribute hold time after the termination of
543 * a write cycle that hits in the associated chip-select's address space. The
544 * hold time applies only at the end of a transfer. Therefore, during a burst
545 * transfer or a transfer to a port size smaller than the transfer size, the hold time
546 * is only added after the last bus cycle.
549 * - 00 - 1 cycle (default for all but FB_CS0 )
552 * - 11 - 4 cycles (default for FB_CS0 )
555 #define BP_FB_CSCRn_WRAH (16U) /*!< Bit position for FB_CSCRn_WRAH. */
556 #define BM_FB_CSCRn_WRAH (0x00030000U) /*!< Bit mask for FB_CSCRn_WRAH. */
557 #define BS_FB_CSCRn_WRAH (2U) /*!< Bit field size in bits for FB_CSCRn_WRAH. */
559 /*! @brief Read current value of the FB_CSCRn_WRAH field. */
560 #define BR_FB_CSCRn_WRAH(x, n) (HW_FB_CSCRn(x, n).B.WRAH)
562 /*! @brief Format value for bitfield FB_CSCRn_WRAH. */
563 #define BF_FB_CSCRn_WRAH(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_WRAH) & BM_FB_CSCRn_WRAH)
565 /*! @brief Set the WRAH field to a new value. */
566 #define BW_FB_CSCRn_WRAH(x, n, v) (HW_FB_CSCRn_WR(x, n, (HW_FB_CSCRn_RD(x, n) & ~BM_FB_CSCRn_WRAH) | BF_FB_CSCRn_WRAH(v)))
570 * @name Register FB_CSCRn, field RDAH[19:18] (RW)
572 * Controls the address and attribute hold time after the termination during a
573 * read cycle that hits in the associated chip-select's address space. The hold
574 * time applies only at the end of a transfer. Therefore, during a burst transfer
575 * or a transfer to a port size smaller than the transfer size, the hold time is
576 * only added after the last bus cycle. The number of cycles the address and
577 * attributes are held after FB_CSn deassertion depends on the value of the AA bit.
580 * - 00 - When AA is 0b, 1 cycle. When AA is 1b, 0 cycles.
581 * - 01 - When AA is 0b, 2 cycles. When AA is 1b, 1 cycle.
582 * - 10 - When AA is 0b, 3 cycles. When AA is 1b, 2 cycles.
583 * - 11 - When AA is 0b, 4 cycles. When AA is 1b, 3 cycles.
586 #define BP_FB_CSCRn_RDAH (18U) /*!< Bit position for FB_CSCRn_RDAH. */
587 #define BM_FB_CSCRn_RDAH (0x000C0000U) /*!< Bit mask for FB_CSCRn_RDAH. */
588 #define BS_FB_CSCRn_RDAH (2U) /*!< Bit field size in bits for FB_CSCRn_RDAH. */
590 /*! @brief Read current value of the FB_CSCRn_RDAH field. */
591 #define BR_FB_CSCRn_RDAH(x, n) (HW_FB_CSCRn(x, n).B.RDAH)
593 /*! @brief Format value for bitfield FB_CSCRn_RDAH. */
594 #define BF_FB_CSCRn_RDAH(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_RDAH) & BM_FB_CSCRn_RDAH)
596 /*! @brief Set the RDAH field to a new value. */
597 #define BW_FB_CSCRn_RDAH(x, n, v) (HW_FB_CSCRn_WR(x, n, (HW_FB_CSCRn_RD(x, n) & ~BM_FB_CSCRn_RDAH) | BF_FB_CSCRn_RDAH(v)))
601 * @name Register FB_CSCRn, field ASET[21:20] (RW)
603 * Controls when the chip-select is asserted with respect to assertion of a
604 * valid address and attributes.
607 * - 00 - Assert FB_CSn on the first rising clock edge after the address is
608 * asserted (default for all but FB_CS0 ).
609 * - 01 - Assert FB_CSn on the second rising clock edge after the address is
611 * - 10 - Assert FB_CSn on the third rising clock edge after the address is
613 * - 11 - Assert FB_CSn on the fourth rising clock edge after the address is
614 * asserted (default for FB_CS0 ).
617 #define BP_FB_CSCRn_ASET (20U) /*!< Bit position for FB_CSCRn_ASET. */
618 #define BM_FB_CSCRn_ASET (0x00300000U) /*!< Bit mask for FB_CSCRn_ASET. */
619 #define BS_FB_CSCRn_ASET (2U) /*!< Bit field size in bits for FB_CSCRn_ASET. */
621 /*! @brief Read current value of the FB_CSCRn_ASET field. */
622 #define BR_FB_CSCRn_ASET(x, n) (HW_FB_CSCRn(x, n).B.ASET)
624 /*! @brief Format value for bitfield FB_CSCRn_ASET. */
625 #define BF_FB_CSCRn_ASET(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_ASET) & BM_FB_CSCRn_ASET)
627 /*! @brief Set the ASET field to a new value. */
628 #define BW_FB_CSCRn_ASET(x, n, v) (HW_FB_CSCRn_WR(x, n, (HW_FB_CSCRn_RD(x, n) & ~BM_FB_CSCRn_ASET) | BF_FB_CSCRn_ASET(v)))
632 * @name Register FB_CSCRn, field EXTS[22] (RW)
634 * Extended Transfer Start/Extended Address Latch Enable Controls how long FB_TS
635 * /FB_ALE is asserted.
638 * - 0 - Disabled. FB_TS /FB_ALE asserts for one bus clock cycle.
639 * - 1 - Enabled. FB_TS /FB_ALE remains asserted until the first positive clock
640 * edge after FB_CSn asserts.
643 #define BP_FB_CSCRn_EXTS (22U) /*!< Bit position for FB_CSCRn_EXTS. */
644 #define BM_FB_CSCRn_EXTS (0x00400000U) /*!< Bit mask for FB_CSCRn_EXTS. */
645 #define BS_FB_CSCRn_EXTS (1U) /*!< Bit field size in bits for FB_CSCRn_EXTS. */
647 /*! @brief Read current value of the FB_CSCRn_EXTS field. */
648 #define BR_FB_CSCRn_EXTS(x, n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_EXTS))
650 /*! @brief Format value for bitfield FB_CSCRn_EXTS. */
651 #define BF_FB_CSCRn_EXTS(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_EXTS) & BM_FB_CSCRn_EXTS)
653 /*! @brief Set the EXTS field to a new value. */
654 #define BW_FB_CSCRn_EXTS(x, n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_EXTS) = (v))
658 * @name Register FB_CSCRn, field SWSEN[23] (RW)
661 * - 0 - Disabled. A number of wait states (specified by WS) are inserted before
662 * an internal transfer acknowledge is generated for all transfers.
663 * - 1 - Enabled. A number of wait states (specified by SWS) are inserted before
664 * an internal transfer acknowledge is generated for burst transfer
665 * secondary terminations.
668 #define BP_FB_CSCRn_SWSEN (23U) /*!< Bit position for FB_CSCRn_SWSEN. */
669 #define BM_FB_CSCRn_SWSEN (0x00800000U) /*!< Bit mask for FB_CSCRn_SWSEN. */
670 #define BS_FB_CSCRn_SWSEN (1U) /*!< Bit field size in bits for FB_CSCRn_SWSEN. */
672 /*! @brief Read current value of the FB_CSCRn_SWSEN field. */
673 #define BR_FB_CSCRn_SWSEN(x, n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_SWSEN))
675 /*! @brief Format value for bitfield FB_CSCRn_SWSEN. */
676 #define BF_FB_CSCRn_SWSEN(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_SWSEN) & BM_FB_CSCRn_SWSEN)
678 /*! @brief Set the SWSEN field to a new value. */
679 #define BW_FB_CSCRn_SWSEN(x, n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(x, n), BP_FB_CSCRn_SWSEN) = (v))
683 * @name Register FB_CSCRn, field SWS[31:26] (RW)
685 * Used only when the SWSEN bit is 1b. Specifies the number of wait states
686 * inserted before an internal transfer acknowledge is generated for a burst transfer
687 * (except for the first termination, which is controlled by WS).
690 #define BP_FB_CSCRn_SWS (26U) /*!< Bit position for FB_CSCRn_SWS. */
691 #define BM_FB_CSCRn_SWS (0xFC000000U) /*!< Bit mask for FB_CSCRn_SWS. */
692 #define BS_FB_CSCRn_SWS (6U) /*!< Bit field size in bits for FB_CSCRn_SWS. */
694 /*! @brief Read current value of the FB_CSCRn_SWS field. */
695 #define BR_FB_CSCRn_SWS(x, n) (HW_FB_CSCRn(x, n).B.SWS)
697 /*! @brief Format value for bitfield FB_CSCRn_SWS. */
698 #define BF_FB_CSCRn_SWS(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSCRn_SWS) & BM_FB_CSCRn_SWS)
700 /*! @brief Set the SWS field to a new value. */
701 #define BW_FB_CSCRn_SWS(x, n, v) (HW_FB_CSCRn_WR(x, n, (HW_FB_CSCRn_RD(x, n) & ~BM_FB_CSCRn_SWS) | BF_FB_CSCRn_SWS(v)))
704 /*******************************************************************************
705 * HW_FB_CSPMCR - Chip Select port Multiplexing Control Register
706 ******************************************************************************/
709 * @brief HW_FB_CSPMCR - Chip Select port Multiplexing Control Register (RW)
711 * Reset value: 0x00000000U
713 * Controls the multiplexing of the FlexBus signals. A bus error occurs when you
714 * do any of the following: Write to a reserved address Write to a reserved
715 * field in this register, or Access this register using a size other than 32 bits.
717 typedef union _hw_fb_cspmcr
720 struct _hw_fb_cspmcr_bitfields
722 uint32_t RESERVED0 : 12; /*!< [11:0] */
723 uint32_t GROUP5 : 4; /*!< [15:12] FlexBus Signal Group 5 Multiplex
725 uint32_t GROUP4 : 4; /*!< [19:16] FlexBus Signal Group 4 Multiplex
727 uint32_t GROUP3 : 4; /*!< [23:20] FlexBus Signal Group 3 Multiplex
729 uint32_t GROUP2 : 4; /*!< [27:24] FlexBus Signal Group 2 Multiplex
731 uint32_t GROUP1 : 4; /*!< [31:28] FlexBus Signal Group 1 Multiplex
737 * @name Constants and macros for entire FB_CSPMCR register
740 #define HW_FB_CSPMCR_ADDR(x) ((x) + 0x60U)
742 #define HW_FB_CSPMCR(x) (*(__IO hw_fb_cspmcr_t *) HW_FB_CSPMCR_ADDR(x))
743 #define HW_FB_CSPMCR_RD(x) (HW_FB_CSPMCR(x).U)
744 #define HW_FB_CSPMCR_WR(x, v) (HW_FB_CSPMCR(x).U = (v))
745 #define HW_FB_CSPMCR_SET(x, v) (HW_FB_CSPMCR_WR(x, HW_FB_CSPMCR_RD(x) | (v)))
746 #define HW_FB_CSPMCR_CLR(x, v) (HW_FB_CSPMCR_WR(x, HW_FB_CSPMCR_RD(x) & ~(v)))
747 #define HW_FB_CSPMCR_TOG(x, v) (HW_FB_CSPMCR_WR(x, HW_FB_CSPMCR_RD(x) ^ (v)))
751 * Constants & macros for individual FB_CSPMCR bitfields
755 * @name Register FB_CSPMCR, field GROUP5[15:12] (RW)
757 * Controls the multiplexing of the FB_TA , FB_CS3 , and FB_BE_7_0 signals. When
758 * GROUP5 is not 0000b, you must write 1b to the CSCR[AA] bit. Otherwise, the
759 * bus hangs during a transfer.
763 * - 0001 - FB_CS3 . You must also write 1b to CSCR[AA].
764 * - 0010 - FB_BE_7_0 . You must also write 1b to CSCR[AA].
767 #define BP_FB_CSPMCR_GROUP5 (12U) /*!< Bit position for FB_CSPMCR_GROUP5. */
768 #define BM_FB_CSPMCR_GROUP5 (0x0000F000U) /*!< Bit mask for FB_CSPMCR_GROUP5. */
769 #define BS_FB_CSPMCR_GROUP5 (4U) /*!< Bit field size in bits for FB_CSPMCR_GROUP5. */
771 /*! @brief Read current value of the FB_CSPMCR_GROUP5 field. */
772 #define BR_FB_CSPMCR_GROUP5(x) (HW_FB_CSPMCR(x).B.GROUP5)
774 /*! @brief Format value for bitfield FB_CSPMCR_GROUP5. */
775 #define BF_FB_CSPMCR_GROUP5(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSPMCR_GROUP5) & BM_FB_CSPMCR_GROUP5)
777 /*! @brief Set the GROUP5 field to a new value. */
778 #define BW_FB_CSPMCR_GROUP5(x, v) (HW_FB_CSPMCR_WR(x, (HW_FB_CSPMCR_RD(x) & ~BM_FB_CSPMCR_GROUP5) | BF_FB_CSPMCR_GROUP5(v)))
782 * @name Register FB_CSPMCR, field GROUP4[19:16] (RW)
784 * Controls the multiplexing of the FB_TBST , FB_CS2 , and FB_BE_15_8 signals.
789 * - 0010 - FB_BE_15_8
792 #define BP_FB_CSPMCR_GROUP4 (16U) /*!< Bit position for FB_CSPMCR_GROUP4. */
793 #define BM_FB_CSPMCR_GROUP4 (0x000F0000U) /*!< Bit mask for FB_CSPMCR_GROUP4. */
794 #define BS_FB_CSPMCR_GROUP4 (4U) /*!< Bit field size in bits for FB_CSPMCR_GROUP4. */
796 /*! @brief Read current value of the FB_CSPMCR_GROUP4 field. */
797 #define BR_FB_CSPMCR_GROUP4(x) (HW_FB_CSPMCR(x).B.GROUP4)
799 /*! @brief Format value for bitfield FB_CSPMCR_GROUP4. */
800 #define BF_FB_CSPMCR_GROUP4(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSPMCR_GROUP4) & BM_FB_CSPMCR_GROUP4)
802 /*! @brief Set the GROUP4 field to a new value. */
803 #define BW_FB_CSPMCR_GROUP4(x, v) (HW_FB_CSPMCR_WR(x, (HW_FB_CSPMCR_RD(x) & ~BM_FB_CSPMCR_GROUP4) | BF_FB_CSPMCR_GROUP4(v)))
807 * @name Register FB_CSPMCR, field GROUP3[23:20] (RW)
809 * Controls the multiplexing of the FB_CS5 , FB_TSIZ1, and FB_BE_23_16 signals.
814 * - 0010 - FB_BE_23_16
817 #define BP_FB_CSPMCR_GROUP3 (20U) /*!< Bit position for FB_CSPMCR_GROUP3. */
818 #define BM_FB_CSPMCR_GROUP3 (0x00F00000U) /*!< Bit mask for FB_CSPMCR_GROUP3. */
819 #define BS_FB_CSPMCR_GROUP3 (4U) /*!< Bit field size in bits for FB_CSPMCR_GROUP3. */
821 /*! @brief Read current value of the FB_CSPMCR_GROUP3 field. */
822 #define BR_FB_CSPMCR_GROUP3(x) (HW_FB_CSPMCR(x).B.GROUP3)
824 /*! @brief Format value for bitfield FB_CSPMCR_GROUP3. */
825 #define BF_FB_CSPMCR_GROUP3(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSPMCR_GROUP3) & BM_FB_CSPMCR_GROUP3)
827 /*! @brief Set the GROUP3 field to a new value. */
828 #define BW_FB_CSPMCR_GROUP3(x, v) (HW_FB_CSPMCR_WR(x, (HW_FB_CSPMCR_RD(x) & ~BM_FB_CSPMCR_GROUP3) | BF_FB_CSPMCR_GROUP3(v)))
832 * @name Register FB_CSPMCR, field GROUP2[27:24] (RW)
834 * Controls the multiplexing of the FB_CS4 , FB_TSIZ0, and FB_BE_31_24 signals.
839 * - 0010 - FB_BE_31_24
842 #define BP_FB_CSPMCR_GROUP2 (24U) /*!< Bit position for FB_CSPMCR_GROUP2. */
843 #define BM_FB_CSPMCR_GROUP2 (0x0F000000U) /*!< Bit mask for FB_CSPMCR_GROUP2. */
844 #define BS_FB_CSPMCR_GROUP2 (4U) /*!< Bit field size in bits for FB_CSPMCR_GROUP2. */
846 /*! @brief Read current value of the FB_CSPMCR_GROUP2 field. */
847 #define BR_FB_CSPMCR_GROUP2(x) (HW_FB_CSPMCR(x).B.GROUP2)
849 /*! @brief Format value for bitfield FB_CSPMCR_GROUP2. */
850 #define BF_FB_CSPMCR_GROUP2(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSPMCR_GROUP2) & BM_FB_CSPMCR_GROUP2)
852 /*! @brief Set the GROUP2 field to a new value. */
853 #define BW_FB_CSPMCR_GROUP2(x, v) (HW_FB_CSPMCR_WR(x, (HW_FB_CSPMCR_RD(x) & ~BM_FB_CSPMCR_GROUP2) | BF_FB_CSPMCR_GROUP2(v)))
857 * @name Register FB_CSPMCR, field GROUP1[31:28] (RW)
859 * Controls the multiplexing of the FB_ALE, FB_CS1 , and FB_TS signals.
867 #define BP_FB_CSPMCR_GROUP1 (28U) /*!< Bit position for FB_CSPMCR_GROUP1. */
868 #define BM_FB_CSPMCR_GROUP1 (0xF0000000U) /*!< Bit mask for FB_CSPMCR_GROUP1. */
869 #define BS_FB_CSPMCR_GROUP1 (4U) /*!< Bit field size in bits for FB_CSPMCR_GROUP1. */
871 /*! @brief Read current value of the FB_CSPMCR_GROUP1 field. */
872 #define BR_FB_CSPMCR_GROUP1(x) (HW_FB_CSPMCR(x).B.GROUP1)
874 /*! @brief Format value for bitfield FB_CSPMCR_GROUP1. */
875 #define BF_FB_CSPMCR_GROUP1(v) ((uint32_t)((uint32_t)(v) << BP_FB_CSPMCR_GROUP1) & BM_FB_CSPMCR_GROUP1)
877 /*! @brief Set the GROUP1 field to a new value. */
878 #define BW_FB_CSPMCR_GROUP1(x, v) (HW_FB_CSPMCR_WR(x, (HW_FB_CSPMCR_RD(x) & ~BM_FB_CSPMCR_GROUP1) | BF_FB_CSPMCR_GROUP1(v)))
881 /*******************************************************************************
882 * hw_fb_t - module struct
883 ******************************************************************************/
885 * @brief All FB module registers.
888 typedef struct _hw_fb
891 __IO hw_fb_csarn_t CSARn; /*!< [0x0] Chip Select Address Register */
892 __IO hw_fb_csmrn_t CSMRn; /*!< [0x4] Chip Select Mask Register */
893 __IO hw_fb_cscrn_t CSCRn; /*!< [0x8] Chip Select Control Register */
895 uint8_t _reserved0[24];
896 __IO hw_fb_cspmcr_t CSPMCR; /*!< [0x60] Chip Select port Multiplexing Control Register */
900 /*! @brief Macro to access all FB registers. */
901 /*! @param x FB module instance base address. */
902 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
903 * use the '&' operator, like <code>&HW_FB(FB_BASE)</code>. */
904 #define HW_FB(x) (*(hw_fb_t *)(x))
906 #endif /* __HW_FB_REGISTERS_H__ */