MK64F12_rtc.h 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828
  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_RTC_REGISTERS_H__
  22. #define __HW_RTC_REGISTERS_H__
  23. #include "regs.h"
  24. /*
  25. * MK64F12 RTC
  26. *
  27. * Secure Real Time Clock
  28. *
  29. * Registers defined in this header file:
  30. * - HW_RTC_TSR - RTC Time Seconds Register
  31. * - HW_RTC_TPR - RTC Time Prescaler Register
  32. * - HW_RTC_TAR - RTC Time Alarm Register
  33. * - HW_RTC_TCR - RTC Time Compensation Register
  34. * - HW_RTC_CR - RTC Control Register
  35. * - HW_RTC_SR - RTC Status Register
  36. * - HW_RTC_LR - RTC Lock Register
  37. * - HW_RTC_IER - RTC Interrupt Enable Register
  38. * - HW_RTC_WAR - RTC Write Access Register
  39. * - HW_RTC_RAR - RTC Read Access Register
  40. *
  41. * - hw_rtc_t - Struct containing all module registers.
  42. */
  43. //! @name Module base addresses
  44. //@{
  45. #ifndef REGS_RTC_BASE
  46. #define HW_RTC_INSTANCE_COUNT (1U) //!< Number of instances of the RTC module.
  47. #define REGS_RTC_BASE (0x4003D000U) //!< Base address for RTC.
  48. #endif
  49. //@}
  50. //-------------------------------------------------------------------------------------------
  51. // HW_RTC_TSR - RTC Time Seconds Register
  52. //-------------------------------------------------------------------------------------------
  53. #ifndef __LANGUAGE_ASM__
  54. /*!
  55. * @brief HW_RTC_TSR - RTC Time Seconds Register (RW)
  56. *
  57. * Reset value: 0x00000000U
  58. */
  59. typedef union _hw_rtc_tsr
  60. {
  61. uint32_t U;
  62. struct _hw_rtc_tsr_bitfields
  63. {
  64. uint32_t TSR : 32; //!< [31:0] Time Seconds Register
  65. } B;
  66. } hw_rtc_tsr_t;
  67. #endif
  68. /*!
  69. * @name Constants and macros for entire RTC_TSR register
  70. */
  71. //@{
  72. #define HW_RTC_TSR_ADDR (REGS_RTC_BASE + 0x0U)
  73. #ifndef __LANGUAGE_ASM__
  74. #define HW_RTC_TSR (*(__IO hw_rtc_tsr_t *) HW_RTC_TSR_ADDR)
  75. #define HW_RTC_TSR_RD() (HW_RTC_TSR.U)
  76. #define HW_RTC_TSR_WR(v) (HW_RTC_TSR.U = (v))
  77. #define HW_RTC_TSR_SET(v) (HW_RTC_TSR_WR(HW_RTC_TSR_RD() | (v)))
  78. #define HW_RTC_TSR_CLR(v) (HW_RTC_TSR_WR(HW_RTC_TSR_RD() & ~(v)))
  79. #define HW_RTC_TSR_TOG(v) (HW_RTC_TSR_WR(HW_RTC_TSR_RD() ^ (v)))
  80. #endif
  81. //@}
  82. /*
  83. * Constants & macros for individual RTC_TSR bitfields
  84. */
  85. /*!
  86. * @name Register RTC_TSR, field TSR[31:0] (RW)
  87. *
  88. * When the time counter is enabled, the TSR is read only and increments once a
  89. * second provided SR[TOF] or SR[TIF] are not set. The time counter will read as
  90. * zero when SR[TOF] or SR[TIF] are set. When the time counter is disabled, the
  91. * TSR can be read or written. Writing to the TSR when the time counter is
  92. * disabled will clear the SR[TOF] and/or the SR[TIF]. Writing to TSR with zero is
  93. * supported, but not recommended because TSR will read as zero when SR[TIF] or
  94. * SR[TOF] are set (indicating the time is invalid).
  95. */
  96. //@{
  97. #define BP_RTC_TSR_TSR (0U) //!< Bit position for RTC_TSR_TSR.
  98. #define BM_RTC_TSR_TSR (0xFFFFFFFFU) //!< Bit mask for RTC_TSR_TSR.
  99. #define BS_RTC_TSR_TSR (32U) //!< Bit field size in bits for RTC_TSR_TSR.
  100. #ifndef __LANGUAGE_ASM__
  101. //! @brief Read current value of the RTC_TSR_TSR field.
  102. #define BR_RTC_TSR_TSR (HW_RTC_TSR.U)
  103. #endif
  104. //! @brief Format value for bitfield RTC_TSR_TSR.
  105. #define BF_RTC_TSR_TSR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_TSR_TSR), uint32_t) & BM_RTC_TSR_TSR)
  106. #ifndef __LANGUAGE_ASM__
  107. //! @brief Set the TSR field to a new value.
  108. #define BW_RTC_TSR_TSR(v) (HW_RTC_TSR_WR(v))
  109. #endif
  110. //@}
  111. //-------------------------------------------------------------------------------------------
  112. // HW_RTC_TPR - RTC Time Prescaler Register
  113. //-------------------------------------------------------------------------------------------
  114. #ifndef __LANGUAGE_ASM__
  115. /*!
  116. * @brief HW_RTC_TPR - RTC Time Prescaler Register (RW)
  117. *
  118. * Reset value: 0x00000000U
  119. */
  120. typedef union _hw_rtc_tpr
  121. {
  122. uint32_t U;
  123. struct _hw_rtc_tpr_bitfields
  124. {
  125. uint32_t TPR : 16; //!< [15:0] Time Prescaler Register
  126. uint32_t RESERVED0 : 16; //!< [31:16]
  127. } B;
  128. } hw_rtc_tpr_t;
  129. #endif
  130. /*!
  131. * @name Constants and macros for entire RTC_TPR register
  132. */
  133. //@{
  134. #define HW_RTC_TPR_ADDR (REGS_RTC_BASE + 0x4U)
  135. #ifndef __LANGUAGE_ASM__
  136. #define HW_RTC_TPR (*(__IO hw_rtc_tpr_t *) HW_RTC_TPR_ADDR)
  137. #define HW_RTC_TPR_RD() (HW_RTC_TPR.U)
  138. #define HW_RTC_TPR_WR(v) (HW_RTC_TPR.U = (v))
  139. #define HW_RTC_TPR_SET(v) (HW_RTC_TPR_WR(HW_RTC_TPR_RD() | (v)))
  140. #define HW_RTC_TPR_CLR(v) (HW_RTC_TPR_WR(HW_RTC_TPR_RD() & ~(v)))
  141. #define HW_RTC_TPR_TOG(v) (HW_RTC_TPR_WR(HW_RTC_TPR_RD() ^ (v)))
  142. #endif
  143. //@}
  144. /*
  145. * Constants & macros for individual RTC_TPR bitfields
  146. */
  147. /*!
  148. * @name Register RTC_TPR, field TPR[15:0] (RW)
  149. *
  150. * When the time counter is enabled, the TPR is read only and increments every
  151. * 32.768 kHz clock cycle. The time counter will read as zero when SR[TOF] or
  152. * SR[TIF] are set. When the time counter is disabled, the TPR can be read or
  153. * written. The TSR[TSR] increments when bit 14 of the TPR transitions from a logic one
  154. * to a logic zero.
  155. */
  156. //@{
  157. #define BP_RTC_TPR_TPR (0U) //!< Bit position for RTC_TPR_TPR.
  158. #define BM_RTC_TPR_TPR (0x0000FFFFU) //!< Bit mask for RTC_TPR_TPR.
  159. #define BS_RTC_TPR_TPR (16U) //!< Bit field size in bits for RTC_TPR_TPR.
  160. #ifndef __LANGUAGE_ASM__
  161. //! @brief Read current value of the RTC_TPR_TPR field.
  162. #define BR_RTC_TPR_TPR (HW_RTC_TPR.B.TPR)
  163. #endif
  164. //! @brief Format value for bitfield RTC_TPR_TPR.
  165. #define BF_RTC_TPR_TPR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_TPR_TPR), uint32_t) & BM_RTC_TPR_TPR)
  166. #ifndef __LANGUAGE_ASM__
  167. //! @brief Set the TPR field to a new value.
  168. #define BW_RTC_TPR_TPR(v) (HW_RTC_TPR_WR((HW_RTC_TPR_RD() & ~BM_RTC_TPR_TPR) | BF_RTC_TPR_TPR(v)))
  169. #endif
  170. //@}
  171. //-------------------------------------------------------------------------------------------
  172. // HW_RTC_TAR - RTC Time Alarm Register
  173. //-------------------------------------------------------------------------------------------
  174. #ifndef __LANGUAGE_ASM__
  175. /*!
  176. * @brief HW_RTC_TAR - RTC Time Alarm Register (RW)
  177. *
  178. * Reset value: 0x00000000U
  179. */
  180. typedef union _hw_rtc_tar
  181. {
  182. uint32_t U;
  183. struct _hw_rtc_tar_bitfields
  184. {
  185. uint32_t TAR : 32; //!< [31:0] Time Alarm Register
  186. } B;
  187. } hw_rtc_tar_t;
  188. #endif
  189. /*!
  190. * @name Constants and macros for entire RTC_TAR register
  191. */
  192. //@{
  193. #define HW_RTC_TAR_ADDR (REGS_RTC_BASE + 0x8U)
  194. #ifndef __LANGUAGE_ASM__
  195. #define HW_RTC_TAR (*(__IO hw_rtc_tar_t *) HW_RTC_TAR_ADDR)
  196. #define HW_RTC_TAR_RD() (HW_RTC_TAR.U)
  197. #define HW_RTC_TAR_WR(v) (HW_RTC_TAR.U = (v))
  198. #define HW_RTC_TAR_SET(v) (HW_RTC_TAR_WR(HW_RTC_TAR_RD() | (v)))
  199. #define HW_RTC_TAR_CLR(v) (HW_RTC_TAR_WR(HW_RTC_TAR_RD() & ~(v)))
  200. #define HW_RTC_TAR_TOG(v) (HW_RTC_TAR_WR(HW_RTC_TAR_RD() ^ (v)))
  201. #endif
  202. //@}
  203. /*
  204. * Constants & macros for individual RTC_TAR bitfields
  205. */
  206. /*!
  207. * @name Register RTC_TAR, field TAR[31:0] (RW)
  208. *
  209. * When the time counter is enabled, the SR[TAF] is set whenever the TAR[TAR]
  210. * equals the TSR[TSR] and the TSR[TSR] increments. Writing to the TAR clears the
  211. * SR[TAF].
  212. */
  213. //@{
  214. #define BP_RTC_TAR_TAR (0U) //!< Bit position for RTC_TAR_TAR.
  215. #define BM_RTC_TAR_TAR (0xFFFFFFFFU) //!< Bit mask for RTC_TAR_TAR.
  216. #define BS_RTC_TAR_TAR (32U) //!< Bit field size in bits for RTC_TAR_TAR.
  217. #ifndef __LANGUAGE_ASM__
  218. //! @brief Read current value of the RTC_TAR_TAR field.
  219. #define BR_RTC_TAR_TAR (HW_RTC_TAR.U)
  220. #endif
  221. //! @brief Format value for bitfield RTC_TAR_TAR.
  222. #define BF_RTC_TAR_TAR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_TAR_TAR), uint32_t) & BM_RTC_TAR_TAR)
  223. #ifndef __LANGUAGE_ASM__
  224. //! @brief Set the TAR field to a new value.
  225. #define BW_RTC_TAR_TAR(v) (HW_RTC_TAR_WR(v))
  226. #endif
  227. //@}
  228. //-------------------------------------------------------------------------------------------
  229. // HW_RTC_TCR - RTC Time Compensation Register
  230. //-------------------------------------------------------------------------------------------
  231. #ifndef __LANGUAGE_ASM__
  232. /*!
  233. * @brief HW_RTC_TCR - RTC Time Compensation Register (RW)
  234. *
  235. * Reset value: 0x00000000U
  236. */
  237. typedef union _hw_rtc_tcr
  238. {
  239. uint32_t U;
  240. struct _hw_rtc_tcr_bitfields
  241. {
  242. uint32_t TCR : 8; //!< [7:0] Time Compensation Register
  243. uint32_t CIR : 8; //!< [15:8] Compensation Interval Register
  244. uint32_t TCV : 8; //!< [23:16] Time Compensation Value
  245. uint32_t CIC : 8; //!< [31:24] Compensation Interval Counter
  246. } B;
  247. } hw_rtc_tcr_t;
  248. #endif
  249. /*!
  250. * @name Constants and macros for entire RTC_TCR register
  251. */
  252. //@{
  253. #define HW_RTC_TCR_ADDR (REGS_RTC_BASE + 0xCU)
  254. #ifndef __LANGUAGE_ASM__
  255. #define HW_RTC_TCR (*(__IO hw_rtc_tcr_t *) HW_RTC_TCR_ADDR)
  256. #define HW_RTC_TCR_RD() (HW_RTC_TCR.U)
  257. #define HW_RTC_TCR_WR(v) (HW_RTC_TCR.U = (v))
  258. #define HW_RTC_TCR_SET(v) (HW_RTC_TCR_WR(HW_RTC_TCR_RD() | (v)))
  259. #define HW_RTC_TCR_CLR(v) (HW_RTC_TCR_WR(HW_RTC_TCR_RD() & ~(v)))
  260. #define HW_RTC_TCR_TOG(v) (HW_RTC_TCR_WR(HW_RTC_TCR_RD() ^ (v)))
  261. #endif
  262. //@}
  263. /*
  264. * Constants & macros for individual RTC_TCR bitfields
  265. */
  266. /*!
  267. * @name Register RTC_TCR, field TCR[7:0] (RW)
  268. *
  269. * Configures the number of 32.768 kHz clock cycles in each second. This
  270. * register is double buffered and writes do not take affect until the end of the
  271. * current compensation interval.
  272. *
  273. * Values:
  274. * - 10000000 - Time Prescaler Register overflows every 32896 clock cycles.
  275. * - 11111111 - Time Prescaler Register overflows every 32769 clock cycles.
  276. * - 0 - Time Prescaler Register overflows every 32768 clock cycles.
  277. * - 1 - Time Prescaler Register overflows every 32767 clock cycles.
  278. * - 1111111 - Time Prescaler Register overflows every 32641 clock cycles.
  279. */
  280. //@{
  281. #define BP_RTC_TCR_TCR (0U) //!< Bit position for RTC_TCR_TCR.
  282. #define BM_RTC_TCR_TCR (0x000000FFU) //!< Bit mask for RTC_TCR_TCR.
  283. #define BS_RTC_TCR_TCR (8U) //!< Bit field size in bits for RTC_TCR_TCR.
  284. #ifndef __LANGUAGE_ASM__
  285. //! @brief Read current value of the RTC_TCR_TCR field.
  286. #define BR_RTC_TCR_TCR (HW_RTC_TCR.B.TCR)
  287. #endif
  288. //! @brief Format value for bitfield RTC_TCR_TCR.
  289. #define BF_RTC_TCR_TCR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_TCR_TCR), uint32_t) & BM_RTC_TCR_TCR)
  290. #ifndef __LANGUAGE_ASM__
  291. //! @brief Set the TCR field to a new value.
  292. #define BW_RTC_TCR_TCR(v) (HW_RTC_TCR_WR((HW_RTC_TCR_RD() & ~BM_RTC_TCR_TCR) | BF_RTC_TCR_TCR(v)))
  293. #endif
  294. //@}
  295. /*!
  296. * @name Register RTC_TCR, field CIR[15:8] (RW)
  297. *
  298. * Configures the compensation interval in seconds from 1 to 256 to control how
  299. * frequently the TCR should adjust the number of 32.768 kHz cycles in each
  300. * second. The value written should be one less than the number of seconds. For
  301. * example, write zero to configure for a compensation interval of one second. This
  302. * register is double buffered and writes do not take affect until the end of the
  303. * current compensation interval.
  304. */
  305. //@{
  306. #define BP_RTC_TCR_CIR (8U) //!< Bit position for RTC_TCR_CIR.
  307. #define BM_RTC_TCR_CIR (0x0000FF00U) //!< Bit mask for RTC_TCR_CIR.
  308. #define BS_RTC_TCR_CIR (8U) //!< Bit field size in bits for RTC_TCR_CIR.
  309. #ifndef __LANGUAGE_ASM__
  310. //! @brief Read current value of the RTC_TCR_CIR field.
  311. #define BR_RTC_TCR_CIR (HW_RTC_TCR.B.CIR)
  312. #endif
  313. //! @brief Format value for bitfield RTC_TCR_CIR.
  314. #define BF_RTC_TCR_CIR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_TCR_CIR), uint32_t) & BM_RTC_TCR_CIR)
  315. #ifndef __LANGUAGE_ASM__
  316. //! @brief Set the CIR field to a new value.
  317. #define BW_RTC_TCR_CIR(v) (HW_RTC_TCR_WR((HW_RTC_TCR_RD() & ~BM_RTC_TCR_CIR) | BF_RTC_TCR_CIR(v)))
  318. #endif
  319. //@}
  320. /*!
  321. * @name Register RTC_TCR, field TCV[23:16] (RO)
  322. *
  323. * Current value used by the compensation logic for the present second interval.
  324. * Updated once a second if the CIC equals 0 with the contents of the TCR field.
  325. * If the CIC does not equal zero then it is loaded with zero (compensation is
  326. * not enabled for that second increment).
  327. */
  328. //@{
  329. #define BP_RTC_TCR_TCV (16U) //!< Bit position for RTC_TCR_TCV.
  330. #define BM_RTC_TCR_TCV (0x00FF0000U) //!< Bit mask for RTC_TCR_TCV.
  331. #define BS_RTC_TCR_TCV (8U) //!< Bit field size in bits for RTC_TCR_TCV.
  332. #ifndef __LANGUAGE_ASM__
  333. //! @brief Read current value of the RTC_TCR_TCV field.
  334. #define BR_RTC_TCR_TCV (HW_RTC_TCR.B.TCV)
  335. #endif
  336. //@}
  337. /*!
  338. * @name Register RTC_TCR, field CIC[31:24] (RO)
  339. *
  340. * Current value of the compensation interval counter. If the compensation
  341. * interval counter equals zero then it is loaded with the contents of the CIR. If the
  342. * CIC does not equal zero then it is decremented once a second.
  343. */
  344. //@{
  345. #define BP_RTC_TCR_CIC (24U) //!< Bit position for RTC_TCR_CIC.
  346. #define BM_RTC_TCR_CIC (0xFF000000U) //!< Bit mask for RTC_TCR_CIC.
  347. #define BS_RTC_TCR_CIC (8U) //!< Bit field size in bits for RTC_TCR_CIC.
  348. #ifndef __LANGUAGE_ASM__
  349. //! @brief Read current value of the RTC_TCR_CIC field.
  350. #define BR_RTC_TCR_CIC (HW_RTC_TCR.B.CIC)
  351. #endif
  352. //@}
  353. //-------------------------------------------------------------------------------------------
  354. // HW_RTC_CR - RTC Control Register
  355. //-------------------------------------------------------------------------------------------
  356. #ifndef __LANGUAGE_ASM__
  357. /*!
  358. * @brief HW_RTC_CR - RTC Control Register (RW)
  359. *
  360. * Reset value: 0x00000000U
  361. */
  362. typedef union _hw_rtc_cr
  363. {
  364. uint32_t U;
  365. struct _hw_rtc_cr_bitfields
  366. {
  367. uint32_t SWR : 1; //!< [0] Software Reset
  368. uint32_t WPE : 1; //!< [1] Wakeup Pin Enable
  369. uint32_t SUP : 1; //!< [2] Supervisor Access
  370. uint32_t UM : 1; //!< [3] Update Mode
  371. uint32_t WPS : 1; //!< [4] Wakeup Pin Select
  372. uint32_t RESERVED0 : 3; //!< [7:5]
  373. uint32_t OSCE : 1; //!< [8] Oscillator Enable
  374. uint32_t CLKO : 1; //!< [9] Clock Output
  375. uint32_t SC16P : 1; //!< [10] Oscillator 16pF Load Configure
  376. uint32_t SC8P : 1; //!< [11] Oscillator 8pF Load Configure
  377. uint32_t SC4P : 1; //!< [12] Oscillator 4pF Load Configure
  378. uint32_t SC2P : 1; //!< [13] Oscillator 2pF Load Configure
  379. uint32_t RESERVED1 : 18; //!< [31:14]
  380. } B;
  381. } hw_rtc_cr_t;
  382. #endif
  383. /*!
  384. * @name Constants and macros for entire RTC_CR register
  385. */
  386. //@{
  387. #define HW_RTC_CR_ADDR (REGS_RTC_BASE + 0x10U)
  388. #ifndef __LANGUAGE_ASM__
  389. #define HW_RTC_CR (*(__IO hw_rtc_cr_t *) HW_RTC_CR_ADDR)
  390. #define HW_RTC_CR_RD() (HW_RTC_CR.U)
  391. #define HW_RTC_CR_WR(v) (HW_RTC_CR.U = (v))
  392. #define HW_RTC_CR_SET(v) (HW_RTC_CR_WR(HW_RTC_CR_RD() | (v)))
  393. #define HW_RTC_CR_CLR(v) (HW_RTC_CR_WR(HW_RTC_CR_RD() & ~(v)))
  394. #define HW_RTC_CR_TOG(v) (HW_RTC_CR_WR(HW_RTC_CR_RD() ^ (v)))
  395. #endif
  396. //@}
  397. /*
  398. * Constants & macros for individual RTC_CR bitfields
  399. */
  400. /*!
  401. * @name Register RTC_CR, field SWR[0] (RW)
  402. *
  403. * Values:
  404. * - 0 - No effect.
  405. * - 1 - Resets all RTC registers except for the SWR bit and the RTC_WAR and
  406. * RTC_RAR registers . The SWR bit is cleared by VBAT POR and by software
  407. * explicitly clearing it.
  408. */
  409. //@{
  410. #define BP_RTC_CR_SWR (0U) //!< Bit position for RTC_CR_SWR.
  411. #define BM_RTC_CR_SWR (0x00000001U) //!< Bit mask for RTC_CR_SWR.
  412. #define BS_RTC_CR_SWR (1U) //!< Bit field size in bits for RTC_CR_SWR.
  413. #ifndef __LANGUAGE_ASM__
  414. //! @brief Read current value of the RTC_CR_SWR field.
  415. #define BR_RTC_CR_SWR (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SWR))
  416. #endif
  417. //! @brief Format value for bitfield RTC_CR_SWR.
  418. #define BF_RTC_CR_SWR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_SWR), uint32_t) & BM_RTC_CR_SWR)
  419. #ifndef __LANGUAGE_ASM__
  420. //! @brief Set the SWR field to a new value.
  421. #define BW_RTC_CR_SWR(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SWR) = (v))
  422. #endif
  423. //@}
  424. /*!
  425. * @name Register RTC_CR, field WPE[1] (RW)
  426. *
  427. * The wakeup pin is optional and not available on all devices.
  428. *
  429. * Values:
  430. * - 0 - Wakeup pin is disabled.
  431. * - 1 - Wakeup pin is enabled and wakeup pin asserts if the RTC interrupt
  432. * asserts or the wakeup pin is turned on.
  433. */
  434. //@{
  435. #define BP_RTC_CR_WPE (1U) //!< Bit position for RTC_CR_WPE.
  436. #define BM_RTC_CR_WPE (0x00000002U) //!< Bit mask for RTC_CR_WPE.
  437. #define BS_RTC_CR_WPE (1U) //!< Bit field size in bits for RTC_CR_WPE.
  438. #ifndef __LANGUAGE_ASM__
  439. //! @brief Read current value of the RTC_CR_WPE field.
  440. #define BR_RTC_CR_WPE (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_WPE))
  441. #endif
  442. //! @brief Format value for bitfield RTC_CR_WPE.
  443. #define BF_RTC_CR_WPE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_WPE), uint32_t) & BM_RTC_CR_WPE)
  444. #ifndef __LANGUAGE_ASM__
  445. //! @brief Set the WPE field to a new value.
  446. #define BW_RTC_CR_WPE(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_WPE) = (v))
  447. #endif
  448. //@}
  449. /*!
  450. * @name Register RTC_CR, field SUP[2] (RW)
  451. *
  452. * Values:
  453. * - 0 - Non-supervisor mode write accesses are not supported and generate a bus
  454. * error.
  455. * - 1 - Non-supervisor mode write accesses are supported.
  456. */
  457. //@{
  458. #define BP_RTC_CR_SUP (2U) //!< Bit position for RTC_CR_SUP.
  459. #define BM_RTC_CR_SUP (0x00000004U) //!< Bit mask for RTC_CR_SUP.
  460. #define BS_RTC_CR_SUP (1U) //!< Bit field size in bits for RTC_CR_SUP.
  461. #ifndef __LANGUAGE_ASM__
  462. //! @brief Read current value of the RTC_CR_SUP field.
  463. #define BR_RTC_CR_SUP (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SUP))
  464. #endif
  465. //! @brief Format value for bitfield RTC_CR_SUP.
  466. #define BF_RTC_CR_SUP(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_SUP), uint32_t) & BM_RTC_CR_SUP)
  467. #ifndef __LANGUAGE_ASM__
  468. //! @brief Set the SUP field to a new value.
  469. #define BW_RTC_CR_SUP(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SUP) = (v))
  470. #endif
  471. //@}
  472. /*!
  473. * @name Register RTC_CR, field UM[3] (RW)
  474. *
  475. * Allows SR[TCE] to be written even when the Status Register is locked. When
  476. * set, the SR[TCE] can always be written if the SR[TIF] or SR[TOF] are set or if
  477. * the SR[TCE] is clear.
  478. *
  479. * Values:
  480. * - 0 - Registers cannot be written when locked.
  481. * - 1 - Registers can be written when locked under limited conditions.
  482. */
  483. //@{
  484. #define BP_RTC_CR_UM (3U) //!< Bit position for RTC_CR_UM.
  485. #define BM_RTC_CR_UM (0x00000008U) //!< Bit mask for RTC_CR_UM.
  486. #define BS_RTC_CR_UM (1U) //!< Bit field size in bits for RTC_CR_UM.
  487. #ifndef __LANGUAGE_ASM__
  488. //! @brief Read current value of the RTC_CR_UM field.
  489. #define BR_RTC_CR_UM (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_UM))
  490. #endif
  491. //! @brief Format value for bitfield RTC_CR_UM.
  492. #define BF_RTC_CR_UM(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_UM), uint32_t) & BM_RTC_CR_UM)
  493. #ifndef __LANGUAGE_ASM__
  494. //! @brief Set the UM field to a new value.
  495. #define BW_RTC_CR_UM(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_UM) = (v))
  496. #endif
  497. //@}
  498. /*!
  499. * @name Register RTC_CR, field WPS[4] (RW)
  500. *
  501. * The wakeup pin is optional and not available on all devices.
  502. *
  503. * Values:
  504. * - 0 - Wakeup pin asserts (active low, open drain) if the RTC interrupt
  505. * asserts or the wakeup pin is turned on.
  506. * - 1 - Wakeup pin instead outputs the RTC 32kHz clock, provided the wakeup pin
  507. * is turned on and the 32kHz clock is output to other peripherals.
  508. */
  509. //@{
  510. #define BP_RTC_CR_WPS (4U) //!< Bit position for RTC_CR_WPS.
  511. #define BM_RTC_CR_WPS (0x00000010U) //!< Bit mask for RTC_CR_WPS.
  512. #define BS_RTC_CR_WPS (1U) //!< Bit field size in bits for RTC_CR_WPS.
  513. #ifndef __LANGUAGE_ASM__
  514. //! @brief Read current value of the RTC_CR_WPS field.
  515. #define BR_RTC_CR_WPS (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_WPS))
  516. #endif
  517. //! @brief Format value for bitfield RTC_CR_WPS.
  518. #define BF_RTC_CR_WPS(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_WPS), uint32_t) & BM_RTC_CR_WPS)
  519. #ifndef __LANGUAGE_ASM__
  520. //! @brief Set the WPS field to a new value.
  521. #define BW_RTC_CR_WPS(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_WPS) = (v))
  522. #endif
  523. //@}
  524. /*!
  525. * @name Register RTC_CR, field OSCE[8] (RW)
  526. *
  527. * Values:
  528. * - 0 - 32.768 kHz oscillator is disabled.
  529. * - 1 - 32.768 kHz oscillator is enabled. After setting this bit, wait the
  530. * oscillator startup time before enabling the time counter to allow the 32.768
  531. * kHz clock time to stabilize.
  532. */
  533. //@{
  534. #define BP_RTC_CR_OSCE (8U) //!< Bit position for RTC_CR_OSCE.
  535. #define BM_RTC_CR_OSCE (0x00000100U) //!< Bit mask for RTC_CR_OSCE.
  536. #define BS_RTC_CR_OSCE (1U) //!< Bit field size in bits for RTC_CR_OSCE.
  537. #ifndef __LANGUAGE_ASM__
  538. //! @brief Read current value of the RTC_CR_OSCE field.
  539. #define BR_RTC_CR_OSCE (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_OSCE))
  540. #endif
  541. //! @brief Format value for bitfield RTC_CR_OSCE.
  542. #define BF_RTC_CR_OSCE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_OSCE), uint32_t) & BM_RTC_CR_OSCE)
  543. #ifndef __LANGUAGE_ASM__
  544. //! @brief Set the OSCE field to a new value.
  545. #define BW_RTC_CR_OSCE(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_OSCE) = (v))
  546. #endif
  547. //@}
  548. /*!
  549. * @name Register RTC_CR, field CLKO[9] (RW)
  550. *
  551. * Values:
  552. * - 0 - The 32 kHz clock is output to other peripherals.
  553. * - 1 - The 32 kHz clock is not output to other peripherals.
  554. */
  555. //@{
  556. #define BP_RTC_CR_CLKO (9U) //!< Bit position for RTC_CR_CLKO.
  557. #define BM_RTC_CR_CLKO (0x00000200U) //!< Bit mask for RTC_CR_CLKO.
  558. #define BS_RTC_CR_CLKO (1U) //!< Bit field size in bits for RTC_CR_CLKO.
  559. #ifndef __LANGUAGE_ASM__
  560. //! @brief Read current value of the RTC_CR_CLKO field.
  561. #define BR_RTC_CR_CLKO (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_CLKO))
  562. #endif
  563. //! @brief Format value for bitfield RTC_CR_CLKO.
  564. #define BF_RTC_CR_CLKO(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_CLKO), uint32_t) & BM_RTC_CR_CLKO)
  565. #ifndef __LANGUAGE_ASM__
  566. //! @brief Set the CLKO field to a new value.
  567. #define BW_RTC_CR_CLKO(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_CLKO) = (v))
  568. #endif
  569. //@}
  570. /*!
  571. * @name Register RTC_CR, field SC16P[10] (RW)
  572. *
  573. * Values:
  574. * - 0 - Disable the load.
  575. * - 1 - Enable the additional load.
  576. */
  577. //@{
  578. #define BP_RTC_CR_SC16P (10U) //!< Bit position for RTC_CR_SC16P.
  579. #define BM_RTC_CR_SC16P (0x00000400U) //!< Bit mask for RTC_CR_SC16P.
  580. #define BS_RTC_CR_SC16P (1U) //!< Bit field size in bits for RTC_CR_SC16P.
  581. #ifndef __LANGUAGE_ASM__
  582. //! @brief Read current value of the RTC_CR_SC16P field.
  583. #define BR_RTC_CR_SC16P (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SC16P))
  584. #endif
  585. //! @brief Format value for bitfield RTC_CR_SC16P.
  586. #define BF_RTC_CR_SC16P(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_SC16P), uint32_t) & BM_RTC_CR_SC16P)
  587. #ifndef __LANGUAGE_ASM__
  588. //! @brief Set the SC16P field to a new value.
  589. #define BW_RTC_CR_SC16P(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SC16P) = (v))
  590. #endif
  591. //@}
  592. /*!
  593. * @name Register RTC_CR, field SC8P[11] (RW)
  594. *
  595. * Values:
  596. * - 0 - Disable the load.
  597. * - 1 - Enable the additional load.
  598. */
  599. //@{
  600. #define BP_RTC_CR_SC8P (11U) //!< Bit position for RTC_CR_SC8P.
  601. #define BM_RTC_CR_SC8P (0x00000800U) //!< Bit mask for RTC_CR_SC8P.
  602. #define BS_RTC_CR_SC8P (1U) //!< Bit field size in bits for RTC_CR_SC8P.
  603. #ifndef __LANGUAGE_ASM__
  604. //! @brief Read current value of the RTC_CR_SC8P field.
  605. #define BR_RTC_CR_SC8P (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SC8P))
  606. #endif
  607. //! @brief Format value for bitfield RTC_CR_SC8P.
  608. #define BF_RTC_CR_SC8P(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_SC8P), uint32_t) & BM_RTC_CR_SC8P)
  609. #ifndef __LANGUAGE_ASM__
  610. //! @brief Set the SC8P field to a new value.
  611. #define BW_RTC_CR_SC8P(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SC8P) = (v))
  612. #endif
  613. //@}
  614. /*!
  615. * @name Register RTC_CR, field SC4P[12] (RW)
  616. *
  617. * Values:
  618. * - 0 - Disable the load.
  619. * - 1 - Enable the additional load.
  620. */
  621. //@{
  622. #define BP_RTC_CR_SC4P (12U) //!< Bit position for RTC_CR_SC4P.
  623. #define BM_RTC_CR_SC4P (0x00001000U) //!< Bit mask for RTC_CR_SC4P.
  624. #define BS_RTC_CR_SC4P (1U) //!< Bit field size in bits for RTC_CR_SC4P.
  625. #ifndef __LANGUAGE_ASM__
  626. //! @brief Read current value of the RTC_CR_SC4P field.
  627. #define BR_RTC_CR_SC4P (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SC4P))
  628. #endif
  629. //! @brief Format value for bitfield RTC_CR_SC4P.
  630. #define BF_RTC_CR_SC4P(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_SC4P), uint32_t) & BM_RTC_CR_SC4P)
  631. #ifndef __LANGUAGE_ASM__
  632. //! @brief Set the SC4P field to a new value.
  633. #define BW_RTC_CR_SC4P(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SC4P) = (v))
  634. #endif
  635. //@}
  636. /*!
  637. * @name Register RTC_CR, field SC2P[13] (RW)
  638. *
  639. * Values:
  640. * - 0 - Disable the load.
  641. * - 1 - Enable the additional load.
  642. */
  643. //@{
  644. #define BP_RTC_CR_SC2P (13U) //!< Bit position for RTC_CR_SC2P.
  645. #define BM_RTC_CR_SC2P (0x00002000U) //!< Bit mask for RTC_CR_SC2P.
  646. #define BS_RTC_CR_SC2P (1U) //!< Bit field size in bits for RTC_CR_SC2P.
  647. #ifndef __LANGUAGE_ASM__
  648. //! @brief Read current value of the RTC_CR_SC2P field.
  649. #define BR_RTC_CR_SC2P (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SC2P))
  650. #endif
  651. //! @brief Format value for bitfield RTC_CR_SC2P.
  652. #define BF_RTC_CR_SC2P(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_CR_SC2P), uint32_t) & BM_RTC_CR_SC2P)
  653. #ifndef __LANGUAGE_ASM__
  654. //! @brief Set the SC2P field to a new value.
  655. #define BW_RTC_CR_SC2P(v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR, BP_RTC_CR_SC2P) = (v))
  656. #endif
  657. //@}
  658. //-------------------------------------------------------------------------------------------
  659. // HW_RTC_SR - RTC Status Register
  660. //-------------------------------------------------------------------------------------------
  661. #ifndef __LANGUAGE_ASM__
  662. /*!
  663. * @brief HW_RTC_SR - RTC Status Register (RW)
  664. *
  665. * Reset value: 0x00000001U
  666. */
  667. typedef union _hw_rtc_sr
  668. {
  669. uint32_t U;
  670. struct _hw_rtc_sr_bitfields
  671. {
  672. uint32_t TIF : 1; //!< [0] Time Invalid Flag
  673. uint32_t TOF : 1; //!< [1] Time Overflow Flag
  674. uint32_t TAF : 1; //!< [2] Time Alarm Flag
  675. uint32_t RESERVED0 : 1; //!< [3]
  676. uint32_t TCE : 1; //!< [4] Time Counter Enable
  677. uint32_t RESERVED1 : 27; //!< [31:5]
  678. } B;
  679. } hw_rtc_sr_t;
  680. #endif
  681. /*!
  682. * @name Constants and macros for entire RTC_SR register
  683. */
  684. //@{
  685. #define HW_RTC_SR_ADDR (REGS_RTC_BASE + 0x14U)
  686. #ifndef __LANGUAGE_ASM__
  687. #define HW_RTC_SR (*(__IO hw_rtc_sr_t *) HW_RTC_SR_ADDR)
  688. #define HW_RTC_SR_RD() (HW_RTC_SR.U)
  689. #define HW_RTC_SR_WR(v) (HW_RTC_SR.U = (v))
  690. #define HW_RTC_SR_SET(v) (HW_RTC_SR_WR(HW_RTC_SR_RD() | (v)))
  691. #define HW_RTC_SR_CLR(v) (HW_RTC_SR_WR(HW_RTC_SR_RD() & ~(v)))
  692. #define HW_RTC_SR_TOG(v) (HW_RTC_SR_WR(HW_RTC_SR_RD() ^ (v)))
  693. #endif
  694. //@}
  695. /*
  696. * Constants & macros for individual RTC_SR bitfields
  697. */
  698. /*!
  699. * @name Register RTC_SR, field TIF[0] (RO)
  700. *
  701. * The time invalid flag is set on VBAT POR or software reset. The TSR and TPR
  702. * do not increment and read as zero when this bit is set. This bit is cleared by
  703. * writing the TSR register when the time counter is disabled.
  704. *
  705. * Values:
  706. * - 0 - Time is valid.
  707. * - 1 - Time is invalid and time counter is read as zero.
  708. */
  709. //@{
  710. #define BP_RTC_SR_TIF (0U) //!< Bit position for RTC_SR_TIF.
  711. #define BM_RTC_SR_TIF (0x00000001U) //!< Bit mask for RTC_SR_TIF.
  712. #define BS_RTC_SR_TIF (1U) //!< Bit field size in bits for RTC_SR_TIF.
  713. #ifndef __LANGUAGE_ASM__
  714. //! @brief Read current value of the RTC_SR_TIF field.
  715. #define BR_RTC_SR_TIF (BITBAND_ACCESS32(HW_RTC_SR_ADDR, BP_RTC_SR_TIF))
  716. #endif
  717. //@}
  718. /*!
  719. * @name Register RTC_SR, field TOF[1] (RO)
  720. *
  721. * Time overflow flag is set when the time counter is enabled and overflows. The
  722. * TSR and TPR do not increment and read as zero when this bit is set. This bit
  723. * is cleared by writing the TSR register when the time counter is disabled.
  724. *
  725. * Values:
  726. * - 0 - Time overflow has not occurred.
  727. * - 1 - Time overflow has occurred and time counter is read as zero.
  728. */
  729. //@{
  730. #define BP_RTC_SR_TOF (1U) //!< Bit position for RTC_SR_TOF.
  731. #define BM_RTC_SR_TOF (0x00000002U) //!< Bit mask for RTC_SR_TOF.
  732. #define BS_RTC_SR_TOF (1U) //!< Bit field size in bits for RTC_SR_TOF.
  733. #ifndef __LANGUAGE_ASM__
  734. //! @brief Read current value of the RTC_SR_TOF field.
  735. #define BR_RTC_SR_TOF (BITBAND_ACCESS32(HW_RTC_SR_ADDR, BP_RTC_SR_TOF))
  736. #endif
  737. //@}
  738. /*!
  739. * @name Register RTC_SR, field TAF[2] (RO)
  740. *
  741. * Time alarm flag is set when the TAR[TAR] equals the TSR[TSR] and the TSR[TSR]
  742. * increments. This bit is cleared by writing the TAR register.
  743. *
  744. * Values:
  745. * - 0 - Time alarm has not occurred.
  746. * - 1 - Time alarm has occurred.
  747. */
  748. //@{
  749. #define BP_RTC_SR_TAF (2U) //!< Bit position for RTC_SR_TAF.
  750. #define BM_RTC_SR_TAF (0x00000004U) //!< Bit mask for RTC_SR_TAF.
  751. #define BS_RTC_SR_TAF (1U) //!< Bit field size in bits for RTC_SR_TAF.
  752. #ifndef __LANGUAGE_ASM__
  753. //! @brief Read current value of the RTC_SR_TAF field.
  754. #define BR_RTC_SR_TAF (BITBAND_ACCESS32(HW_RTC_SR_ADDR, BP_RTC_SR_TAF))
  755. #endif
  756. //@}
  757. /*!
  758. * @name Register RTC_SR, field TCE[4] (RW)
  759. *
  760. * When time counter is disabled the TSR register and TPR register are
  761. * writeable, but do not increment. When time counter is enabled the TSR register and TPR
  762. * register are not writeable, but increment.
  763. *
  764. * Values:
  765. * - 0 - Time counter is disabled.
  766. * - 1 - Time counter is enabled.
  767. */
  768. //@{
  769. #define BP_RTC_SR_TCE (4U) //!< Bit position for RTC_SR_TCE.
  770. #define BM_RTC_SR_TCE (0x00000010U) //!< Bit mask for RTC_SR_TCE.
  771. #define BS_RTC_SR_TCE (1U) //!< Bit field size in bits for RTC_SR_TCE.
  772. #ifndef __LANGUAGE_ASM__
  773. //! @brief Read current value of the RTC_SR_TCE field.
  774. #define BR_RTC_SR_TCE (BITBAND_ACCESS32(HW_RTC_SR_ADDR, BP_RTC_SR_TCE))
  775. #endif
  776. //! @brief Format value for bitfield RTC_SR_TCE.
  777. #define BF_RTC_SR_TCE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_SR_TCE), uint32_t) & BM_RTC_SR_TCE)
  778. #ifndef __LANGUAGE_ASM__
  779. //! @brief Set the TCE field to a new value.
  780. #define BW_RTC_SR_TCE(v) (BITBAND_ACCESS32(HW_RTC_SR_ADDR, BP_RTC_SR_TCE) = (v))
  781. #endif
  782. //@}
  783. //-------------------------------------------------------------------------------------------
  784. // HW_RTC_LR - RTC Lock Register
  785. //-------------------------------------------------------------------------------------------
  786. #ifndef __LANGUAGE_ASM__
  787. /*!
  788. * @brief HW_RTC_LR - RTC Lock Register (RW)
  789. *
  790. * Reset value: 0x000000FFU
  791. */
  792. typedef union _hw_rtc_lr
  793. {
  794. uint32_t U;
  795. struct _hw_rtc_lr_bitfields
  796. {
  797. uint32_t RESERVED0 : 3; //!< [2:0]
  798. uint32_t TCL : 1; //!< [3] Time Compensation Lock
  799. uint32_t CRL : 1; //!< [4] Control Register Lock
  800. uint32_t SRL : 1; //!< [5] Status Register Lock
  801. uint32_t LRL : 1; //!< [6] Lock Register Lock
  802. uint32_t RESERVED1 : 25; //!< [31:7]
  803. } B;
  804. } hw_rtc_lr_t;
  805. #endif
  806. /*!
  807. * @name Constants and macros for entire RTC_LR register
  808. */
  809. //@{
  810. #define HW_RTC_LR_ADDR (REGS_RTC_BASE + 0x18U)
  811. #ifndef __LANGUAGE_ASM__
  812. #define HW_RTC_LR (*(__IO hw_rtc_lr_t *) HW_RTC_LR_ADDR)
  813. #define HW_RTC_LR_RD() (HW_RTC_LR.U)
  814. #define HW_RTC_LR_WR(v) (HW_RTC_LR.U = (v))
  815. #define HW_RTC_LR_SET(v) (HW_RTC_LR_WR(HW_RTC_LR_RD() | (v)))
  816. #define HW_RTC_LR_CLR(v) (HW_RTC_LR_WR(HW_RTC_LR_RD() & ~(v)))
  817. #define HW_RTC_LR_TOG(v) (HW_RTC_LR_WR(HW_RTC_LR_RD() ^ (v)))
  818. #endif
  819. //@}
  820. /*
  821. * Constants & macros for individual RTC_LR bitfields
  822. */
  823. /*!
  824. * @name Register RTC_LR, field TCL[3] (RW)
  825. *
  826. * After being cleared, this bit can be set only by VBAT POR or software reset.
  827. *
  828. * Values:
  829. * - 0 - Time Compensation Register is locked and writes are ignored.
  830. * - 1 - Time Compensation Register is not locked and writes complete as normal.
  831. */
  832. //@{
  833. #define BP_RTC_LR_TCL (3U) //!< Bit position for RTC_LR_TCL.
  834. #define BM_RTC_LR_TCL (0x00000008U) //!< Bit mask for RTC_LR_TCL.
  835. #define BS_RTC_LR_TCL (1U) //!< Bit field size in bits for RTC_LR_TCL.
  836. #ifndef __LANGUAGE_ASM__
  837. //! @brief Read current value of the RTC_LR_TCL field.
  838. #define BR_RTC_LR_TCL (BITBAND_ACCESS32(HW_RTC_LR_ADDR, BP_RTC_LR_TCL))
  839. #endif
  840. //! @brief Format value for bitfield RTC_LR_TCL.
  841. #define BF_RTC_LR_TCL(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_LR_TCL), uint32_t) & BM_RTC_LR_TCL)
  842. #ifndef __LANGUAGE_ASM__
  843. //! @brief Set the TCL field to a new value.
  844. #define BW_RTC_LR_TCL(v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR, BP_RTC_LR_TCL) = (v))
  845. #endif
  846. //@}
  847. /*!
  848. * @name Register RTC_LR, field CRL[4] (RW)
  849. *
  850. * After being cleared, this bit can only be set by VBAT POR.
  851. *
  852. * Values:
  853. * - 0 - Control Register is locked and writes are ignored.
  854. * - 1 - Control Register is not locked and writes complete as normal.
  855. */
  856. //@{
  857. #define BP_RTC_LR_CRL (4U) //!< Bit position for RTC_LR_CRL.
  858. #define BM_RTC_LR_CRL (0x00000010U) //!< Bit mask for RTC_LR_CRL.
  859. #define BS_RTC_LR_CRL (1U) //!< Bit field size in bits for RTC_LR_CRL.
  860. #ifndef __LANGUAGE_ASM__
  861. //! @brief Read current value of the RTC_LR_CRL field.
  862. #define BR_RTC_LR_CRL (BITBAND_ACCESS32(HW_RTC_LR_ADDR, BP_RTC_LR_CRL))
  863. #endif
  864. //! @brief Format value for bitfield RTC_LR_CRL.
  865. #define BF_RTC_LR_CRL(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_LR_CRL), uint32_t) & BM_RTC_LR_CRL)
  866. #ifndef __LANGUAGE_ASM__
  867. //! @brief Set the CRL field to a new value.
  868. #define BW_RTC_LR_CRL(v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR, BP_RTC_LR_CRL) = (v))
  869. #endif
  870. //@}
  871. /*!
  872. * @name Register RTC_LR, field SRL[5] (RW)
  873. *
  874. * After being cleared, this bit can be set only by VBAT POR or software reset.
  875. *
  876. * Values:
  877. * - 0 - Status Register is locked and writes are ignored.
  878. * - 1 - Status Register is not locked and writes complete as normal.
  879. */
  880. //@{
  881. #define BP_RTC_LR_SRL (5U) //!< Bit position for RTC_LR_SRL.
  882. #define BM_RTC_LR_SRL (0x00000020U) //!< Bit mask for RTC_LR_SRL.
  883. #define BS_RTC_LR_SRL (1U) //!< Bit field size in bits for RTC_LR_SRL.
  884. #ifndef __LANGUAGE_ASM__
  885. //! @brief Read current value of the RTC_LR_SRL field.
  886. #define BR_RTC_LR_SRL (BITBAND_ACCESS32(HW_RTC_LR_ADDR, BP_RTC_LR_SRL))
  887. #endif
  888. //! @brief Format value for bitfield RTC_LR_SRL.
  889. #define BF_RTC_LR_SRL(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_LR_SRL), uint32_t) & BM_RTC_LR_SRL)
  890. #ifndef __LANGUAGE_ASM__
  891. //! @brief Set the SRL field to a new value.
  892. #define BW_RTC_LR_SRL(v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR, BP_RTC_LR_SRL) = (v))
  893. #endif
  894. //@}
  895. /*!
  896. * @name Register RTC_LR, field LRL[6] (RW)
  897. *
  898. * After being cleared, this bit can be set only by VBAT POR or software reset.
  899. *
  900. * Values:
  901. * - 0 - Lock Register is locked and writes are ignored.
  902. * - 1 - Lock Register is not locked and writes complete as normal.
  903. */
  904. //@{
  905. #define BP_RTC_LR_LRL (6U) //!< Bit position for RTC_LR_LRL.
  906. #define BM_RTC_LR_LRL (0x00000040U) //!< Bit mask for RTC_LR_LRL.
  907. #define BS_RTC_LR_LRL (1U) //!< Bit field size in bits for RTC_LR_LRL.
  908. #ifndef __LANGUAGE_ASM__
  909. //! @brief Read current value of the RTC_LR_LRL field.
  910. #define BR_RTC_LR_LRL (BITBAND_ACCESS32(HW_RTC_LR_ADDR, BP_RTC_LR_LRL))
  911. #endif
  912. //! @brief Format value for bitfield RTC_LR_LRL.
  913. #define BF_RTC_LR_LRL(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_LR_LRL), uint32_t) & BM_RTC_LR_LRL)
  914. #ifndef __LANGUAGE_ASM__
  915. //! @brief Set the LRL field to a new value.
  916. #define BW_RTC_LR_LRL(v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR, BP_RTC_LR_LRL) = (v))
  917. #endif
  918. //@}
  919. //-------------------------------------------------------------------------------------------
  920. // HW_RTC_IER - RTC Interrupt Enable Register
  921. //-------------------------------------------------------------------------------------------
  922. #ifndef __LANGUAGE_ASM__
  923. /*!
  924. * @brief HW_RTC_IER - RTC Interrupt Enable Register (RW)
  925. *
  926. * Reset value: 0x00000007U
  927. */
  928. typedef union _hw_rtc_ier
  929. {
  930. uint32_t U;
  931. struct _hw_rtc_ier_bitfields
  932. {
  933. uint32_t TIIE : 1; //!< [0] Time Invalid Interrupt Enable
  934. uint32_t TOIE : 1; //!< [1] Time Overflow Interrupt Enable
  935. uint32_t TAIE : 1; //!< [2] Time Alarm Interrupt Enable
  936. uint32_t RESERVED0 : 1; //!< [3]
  937. uint32_t TSIE : 1; //!< [4] Time Seconds Interrupt Enable
  938. uint32_t RESERVED1 : 2; //!< [6:5]
  939. uint32_t WPON : 1; //!< [7] Wakeup Pin On
  940. uint32_t RESERVED2 : 24; //!< [31:8]
  941. } B;
  942. } hw_rtc_ier_t;
  943. #endif
  944. /*!
  945. * @name Constants and macros for entire RTC_IER register
  946. */
  947. //@{
  948. #define HW_RTC_IER_ADDR (REGS_RTC_BASE + 0x1CU)
  949. #ifndef __LANGUAGE_ASM__
  950. #define HW_RTC_IER (*(__IO hw_rtc_ier_t *) HW_RTC_IER_ADDR)
  951. #define HW_RTC_IER_RD() (HW_RTC_IER.U)
  952. #define HW_RTC_IER_WR(v) (HW_RTC_IER.U = (v))
  953. #define HW_RTC_IER_SET(v) (HW_RTC_IER_WR(HW_RTC_IER_RD() | (v)))
  954. #define HW_RTC_IER_CLR(v) (HW_RTC_IER_WR(HW_RTC_IER_RD() & ~(v)))
  955. #define HW_RTC_IER_TOG(v) (HW_RTC_IER_WR(HW_RTC_IER_RD() ^ (v)))
  956. #endif
  957. //@}
  958. /*
  959. * Constants & macros for individual RTC_IER bitfields
  960. */
  961. /*!
  962. * @name Register RTC_IER, field TIIE[0] (RW)
  963. *
  964. * Values:
  965. * - 0 - Time invalid flag does not generate an interrupt.
  966. * - 1 - Time invalid flag does generate an interrupt.
  967. */
  968. //@{
  969. #define BP_RTC_IER_TIIE (0U) //!< Bit position for RTC_IER_TIIE.
  970. #define BM_RTC_IER_TIIE (0x00000001U) //!< Bit mask for RTC_IER_TIIE.
  971. #define BS_RTC_IER_TIIE (1U) //!< Bit field size in bits for RTC_IER_TIIE.
  972. #ifndef __LANGUAGE_ASM__
  973. //! @brief Read current value of the RTC_IER_TIIE field.
  974. #define BR_RTC_IER_TIIE (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_TIIE))
  975. #endif
  976. //! @brief Format value for bitfield RTC_IER_TIIE.
  977. #define BF_RTC_IER_TIIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_IER_TIIE), uint32_t) & BM_RTC_IER_TIIE)
  978. #ifndef __LANGUAGE_ASM__
  979. //! @brief Set the TIIE field to a new value.
  980. #define BW_RTC_IER_TIIE(v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_TIIE) = (v))
  981. #endif
  982. //@}
  983. /*!
  984. * @name Register RTC_IER, field TOIE[1] (RW)
  985. *
  986. * Values:
  987. * - 0 - Time overflow flag does not generate an interrupt.
  988. * - 1 - Time overflow flag does generate an interrupt.
  989. */
  990. //@{
  991. #define BP_RTC_IER_TOIE (1U) //!< Bit position for RTC_IER_TOIE.
  992. #define BM_RTC_IER_TOIE (0x00000002U) //!< Bit mask for RTC_IER_TOIE.
  993. #define BS_RTC_IER_TOIE (1U) //!< Bit field size in bits for RTC_IER_TOIE.
  994. #ifndef __LANGUAGE_ASM__
  995. //! @brief Read current value of the RTC_IER_TOIE field.
  996. #define BR_RTC_IER_TOIE (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_TOIE))
  997. #endif
  998. //! @brief Format value for bitfield RTC_IER_TOIE.
  999. #define BF_RTC_IER_TOIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_IER_TOIE), uint32_t) & BM_RTC_IER_TOIE)
  1000. #ifndef __LANGUAGE_ASM__
  1001. //! @brief Set the TOIE field to a new value.
  1002. #define BW_RTC_IER_TOIE(v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_TOIE) = (v))
  1003. #endif
  1004. //@}
  1005. /*!
  1006. * @name Register RTC_IER, field TAIE[2] (RW)
  1007. *
  1008. * Values:
  1009. * - 0 - Time alarm flag does not generate an interrupt.
  1010. * - 1 - Time alarm flag does generate an interrupt.
  1011. */
  1012. //@{
  1013. #define BP_RTC_IER_TAIE (2U) //!< Bit position for RTC_IER_TAIE.
  1014. #define BM_RTC_IER_TAIE (0x00000004U) //!< Bit mask for RTC_IER_TAIE.
  1015. #define BS_RTC_IER_TAIE (1U) //!< Bit field size in bits for RTC_IER_TAIE.
  1016. #ifndef __LANGUAGE_ASM__
  1017. //! @brief Read current value of the RTC_IER_TAIE field.
  1018. #define BR_RTC_IER_TAIE (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_TAIE))
  1019. #endif
  1020. //! @brief Format value for bitfield RTC_IER_TAIE.
  1021. #define BF_RTC_IER_TAIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_IER_TAIE), uint32_t) & BM_RTC_IER_TAIE)
  1022. #ifndef __LANGUAGE_ASM__
  1023. //! @brief Set the TAIE field to a new value.
  1024. #define BW_RTC_IER_TAIE(v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_TAIE) = (v))
  1025. #endif
  1026. //@}
  1027. /*!
  1028. * @name Register RTC_IER, field TSIE[4] (RW)
  1029. *
  1030. * The seconds interrupt is an edge-sensitive interrupt with a dedicated
  1031. * interrupt vector. It is generated once a second and requires no software overhead
  1032. * (there is no corresponding status flag to clear).
  1033. *
  1034. * Values:
  1035. * - 0 - Seconds interrupt is disabled.
  1036. * - 1 - Seconds interrupt is enabled.
  1037. */
  1038. //@{
  1039. #define BP_RTC_IER_TSIE (4U) //!< Bit position for RTC_IER_TSIE.
  1040. #define BM_RTC_IER_TSIE (0x00000010U) //!< Bit mask for RTC_IER_TSIE.
  1041. #define BS_RTC_IER_TSIE (1U) //!< Bit field size in bits for RTC_IER_TSIE.
  1042. #ifndef __LANGUAGE_ASM__
  1043. //! @brief Read current value of the RTC_IER_TSIE field.
  1044. #define BR_RTC_IER_TSIE (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_TSIE))
  1045. #endif
  1046. //! @brief Format value for bitfield RTC_IER_TSIE.
  1047. #define BF_RTC_IER_TSIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_IER_TSIE), uint32_t) & BM_RTC_IER_TSIE)
  1048. #ifndef __LANGUAGE_ASM__
  1049. //! @brief Set the TSIE field to a new value.
  1050. #define BW_RTC_IER_TSIE(v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_TSIE) = (v))
  1051. #endif
  1052. //@}
  1053. /*!
  1054. * @name Register RTC_IER, field WPON[7] (RW)
  1055. *
  1056. * The wakeup pin is optional and not available on all devices. Whenever the
  1057. * wakeup pin is enabled and this bit is set, the wakeup pin will assert.
  1058. *
  1059. * Values:
  1060. * - 0 - No effect.
  1061. * - 1 - If the wakeup pin is enabled, then the wakeup pin will assert.
  1062. */
  1063. //@{
  1064. #define BP_RTC_IER_WPON (7U) //!< Bit position for RTC_IER_WPON.
  1065. #define BM_RTC_IER_WPON (0x00000080U) //!< Bit mask for RTC_IER_WPON.
  1066. #define BS_RTC_IER_WPON (1U) //!< Bit field size in bits for RTC_IER_WPON.
  1067. #ifndef __LANGUAGE_ASM__
  1068. //! @brief Read current value of the RTC_IER_WPON field.
  1069. #define BR_RTC_IER_WPON (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_WPON))
  1070. #endif
  1071. //! @brief Format value for bitfield RTC_IER_WPON.
  1072. #define BF_RTC_IER_WPON(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_IER_WPON), uint32_t) & BM_RTC_IER_WPON)
  1073. #ifndef __LANGUAGE_ASM__
  1074. //! @brief Set the WPON field to a new value.
  1075. #define BW_RTC_IER_WPON(v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR, BP_RTC_IER_WPON) = (v))
  1076. #endif
  1077. //@}
  1078. //-------------------------------------------------------------------------------------------
  1079. // HW_RTC_WAR - RTC Write Access Register
  1080. //-------------------------------------------------------------------------------------------
  1081. #ifndef __LANGUAGE_ASM__
  1082. /*!
  1083. * @brief HW_RTC_WAR - RTC Write Access Register (RW)
  1084. *
  1085. * Reset value: 0x000000FFU
  1086. */
  1087. typedef union _hw_rtc_war
  1088. {
  1089. uint32_t U;
  1090. struct _hw_rtc_war_bitfields
  1091. {
  1092. uint32_t TSRW : 1; //!< [0] Time Seconds Register Write
  1093. uint32_t TPRW : 1; //!< [1] Time Prescaler Register Write
  1094. uint32_t TARW : 1; //!< [2] Time Alarm Register Write
  1095. uint32_t TCRW : 1; //!< [3] Time Compensation Register Write
  1096. uint32_t CRW : 1; //!< [4] Control Register Write
  1097. uint32_t SRW : 1; //!< [5] Status Register Write
  1098. uint32_t LRW : 1; //!< [6] Lock Register Write
  1099. uint32_t IERW : 1; //!< [7] Interrupt Enable Register Write
  1100. uint32_t RESERVED0 : 24; //!< [31:8]
  1101. } B;
  1102. } hw_rtc_war_t;
  1103. #endif
  1104. /*!
  1105. * @name Constants and macros for entire RTC_WAR register
  1106. */
  1107. //@{
  1108. #define HW_RTC_WAR_ADDR (REGS_RTC_BASE + 0x800U)
  1109. #ifndef __LANGUAGE_ASM__
  1110. #define HW_RTC_WAR (*(__IO hw_rtc_war_t *) HW_RTC_WAR_ADDR)
  1111. #define HW_RTC_WAR_RD() (HW_RTC_WAR.U)
  1112. #define HW_RTC_WAR_WR(v) (HW_RTC_WAR.U = (v))
  1113. #define HW_RTC_WAR_SET(v) (HW_RTC_WAR_WR(HW_RTC_WAR_RD() | (v)))
  1114. #define HW_RTC_WAR_CLR(v) (HW_RTC_WAR_WR(HW_RTC_WAR_RD() & ~(v)))
  1115. #define HW_RTC_WAR_TOG(v) (HW_RTC_WAR_WR(HW_RTC_WAR_RD() ^ (v)))
  1116. #endif
  1117. //@}
  1118. /*
  1119. * Constants & macros for individual RTC_WAR bitfields
  1120. */
  1121. /*!
  1122. * @name Register RTC_WAR, field TSRW[0] (RW)
  1123. *
  1124. * After being cleared, this bit is set only by system reset. It is not affected
  1125. * by VBAT POR or software reset.
  1126. *
  1127. * Values:
  1128. * - 0 - Writes to the Time Seconds Register are ignored.
  1129. * - 1 - Writes to the Time Seconds Register complete as normal.
  1130. */
  1131. //@{
  1132. #define BP_RTC_WAR_TSRW (0U) //!< Bit position for RTC_WAR_TSRW.
  1133. #define BM_RTC_WAR_TSRW (0x00000001U) //!< Bit mask for RTC_WAR_TSRW.
  1134. #define BS_RTC_WAR_TSRW (1U) //!< Bit field size in bits for RTC_WAR_TSRW.
  1135. #ifndef __LANGUAGE_ASM__
  1136. //! @brief Read current value of the RTC_WAR_TSRW field.
  1137. #define BR_RTC_WAR_TSRW (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_TSRW))
  1138. #endif
  1139. //! @brief Format value for bitfield RTC_WAR_TSRW.
  1140. #define BF_RTC_WAR_TSRW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_WAR_TSRW), uint32_t) & BM_RTC_WAR_TSRW)
  1141. #ifndef __LANGUAGE_ASM__
  1142. //! @brief Set the TSRW field to a new value.
  1143. #define BW_RTC_WAR_TSRW(v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_TSRW) = (v))
  1144. #endif
  1145. //@}
  1146. /*!
  1147. * @name Register RTC_WAR, field TPRW[1] (RW)
  1148. *
  1149. * After being cleared, this bit is set only by system reset. It is not affected
  1150. * by VBAT POR or software reset.
  1151. *
  1152. * Values:
  1153. * - 0 - Writes to the Time Prescaler Register are ignored.
  1154. * - 1 - Writes to the Time Prescaler Register complete as normal.
  1155. */
  1156. //@{
  1157. #define BP_RTC_WAR_TPRW (1U) //!< Bit position for RTC_WAR_TPRW.
  1158. #define BM_RTC_WAR_TPRW (0x00000002U) //!< Bit mask for RTC_WAR_TPRW.
  1159. #define BS_RTC_WAR_TPRW (1U) //!< Bit field size in bits for RTC_WAR_TPRW.
  1160. #ifndef __LANGUAGE_ASM__
  1161. //! @brief Read current value of the RTC_WAR_TPRW field.
  1162. #define BR_RTC_WAR_TPRW (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_TPRW))
  1163. #endif
  1164. //! @brief Format value for bitfield RTC_WAR_TPRW.
  1165. #define BF_RTC_WAR_TPRW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_WAR_TPRW), uint32_t) & BM_RTC_WAR_TPRW)
  1166. #ifndef __LANGUAGE_ASM__
  1167. //! @brief Set the TPRW field to a new value.
  1168. #define BW_RTC_WAR_TPRW(v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_TPRW) = (v))
  1169. #endif
  1170. //@}
  1171. /*!
  1172. * @name Register RTC_WAR, field TARW[2] (RW)
  1173. *
  1174. * After being cleared, this bit is set only by system reset. It is not affected
  1175. * by VBAT POR or software reset.
  1176. *
  1177. * Values:
  1178. * - 0 - Writes to the Time Alarm Register are ignored.
  1179. * - 1 - Writes to the Time Alarm Register complete as normal.
  1180. */
  1181. //@{
  1182. #define BP_RTC_WAR_TARW (2U) //!< Bit position for RTC_WAR_TARW.
  1183. #define BM_RTC_WAR_TARW (0x00000004U) //!< Bit mask for RTC_WAR_TARW.
  1184. #define BS_RTC_WAR_TARW (1U) //!< Bit field size in bits for RTC_WAR_TARW.
  1185. #ifndef __LANGUAGE_ASM__
  1186. //! @brief Read current value of the RTC_WAR_TARW field.
  1187. #define BR_RTC_WAR_TARW (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_TARW))
  1188. #endif
  1189. //! @brief Format value for bitfield RTC_WAR_TARW.
  1190. #define BF_RTC_WAR_TARW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_WAR_TARW), uint32_t) & BM_RTC_WAR_TARW)
  1191. #ifndef __LANGUAGE_ASM__
  1192. //! @brief Set the TARW field to a new value.
  1193. #define BW_RTC_WAR_TARW(v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_TARW) = (v))
  1194. #endif
  1195. //@}
  1196. /*!
  1197. * @name Register RTC_WAR, field TCRW[3] (RW)
  1198. *
  1199. * After being cleared, this bit is set only by system reset. It is not affected
  1200. * by VBAT POR or software reset.
  1201. *
  1202. * Values:
  1203. * - 0 - Writes to the Time Compensation Register are ignored.
  1204. * - 1 - Writes to the Time Compensation Register complete as normal.
  1205. */
  1206. //@{
  1207. #define BP_RTC_WAR_TCRW (3U) //!< Bit position for RTC_WAR_TCRW.
  1208. #define BM_RTC_WAR_TCRW (0x00000008U) //!< Bit mask for RTC_WAR_TCRW.
  1209. #define BS_RTC_WAR_TCRW (1U) //!< Bit field size in bits for RTC_WAR_TCRW.
  1210. #ifndef __LANGUAGE_ASM__
  1211. //! @brief Read current value of the RTC_WAR_TCRW field.
  1212. #define BR_RTC_WAR_TCRW (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_TCRW))
  1213. #endif
  1214. //! @brief Format value for bitfield RTC_WAR_TCRW.
  1215. #define BF_RTC_WAR_TCRW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_WAR_TCRW), uint32_t) & BM_RTC_WAR_TCRW)
  1216. #ifndef __LANGUAGE_ASM__
  1217. //! @brief Set the TCRW field to a new value.
  1218. #define BW_RTC_WAR_TCRW(v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_TCRW) = (v))
  1219. #endif
  1220. //@}
  1221. /*!
  1222. * @name Register RTC_WAR, field CRW[4] (RW)
  1223. *
  1224. * After being cleared, this bit is set only by system reset. It is not affected
  1225. * by VBAT POR or software reset.
  1226. *
  1227. * Values:
  1228. * - 0 - Writes to the Control Register are ignored.
  1229. * - 1 - Writes to the Control Register complete as normal.
  1230. */
  1231. //@{
  1232. #define BP_RTC_WAR_CRW (4U) //!< Bit position for RTC_WAR_CRW.
  1233. #define BM_RTC_WAR_CRW (0x00000010U) //!< Bit mask for RTC_WAR_CRW.
  1234. #define BS_RTC_WAR_CRW (1U) //!< Bit field size in bits for RTC_WAR_CRW.
  1235. #ifndef __LANGUAGE_ASM__
  1236. //! @brief Read current value of the RTC_WAR_CRW field.
  1237. #define BR_RTC_WAR_CRW (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_CRW))
  1238. #endif
  1239. //! @brief Format value for bitfield RTC_WAR_CRW.
  1240. #define BF_RTC_WAR_CRW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_WAR_CRW), uint32_t) & BM_RTC_WAR_CRW)
  1241. #ifndef __LANGUAGE_ASM__
  1242. //! @brief Set the CRW field to a new value.
  1243. #define BW_RTC_WAR_CRW(v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_CRW) = (v))
  1244. #endif
  1245. //@}
  1246. /*!
  1247. * @name Register RTC_WAR, field SRW[5] (RW)
  1248. *
  1249. * After being cleared, this bit is set only by system reset. It is not affected
  1250. * by VBAT POR or software reset.
  1251. *
  1252. * Values:
  1253. * - 0 - Writes to the Status Register are ignored.
  1254. * - 1 - Writes to the Status Register complete as normal.
  1255. */
  1256. //@{
  1257. #define BP_RTC_WAR_SRW (5U) //!< Bit position for RTC_WAR_SRW.
  1258. #define BM_RTC_WAR_SRW (0x00000020U) //!< Bit mask for RTC_WAR_SRW.
  1259. #define BS_RTC_WAR_SRW (1U) //!< Bit field size in bits for RTC_WAR_SRW.
  1260. #ifndef __LANGUAGE_ASM__
  1261. //! @brief Read current value of the RTC_WAR_SRW field.
  1262. #define BR_RTC_WAR_SRW (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_SRW))
  1263. #endif
  1264. //! @brief Format value for bitfield RTC_WAR_SRW.
  1265. #define BF_RTC_WAR_SRW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_WAR_SRW), uint32_t) & BM_RTC_WAR_SRW)
  1266. #ifndef __LANGUAGE_ASM__
  1267. //! @brief Set the SRW field to a new value.
  1268. #define BW_RTC_WAR_SRW(v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_SRW) = (v))
  1269. #endif
  1270. //@}
  1271. /*!
  1272. * @name Register RTC_WAR, field LRW[6] (RW)
  1273. *
  1274. * After being cleared, this bit is set only by system reset. It is not affected
  1275. * by VBAT POR or software reset.
  1276. *
  1277. * Values:
  1278. * - 0 - Writes to the Lock Register are ignored.
  1279. * - 1 - Writes to the Lock Register complete as normal.
  1280. */
  1281. //@{
  1282. #define BP_RTC_WAR_LRW (6U) //!< Bit position for RTC_WAR_LRW.
  1283. #define BM_RTC_WAR_LRW (0x00000040U) //!< Bit mask for RTC_WAR_LRW.
  1284. #define BS_RTC_WAR_LRW (1U) //!< Bit field size in bits for RTC_WAR_LRW.
  1285. #ifndef __LANGUAGE_ASM__
  1286. //! @brief Read current value of the RTC_WAR_LRW field.
  1287. #define BR_RTC_WAR_LRW (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_LRW))
  1288. #endif
  1289. //! @brief Format value for bitfield RTC_WAR_LRW.
  1290. #define BF_RTC_WAR_LRW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_WAR_LRW), uint32_t) & BM_RTC_WAR_LRW)
  1291. #ifndef __LANGUAGE_ASM__
  1292. //! @brief Set the LRW field to a new value.
  1293. #define BW_RTC_WAR_LRW(v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_LRW) = (v))
  1294. #endif
  1295. //@}
  1296. /*!
  1297. * @name Register RTC_WAR, field IERW[7] (RW)
  1298. *
  1299. * After being cleared, this bit is set only by system reset. It is not affected
  1300. * by VBAT POR or software reset.
  1301. *
  1302. * Values:
  1303. * - 0 - Writes to the Interupt Enable Register are ignored.
  1304. * - 1 - Writes to the Interrupt Enable Register complete as normal.
  1305. */
  1306. //@{
  1307. #define BP_RTC_WAR_IERW (7U) //!< Bit position for RTC_WAR_IERW.
  1308. #define BM_RTC_WAR_IERW (0x00000080U) //!< Bit mask for RTC_WAR_IERW.
  1309. #define BS_RTC_WAR_IERW (1U) //!< Bit field size in bits for RTC_WAR_IERW.
  1310. #ifndef __LANGUAGE_ASM__
  1311. //! @brief Read current value of the RTC_WAR_IERW field.
  1312. #define BR_RTC_WAR_IERW (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_IERW))
  1313. #endif
  1314. //! @brief Format value for bitfield RTC_WAR_IERW.
  1315. #define BF_RTC_WAR_IERW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_WAR_IERW), uint32_t) & BM_RTC_WAR_IERW)
  1316. #ifndef __LANGUAGE_ASM__
  1317. //! @brief Set the IERW field to a new value.
  1318. #define BW_RTC_WAR_IERW(v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR, BP_RTC_WAR_IERW) = (v))
  1319. #endif
  1320. //@}
  1321. //-------------------------------------------------------------------------------------------
  1322. // HW_RTC_RAR - RTC Read Access Register
  1323. //-------------------------------------------------------------------------------------------
  1324. #ifndef __LANGUAGE_ASM__
  1325. /*!
  1326. * @brief HW_RTC_RAR - RTC Read Access Register (RW)
  1327. *
  1328. * Reset value: 0x000000FFU
  1329. */
  1330. typedef union _hw_rtc_rar
  1331. {
  1332. uint32_t U;
  1333. struct _hw_rtc_rar_bitfields
  1334. {
  1335. uint32_t TSRR : 1; //!< [0] Time Seconds Register Read
  1336. uint32_t TPRR : 1; //!< [1] Time Prescaler Register Read
  1337. uint32_t TARR : 1; //!< [2] Time Alarm Register Read
  1338. uint32_t TCRR : 1; //!< [3] Time Compensation Register Read
  1339. uint32_t CRR : 1; //!< [4] Control Register Read
  1340. uint32_t SRR : 1; //!< [5] Status Register Read
  1341. uint32_t LRR : 1; //!< [6] Lock Register Read
  1342. uint32_t IERR : 1; //!< [7] Interrupt Enable Register Read
  1343. uint32_t RESERVED0 : 24; //!< [31:8]
  1344. } B;
  1345. } hw_rtc_rar_t;
  1346. #endif
  1347. /*!
  1348. * @name Constants and macros for entire RTC_RAR register
  1349. */
  1350. //@{
  1351. #define HW_RTC_RAR_ADDR (REGS_RTC_BASE + 0x804U)
  1352. #ifndef __LANGUAGE_ASM__
  1353. #define HW_RTC_RAR (*(__IO hw_rtc_rar_t *) HW_RTC_RAR_ADDR)
  1354. #define HW_RTC_RAR_RD() (HW_RTC_RAR.U)
  1355. #define HW_RTC_RAR_WR(v) (HW_RTC_RAR.U = (v))
  1356. #define HW_RTC_RAR_SET(v) (HW_RTC_RAR_WR(HW_RTC_RAR_RD() | (v)))
  1357. #define HW_RTC_RAR_CLR(v) (HW_RTC_RAR_WR(HW_RTC_RAR_RD() & ~(v)))
  1358. #define HW_RTC_RAR_TOG(v) (HW_RTC_RAR_WR(HW_RTC_RAR_RD() ^ (v)))
  1359. #endif
  1360. //@}
  1361. /*
  1362. * Constants & macros for individual RTC_RAR bitfields
  1363. */
  1364. /*!
  1365. * @name Register RTC_RAR, field TSRR[0] (RW)
  1366. *
  1367. * After being cleared, this bit is set only by system reset. It is not affected
  1368. * by VBAT POR or software reset.
  1369. *
  1370. * Values:
  1371. * - 0 - Reads to the Time Seconds Register are ignored.
  1372. * - 1 - Reads to the Time Seconds Register complete as normal.
  1373. */
  1374. //@{
  1375. #define BP_RTC_RAR_TSRR (0U) //!< Bit position for RTC_RAR_TSRR.
  1376. #define BM_RTC_RAR_TSRR (0x00000001U) //!< Bit mask for RTC_RAR_TSRR.
  1377. #define BS_RTC_RAR_TSRR (1U) //!< Bit field size in bits for RTC_RAR_TSRR.
  1378. #ifndef __LANGUAGE_ASM__
  1379. //! @brief Read current value of the RTC_RAR_TSRR field.
  1380. #define BR_RTC_RAR_TSRR (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_TSRR))
  1381. #endif
  1382. //! @brief Format value for bitfield RTC_RAR_TSRR.
  1383. #define BF_RTC_RAR_TSRR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_RAR_TSRR), uint32_t) & BM_RTC_RAR_TSRR)
  1384. #ifndef __LANGUAGE_ASM__
  1385. //! @brief Set the TSRR field to a new value.
  1386. #define BW_RTC_RAR_TSRR(v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_TSRR) = (v))
  1387. #endif
  1388. //@}
  1389. /*!
  1390. * @name Register RTC_RAR, field TPRR[1] (RW)
  1391. *
  1392. * After being cleared, this bit is set only by system reset. It is not affected
  1393. * by VBAT POR or software reset.
  1394. *
  1395. * Values:
  1396. * - 0 - Reads to the Time Pprescaler Register are ignored.
  1397. * - 1 - Reads to the Time Prescaler Register complete as normal.
  1398. */
  1399. //@{
  1400. #define BP_RTC_RAR_TPRR (1U) //!< Bit position for RTC_RAR_TPRR.
  1401. #define BM_RTC_RAR_TPRR (0x00000002U) //!< Bit mask for RTC_RAR_TPRR.
  1402. #define BS_RTC_RAR_TPRR (1U) //!< Bit field size in bits for RTC_RAR_TPRR.
  1403. #ifndef __LANGUAGE_ASM__
  1404. //! @brief Read current value of the RTC_RAR_TPRR field.
  1405. #define BR_RTC_RAR_TPRR (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_TPRR))
  1406. #endif
  1407. //! @brief Format value for bitfield RTC_RAR_TPRR.
  1408. #define BF_RTC_RAR_TPRR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_RAR_TPRR), uint32_t) & BM_RTC_RAR_TPRR)
  1409. #ifndef __LANGUAGE_ASM__
  1410. //! @brief Set the TPRR field to a new value.
  1411. #define BW_RTC_RAR_TPRR(v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_TPRR) = (v))
  1412. #endif
  1413. //@}
  1414. /*!
  1415. * @name Register RTC_RAR, field TARR[2] (RW)
  1416. *
  1417. * After being cleared, this bit is set only by system reset. It is not affected
  1418. * by VBAT POR or software reset.
  1419. *
  1420. * Values:
  1421. * - 0 - Reads to the Time Alarm Register are ignored.
  1422. * - 1 - Reads to the Time Alarm Register complete as normal.
  1423. */
  1424. //@{
  1425. #define BP_RTC_RAR_TARR (2U) //!< Bit position for RTC_RAR_TARR.
  1426. #define BM_RTC_RAR_TARR (0x00000004U) //!< Bit mask for RTC_RAR_TARR.
  1427. #define BS_RTC_RAR_TARR (1U) //!< Bit field size in bits for RTC_RAR_TARR.
  1428. #ifndef __LANGUAGE_ASM__
  1429. //! @brief Read current value of the RTC_RAR_TARR field.
  1430. #define BR_RTC_RAR_TARR (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_TARR))
  1431. #endif
  1432. //! @brief Format value for bitfield RTC_RAR_TARR.
  1433. #define BF_RTC_RAR_TARR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_RAR_TARR), uint32_t) & BM_RTC_RAR_TARR)
  1434. #ifndef __LANGUAGE_ASM__
  1435. //! @brief Set the TARR field to a new value.
  1436. #define BW_RTC_RAR_TARR(v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_TARR) = (v))
  1437. #endif
  1438. //@}
  1439. /*!
  1440. * @name Register RTC_RAR, field TCRR[3] (RW)
  1441. *
  1442. * After being cleared, this bit is set only by system reset. It is not affected
  1443. * by VBAT POR or software reset.
  1444. *
  1445. * Values:
  1446. * - 0 - Reads to the Time Compensation Register are ignored.
  1447. * - 1 - Reads to the Time Compensation Register complete as normal.
  1448. */
  1449. //@{
  1450. #define BP_RTC_RAR_TCRR (3U) //!< Bit position for RTC_RAR_TCRR.
  1451. #define BM_RTC_RAR_TCRR (0x00000008U) //!< Bit mask for RTC_RAR_TCRR.
  1452. #define BS_RTC_RAR_TCRR (1U) //!< Bit field size in bits for RTC_RAR_TCRR.
  1453. #ifndef __LANGUAGE_ASM__
  1454. //! @brief Read current value of the RTC_RAR_TCRR field.
  1455. #define BR_RTC_RAR_TCRR (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_TCRR))
  1456. #endif
  1457. //! @brief Format value for bitfield RTC_RAR_TCRR.
  1458. #define BF_RTC_RAR_TCRR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_RAR_TCRR), uint32_t) & BM_RTC_RAR_TCRR)
  1459. #ifndef __LANGUAGE_ASM__
  1460. //! @brief Set the TCRR field to a new value.
  1461. #define BW_RTC_RAR_TCRR(v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_TCRR) = (v))
  1462. #endif
  1463. //@}
  1464. /*!
  1465. * @name Register RTC_RAR, field CRR[4] (RW)
  1466. *
  1467. * After being cleared, this bit is set only by system reset. It is not affected
  1468. * by VBAT POR or software reset.
  1469. *
  1470. * Values:
  1471. * - 0 - Reads to the Control Register are ignored.
  1472. * - 1 - Reads to the Control Register complete as normal.
  1473. */
  1474. //@{
  1475. #define BP_RTC_RAR_CRR (4U) //!< Bit position for RTC_RAR_CRR.
  1476. #define BM_RTC_RAR_CRR (0x00000010U) //!< Bit mask for RTC_RAR_CRR.
  1477. #define BS_RTC_RAR_CRR (1U) //!< Bit field size in bits for RTC_RAR_CRR.
  1478. #ifndef __LANGUAGE_ASM__
  1479. //! @brief Read current value of the RTC_RAR_CRR field.
  1480. #define BR_RTC_RAR_CRR (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_CRR))
  1481. #endif
  1482. //! @brief Format value for bitfield RTC_RAR_CRR.
  1483. #define BF_RTC_RAR_CRR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_RAR_CRR), uint32_t) & BM_RTC_RAR_CRR)
  1484. #ifndef __LANGUAGE_ASM__
  1485. //! @brief Set the CRR field to a new value.
  1486. #define BW_RTC_RAR_CRR(v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_CRR) = (v))
  1487. #endif
  1488. //@}
  1489. /*!
  1490. * @name Register RTC_RAR, field SRR[5] (RW)
  1491. *
  1492. * After being cleared, this bit is set only by system reset. It is not affected
  1493. * by VBAT POR or software reset.
  1494. *
  1495. * Values:
  1496. * - 0 - Reads to the Status Register are ignored.
  1497. * - 1 - Reads to the Status Register complete as normal.
  1498. */
  1499. //@{
  1500. #define BP_RTC_RAR_SRR (5U) //!< Bit position for RTC_RAR_SRR.
  1501. #define BM_RTC_RAR_SRR (0x00000020U) //!< Bit mask for RTC_RAR_SRR.
  1502. #define BS_RTC_RAR_SRR (1U) //!< Bit field size in bits for RTC_RAR_SRR.
  1503. #ifndef __LANGUAGE_ASM__
  1504. //! @brief Read current value of the RTC_RAR_SRR field.
  1505. #define BR_RTC_RAR_SRR (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_SRR))
  1506. #endif
  1507. //! @brief Format value for bitfield RTC_RAR_SRR.
  1508. #define BF_RTC_RAR_SRR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_RAR_SRR), uint32_t) & BM_RTC_RAR_SRR)
  1509. #ifndef __LANGUAGE_ASM__
  1510. //! @brief Set the SRR field to a new value.
  1511. #define BW_RTC_RAR_SRR(v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_SRR) = (v))
  1512. #endif
  1513. //@}
  1514. /*!
  1515. * @name Register RTC_RAR, field LRR[6] (RW)
  1516. *
  1517. * After being cleared, this bit is set only by system reset. It is not affected
  1518. * by VBAT POR or software reset.
  1519. *
  1520. * Values:
  1521. * - 0 - Reads to the Lock Register are ignored.
  1522. * - 1 - Reads to the Lock Register complete as normal.
  1523. */
  1524. //@{
  1525. #define BP_RTC_RAR_LRR (6U) //!< Bit position for RTC_RAR_LRR.
  1526. #define BM_RTC_RAR_LRR (0x00000040U) //!< Bit mask for RTC_RAR_LRR.
  1527. #define BS_RTC_RAR_LRR (1U) //!< Bit field size in bits for RTC_RAR_LRR.
  1528. #ifndef __LANGUAGE_ASM__
  1529. //! @brief Read current value of the RTC_RAR_LRR field.
  1530. #define BR_RTC_RAR_LRR (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_LRR))
  1531. #endif
  1532. //! @brief Format value for bitfield RTC_RAR_LRR.
  1533. #define BF_RTC_RAR_LRR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_RAR_LRR), uint32_t) & BM_RTC_RAR_LRR)
  1534. #ifndef __LANGUAGE_ASM__
  1535. //! @brief Set the LRR field to a new value.
  1536. #define BW_RTC_RAR_LRR(v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_LRR) = (v))
  1537. #endif
  1538. //@}
  1539. /*!
  1540. * @name Register RTC_RAR, field IERR[7] (RW)
  1541. *
  1542. * After being cleared, this bit is set only by system reset. It is not affected
  1543. * by VBAT POR or software reset.
  1544. *
  1545. * Values:
  1546. * - 0 - Reads to the Interrupt Enable Register are ignored.
  1547. * - 1 - Reads to the Interrupt Enable Register complete as normal.
  1548. */
  1549. //@{
  1550. #define BP_RTC_RAR_IERR (7U) //!< Bit position for RTC_RAR_IERR.
  1551. #define BM_RTC_RAR_IERR (0x00000080U) //!< Bit mask for RTC_RAR_IERR.
  1552. #define BS_RTC_RAR_IERR (1U) //!< Bit field size in bits for RTC_RAR_IERR.
  1553. #ifndef __LANGUAGE_ASM__
  1554. //! @brief Read current value of the RTC_RAR_IERR field.
  1555. #define BR_RTC_RAR_IERR (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_IERR))
  1556. #endif
  1557. //! @brief Format value for bitfield RTC_RAR_IERR.
  1558. #define BF_RTC_RAR_IERR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_RTC_RAR_IERR), uint32_t) & BM_RTC_RAR_IERR)
  1559. #ifndef __LANGUAGE_ASM__
  1560. //! @brief Set the IERR field to a new value.
  1561. #define BW_RTC_RAR_IERR(v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR, BP_RTC_RAR_IERR) = (v))
  1562. #endif
  1563. //@}
  1564. //-------------------------------------------------------------------------------------------
  1565. // hw_rtc_t - module struct
  1566. //-------------------------------------------------------------------------------------------
  1567. /*!
  1568. * @brief All RTC module registers.
  1569. */
  1570. #ifndef __LANGUAGE_ASM__
  1571. #pragma pack(1)
  1572. typedef struct _hw_rtc
  1573. {
  1574. __IO hw_rtc_tsr_t TSR; //!< [0x0] RTC Time Seconds Register
  1575. __IO hw_rtc_tpr_t TPR; //!< [0x4] RTC Time Prescaler Register
  1576. __IO hw_rtc_tar_t TAR; //!< [0x8] RTC Time Alarm Register
  1577. __IO hw_rtc_tcr_t TCR; //!< [0xC] RTC Time Compensation Register
  1578. __IO hw_rtc_cr_t CR; //!< [0x10] RTC Control Register
  1579. __IO hw_rtc_sr_t SR; //!< [0x14] RTC Status Register
  1580. __IO hw_rtc_lr_t LR; //!< [0x18] RTC Lock Register
  1581. __IO hw_rtc_ier_t IER; //!< [0x1C] RTC Interrupt Enable Register
  1582. uint8_t _reserved0[2016];
  1583. __IO hw_rtc_war_t WAR; //!< [0x800] RTC Write Access Register
  1584. __IO hw_rtc_rar_t RAR; //!< [0x804] RTC Read Access Register
  1585. } hw_rtc_t;
  1586. #pragma pack()
  1587. //! @brief Macro to access all RTC registers.
  1588. //! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
  1589. //! use the '&' operator, like <code>&HW_RTC</code>.
  1590. #define HW_RTC (*(hw_rtc_t *) REGS_RTC_BASE)
  1591. #endif
  1592. #endif // __HW_RTC_REGISTERS_H__
  1593. // v22/130726/0.9
  1594. // EOF