MK64F12_fb.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  1. /*
  2. * Copyright (c) 2014, Freescale Semiconductor, Inc.
  3. * All rights reserved.
  4. *
  5. * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESS OR IMPLIED
  6. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  7. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  8. * SHALL FREESCALE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  9. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
  10. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  11. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  12. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  13. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  14. * OF SUCH DAMAGE.
  15. */
  16. /*
  17. * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
  18. *
  19. * This file was generated automatically and any changes may be lost.
  20. */
  21. #ifndef __HW_FB_REGISTERS_H__
  22. #define __HW_FB_REGISTERS_H__
  23. #include "regs.h"
  24. /*
  25. * MK64F12 FB
  26. *
  27. * FlexBus external bus interface
  28. *
  29. * Registers defined in this header file:
  30. * - HW_FB_CSARn - Chip Select Address Register
  31. * - HW_FB_CSMRn - Chip Select Mask Register
  32. * - HW_FB_CSCRn - Chip Select Control Register
  33. * - HW_FB_CSPMCR - Chip Select port Multiplexing Control Register
  34. *
  35. * - hw_fb_t - Struct containing all module registers.
  36. */
  37. //! @name Module base addresses
  38. //@{
  39. #ifndef REGS_FB_BASE
  40. #define HW_FB_INSTANCE_COUNT (1U) //!< Number of instances of the FB module.
  41. #define REGS_FB_BASE (0x4000C000U) //!< Base address for FB.
  42. #endif
  43. //@}
  44. //-------------------------------------------------------------------------------------------
  45. // HW_FB_CSARn - Chip Select Address Register
  46. //-------------------------------------------------------------------------------------------
  47. #ifndef __LANGUAGE_ASM__
  48. /*!
  49. * @brief HW_FB_CSARn - Chip Select Address Register (RW)
  50. *
  51. * Reset value: 0x00000000U
  52. *
  53. * Specifies the associated chip-select's base address.
  54. */
  55. typedef union _hw_fb_csarn
  56. {
  57. uint32_t U;
  58. struct _hw_fb_csarn_bitfields
  59. {
  60. uint32_t RESERVED0 : 16; //!< [15:0]
  61. uint32_t BA : 16; //!< [31:16] Base Address
  62. } B;
  63. } hw_fb_csarn_t;
  64. #endif
  65. /*!
  66. * @name Constants and macros for entire FB_CSARn register
  67. */
  68. //@{
  69. #define HW_FB_CSARn_COUNT (6U)
  70. #define HW_FB_CSARn_ADDR(n) (REGS_FB_BASE + 0x0U + (0xCU * n))
  71. #ifndef __LANGUAGE_ASM__
  72. #define HW_FB_CSARn(n) (*(__IO hw_fb_csarn_t *) HW_FB_CSARn_ADDR(n))
  73. #define HW_FB_CSARn_RD(n) (HW_FB_CSARn(n).U)
  74. #define HW_FB_CSARn_WR(n, v) (HW_FB_CSARn(n).U = (v))
  75. #define HW_FB_CSARn_SET(n, v) (HW_FB_CSARn_WR(n, HW_FB_CSARn_RD(n) | (v)))
  76. #define HW_FB_CSARn_CLR(n, v) (HW_FB_CSARn_WR(n, HW_FB_CSARn_RD(n) & ~(v)))
  77. #define HW_FB_CSARn_TOG(n, v) (HW_FB_CSARn_WR(n, HW_FB_CSARn_RD(n) ^ (v)))
  78. #endif
  79. //@}
  80. /*
  81. * Constants & macros for individual FB_CSARn bitfields
  82. */
  83. /*!
  84. * @name Register FB_CSARn, field BA[31:16] (RW)
  85. *
  86. * Defines the base address for memory dedicated to the associated chip-select.
  87. * BA is compared to bits 31-16 on the internal address bus to determine if the
  88. * associated chip-select's memory is being accessed. Because the FlexBus module
  89. * is one of the slaves connected to the crossbar switch, it is only accessible
  90. * within a certain memory range. See the chip memory map for the applicable
  91. * FlexBus "expansion" address range for which the chip-selects can be active. Set the
  92. * CSARn and CSMRn registers appropriately before accessing this region.
  93. */
  94. //@{
  95. #define BP_FB_CSARn_BA (16U) //!< Bit position for FB_CSARn_BA.
  96. #define BM_FB_CSARn_BA (0xFFFF0000U) //!< Bit mask for FB_CSARn_BA.
  97. #define BS_FB_CSARn_BA (16U) //!< Bit field size in bits for FB_CSARn_BA.
  98. #ifndef __LANGUAGE_ASM__
  99. //! @brief Read current value of the FB_CSARn_BA field.
  100. #define BR_FB_CSARn_BA(n) (HW_FB_CSARn(n).B.BA)
  101. #endif
  102. //! @brief Format value for bitfield FB_CSARn_BA.
  103. #define BF_FB_CSARn_BA(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSARn_BA), uint32_t) & BM_FB_CSARn_BA)
  104. #ifndef __LANGUAGE_ASM__
  105. //! @brief Set the BA field to a new value.
  106. #define BW_FB_CSARn_BA(n, v) (HW_FB_CSARn_WR(n, (HW_FB_CSARn_RD(n) & ~BM_FB_CSARn_BA) | BF_FB_CSARn_BA(v)))
  107. #endif
  108. //@}
  109. //-------------------------------------------------------------------------------------------
  110. // HW_FB_CSMRn - Chip Select Mask Register
  111. //-------------------------------------------------------------------------------------------
  112. #ifndef __LANGUAGE_ASM__
  113. /*!
  114. * @brief HW_FB_CSMRn - Chip Select Mask Register (RW)
  115. *
  116. * Reset value: 0x00000000U
  117. *
  118. * Specifies the address mask and allowable access types for the associated
  119. * chip-select.
  120. */
  121. typedef union _hw_fb_csmrn
  122. {
  123. uint32_t U;
  124. struct _hw_fb_csmrn_bitfields
  125. {
  126. uint32_t V : 1; //!< [0] Valid
  127. uint32_t RESERVED0 : 7; //!< [7:1]
  128. uint32_t WP : 1; //!< [8] Write Protect
  129. uint32_t RESERVED1 : 7; //!< [15:9]
  130. uint32_t BAM : 16; //!< [31:16] Base Address Mask
  131. } B;
  132. } hw_fb_csmrn_t;
  133. #endif
  134. /*!
  135. * @name Constants and macros for entire FB_CSMRn register
  136. */
  137. //@{
  138. #define HW_FB_CSMRn_COUNT (6U)
  139. #define HW_FB_CSMRn_ADDR(n) (REGS_FB_BASE + 0x4U + (0xCU * n))
  140. #ifndef __LANGUAGE_ASM__
  141. #define HW_FB_CSMRn(n) (*(__IO hw_fb_csmrn_t *) HW_FB_CSMRn_ADDR(n))
  142. #define HW_FB_CSMRn_RD(n) (HW_FB_CSMRn(n).U)
  143. #define HW_FB_CSMRn_WR(n, v) (HW_FB_CSMRn(n).U = (v))
  144. #define HW_FB_CSMRn_SET(n, v) (HW_FB_CSMRn_WR(n, HW_FB_CSMRn_RD(n) | (v)))
  145. #define HW_FB_CSMRn_CLR(n, v) (HW_FB_CSMRn_WR(n, HW_FB_CSMRn_RD(n) & ~(v)))
  146. #define HW_FB_CSMRn_TOG(n, v) (HW_FB_CSMRn_WR(n, HW_FB_CSMRn_RD(n) ^ (v)))
  147. #endif
  148. //@}
  149. /*
  150. * Constants & macros for individual FB_CSMRn bitfields
  151. */
  152. /*!
  153. * @name Register FB_CSMRn, field V[0] (RW)
  154. *
  155. * Specifies whether the corresponding CSAR, CSMR, and CSCR contents are valid.
  156. * Programmed chip-selects do not assert until the V bit is 1b (except for
  157. * FB_CS0, which acts as the global chip-select). At reset, FB_CS0 will fire for any
  158. * access to the FlexBus memory region. CSMR0[V] must be set as part of the chip
  159. * select initialization sequence to allow other chip selects to function as
  160. * programmed.
  161. *
  162. * Values:
  163. * - 0 - Chip-select is invalid.
  164. * - 1 - Chip-select is valid.
  165. */
  166. //@{
  167. #define BP_FB_CSMRn_V (0U) //!< Bit position for FB_CSMRn_V.
  168. #define BM_FB_CSMRn_V (0x00000001U) //!< Bit mask for FB_CSMRn_V.
  169. #define BS_FB_CSMRn_V (1U) //!< Bit field size in bits for FB_CSMRn_V.
  170. #ifndef __LANGUAGE_ASM__
  171. //! @brief Read current value of the FB_CSMRn_V field.
  172. #define BR_FB_CSMRn_V(n) (BITBAND_ACCESS32(HW_FB_CSMRn_ADDR(n), BP_FB_CSMRn_V))
  173. #endif
  174. //! @brief Format value for bitfield FB_CSMRn_V.
  175. #define BF_FB_CSMRn_V(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSMRn_V), uint32_t) & BM_FB_CSMRn_V)
  176. #ifndef __LANGUAGE_ASM__
  177. //! @brief Set the V field to a new value.
  178. #define BW_FB_CSMRn_V(n, v) (BITBAND_ACCESS32(HW_FB_CSMRn_ADDR(n), BP_FB_CSMRn_V) = (v))
  179. #endif
  180. //@}
  181. /*!
  182. * @name Register FB_CSMRn, field WP[8] (RW)
  183. *
  184. * Controls write accesses to the address range in the corresponding CSAR.
  185. *
  186. * Values:
  187. * - 0 - Write accesses are allowed.
  188. * - 1 - Write accesses are not allowed. Attempting to write to the range of
  189. * addresses for which the WP bit is set results in a bus error termination of
  190. * the internal cycle and no external cycle.
  191. */
  192. //@{
  193. #define BP_FB_CSMRn_WP (8U) //!< Bit position for FB_CSMRn_WP.
  194. #define BM_FB_CSMRn_WP (0x00000100U) //!< Bit mask for FB_CSMRn_WP.
  195. #define BS_FB_CSMRn_WP (1U) //!< Bit field size in bits for FB_CSMRn_WP.
  196. #ifndef __LANGUAGE_ASM__
  197. //! @brief Read current value of the FB_CSMRn_WP field.
  198. #define BR_FB_CSMRn_WP(n) (BITBAND_ACCESS32(HW_FB_CSMRn_ADDR(n), BP_FB_CSMRn_WP))
  199. #endif
  200. //! @brief Format value for bitfield FB_CSMRn_WP.
  201. #define BF_FB_CSMRn_WP(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSMRn_WP), uint32_t) & BM_FB_CSMRn_WP)
  202. #ifndef __LANGUAGE_ASM__
  203. //! @brief Set the WP field to a new value.
  204. #define BW_FB_CSMRn_WP(n, v) (BITBAND_ACCESS32(HW_FB_CSMRn_ADDR(n), BP_FB_CSMRn_WP) = (v))
  205. #endif
  206. //@}
  207. /*!
  208. * @name Register FB_CSMRn, field BAM[31:16] (RW)
  209. *
  210. * Defines the associated chip-select's block size by masking address bits.
  211. *
  212. * Values:
  213. * - 0 - The corresponding address bit in CSAR is used in the chip-select decode.
  214. * - 1 - The corresponding address bit in CSAR is a don't care in the
  215. * chip-select decode.
  216. */
  217. //@{
  218. #define BP_FB_CSMRn_BAM (16U) //!< Bit position for FB_CSMRn_BAM.
  219. #define BM_FB_CSMRn_BAM (0xFFFF0000U) //!< Bit mask for FB_CSMRn_BAM.
  220. #define BS_FB_CSMRn_BAM (16U) //!< Bit field size in bits for FB_CSMRn_BAM.
  221. #ifndef __LANGUAGE_ASM__
  222. //! @brief Read current value of the FB_CSMRn_BAM field.
  223. #define BR_FB_CSMRn_BAM(n) (HW_FB_CSMRn(n).B.BAM)
  224. #endif
  225. //! @brief Format value for bitfield FB_CSMRn_BAM.
  226. #define BF_FB_CSMRn_BAM(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSMRn_BAM), uint32_t) & BM_FB_CSMRn_BAM)
  227. #ifndef __LANGUAGE_ASM__
  228. //! @brief Set the BAM field to a new value.
  229. #define BW_FB_CSMRn_BAM(n, v) (HW_FB_CSMRn_WR(n, (HW_FB_CSMRn_RD(n) & ~BM_FB_CSMRn_BAM) | BF_FB_CSMRn_BAM(v)))
  230. #endif
  231. //@}
  232. //-------------------------------------------------------------------------------------------
  233. // HW_FB_CSCRn - Chip Select Control Register
  234. //-------------------------------------------------------------------------------------------
  235. #ifndef __LANGUAGE_ASM__
  236. /*!
  237. * @brief HW_FB_CSCRn - Chip Select Control Register (RW)
  238. *
  239. * Reset value: 0x003FFC00U
  240. *
  241. * Controls the auto-acknowledge, address setup and hold times, port size, burst
  242. * capability, and number of wait states for the associated chip select. To
  243. * support the global chip-select (FB_CS0), the CSCR0 reset values differ from the
  244. * other CSCRs. The reset value of CSCR0 is as follows: Bits 31-24 are 0b Bit 23-3
  245. * are chip-dependent Bits 3-0 are 0b See the chip configuration details for your
  246. * particular chip for information on the exact CSCR0 reset value.
  247. */
  248. typedef union _hw_fb_cscrn
  249. {
  250. uint32_t U;
  251. struct _hw_fb_cscrn_bitfields
  252. {
  253. uint32_t RESERVED0 : 3; //!< [2:0]
  254. uint32_t BSTW : 1; //!< [3] Burst-Write Enable
  255. uint32_t BSTR : 1; //!< [4] Burst-Read Enable
  256. uint32_t BEM : 1; //!< [5] Byte-Enable Mode
  257. uint32_t PS : 2; //!< [7:6] Port Size
  258. uint32_t AA : 1; //!< [8] Auto-Acknowledge Enable
  259. uint32_t BLS : 1; //!< [9] Byte-Lane Shift
  260. uint32_t WS : 6; //!< [15:10] Wait States
  261. uint32_t WRAH : 2; //!< [17:16] Write Address Hold or Deselect
  262. uint32_t RDAH : 2; //!< [19:18] Read Address Hold or Deselect
  263. uint32_t ASET : 2; //!< [21:20] Address Setup
  264. uint32_t EXTS : 1; //!< [22]
  265. uint32_t SWSEN : 1; //!< [23] Secondary Wait State Enable
  266. uint32_t RESERVED1 : 2; //!< [25:24]
  267. uint32_t SWS : 6; //!< [31:26] Secondary Wait States
  268. } B;
  269. } hw_fb_cscrn_t;
  270. #endif
  271. /*!
  272. * @name Constants and macros for entire FB_CSCRn register
  273. */
  274. //@{
  275. #define HW_FB_CSCRn_COUNT (6U)
  276. #define HW_FB_CSCRn_ADDR(n) (REGS_FB_BASE + 0x8U + (0xCU * n))
  277. #ifndef __LANGUAGE_ASM__
  278. #define HW_FB_CSCRn(n) (*(__IO hw_fb_cscrn_t *) HW_FB_CSCRn_ADDR(n))
  279. #define HW_FB_CSCRn_RD(n) (HW_FB_CSCRn(n).U)
  280. #define HW_FB_CSCRn_WR(n, v) (HW_FB_CSCRn(n).U = (v))
  281. #define HW_FB_CSCRn_SET(n, v) (HW_FB_CSCRn_WR(n, HW_FB_CSCRn_RD(n) | (v)))
  282. #define HW_FB_CSCRn_CLR(n, v) (HW_FB_CSCRn_WR(n, HW_FB_CSCRn_RD(n) & ~(v)))
  283. #define HW_FB_CSCRn_TOG(n, v) (HW_FB_CSCRn_WR(n, HW_FB_CSCRn_RD(n) ^ (v)))
  284. #endif
  285. //@}
  286. /*
  287. * Constants & macros for individual FB_CSCRn bitfields
  288. */
  289. /*!
  290. * @name Register FB_CSCRn, field BSTW[3] (RW)
  291. *
  292. * Specifies whether burst writes are enabled for memory associated with each
  293. * chip select.
  294. *
  295. * Values:
  296. * - 0 - Disabled. Data exceeding the specified port size is broken into
  297. * individual, port-sized, non-burst writes. For example, a 32-bit write to an 8-bit
  298. * port takes four byte writes.
  299. * - 1 - Enabled. Enables burst write of data larger than the specified port
  300. * size, including 32-bit writes to 8- and 16-bit ports, 16-bit writes to 8-bit
  301. * ports, and line writes to 8-, 16-, and 32-bit ports.
  302. */
  303. //@{
  304. #define BP_FB_CSCRn_BSTW (3U) //!< Bit position for FB_CSCRn_BSTW.
  305. #define BM_FB_CSCRn_BSTW (0x00000008U) //!< Bit mask for FB_CSCRn_BSTW.
  306. #define BS_FB_CSCRn_BSTW (1U) //!< Bit field size in bits for FB_CSCRn_BSTW.
  307. #ifndef __LANGUAGE_ASM__
  308. //! @brief Read current value of the FB_CSCRn_BSTW field.
  309. #define BR_FB_CSCRn_BSTW(n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_BSTW))
  310. #endif
  311. //! @brief Format value for bitfield FB_CSCRn_BSTW.
  312. #define BF_FB_CSCRn_BSTW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_BSTW), uint32_t) & BM_FB_CSCRn_BSTW)
  313. #ifndef __LANGUAGE_ASM__
  314. //! @brief Set the BSTW field to a new value.
  315. #define BW_FB_CSCRn_BSTW(n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_BSTW) = (v))
  316. #endif
  317. //@}
  318. /*!
  319. * @name Register FB_CSCRn, field BSTR[4] (RW)
  320. *
  321. * Specifies whether burst reads are enabled for memory associated with each
  322. * chip select.
  323. *
  324. * Values:
  325. * - 0 - Disabled. Data exceeding the specified port size is broken into
  326. * individual, port-sized, non-burst reads. For example, a 32-bit read from an 8-bit
  327. * port is broken into four 8-bit reads.
  328. * - 1 - Enabled. Enables data burst reads larger than the specified port size,
  329. * including 32-bit reads from 8- and 16-bit ports, 16-bit reads from 8-bit
  330. * ports, and line reads from 8-, 16-, and 32-bit ports.
  331. */
  332. //@{
  333. #define BP_FB_CSCRn_BSTR (4U) //!< Bit position for FB_CSCRn_BSTR.
  334. #define BM_FB_CSCRn_BSTR (0x00000010U) //!< Bit mask for FB_CSCRn_BSTR.
  335. #define BS_FB_CSCRn_BSTR (1U) //!< Bit field size in bits for FB_CSCRn_BSTR.
  336. #ifndef __LANGUAGE_ASM__
  337. //! @brief Read current value of the FB_CSCRn_BSTR field.
  338. #define BR_FB_CSCRn_BSTR(n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_BSTR))
  339. #endif
  340. //! @brief Format value for bitfield FB_CSCRn_BSTR.
  341. #define BF_FB_CSCRn_BSTR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_BSTR), uint32_t) & BM_FB_CSCRn_BSTR)
  342. #ifndef __LANGUAGE_ASM__
  343. //! @brief Set the BSTR field to a new value.
  344. #define BW_FB_CSCRn_BSTR(n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_BSTR) = (v))
  345. #endif
  346. //@}
  347. /*!
  348. * @name Register FB_CSCRn, field BEM[5] (RW)
  349. *
  350. * Specifies whether the corresponding FB_BE is asserted for read accesses.
  351. * Certain memories have byte enables that must be asserted during reads and writes.
  352. * Write 1b to the BEM bit in the relevant CSCR to provide the appropriate mode
  353. * of byte enable support for these SRAMs.
  354. *
  355. * Values:
  356. * - 0 - FB_BE is asserted for data write only.
  357. * - 1 - FB_BE is asserted for data read and write accesses.
  358. */
  359. //@{
  360. #define BP_FB_CSCRn_BEM (5U) //!< Bit position for FB_CSCRn_BEM.
  361. #define BM_FB_CSCRn_BEM (0x00000020U) //!< Bit mask for FB_CSCRn_BEM.
  362. #define BS_FB_CSCRn_BEM (1U) //!< Bit field size in bits for FB_CSCRn_BEM.
  363. #ifndef __LANGUAGE_ASM__
  364. //! @brief Read current value of the FB_CSCRn_BEM field.
  365. #define BR_FB_CSCRn_BEM(n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_BEM))
  366. #endif
  367. //! @brief Format value for bitfield FB_CSCRn_BEM.
  368. #define BF_FB_CSCRn_BEM(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_BEM), uint32_t) & BM_FB_CSCRn_BEM)
  369. #ifndef __LANGUAGE_ASM__
  370. //! @brief Set the BEM field to a new value.
  371. #define BW_FB_CSCRn_BEM(n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_BEM) = (v))
  372. #endif
  373. //@}
  374. /*!
  375. * @name Register FB_CSCRn, field PS[7:6] (RW)
  376. *
  377. * Specifies the data port width of the associated chip-select, and determines
  378. * where data is driven during write cycles and where data is sampled during read
  379. * cycles.
  380. *
  381. * Values:
  382. * - 00 - 32-bit port size. Valid data is sampled and driven on FB_D[31:0].
  383. * - 01 - 8-bit port size. Valid data is sampled and driven on FB_D[31:24] when
  384. * BLS is 0b, or FB_D[7:0] when BLS is 1b.
  385. */
  386. //@{
  387. #define BP_FB_CSCRn_PS (6U) //!< Bit position for FB_CSCRn_PS.
  388. #define BM_FB_CSCRn_PS (0x000000C0U) //!< Bit mask for FB_CSCRn_PS.
  389. #define BS_FB_CSCRn_PS (2U) //!< Bit field size in bits for FB_CSCRn_PS.
  390. #ifndef __LANGUAGE_ASM__
  391. //! @brief Read current value of the FB_CSCRn_PS field.
  392. #define BR_FB_CSCRn_PS(n) (HW_FB_CSCRn(n).B.PS)
  393. #endif
  394. //! @brief Format value for bitfield FB_CSCRn_PS.
  395. #define BF_FB_CSCRn_PS(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_PS), uint32_t) & BM_FB_CSCRn_PS)
  396. #ifndef __LANGUAGE_ASM__
  397. //! @brief Set the PS field to a new value.
  398. #define BW_FB_CSCRn_PS(n, v) (HW_FB_CSCRn_WR(n, (HW_FB_CSCRn_RD(n) & ~BM_FB_CSCRn_PS) | BF_FB_CSCRn_PS(v)))
  399. #endif
  400. //@}
  401. /*!
  402. * @name Register FB_CSCRn, field AA[8] (RW)
  403. *
  404. * Asserts the internal transfer acknowledge for accesses specified by the
  405. * chip-select address. If AA is 1b for a corresponding FB_CSn and the external system
  406. * asserts an external FB_TA before the wait-state countdown asserts the
  407. * internal FB_TA, the cycle is terminated. Burst cycles increment the address bus
  408. * between each internal termination. This field must be 1b if CSPMCR disables FB_TA.
  409. *
  410. * Values:
  411. * - 0 - Disabled. No internal transfer acknowledge is asserted and the cycle is
  412. * terminated externally.
  413. * - 1 - Enabled. Internal transfer acknowledge is asserted as specified by WS.
  414. */
  415. //@{
  416. #define BP_FB_CSCRn_AA (8U) //!< Bit position for FB_CSCRn_AA.
  417. #define BM_FB_CSCRn_AA (0x00000100U) //!< Bit mask for FB_CSCRn_AA.
  418. #define BS_FB_CSCRn_AA (1U) //!< Bit field size in bits for FB_CSCRn_AA.
  419. #ifndef __LANGUAGE_ASM__
  420. //! @brief Read current value of the FB_CSCRn_AA field.
  421. #define BR_FB_CSCRn_AA(n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_AA))
  422. #endif
  423. //! @brief Format value for bitfield FB_CSCRn_AA.
  424. #define BF_FB_CSCRn_AA(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_AA), uint32_t) & BM_FB_CSCRn_AA)
  425. #ifndef __LANGUAGE_ASM__
  426. //! @brief Set the AA field to a new value.
  427. #define BW_FB_CSCRn_AA(n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_AA) = (v))
  428. #endif
  429. //@}
  430. /*!
  431. * @name Register FB_CSCRn, field BLS[9] (RW)
  432. *
  433. * Specifies if data on FB_AD appears left-aligned or right-aligned during the
  434. * data phase of a FlexBus access.
  435. *
  436. * Values:
  437. * - 0 - Not shifted. Data is left-aligned on FB_AD.
  438. * - 1 - Shifted. Data is right-aligned on FB_AD.
  439. */
  440. //@{
  441. #define BP_FB_CSCRn_BLS (9U) //!< Bit position for FB_CSCRn_BLS.
  442. #define BM_FB_CSCRn_BLS (0x00000200U) //!< Bit mask for FB_CSCRn_BLS.
  443. #define BS_FB_CSCRn_BLS (1U) //!< Bit field size in bits for FB_CSCRn_BLS.
  444. #ifndef __LANGUAGE_ASM__
  445. //! @brief Read current value of the FB_CSCRn_BLS field.
  446. #define BR_FB_CSCRn_BLS(n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_BLS))
  447. #endif
  448. //! @brief Format value for bitfield FB_CSCRn_BLS.
  449. #define BF_FB_CSCRn_BLS(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_BLS), uint32_t) & BM_FB_CSCRn_BLS)
  450. #ifndef __LANGUAGE_ASM__
  451. //! @brief Set the BLS field to a new value.
  452. #define BW_FB_CSCRn_BLS(n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_BLS) = (v))
  453. #endif
  454. //@}
  455. /*!
  456. * @name Register FB_CSCRn, field WS[15:10] (RW)
  457. *
  458. * Specifies the number of wait states inserted after FlexBus asserts the
  459. * associated chip-select and before an internal transfer acknowledge is generated (WS
  460. * = 00h inserts 0 wait states, ..., WS = 3Fh inserts 63 wait states).
  461. */
  462. //@{
  463. #define BP_FB_CSCRn_WS (10U) //!< Bit position for FB_CSCRn_WS.
  464. #define BM_FB_CSCRn_WS (0x0000FC00U) //!< Bit mask for FB_CSCRn_WS.
  465. #define BS_FB_CSCRn_WS (6U) //!< Bit field size in bits for FB_CSCRn_WS.
  466. #ifndef __LANGUAGE_ASM__
  467. //! @brief Read current value of the FB_CSCRn_WS field.
  468. #define BR_FB_CSCRn_WS(n) (HW_FB_CSCRn(n).B.WS)
  469. #endif
  470. //! @brief Format value for bitfield FB_CSCRn_WS.
  471. #define BF_FB_CSCRn_WS(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_WS), uint32_t) & BM_FB_CSCRn_WS)
  472. #ifndef __LANGUAGE_ASM__
  473. //! @brief Set the WS field to a new value.
  474. #define BW_FB_CSCRn_WS(n, v) (HW_FB_CSCRn_WR(n, (HW_FB_CSCRn_RD(n) & ~BM_FB_CSCRn_WS) | BF_FB_CSCRn_WS(v)))
  475. #endif
  476. //@}
  477. /*!
  478. * @name Register FB_CSCRn, field WRAH[17:16] (RW)
  479. *
  480. * Controls the address, data, and attribute hold time after the termination of
  481. * a write cycle that hits in the associated chip-select's address space. The
  482. * hold time applies only at the end of a transfer. Therefore, during a burst
  483. * transfer or a transfer to a port size smaller than the transfer size, the hold time
  484. * is only added after the last bus cycle.
  485. *
  486. * Values:
  487. * - 00 - 1 cycle (default for all but FB_CS0 )
  488. * - 01 - 2 cycles
  489. * - 10 - 3 cycles
  490. * - 11 - 4 cycles (default for FB_CS0 )
  491. */
  492. //@{
  493. #define BP_FB_CSCRn_WRAH (16U) //!< Bit position for FB_CSCRn_WRAH.
  494. #define BM_FB_CSCRn_WRAH (0x00030000U) //!< Bit mask for FB_CSCRn_WRAH.
  495. #define BS_FB_CSCRn_WRAH (2U) //!< Bit field size in bits for FB_CSCRn_WRAH.
  496. #ifndef __LANGUAGE_ASM__
  497. //! @brief Read current value of the FB_CSCRn_WRAH field.
  498. #define BR_FB_CSCRn_WRAH(n) (HW_FB_CSCRn(n).B.WRAH)
  499. #endif
  500. //! @brief Format value for bitfield FB_CSCRn_WRAH.
  501. #define BF_FB_CSCRn_WRAH(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_WRAH), uint32_t) & BM_FB_CSCRn_WRAH)
  502. #ifndef __LANGUAGE_ASM__
  503. //! @brief Set the WRAH field to a new value.
  504. #define BW_FB_CSCRn_WRAH(n, v) (HW_FB_CSCRn_WR(n, (HW_FB_CSCRn_RD(n) & ~BM_FB_CSCRn_WRAH) | BF_FB_CSCRn_WRAH(v)))
  505. #endif
  506. //@}
  507. /*!
  508. * @name Register FB_CSCRn, field RDAH[19:18] (RW)
  509. *
  510. * Controls the address and attribute hold time after the termination during a
  511. * read cycle that hits in the associated chip-select's address space. The hold
  512. * time applies only at the end of a transfer. Therefore, during a burst transfer
  513. * or a transfer to a port size smaller than the transfer size, the hold time is
  514. * only added after the last bus cycle. The number of cycles the address and
  515. * attributes are held after FB_CSn deassertion depends on the value of the AA bit.
  516. *
  517. * Values:
  518. * - 00 - When AA is 0b, 1 cycle. When AA is 1b, 0 cycles.
  519. * - 01 - When AA is 0b, 2 cycles. When AA is 1b, 1 cycle.
  520. * - 10 - When AA is 0b, 3 cycles. When AA is 1b, 2 cycles.
  521. * - 11 - When AA is 0b, 4 cycles. When AA is 1b, 3 cycles.
  522. */
  523. //@{
  524. #define BP_FB_CSCRn_RDAH (18U) //!< Bit position for FB_CSCRn_RDAH.
  525. #define BM_FB_CSCRn_RDAH (0x000C0000U) //!< Bit mask for FB_CSCRn_RDAH.
  526. #define BS_FB_CSCRn_RDAH (2U) //!< Bit field size in bits for FB_CSCRn_RDAH.
  527. #ifndef __LANGUAGE_ASM__
  528. //! @brief Read current value of the FB_CSCRn_RDAH field.
  529. #define BR_FB_CSCRn_RDAH(n) (HW_FB_CSCRn(n).B.RDAH)
  530. #endif
  531. //! @brief Format value for bitfield FB_CSCRn_RDAH.
  532. #define BF_FB_CSCRn_RDAH(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_RDAH), uint32_t) & BM_FB_CSCRn_RDAH)
  533. #ifndef __LANGUAGE_ASM__
  534. //! @brief Set the RDAH field to a new value.
  535. #define BW_FB_CSCRn_RDAH(n, v) (HW_FB_CSCRn_WR(n, (HW_FB_CSCRn_RD(n) & ~BM_FB_CSCRn_RDAH) | BF_FB_CSCRn_RDAH(v)))
  536. #endif
  537. //@}
  538. /*!
  539. * @name Register FB_CSCRn, field ASET[21:20] (RW)
  540. *
  541. * Controls when the chip-select is asserted with respect to assertion of a
  542. * valid address and attributes.
  543. *
  544. * Values:
  545. * - 00 - Assert FB_CSn on the first rising clock edge after the address is
  546. * asserted (default for all but FB_CS0 ).
  547. * - 01 - Assert FB_CSn on the second rising clock edge after the address is
  548. * asserted.
  549. * - 10 - Assert FB_CSn on the third rising clock edge after the address is
  550. * asserted.
  551. * - 11 - Assert FB_CSn on the fourth rising clock edge after the address is
  552. * asserted (default for FB_CS0 ).
  553. */
  554. //@{
  555. #define BP_FB_CSCRn_ASET (20U) //!< Bit position for FB_CSCRn_ASET.
  556. #define BM_FB_CSCRn_ASET (0x00300000U) //!< Bit mask for FB_CSCRn_ASET.
  557. #define BS_FB_CSCRn_ASET (2U) //!< Bit field size in bits for FB_CSCRn_ASET.
  558. #ifndef __LANGUAGE_ASM__
  559. //! @brief Read current value of the FB_CSCRn_ASET field.
  560. #define BR_FB_CSCRn_ASET(n) (HW_FB_CSCRn(n).B.ASET)
  561. #endif
  562. //! @brief Format value for bitfield FB_CSCRn_ASET.
  563. #define BF_FB_CSCRn_ASET(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_ASET), uint32_t) & BM_FB_CSCRn_ASET)
  564. #ifndef __LANGUAGE_ASM__
  565. //! @brief Set the ASET field to a new value.
  566. #define BW_FB_CSCRn_ASET(n, v) (HW_FB_CSCRn_WR(n, (HW_FB_CSCRn_RD(n) & ~BM_FB_CSCRn_ASET) | BF_FB_CSCRn_ASET(v)))
  567. #endif
  568. //@}
  569. /*!
  570. * @name Register FB_CSCRn, field EXTS[22] (RW)
  571. *
  572. * Extended Transfer Start/Extended Address Latch Enable Controls how long FB_TS
  573. * /FB_ALE is asserted.
  574. *
  575. * Values:
  576. * - 0 - Disabled. FB_TS /FB_ALE asserts for one bus clock cycle.
  577. * - 1 - Enabled. FB_TS /FB_ALE remains asserted until the first positive clock
  578. * edge after FB_CSn asserts.
  579. */
  580. //@{
  581. #define BP_FB_CSCRn_EXTS (22U) //!< Bit position for FB_CSCRn_EXTS.
  582. #define BM_FB_CSCRn_EXTS (0x00400000U) //!< Bit mask for FB_CSCRn_EXTS.
  583. #define BS_FB_CSCRn_EXTS (1U) //!< Bit field size in bits for FB_CSCRn_EXTS.
  584. #ifndef __LANGUAGE_ASM__
  585. //! @brief Read current value of the FB_CSCRn_EXTS field.
  586. #define BR_FB_CSCRn_EXTS(n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_EXTS))
  587. #endif
  588. //! @brief Format value for bitfield FB_CSCRn_EXTS.
  589. #define BF_FB_CSCRn_EXTS(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_EXTS), uint32_t) & BM_FB_CSCRn_EXTS)
  590. #ifndef __LANGUAGE_ASM__
  591. //! @brief Set the EXTS field to a new value.
  592. #define BW_FB_CSCRn_EXTS(n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_EXTS) = (v))
  593. #endif
  594. //@}
  595. /*!
  596. * @name Register FB_CSCRn, field SWSEN[23] (RW)
  597. *
  598. * Values:
  599. * - 0 - Disabled. A number of wait states (specified by WS) are inserted before
  600. * an internal transfer acknowledge is generated for all transfers.
  601. * - 1 - Enabled. A number of wait states (specified by SWS) are inserted before
  602. * an internal transfer acknowledge is generated for burst transfer
  603. * secondary terminations.
  604. */
  605. //@{
  606. #define BP_FB_CSCRn_SWSEN (23U) //!< Bit position for FB_CSCRn_SWSEN.
  607. #define BM_FB_CSCRn_SWSEN (0x00800000U) //!< Bit mask for FB_CSCRn_SWSEN.
  608. #define BS_FB_CSCRn_SWSEN (1U) //!< Bit field size in bits for FB_CSCRn_SWSEN.
  609. #ifndef __LANGUAGE_ASM__
  610. //! @brief Read current value of the FB_CSCRn_SWSEN field.
  611. #define BR_FB_CSCRn_SWSEN(n) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_SWSEN))
  612. #endif
  613. //! @brief Format value for bitfield FB_CSCRn_SWSEN.
  614. #define BF_FB_CSCRn_SWSEN(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_SWSEN), uint32_t) & BM_FB_CSCRn_SWSEN)
  615. #ifndef __LANGUAGE_ASM__
  616. //! @brief Set the SWSEN field to a new value.
  617. #define BW_FB_CSCRn_SWSEN(n, v) (BITBAND_ACCESS32(HW_FB_CSCRn_ADDR(n), BP_FB_CSCRn_SWSEN) = (v))
  618. #endif
  619. //@}
  620. /*!
  621. * @name Register FB_CSCRn, field SWS[31:26] (RW)
  622. *
  623. * Used only when the SWSEN bit is 1b. Specifies the number of wait states
  624. * inserted before an internal transfer acknowledge is generated for a burst transfer
  625. * (except for the first termination, which is controlled by WS).
  626. */
  627. //@{
  628. #define BP_FB_CSCRn_SWS (26U) //!< Bit position for FB_CSCRn_SWS.
  629. #define BM_FB_CSCRn_SWS (0xFC000000U) //!< Bit mask for FB_CSCRn_SWS.
  630. #define BS_FB_CSCRn_SWS (6U) //!< Bit field size in bits for FB_CSCRn_SWS.
  631. #ifndef __LANGUAGE_ASM__
  632. //! @brief Read current value of the FB_CSCRn_SWS field.
  633. #define BR_FB_CSCRn_SWS(n) (HW_FB_CSCRn(n).B.SWS)
  634. #endif
  635. //! @brief Format value for bitfield FB_CSCRn_SWS.
  636. #define BF_FB_CSCRn_SWS(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSCRn_SWS), uint32_t) & BM_FB_CSCRn_SWS)
  637. #ifndef __LANGUAGE_ASM__
  638. //! @brief Set the SWS field to a new value.
  639. #define BW_FB_CSCRn_SWS(n, v) (HW_FB_CSCRn_WR(n, (HW_FB_CSCRn_RD(n) & ~BM_FB_CSCRn_SWS) | BF_FB_CSCRn_SWS(v)))
  640. #endif
  641. //@}
  642. //-------------------------------------------------------------------------------------------
  643. // HW_FB_CSPMCR - Chip Select port Multiplexing Control Register
  644. //-------------------------------------------------------------------------------------------
  645. #ifndef __LANGUAGE_ASM__
  646. /*!
  647. * @brief HW_FB_CSPMCR - Chip Select port Multiplexing Control Register (RW)
  648. *
  649. * Reset value: 0x00000000U
  650. *
  651. * Controls the multiplexing of the FlexBus signals. A bus error occurs when you
  652. * do any of the following: Write to a reserved address Write to a reserved
  653. * field in this register, or Access this register using a size other than 32 bits.
  654. */
  655. typedef union _hw_fb_cspmcr
  656. {
  657. uint32_t U;
  658. struct _hw_fb_cspmcr_bitfields
  659. {
  660. uint32_t RESERVED0 : 12; //!< [11:0]
  661. uint32_t GROUP5 : 4; //!< [15:12] FlexBus Signal Group 5 Multiplex
  662. //! control
  663. uint32_t GROUP4 : 4; //!< [19:16] FlexBus Signal Group 4 Multiplex
  664. //! control
  665. uint32_t GROUP3 : 4; //!< [23:20] FlexBus Signal Group 3 Multiplex
  666. //! control
  667. uint32_t GROUP2 : 4; //!< [27:24] FlexBus Signal Group 2 Multiplex
  668. //! control
  669. uint32_t GROUP1 : 4; //!< [31:28] FlexBus Signal Group 1 Multiplex
  670. //! control
  671. } B;
  672. } hw_fb_cspmcr_t;
  673. #endif
  674. /*!
  675. * @name Constants and macros for entire FB_CSPMCR register
  676. */
  677. //@{
  678. #define HW_FB_CSPMCR_ADDR (REGS_FB_BASE + 0x60U)
  679. #ifndef __LANGUAGE_ASM__
  680. #define HW_FB_CSPMCR (*(__IO hw_fb_cspmcr_t *) HW_FB_CSPMCR_ADDR)
  681. #define HW_FB_CSPMCR_RD() (HW_FB_CSPMCR.U)
  682. #define HW_FB_CSPMCR_WR(v) (HW_FB_CSPMCR.U = (v))
  683. #define HW_FB_CSPMCR_SET(v) (HW_FB_CSPMCR_WR(HW_FB_CSPMCR_RD() | (v)))
  684. #define HW_FB_CSPMCR_CLR(v) (HW_FB_CSPMCR_WR(HW_FB_CSPMCR_RD() & ~(v)))
  685. #define HW_FB_CSPMCR_TOG(v) (HW_FB_CSPMCR_WR(HW_FB_CSPMCR_RD() ^ (v)))
  686. #endif
  687. //@}
  688. /*
  689. * Constants & macros for individual FB_CSPMCR bitfields
  690. */
  691. /*!
  692. * @name Register FB_CSPMCR, field GROUP5[15:12] (RW)
  693. *
  694. * Controls the multiplexing of the FB_TA , FB_CS3 , and FB_BE_7_0 signals. When
  695. * GROUP5 is not 0000b, you must write 1b to the CSCR[AA] bit. Otherwise, the
  696. * bus hangs during a transfer.
  697. *
  698. * Values:
  699. * - 0000 - FB_TA
  700. * - 0001 - FB_CS3 . You must also write 1b to CSCR[AA].
  701. * - 0010 - FB_BE_7_0 . You must also write 1b to CSCR[AA].
  702. */
  703. //@{
  704. #define BP_FB_CSPMCR_GROUP5 (12U) //!< Bit position for FB_CSPMCR_GROUP5.
  705. #define BM_FB_CSPMCR_GROUP5 (0x0000F000U) //!< Bit mask for FB_CSPMCR_GROUP5.
  706. #define BS_FB_CSPMCR_GROUP5 (4U) //!< Bit field size in bits for FB_CSPMCR_GROUP5.
  707. #ifndef __LANGUAGE_ASM__
  708. //! @brief Read current value of the FB_CSPMCR_GROUP5 field.
  709. #define BR_FB_CSPMCR_GROUP5 (HW_FB_CSPMCR.B.GROUP5)
  710. #endif
  711. //! @brief Format value for bitfield FB_CSPMCR_GROUP5.
  712. #define BF_FB_CSPMCR_GROUP5(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSPMCR_GROUP5), uint32_t) & BM_FB_CSPMCR_GROUP5)
  713. #ifndef __LANGUAGE_ASM__
  714. //! @brief Set the GROUP5 field to a new value.
  715. #define BW_FB_CSPMCR_GROUP5(v) (HW_FB_CSPMCR_WR((HW_FB_CSPMCR_RD() & ~BM_FB_CSPMCR_GROUP5) | BF_FB_CSPMCR_GROUP5(v)))
  716. #endif
  717. //@}
  718. /*!
  719. * @name Register FB_CSPMCR, field GROUP4[19:16] (RW)
  720. *
  721. * Controls the multiplexing of the FB_TBST , FB_CS2 , and FB_BE_15_8 signals.
  722. *
  723. * Values:
  724. * - 0000 - FB_TBST
  725. * - 0001 - FB_CS2
  726. * - 0010 - FB_BE_15_8
  727. */
  728. //@{
  729. #define BP_FB_CSPMCR_GROUP4 (16U) //!< Bit position for FB_CSPMCR_GROUP4.
  730. #define BM_FB_CSPMCR_GROUP4 (0x000F0000U) //!< Bit mask for FB_CSPMCR_GROUP4.
  731. #define BS_FB_CSPMCR_GROUP4 (4U) //!< Bit field size in bits for FB_CSPMCR_GROUP4.
  732. #ifndef __LANGUAGE_ASM__
  733. //! @brief Read current value of the FB_CSPMCR_GROUP4 field.
  734. #define BR_FB_CSPMCR_GROUP4 (HW_FB_CSPMCR.B.GROUP4)
  735. #endif
  736. //! @brief Format value for bitfield FB_CSPMCR_GROUP4.
  737. #define BF_FB_CSPMCR_GROUP4(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSPMCR_GROUP4), uint32_t) & BM_FB_CSPMCR_GROUP4)
  738. #ifndef __LANGUAGE_ASM__
  739. //! @brief Set the GROUP4 field to a new value.
  740. #define BW_FB_CSPMCR_GROUP4(v) (HW_FB_CSPMCR_WR((HW_FB_CSPMCR_RD() & ~BM_FB_CSPMCR_GROUP4) | BF_FB_CSPMCR_GROUP4(v)))
  741. #endif
  742. //@}
  743. /*!
  744. * @name Register FB_CSPMCR, field GROUP3[23:20] (RW)
  745. *
  746. * Controls the multiplexing of the FB_CS5 , FB_TSIZ1, and FB_BE_23_16 signals.
  747. *
  748. * Values:
  749. * - 0000 - FB_CS5
  750. * - 0001 - FB_TSIZ1
  751. * - 0010 - FB_BE_23_16
  752. */
  753. //@{
  754. #define BP_FB_CSPMCR_GROUP3 (20U) //!< Bit position for FB_CSPMCR_GROUP3.
  755. #define BM_FB_CSPMCR_GROUP3 (0x00F00000U) //!< Bit mask for FB_CSPMCR_GROUP3.
  756. #define BS_FB_CSPMCR_GROUP3 (4U) //!< Bit field size in bits for FB_CSPMCR_GROUP3.
  757. #ifndef __LANGUAGE_ASM__
  758. //! @brief Read current value of the FB_CSPMCR_GROUP3 field.
  759. #define BR_FB_CSPMCR_GROUP3 (HW_FB_CSPMCR.B.GROUP3)
  760. #endif
  761. //! @brief Format value for bitfield FB_CSPMCR_GROUP3.
  762. #define BF_FB_CSPMCR_GROUP3(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSPMCR_GROUP3), uint32_t) & BM_FB_CSPMCR_GROUP3)
  763. #ifndef __LANGUAGE_ASM__
  764. //! @brief Set the GROUP3 field to a new value.
  765. #define BW_FB_CSPMCR_GROUP3(v) (HW_FB_CSPMCR_WR((HW_FB_CSPMCR_RD() & ~BM_FB_CSPMCR_GROUP3) | BF_FB_CSPMCR_GROUP3(v)))
  766. #endif
  767. //@}
  768. /*!
  769. * @name Register FB_CSPMCR, field GROUP2[27:24] (RW)
  770. *
  771. * Controls the multiplexing of the FB_CS4 , FB_TSIZ0, and FB_BE_31_24 signals.
  772. *
  773. * Values:
  774. * - 0000 - FB_CS4
  775. * - 0001 - FB_TSIZ0
  776. * - 0010 - FB_BE_31_24
  777. */
  778. //@{
  779. #define BP_FB_CSPMCR_GROUP2 (24U) //!< Bit position for FB_CSPMCR_GROUP2.
  780. #define BM_FB_CSPMCR_GROUP2 (0x0F000000U) //!< Bit mask for FB_CSPMCR_GROUP2.
  781. #define BS_FB_CSPMCR_GROUP2 (4U) //!< Bit field size in bits for FB_CSPMCR_GROUP2.
  782. #ifndef __LANGUAGE_ASM__
  783. //! @brief Read current value of the FB_CSPMCR_GROUP2 field.
  784. #define BR_FB_CSPMCR_GROUP2 (HW_FB_CSPMCR.B.GROUP2)
  785. #endif
  786. //! @brief Format value for bitfield FB_CSPMCR_GROUP2.
  787. #define BF_FB_CSPMCR_GROUP2(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSPMCR_GROUP2), uint32_t) & BM_FB_CSPMCR_GROUP2)
  788. #ifndef __LANGUAGE_ASM__
  789. //! @brief Set the GROUP2 field to a new value.
  790. #define BW_FB_CSPMCR_GROUP2(v) (HW_FB_CSPMCR_WR((HW_FB_CSPMCR_RD() & ~BM_FB_CSPMCR_GROUP2) | BF_FB_CSPMCR_GROUP2(v)))
  791. #endif
  792. //@}
  793. /*!
  794. * @name Register FB_CSPMCR, field GROUP1[31:28] (RW)
  795. *
  796. * Controls the multiplexing of the FB_ALE, FB_CS1 , and FB_TS signals.
  797. *
  798. * Values:
  799. * - 0000 - FB_ALE
  800. * - 0001 - FB_CS1
  801. * - 0010 - FB_TS
  802. */
  803. //@{
  804. #define BP_FB_CSPMCR_GROUP1 (28U) //!< Bit position for FB_CSPMCR_GROUP1.
  805. #define BM_FB_CSPMCR_GROUP1 (0xF0000000U) //!< Bit mask for FB_CSPMCR_GROUP1.
  806. #define BS_FB_CSPMCR_GROUP1 (4U) //!< Bit field size in bits for FB_CSPMCR_GROUP1.
  807. #ifndef __LANGUAGE_ASM__
  808. //! @brief Read current value of the FB_CSPMCR_GROUP1 field.
  809. #define BR_FB_CSPMCR_GROUP1 (HW_FB_CSPMCR.B.GROUP1)
  810. #endif
  811. //! @brief Format value for bitfield FB_CSPMCR_GROUP1.
  812. #define BF_FB_CSPMCR_GROUP1(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_FB_CSPMCR_GROUP1), uint32_t) & BM_FB_CSPMCR_GROUP1)
  813. #ifndef __LANGUAGE_ASM__
  814. //! @brief Set the GROUP1 field to a new value.
  815. #define BW_FB_CSPMCR_GROUP1(v) (HW_FB_CSPMCR_WR((HW_FB_CSPMCR_RD() & ~BM_FB_CSPMCR_GROUP1) | BF_FB_CSPMCR_GROUP1(v)))
  816. #endif
  817. //@}
  818. //-------------------------------------------------------------------------------------------
  819. // hw_fb_t - module struct
  820. //-------------------------------------------------------------------------------------------
  821. /*!
  822. * @brief All FB module registers.
  823. */
  824. #ifndef __LANGUAGE_ASM__
  825. #pragma pack(1)
  826. typedef struct _hw_fb
  827. {
  828. struct {
  829. __IO hw_fb_csarn_t CSARn; //!< [0x0] Chip Select Address Register
  830. __IO hw_fb_csmrn_t CSMRn; //!< [0x4] Chip Select Mask Register
  831. __IO hw_fb_cscrn_t CSCRn; //!< [0x8] Chip Select Control Register
  832. } CS[6];
  833. uint8_t _reserved0[24];
  834. __IO hw_fb_cspmcr_t CSPMCR; //!< [0x60] Chip Select port Multiplexing Control Register
  835. } hw_fb_t;
  836. #pragma pack()
  837. //! @brief Macro to access all FB registers.
  838. //! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
  839. //! use the '&' operator, like <code>&HW_FB</code>.
  840. #define HW_FB (*(hw_fb_t *) REGS_FB_BASE)
  841. #endif
  842. #endif // __HW_FB_REGISTERS_H__
  843. // v22/130726/0.9
  844. // EOF