rtc.h 79 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054
  1. /**
  2. * \file
  3. *
  4. * \brief Component description for RTC
  5. *
  6. * Copyright (c) 2018 Microchip Technology Inc.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the Licence at
  17. *
  18. * http://www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  22. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. * \asf_license_stop
  27. *
  28. */
  29. #ifndef _SAMD11_RTC_COMPONENT_
  30. #define _SAMD11_RTC_COMPONENT_
  31. /* ========================================================================== */
  32. /** SOFTWARE API DEFINITION FOR RTC */
  33. /* ========================================================================== */
  34. /** \addtogroup SAMD11_RTC Real-Time Counter */
  35. /*@{*/
  36. #define RTC_U2202
  37. #define REV_RTC 0x101
  38. /* -------- RTC_MODE0_CTRL : (RTC Offset: 0x00) (R/W 16) MODE0 MODE0 Control -------- */
  39. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  40. typedef union {
  41. struct {
  42. uint16_t SWRST:1; /*!< bit: 0 Software Reset */
  43. uint16_t ENABLE:1; /*!< bit: 1 Enable */
  44. uint16_t MODE:2; /*!< bit: 2.. 3 Operating Mode */
  45. uint16_t :3; /*!< bit: 4.. 6 Reserved */
  46. uint16_t MATCHCLR:1; /*!< bit: 7 Clear on Match */
  47. uint16_t PRESCALER:4; /*!< bit: 8..11 Prescaler */
  48. uint16_t :4; /*!< bit: 12..15 Reserved */
  49. } bit; /*!< Structure used for bit access */
  50. uint16_t reg; /*!< Type used for register access */
  51. } RTC_MODE0_CTRL_Type;
  52. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  53. #define RTC_MODE0_CTRL_OFFSET 0x00 /**< \brief (RTC_MODE0_CTRL offset) MODE0 Control */
  54. #define RTC_MODE0_CTRL_RESETVALUE _U_(0x0000) /**< \brief (RTC_MODE0_CTRL reset_value) MODE0 Control */
  55. #define RTC_MODE0_CTRL_SWRST_Pos 0 /**< \brief (RTC_MODE0_CTRL) Software Reset */
  56. #define RTC_MODE0_CTRL_SWRST (_U_(0x1) << RTC_MODE0_CTRL_SWRST_Pos)
  57. #define RTC_MODE0_CTRL_ENABLE_Pos 1 /**< \brief (RTC_MODE0_CTRL) Enable */
  58. #define RTC_MODE0_CTRL_ENABLE (_U_(0x1) << RTC_MODE0_CTRL_ENABLE_Pos)
  59. #define RTC_MODE0_CTRL_MODE_Pos 2 /**< \brief (RTC_MODE0_CTRL) Operating Mode */
  60. #define RTC_MODE0_CTRL_MODE_Msk (_U_(0x3) << RTC_MODE0_CTRL_MODE_Pos)
  61. #define RTC_MODE0_CTRL_MODE(value) (RTC_MODE0_CTRL_MODE_Msk & ((value) << RTC_MODE0_CTRL_MODE_Pos))
  62. #define RTC_MODE0_CTRL_MODE_COUNT32_Val _U_(0x0) /**< \brief (RTC_MODE0_CTRL) Mode 0: 32-bit Counter */
  63. #define RTC_MODE0_CTRL_MODE_COUNT16_Val _U_(0x1) /**< \brief (RTC_MODE0_CTRL) Mode 1: 16-bit Counter */
  64. #define RTC_MODE0_CTRL_MODE_CLOCK_Val _U_(0x2) /**< \brief (RTC_MODE0_CTRL) Mode 2: Clock/Calendar */
  65. #define RTC_MODE0_CTRL_MODE_COUNT32 (RTC_MODE0_CTRL_MODE_COUNT32_Val << RTC_MODE0_CTRL_MODE_Pos)
  66. #define RTC_MODE0_CTRL_MODE_COUNT16 (RTC_MODE0_CTRL_MODE_COUNT16_Val << RTC_MODE0_CTRL_MODE_Pos)
  67. #define RTC_MODE0_CTRL_MODE_CLOCK (RTC_MODE0_CTRL_MODE_CLOCK_Val << RTC_MODE0_CTRL_MODE_Pos)
  68. #define RTC_MODE0_CTRL_MATCHCLR_Pos 7 /**< \brief (RTC_MODE0_CTRL) Clear on Match */
  69. #define RTC_MODE0_CTRL_MATCHCLR (_U_(0x1) << RTC_MODE0_CTRL_MATCHCLR_Pos)
  70. #define RTC_MODE0_CTRL_PRESCALER_Pos 8 /**< \brief (RTC_MODE0_CTRL) Prescaler */
  71. #define RTC_MODE0_CTRL_PRESCALER_Msk (_U_(0xF) << RTC_MODE0_CTRL_PRESCALER_Pos)
  72. #define RTC_MODE0_CTRL_PRESCALER(value) (RTC_MODE0_CTRL_PRESCALER_Msk & ((value) << RTC_MODE0_CTRL_PRESCALER_Pos))
  73. #define RTC_MODE0_CTRL_PRESCALER_DIV1_Val _U_(0x0) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/1 */
  74. #define RTC_MODE0_CTRL_PRESCALER_DIV2_Val _U_(0x1) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/2 */
  75. #define RTC_MODE0_CTRL_PRESCALER_DIV4_Val _U_(0x2) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/4 */
  76. #define RTC_MODE0_CTRL_PRESCALER_DIV8_Val _U_(0x3) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/8 */
  77. #define RTC_MODE0_CTRL_PRESCALER_DIV16_Val _U_(0x4) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/16 */
  78. #define RTC_MODE0_CTRL_PRESCALER_DIV32_Val _U_(0x5) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/32 */
  79. #define RTC_MODE0_CTRL_PRESCALER_DIV64_Val _U_(0x6) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/64 */
  80. #define RTC_MODE0_CTRL_PRESCALER_DIV128_Val _U_(0x7) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/128 */
  81. #define RTC_MODE0_CTRL_PRESCALER_DIV256_Val _U_(0x8) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/256 */
  82. #define RTC_MODE0_CTRL_PRESCALER_DIV512_Val _U_(0x9) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/512 */
  83. #define RTC_MODE0_CTRL_PRESCALER_DIV1024_Val _U_(0xA) /**< \brief (RTC_MODE0_CTRL) CLK_RTC_CNT = GCLK_RTC/1024 */
  84. #define RTC_MODE0_CTRL_PRESCALER_DIV1 (RTC_MODE0_CTRL_PRESCALER_DIV1_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  85. #define RTC_MODE0_CTRL_PRESCALER_DIV2 (RTC_MODE0_CTRL_PRESCALER_DIV2_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  86. #define RTC_MODE0_CTRL_PRESCALER_DIV4 (RTC_MODE0_CTRL_PRESCALER_DIV4_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  87. #define RTC_MODE0_CTRL_PRESCALER_DIV8 (RTC_MODE0_CTRL_PRESCALER_DIV8_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  88. #define RTC_MODE0_CTRL_PRESCALER_DIV16 (RTC_MODE0_CTRL_PRESCALER_DIV16_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  89. #define RTC_MODE0_CTRL_PRESCALER_DIV32 (RTC_MODE0_CTRL_PRESCALER_DIV32_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  90. #define RTC_MODE0_CTRL_PRESCALER_DIV64 (RTC_MODE0_CTRL_PRESCALER_DIV64_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  91. #define RTC_MODE0_CTRL_PRESCALER_DIV128 (RTC_MODE0_CTRL_PRESCALER_DIV128_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  92. #define RTC_MODE0_CTRL_PRESCALER_DIV256 (RTC_MODE0_CTRL_PRESCALER_DIV256_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  93. #define RTC_MODE0_CTRL_PRESCALER_DIV512 (RTC_MODE0_CTRL_PRESCALER_DIV512_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  94. #define RTC_MODE0_CTRL_PRESCALER_DIV1024 (RTC_MODE0_CTRL_PRESCALER_DIV1024_Val << RTC_MODE0_CTRL_PRESCALER_Pos)
  95. #define RTC_MODE0_CTRL_MASK _U_(0x0F8F) /**< \brief (RTC_MODE0_CTRL) MASK Register */
  96. /* -------- RTC_MODE1_CTRL : (RTC Offset: 0x00) (R/W 16) MODE1 MODE1 Control -------- */
  97. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  98. typedef union {
  99. struct {
  100. uint16_t SWRST:1; /*!< bit: 0 Software Reset */
  101. uint16_t ENABLE:1; /*!< bit: 1 Enable */
  102. uint16_t MODE:2; /*!< bit: 2.. 3 Operating Mode */
  103. uint16_t :4; /*!< bit: 4.. 7 Reserved */
  104. uint16_t PRESCALER:4; /*!< bit: 8..11 Prescaler */
  105. uint16_t :4; /*!< bit: 12..15 Reserved */
  106. } bit; /*!< Structure used for bit access */
  107. uint16_t reg; /*!< Type used for register access */
  108. } RTC_MODE1_CTRL_Type;
  109. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  110. #define RTC_MODE1_CTRL_OFFSET 0x00 /**< \brief (RTC_MODE1_CTRL offset) MODE1 Control */
  111. #define RTC_MODE1_CTRL_RESETVALUE _U_(0x0000) /**< \brief (RTC_MODE1_CTRL reset_value) MODE1 Control */
  112. #define RTC_MODE1_CTRL_SWRST_Pos 0 /**< \brief (RTC_MODE1_CTRL) Software Reset */
  113. #define RTC_MODE1_CTRL_SWRST (_U_(0x1) << RTC_MODE1_CTRL_SWRST_Pos)
  114. #define RTC_MODE1_CTRL_ENABLE_Pos 1 /**< \brief (RTC_MODE1_CTRL) Enable */
  115. #define RTC_MODE1_CTRL_ENABLE (_U_(0x1) << RTC_MODE1_CTRL_ENABLE_Pos)
  116. #define RTC_MODE1_CTRL_MODE_Pos 2 /**< \brief (RTC_MODE1_CTRL) Operating Mode */
  117. #define RTC_MODE1_CTRL_MODE_Msk (_U_(0x3) << RTC_MODE1_CTRL_MODE_Pos)
  118. #define RTC_MODE1_CTRL_MODE(value) (RTC_MODE1_CTRL_MODE_Msk & ((value) << RTC_MODE1_CTRL_MODE_Pos))
  119. #define RTC_MODE1_CTRL_MODE_COUNT32_Val _U_(0x0) /**< \brief (RTC_MODE1_CTRL) Mode 0: 32-bit Counter */
  120. #define RTC_MODE1_CTRL_MODE_COUNT16_Val _U_(0x1) /**< \brief (RTC_MODE1_CTRL) Mode 1: 16-bit Counter */
  121. #define RTC_MODE1_CTRL_MODE_CLOCK_Val _U_(0x2) /**< \brief (RTC_MODE1_CTRL) Mode 2: Clock/Calendar */
  122. #define RTC_MODE1_CTRL_MODE_COUNT32 (RTC_MODE1_CTRL_MODE_COUNT32_Val << RTC_MODE1_CTRL_MODE_Pos)
  123. #define RTC_MODE1_CTRL_MODE_COUNT16 (RTC_MODE1_CTRL_MODE_COUNT16_Val << RTC_MODE1_CTRL_MODE_Pos)
  124. #define RTC_MODE1_CTRL_MODE_CLOCK (RTC_MODE1_CTRL_MODE_CLOCK_Val << RTC_MODE1_CTRL_MODE_Pos)
  125. #define RTC_MODE1_CTRL_PRESCALER_Pos 8 /**< \brief (RTC_MODE1_CTRL) Prescaler */
  126. #define RTC_MODE1_CTRL_PRESCALER_Msk (_U_(0xF) << RTC_MODE1_CTRL_PRESCALER_Pos)
  127. #define RTC_MODE1_CTRL_PRESCALER(value) (RTC_MODE1_CTRL_PRESCALER_Msk & ((value) << RTC_MODE1_CTRL_PRESCALER_Pos))
  128. #define RTC_MODE1_CTRL_PRESCALER_DIV1_Val _U_(0x0) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/1 */
  129. #define RTC_MODE1_CTRL_PRESCALER_DIV2_Val _U_(0x1) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/2 */
  130. #define RTC_MODE1_CTRL_PRESCALER_DIV4_Val _U_(0x2) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/4 */
  131. #define RTC_MODE1_CTRL_PRESCALER_DIV8_Val _U_(0x3) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/8 */
  132. #define RTC_MODE1_CTRL_PRESCALER_DIV16_Val _U_(0x4) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/16 */
  133. #define RTC_MODE1_CTRL_PRESCALER_DIV32_Val _U_(0x5) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/32 */
  134. #define RTC_MODE1_CTRL_PRESCALER_DIV64_Val _U_(0x6) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/64 */
  135. #define RTC_MODE1_CTRL_PRESCALER_DIV128_Val _U_(0x7) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/128 */
  136. #define RTC_MODE1_CTRL_PRESCALER_DIV256_Val _U_(0x8) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/256 */
  137. #define RTC_MODE1_CTRL_PRESCALER_DIV512_Val _U_(0x9) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/512 */
  138. #define RTC_MODE1_CTRL_PRESCALER_DIV1024_Val _U_(0xA) /**< \brief (RTC_MODE1_CTRL) CLK_RTC_CNT = GCLK_RTC/1024 */
  139. #define RTC_MODE1_CTRL_PRESCALER_DIV1 (RTC_MODE1_CTRL_PRESCALER_DIV1_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  140. #define RTC_MODE1_CTRL_PRESCALER_DIV2 (RTC_MODE1_CTRL_PRESCALER_DIV2_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  141. #define RTC_MODE1_CTRL_PRESCALER_DIV4 (RTC_MODE1_CTRL_PRESCALER_DIV4_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  142. #define RTC_MODE1_CTRL_PRESCALER_DIV8 (RTC_MODE1_CTRL_PRESCALER_DIV8_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  143. #define RTC_MODE1_CTRL_PRESCALER_DIV16 (RTC_MODE1_CTRL_PRESCALER_DIV16_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  144. #define RTC_MODE1_CTRL_PRESCALER_DIV32 (RTC_MODE1_CTRL_PRESCALER_DIV32_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  145. #define RTC_MODE1_CTRL_PRESCALER_DIV64 (RTC_MODE1_CTRL_PRESCALER_DIV64_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  146. #define RTC_MODE1_CTRL_PRESCALER_DIV128 (RTC_MODE1_CTRL_PRESCALER_DIV128_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  147. #define RTC_MODE1_CTRL_PRESCALER_DIV256 (RTC_MODE1_CTRL_PRESCALER_DIV256_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  148. #define RTC_MODE1_CTRL_PRESCALER_DIV512 (RTC_MODE1_CTRL_PRESCALER_DIV512_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  149. #define RTC_MODE1_CTRL_PRESCALER_DIV1024 (RTC_MODE1_CTRL_PRESCALER_DIV1024_Val << RTC_MODE1_CTRL_PRESCALER_Pos)
  150. #define RTC_MODE1_CTRL_MASK _U_(0x0F0F) /**< \brief (RTC_MODE1_CTRL) MASK Register */
  151. /* -------- RTC_MODE2_CTRL : (RTC Offset: 0x00) (R/W 16) MODE2 MODE2 Control -------- */
  152. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  153. typedef union {
  154. struct {
  155. uint16_t SWRST:1; /*!< bit: 0 Software Reset */
  156. uint16_t ENABLE:1; /*!< bit: 1 Enable */
  157. uint16_t MODE:2; /*!< bit: 2.. 3 Operating Mode */
  158. uint16_t :2; /*!< bit: 4.. 5 Reserved */
  159. uint16_t CLKREP:1; /*!< bit: 6 Clock Representation */
  160. uint16_t MATCHCLR:1; /*!< bit: 7 Clear on Match */
  161. uint16_t PRESCALER:4; /*!< bit: 8..11 Prescaler */
  162. uint16_t :4; /*!< bit: 12..15 Reserved */
  163. } bit; /*!< Structure used for bit access */
  164. uint16_t reg; /*!< Type used for register access */
  165. } RTC_MODE2_CTRL_Type;
  166. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  167. #define RTC_MODE2_CTRL_OFFSET 0x00 /**< \brief (RTC_MODE2_CTRL offset) MODE2 Control */
  168. #define RTC_MODE2_CTRL_RESETVALUE _U_(0x0000) /**< \brief (RTC_MODE2_CTRL reset_value) MODE2 Control */
  169. #define RTC_MODE2_CTRL_SWRST_Pos 0 /**< \brief (RTC_MODE2_CTRL) Software Reset */
  170. #define RTC_MODE2_CTRL_SWRST (_U_(0x1) << RTC_MODE2_CTRL_SWRST_Pos)
  171. #define RTC_MODE2_CTRL_ENABLE_Pos 1 /**< \brief (RTC_MODE2_CTRL) Enable */
  172. #define RTC_MODE2_CTRL_ENABLE (_U_(0x1) << RTC_MODE2_CTRL_ENABLE_Pos)
  173. #define RTC_MODE2_CTRL_MODE_Pos 2 /**< \brief (RTC_MODE2_CTRL) Operating Mode */
  174. #define RTC_MODE2_CTRL_MODE_Msk (_U_(0x3) << RTC_MODE2_CTRL_MODE_Pos)
  175. #define RTC_MODE2_CTRL_MODE(value) (RTC_MODE2_CTRL_MODE_Msk & ((value) << RTC_MODE2_CTRL_MODE_Pos))
  176. #define RTC_MODE2_CTRL_MODE_COUNT32_Val _U_(0x0) /**< \brief (RTC_MODE2_CTRL) Mode 0: 32-bit Counter */
  177. #define RTC_MODE2_CTRL_MODE_COUNT16_Val _U_(0x1) /**< \brief (RTC_MODE2_CTRL) Mode 1: 16-bit Counter */
  178. #define RTC_MODE2_CTRL_MODE_CLOCK_Val _U_(0x2) /**< \brief (RTC_MODE2_CTRL) Mode 2: Clock/Calendar */
  179. #define RTC_MODE2_CTRL_MODE_COUNT32 (RTC_MODE2_CTRL_MODE_COUNT32_Val << RTC_MODE2_CTRL_MODE_Pos)
  180. #define RTC_MODE2_CTRL_MODE_COUNT16 (RTC_MODE2_CTRL_MODE_COUNT16_Val << RTC_MODE2_CTRL_MODE_Pos)
  181. #define RTC_MODE2_CTRL_MODE_CLOCK (RTC_MODE2_CTRL_MODE_CLOCK_Val << RTC_MODE2_CTRL_MODE_Pos)
  182. #define RTC_MODE2_CTRL_CLKREP_Pos 6 /**< \brief (RTC_MODE2_CTRL) Clock Representation */
  183. #define RTC_MODE2_CTRL_CLKREP (_U_(0x1) << RTC_MODE2_CTRL_CLKREP_Pos)
  184. #define RTC_MODE2_CTRL_MATCHCLR_Pos 7 /**< \brief (RTC_MODE2_CTRL) Clear on Match */
  185. #define RTC_MODE2_CTRL_MATCHCLR (_U_(0x1) << RTC_MODE2_CTRL_MATCHCLR_Pos)
  186. #define RTC_MODE2_CTRL_PRESCALER_Pos 8 /**< \brief (RTC_MODE2_CTRL) Prescaler */
  187. #define RTC_MODE2_CTRL_PRESCALER_Msk (_U_(0xF) << RTC_MODE2_CTRL_PRESCALER_Pos)
  188. #define RTC_MODE2_CTRL_PRESCALER(value) (RTC_MODE2_CTRL_PRESCALER_Msk & ((value) << RTC_MODE2_CTRL_PRESCALER_Pos))
  189. #define RTC_MODE2_CTRL_PRESCALER_DIV1_Val _U_(0x0) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/1 */
  190. #define RTC_MODE2_CTRL_PRESCALER_DIV2_Val _U_(0x1) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/2 */
  191. #define RTC_MODE2_CTRL_PRESCALER_DIV4_Val _U_(0x2) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/4 */
  192. #define RTC_MODE2_CTRL_PRESCALER_DIV8_Val _U_(0x3) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/8 */
  193. #define RTC_MODE2_CTRL_PRESCALER_DIV16_Val _U_(0x4) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/16 */
  194. #define RTC_MODE2_CTRL_PRESCALER_DIV32_Val _U_(0x5) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/32 */
  195. #define RTC_MODE2_CTRL_PRESCALER_DIV64_Val _U_(0x6) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/64 */
  196. #define RTC_MODE2_CTRL_PRESCALER_DIV128_Val _U_(0x7) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/128 */
  197. #define RTC_MODE2_CTRL_PRESCALER_DIV256_Val _U_(0x8) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/256 */
  198. #define RTC_MODE2_CTRL_PRESCALER_DIV512_Val _U_(0x9) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/512 */
  199. #define RTC_MODE2_CTRL_PRESCALER_DIV1024_Val _U_(0xA) /**< \brief (RTC_MODE2_CTRL) CLK_RTC_CNT = GCLK_RTC/1024 */
  200. #define RTC_MODE2_CTRL_PRESCALER_DIV1 (RTC_MODE2_CTRL_PRESCALER_DIV1_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  201. #define RTC_MODE2_CTRL_PRESCALER_DIV2 (RTC_MODE2_CTRL_PRESCALER_DIV2_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  202. #define RTC_MODE2_CTRL_PRESCALER_DIV4 (RTC_MODE2_CTRL_PRESCALER_DIV4_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  203. #define RTC_MODE2_CTRL_PRESCALER_DIV8 (RTC_MODE2_CTRL_PRESCALER_DIV8_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  204. #define RTC_MODE2_CTRL_PRESCALER_DIV16 (RTC_MODE2_CTRL_PRESCALER_DIV16_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  205. #define RTC_MODE2_CTRL_PRESCALER_DIV32 (RTC_MODE2_CTRL_PRESCALER_DIV32_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  206. #define RTC_MODE2_CTRL_PRESCALER_DIV64 (RTC_MODE2_CTRL_PRESCALER_DIV64_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  207. #define RTC_MODE2_CTRL_PRESCALER_DIV128 (RTC_MODE2_CTRL_PRESCALER_DIV128_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  208. #define RTC_MODE2_CTRL_PRESCALER_DIV256 (RTC_MODE2_CTRL_PRESCALER_DIV256_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  209. #define RTC_MODE2_CTRL_PRESCALER_DIV512 (RTC_MODE2_CTRL_PRESCALER_DIV512_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  210. #define RTC_MODE2_CTRL_PRESCALER_DIV1024 (RTC_MODE2_CTRL_PRESCALER_DIV1024_Val << RTC_MODE2_CTRL_PRESCALER_Pos)
  211. #define RTC_MODE2_CTRL_MASK _U_(0x0FCF) /**< \brief (RTC_MODE2_CTRL) MASK Register */
  212. /* -------- RTC_READREQ : (RTC Offset: 0x02) (R/W 16) Read Request -------- */
  213. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  214. typedef union {
  215. struct {
  216. uint16_t ADDR:6; /*!< bit: 0.. 5 Address */
  217. uint16_t :8; /*!< bit: 6..13 Reserved */
  218. uint16_t RCONT:1; /*!< bit: 14 Read Continuously */
  219. uint16_t RREQ:1; /*!< bit: 15 Read Request */
  220. } bit; /*!< Structure used for bit access */
  221. uint16_t reg; /*!< Type used for register access */
  222. } RTC_READREQ_Type;
  223. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  224. #define RTC_READREQ_OFFSET 0x02 /**< \brief (RTC_READREQ offset) Read Request */
  225. #define RTC_READREQ_RESETVALUE _U_(0x0010) /**< \brief (RTC_READREQ reset_value) Read Request */
  226. #define RTC_READREQ_ADDR_Pos 0 /**< \brief (RTC_READREQ) Address */
  227. #define RTC_READREQ_ADDR_Msk (_U_(0x3F) << RTC_READREQ_ADDR_Pos)
  228. #define RTC_READREQ_ADDR(value) (RTC_READREQ_ADDR_Msk & ((value) << RTC_READREQ_ADDR_Pos))
  229. #define RTC_READREQ_RCONT_Pos 14 /**< \brief (RTC_READREQ) Read Continuously */
  230. #define RTC_READREQ_RCONT (_U_(0x1) << RTC_READREQ_RCONT_Pos)
  231. #define RTC_READREQ_RREQ_Pos 15 /**< \brief (RTC_READREQ) Read Request */
  232. #define RTC_READREQ_RREQ (_U_(0x1) << RTC_READREQ_RREQ_Pos)
  233. #define RTC_READREQ_MASK _U_(0xC03F) /**< \brief (RTC_READREQ) MASK Register */
  234. /* -------- RTC_MODE0_EVCTRL : (RTC Offset: 0x04) (R/W 16) MODE0 MODE0 Event Control -------- */
  235. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  236. typedef union {
  237. struct {
  238. uint16_t PEREO0:1; /*!< bit: 0 Periodic Interval 0 Event Output Enable */
  239. uint16_t PEREO1:1; /*!< bit: 1 Periodic Interval 1 Event Output Enable */
  240. uint16_t PEREO2:1; /*!< bit: 2 Periodic Interval 2 Event Output Enable */
  241. uint16_t PEREO3:1; /*!< bit: 3 Periodic Interval 3 Event Output Enable */
  242. uint16_t PEREO4:1; /*!< bit: 4 Periodic Interval 4 Event Output Enable */
  243. uint16_t PEREO5:1; /*!< bit: 5 Periodic Interval 5 Event Output Enable */
  244. uint16_t PEREO6:1; /*!< bit: 6 Periodic Interval 6 Event Output Enable */
  245. uint16_t PEREO7:1; /*!< bit: 7 Periodic Interval 7 Event Output Enable */
  246. uint16_t CMPEO0:1; /*!< bit: 8 Compare 0 Event Output Enable */
  247. uint16_t :6; /*!< bit: 9..14 Reserved */
  248. uint16_t OVFEO:1; /*!< bit: 15 Overflow Event Output Enable */
  249. } bit; /*!< Structure used for bit access */
  250. struct {
  251. uint16_t PEREO:8; /*!< bit: 0.. 7 Periodic Interval x Event Output Enable */
  252. uint16_t CMPEO:1; /*!< bit: 8 Compare x Event Output Enable */
  253. uint16_t :7; /*!< bit: 9..15 Reserved */
  254. } vec; /*!< Structure used for vec access */
  255. uint16_t reg; /*!< Type used for register access */
  256. } RTC_MODE0_EVCTRL_Type;
  257. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  258. #define RTC_MODE0_EVCTRL_OFFSET 0x04 /**< \brief (RTC_MODE0_EVCTRL offset) MODE0 Event Control */
  259. #define RTC_MODE0_EVCTRL_RESETVALUE _U_(0x0000) /**< \brief (RTC_MODE0_EVCTRL reset_value) MODE0 Event Control */
  260. #define RTC_MODE0_EVCTRL_PEREO0_Pos 0 /**< \brief (RTC_MODE0_EVCTRL) Periodic Interval 0 Event Output Enable */
  261. #define RTC_MODE0_EVCTRL_PEREO0 (_U_(1) << RTC_MODE0_EVCTRL_PEREO0_Pos)
  262. #define RTC_MODE0_EVCTRL_PEREO1_Pos 1 /**< \brief (RTC_MODE0_EVCTRL) Periodic Interval 1 Event Output Enable */
  263. #define RTC_MODE0_EVCTRL_PEREO1 (_U_(1) << RTC_MODE0_EVCTRL_PEREO1_Pos)
  264. #define RTC_MODE0_EVCTRL_PEREO2_Pos 2 /**< \brief (RTC_MODE0_EVCTRL) Periodic Interval 2 Event Output Enable */
  265. #define RTC_MODE0_EVCTRL_PEREO2 (_U_(1) << RTC_MODE0_EVCTRL_PEREO2_Pos)
  266. #define RTC_MODE0_EVCTRL_PEREO3_Pos 3 /**< \brief (RTC_MODE0_EVCTRL) Periodic Interval 3 Event Output Enable */
  267. #define RTC_MODE0_EVCTRL_PEREO3 (_U_(1) << RTC_MODE0_EVCTRL_PEREO3_Pos)
  268. #define RTC_MODE0_EVCTRL_PEREO4_Pos 4 /**< \brief (RTC_MODE0_EVCTRL) Periodic Interval 4 Event Output Enable */
  269. #define RTC_MODE0_EVCTRL_PEREO4 (_U_(1) << RTC_MODE0_EVCTRL_PEREO4_Pos)
  270. #define RTC_MODE0_EVCTRL_PEREO5_Pos 5 /**< \brief (RTC_MODE0_EVCTRL) Periodic Interval 5 Event Output Enable */
  271. #define RTC_MODE0_EVCTRL_PEREO5 (_U_(1) << RTC_MODE0_EVCTRL_PEREO5_Pos)
  272. #define RTC_MODE0_EVCTRL_PEREO6_Pos 6 /**< \brief (RTC_MODE0_EVCTRL) Periodic Interval 6 Event Output Enable */
  273. #define RTC_MODE0_EVCTRL_PEREO6 (_U_(1) << RTC_MODE0_EVCTRL_PEREO6_Pos)
  274. #define RTC_MODE0_EVCTRL_PEREO7_Pos 7 /**< \brief (RTC_MODE0_EVCTRL) Periodic Interval 7 Event Output Enable */
  275. #define RTC_MODE0_EVCTRL_PEREO7 (_U_(1) << RTC_MODE0_EVCTRL_PEREO7_Pos)
  276. #define RTC_MODE0_EVCTRL_PEREO_Pos 0 /**< \brief (RTC_MODE0_EVCTRL) Periodic Interval x Event Output Enable */
  277. #define RTC_MODE0_EVCTRL_PEREO_Msk (_U_(0xFF) << RTC_MODE0_EVCTRL_PEREO_Pos)
  278. #define RTC_MODE0_EVCTRL_PEREO(value) (RTC_MODE0_EVCTRL_PEREO_Msk & ((value) << RTC_MODE0_EVCTRL_PEREO_Pos))
  279. #define RTC_MODE0_EVCTRL_CMPEO0_Pos 8 /**< \brief (RTC_MODE0_EVCTRL) Compare 0 Event Output Enable */
  280. #define RTC_MODE0_EVCTRL_CMPEO0 (_U_(1) << RTC_MODE0_EVCTRL_CMPEO0_Pos)
  281. #define RTC_MODE0_EVCTRL_CMPEO_Pos 8 /**< \brief (RTC_MODE0_EVCTRL) Compare x Event Output Enable */
  282. #define RTC_MODE0_EVCTRL_CMPEO_Msk (_U_(0x1) << RTC_MODE0_EVCTRL_CMPEO_Pos)
  283. #define RTC_MODE0_EVCTRL_CMPEO(value) (RTC_MODE0_EVCTRL_CMPEO_Msk & ((value) << RTC_MODE0_EVCTRL_CMPEO_Pos))
  284. #define RTC_MODE0_EVCTRL_OVFEO_Pos 15 /**< \brief (RTC_MODE0_EVCTRL) Overflow Event Output Enable */
  285. #define RTC_MODE0_EVCTRL_OVFEO (_U_(0x1) << RTC_MODE0_EVCTRL_OVFEO_Pos)
  286. #define RTC_MODE0_EVCTRL_MASK _U_(0x81FF) /**< \brief (RTC_MODE0_EVCTRL) MASK Register */
  287. /* -------- RTC_MODE1_EVCTRL : (RTC Offset: 0x04) (R/W 16) MODE1 MODE1 Event Control -------- */
  288. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  289. typedef union {
  290. struct {
  291. uint16_t PEREO0:1; /*!< bit: 0 Periodic Interval 0 Event Output Enable */
  292. uint16_t PEREO1:1; /*!< bit: 1 Periodic Interval 1 Event Output Enable */
  293. uint16_t PEREO2:1; /*!< bit: 2 Periodic Interval 2 Event Output Enable */
  294. uint16_t PEREO3:1; /*!< bit: 3 Periodic Interval 3 Event Output Enable */
  295. uint16_t PEREO4:1; /*!< bit: 4 Periodic Interval 4 Event Output Enable */
  296. uint16_t PEREO5:1; /*!< bit: 5 Periodic Interval 5 Event Output Enable */
  297. uint16_t PEREO6:1; /*!< bit: 6 Periodic Interval 6 Event Output Enable */
  298. uint16_t PEREO7:1; /*!< bit: 7 Periodic Interval 7 Event Output Enable */
  299. uint16_t CMPEO0:1; /*!< bit: 8 Compare 0 Event Output Enable */
  300. uint16_t CMPEO1:1; /*!< bit: 9 Compare 1 Event Output Enable */
  301. uint16_t :5; /*!< bit: 10..14 Reserved */
  302. uint16_t OVFEO:1; /*!< bit: 15 Overflow Event Output Enable */
  303. } bit; /*!< Structure used for bit access */
  304. struct {
  305. uint16_t PEREO:8; /*!< bit: 0.. 7 Periodic Interval x Event Output Enable */
  306. uint16_t CMPEO:2; /*!< bit: 8.. 9 Compare x Event Output Enable */
  307. uint16_t :6; /*!< bit: 10..15 Reserved */
  308. } vec; /*!< Structure used for vec access */
  309. uint16_t reg; /*!< Type used for register access */
  310. } RTC_MODE1_EVCTRL_Type;
  311. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  312. #define RTC_MODE1_EVCTRL_OFFSET 0x04 /**< \brief (RTC_MODE1_EVCTRL offset) MODE1 Event Control */
  313. #define RTC_MODE1_EVCTRL_RESETVALUE _U_(0x0000) /**< \brief (RTC_MODE1_EVCTRL reset_value) MODE1 Event Control */
  314. #define RTC_MODE1_EVCTRL_PEREO0_Pos 0 /**< \brief (RTC_MODE1_EVCTRL) Periodic Interval 0 Event Output Enable */
  315. #define RTC_MODE1_EVCTRL_PEREO0 (_U_(1) << RTC_MODE1_EVCTRL_PEREO0_Pos)
  316. #define RTC_MODE1_EVCTRL_PEREO1_Pos 1 /**< \brief (RTC_MODE1_EVCTRL) Periodic Interval 1 Event Output Enable */
  317. #define RTC_MODE1_EVCTRL_PEREO1 (_U_(1) << RTC_MODE1_EVCTRL_PEREO1_Pos)
  318. #define RTC_MODE1_EVCTRL_PEREO2_Pos 2 /**< \brief (RTC_MODE1_EVCTRL) Periodic Interval 2 Event Output Enable */
  319. #define RTC_MODE1_EVCTRL_PEREO2 (_U_(1) << RTC_MODE1_EVCTRL_PEREO2_Pos)
  320. #define RTC_MODE1_EVCTRL_PEREO3_Pos 3 /**< \brief (RTC_MODE1_EVCTRL) Periodic Interval 3 Event Output Enable */
  321. #define RTC_MODE1_EVCTRL_PEREO3 (_U_(1) << RTC_MODE1_EVCTRL_PEREO3_Pos)
  322. #define RTC_MODE1_EVCTRL_PEREO4_Pos 4 /**< \brief (RTC_MODE1_EVCTRL) Periodic Interval 4 Event Output Enable */
  323. #define RTC_MODE1_EVCTRL_PEREO4 (_U_(1) << RTC_MODE1_EVCTRL_PEREO4_Pos)
  324. #define RTC_MODE1_EVCTRL_PEREO5_Pos 5 /**< \brief (RTC_MODE1_EVCTRL) Periodic Interval 5 Event Output Enable */
  325. #define RTC_MODE1_EVCTRL_PEREO5 (_U_(1) << RTC_MODE1_EVCTRL_PEREO5_Pos)
  326. #define RTC_MODE1_EVCTRL_PEREO6_Pos 6 /**< \brief (RTC_MODE1_EVCTRL) Periodic Interval 6 Event Output Enable */
  327. #define RTC_MODE1_EVCTRL_PEREO6 (_U_(1) << RTC_MODE1_EVCTRL_PEREO6_Pos)
  328. #define RTC_MODE1_EVCTRL_PEREO7_Pos 7 /**< \brief (RTC_MODE1_EVCTRL) Periodic Interval 7 Event Output Enable */
  329. #define RTC_MODE1_EVCTRL_PEREO7 (_U_(1) << RTC_MODE1_EVCTRL_PEREO7_Pos)
  330. #define RTC_MODE1_EVCTRL_PEREO_Pos 0 /**< \brief (RTC_MODE1_EVCTRL) Periodic Interval x Event Output Enable */
  331. #define RTC_MODE1_EVCTRL_PEREO_Msk (_U_(0xFF) << RTC_MODE1_EVCTRL_PEREO_Pos)
  332. #define RTC_MODE1_EVCTRL_PEREO(value) (RTC_MODE1_EVCTRL_PEREO_Msk & ((value) << RTC_MODE1_EVCTRL_PEREO_Pos))
  333. #define RTC_MODE1_EVCTRL_CMPEO0_Pos 8 /**< \brief (RTC_MODE1_EVCTRL) Compare 0 Event Output Enable */
  334. #define RTC_MODE1_EVCTRL_CMPEO0 (_U_(1) << RTC_MODE1_EVCTRL_CMPEO0_Pos)
  335. #define RTC_MODE1_EVCTRL_CMPEO1_Pos 9 /**< \brief (RTC_MODE1_EVCTRL) Compare 1 Event Output Enable */
  336. #define RTC_MODE1_EVCTRL_CMPEO1 (_U_(1) << RTC_MODE1_EVCTRL_CMPEO1_Pos)
  337. #define RTC_MODE1_EVCTRL_CMPEO_Pos 8 /**< \brief (RTC_MODE1_EVCTRL) Compare x Event Output Enable */
  338. #define RTC_MODE1_EVCTRL_CMPEO_Msk (_U_(0x3) << RTC_MODE1_EVCTRL_CMPEO_Pos)
  339. #define RTC_MODE1_EVCTRL_CMPEO(value) (RTC_MODE1_EVCTRL_CMPEO_Msk & ((value) << RTC_MODE1_EVCTRL_CMPEO_Pos))
  340. #define RTC_MODE1_EVCTRL_OVFEO_Pos 15 /**< \brief (RTC_MODE1_EVCTRL) Overflow Event Output Enable */
  341. #define RTC_MODE1_EVCTRL_OVFEO (_U_(0x1) << RTC_MODE1_EVCTRL_OVFEO_Pos)
  342. #define RTC_MODE1_EVCTRL_MASK _U_(0x83FF) /**< \brief (RTC_MODE1_EVCTRL) MASK Register */
  343. /* -------- RTC_MODE2_EVCTRL : (RTC Offset: 0x04) (R/W 16) MODE2 MODE2 Event Control -------- */
  344. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  345. typedef union {
  346. struct {
  347. uint16_t PEREO0:1; /*!< bit: 0 Periodic Interval 0 Event Output Enable */
  348. uint16_t PEREO1:1; /*!< bit: 1 Periodic Interval 1 Event Output Enable */
  349. uint16_t PEREO2:1; /*!< bit: 2 Periodic Interval 2 Event Output Enable */
  350. uint16_t PEREO3:1; /*!< bit: 3 Periodic Interval 3 Event Output Enable */
  351. uint16_t PEREO4:1; /*!< bit: 4 Periodic Interval 4 Event Output Enable */
  352. uint16_t PEREO5:1; /*!< bit: 5 Periodic Interval 5 Event Output Enable */
  353. uint16_t PEREO6:1; /*!< bit: 6 Periodic Interval 6 Event Output Enable */
  354. uint16_t PEREO7:1; /*!< bit: 7 Periodic Interval 7 Event Output Enable */
  355. uint16_t ALARMEO0:1; /*!< bit: 8 Alarm 0 Event Output Enable */
  356. uint16_t :6; /*!< bit: 9..14 Reserved */
  357. uint16_t OVFEO:1; /*!< bit: 15 Overflow Event Output Enable */
  358. } bit; /*!< Structure used for bit access */
  359. struct {
  360. uint16_t PEREO:8; /*!< bit: 0.. 7 Periodic Interval x Event Output Enable */
  361. uint16_t ALARMEO:1; /*!< bit: 8 Alarm x Event Output Enable */
  362. uint16_t :7; /*!< bit: 9..15 Reserved */
  363. } vec; /*!< Structure used for vec access */
  364. uint16_t reg; /*!< Type used for register access */
  365. } RTC_MODE2_EVCTRL_Type;
  366. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  367. #define RTC_MODE2_EVCTRL_OFFSET 0x04 /**< \brief (RTC_MODE2_EVCTRL offset) MODE2 Event Control */
  368. #define RTC_MODE2_EVCTRL_RESETVALUE _U_(0x0000) /**< \brief (RTC_MODE2_EVCTRL reset_value) MODE2 Event Control */
  369. #define RTC_MODE2_EVCTRL_PEREO0_Pos 0 /**< \brief (RTC_MODE2_EVCTRL) Periodic Interval 0 Event Output Enable */
  370. #define RTC_MODE2_EVCTRL_PEREO0 (_U_(1) << RTC_MODE2_EVCTRL_PEREO0_Pos)
  371. #define RTC_MODE2_EVCTRL_PEREO1_Pos 1 /**< \brief (RTC_MODE2_EVCTRL) Periodic Interval 1 Event Output Enable */
  372. #define RTC_MODE2_EVCTRL_PEREO1 (_U_(1) << RTC_MODE2_EVCTRL_PEREO1_Pos)
  373. #define RTC_MODE2_EVCTRL_PEREO2_Pos 2 /**< \brief (RTC_MODE2_EVCTRL) Periodic Interval 2 Event Output Enable */
  374. #define RTC_MODE2_EVCTRL_PEREO2 (_U_(1) << RTC_MODE2_EVCTRL_PEREO2_Pos)
  375. #define RTC_MODE2_EVCTRL_PEREO3_Pos 3 /**< \brief (RTC_MODE2_EVCTRL) Periodic Interval 3 Event Output Enable */
  376. #define RTC_MODE2_EVCTRL_PEREO3 (_U_(1) << RTC_MODE2_EVCTRL_PEREO3_Pos)
  377. #define RTC_MODE2_EVCTRL_PEREO4_Pos 4 /**< \brief (RTC_MODE2_EVCTRL) Periodic Interval 4 Event Output Enable */
  378. #define RTC_MODE2_EVCTRL_PEREO4 (_U_(1) << RTC_MODE2_EVCTRL_PEREO4_Pos)
  379. #define RTC_MODE2_EVCTRL_PEREO5_Pos 5 /**< \brief (RTC_MODE2_EVCTRL) Periodic Interval 5 Event Output Enable */
  380. #define RTC_MODE2_EVCTRL_PEREO5 (_U_(1) << RTC_MODE2_EVCTRL_PEREO5_Pos)
  381. #define RTC_MODE2_EVCTRL_PEREO6_Pos 6 /**< \brief (RTC_MODE2_EVCTRL) Periodic Interval 6 Event Output Enable */
  382. #define RTC_MODE2_EVCTRL_PEREO6 (_U_(1) << RTC_MODE2_EVCTRL_PEREO6_Pos)
  383. #define RTC_MODE2_EVCTRL_PEREO7_Pos 7 /**< \brief (RTC_MODE2_EVCTRL) Periodic Interval 7 Event Output Enable */
  384. #define RTC_MODE2_EVCTRL_PEREO7 (_U_(1) << RTC_MODE2_EVCTRL_PEREO7_Pos)
  385. #define RTC_MODE2_EVCTRL_PEREO_Pos 0 /**< \brief (RTC_MODE2_EVCTRL) Periodic Interval x Event Output Enable */
  386. #define RTC_MODE2_EVCTRL_PEREO_Msk (_U_(0xFF) << RTC_MODE2_EVCTRL_PEREO_Pos)
  387. #define RTC_MODE2_EVCTRL_PEREO(value) (RTC_MODE2_EVCTRL_PEREO_Msk & ((value) << RTC_MODE2_EVCTRL_PEREO_Pos))
  388. #define RTC_MODE2_EVCTRL_ALARMEO0_Pos 8 /**< \brief (RTC_MODE2_EVCTRL) Alarm 0 Event Output Enable */
  389. #define RTC_MODE2_EVCTRL_ALARMEO0 (_U_(1) << RTC_MODE2_EVCTRL_ALARMEO0_Pos)
  390. #define RTC_MODE2_EVCTRL_ALARMEO_Pos 8 /**< \brief (RTC_MODE2_EVCTRL) Alarm x Event Output Enable */
  391. #define RTC_MODE2_EVCTRL_ALARMEO_Msk (_U_(0x1) << RTC_MODE2_EVCTRL_ALARMEO_Pos)
  392. #define RTC_MODE2_EVCTRL_ALARMEO(value) (RTC_MODE2_EVCTRL_ALARMEO_Msk & ((value) << RTC_MODE2_EVCTRL_ALARMEO_Pos))
  393. #define RTC_MODE2_EVCTRL_OVFEO_Pos 15 /**< \brief (RTC_MODE2_EVCTRL) Overflow Event Output Enable */
  394. #define RTC_MODE2_EVCTRL_OVFEO (_U_(0x1) << RTC_MODE2_EVCTRL_OVFEO_Pos)
  395. #define RTC_MODE2_EVCTRL_MASK _U_(0x81FF) /**< \brief (RTC_MODE2_EVCTRL) MASK Register */
  396. /* -------- RTC_MODE0_INTENCLR : (RTC Offset: 0x06) (R/W 8) MODE0 MODE0 Interrupt Enable Clear -------- */
  397. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  398. typedef union {
  399. struct {
  400. uint8_t CMP0:1; /*!< bit: 0 Compare 0 Interrupt Enable */
  401. uint8_t :5; /*!< bit: 1.. 5 Reserved */
  402. uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready Interrupt Enable */
  403. uint8_t OVF:1; /*!< bit: 7 Overflow Interrupt Enable */
  404. } bit; /*!< Structure used for bit access */
  405. struct {
  406. uint8_t CMP:1; /*!< bit: 0 Compare x Interrupt Enable */
  407. uint8_t :7; /*!< bit: 1.. 7 Reserved */
  408. } vec; /*!< Structure used for vec access */
  409. uint8_t reg; /*!< Type used for register access */
  410. } RTC_MODE0_INTENCLR_Type;
  411. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  412. #define RTC_MODE0_INTENCLR_OFFSET 0x06 /**< \brief (RTC_MODE0_INTENCLR offset) MODE0 Interrupt Enable Clear */
  413. #define RTC_MODE0_INTENCLR_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE0_INTENCLR reset_value) MODE0 Interrupt Enable Clear */
  414. #define RTC_MODE0_INTENCLR_CMP0_Pos 0 /**< \brief (RTC_MODE0_INTENCLR) Compare 0 Interrupt Enable */
  415. #define RTC_MODE0_INTENCLR_CMP0 (_U_(1) << RTC_MODE0_INTENCLR_CMP0_Pos)
  416. #define RTC_MODE0_INTENCLR_CMP_Pos 0 /**< \brief (RTC_MODE0_INTENCLR) Compare x Interrupt Enable */
  417. #define RTC_MODE0_INTENCLR_CMP_Msk (_U_(0x1) << RTC_MODE0_INTENCLR_CMP_Pos)
  418. #define RTC_MODE0_INTENCLR_CMP(value) (RTC_MODE0_INTENCLR_CMP_Msk & ((value) << RTC_MODE0_INTENCLR_CMP_Pos))
  419. #define RTC_MODE0_INTENCLR_SYNCRDY_Pos 6 /**< \brief (RTC_MODE0_INTENCLR) Synchronization Ready Interrupt Enable */
  420. #define RTC_MODE0_INTENCLR_SYNCRDY (_U_(0x1) << RTC_MODE0_INTENCLR_SYNCRDY_Pos)
  421. #define RTC_MODE0_INTENCLR_OVF_Pos 7 /**< \brief (RTC_MODE0_INTENCLR) Overflow Interrupt Enable */
  422. #define RTC_MODE0_INTENCLR_OVF (_U_(0x1) << RTC_MODE0_INTENCLR_OVF_Pos)
  423. #define RTC_MODE0_INTENCLR_MASK _U_(0xC1) /**< \brief (RTC_MODE0_INTENCLR) MASK Register */
  424. /* -------- RTC_MODE1_INTENCLR : (RTC Offset: 0x06) (R/W 8) MODE1 MODE1 Interrupt Enable Clear -------- */
  425. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  426. typedef union {
  427. struct {
  428. uint8_t CMP0:1; /*!< bit: 0 Compare 0 Interrupt Enable */
  429. uint8_t CMP1:1; /*!< bit: 1 Compare 1 Interrupt Enable */
  430. uint8_t :4; /*!< bit: 2.. 5 Reserved */
  431. uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready Interrupt Enable */
  432. uint8_t OVF:1; /*!< bit: 7 Overflow Interrupt Enable */
  433. } bit; /*!< Structure used for bit access */
  434. struct {
  435. uint8_t CMP:2; /*!< bit: 0.. 1 Compare x Interrupt Enable */
  436. uint8_t :6; /*!< bit: 2.. 7 Reserved */
  437. } vec; /*!< Structure used for vec access */
  438. uint8_t reg; /*!< Type used for register access */
  439. } RTC_MODE1_INTENCLR_Type;
  440. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  441. #define RTC_MODE1_INTENCLR_OFFSET 0x06 /**< \brief (RTC_MODE1_INTENCLR offset) MODE1 Interrupt Enable Clear */
  442. #define RTC_MODE1_INTENCLR_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE1_INTENCLR reset_value) MODE1 Interrupt Enable Clear */
  443. #define RTC_MODE1_INTENCLR_CMP0_Pos 0 /**< \brief (RTC_MODE1_INTENCLR) Compare 0 Interrupt Enable */
  444. #define RTC_MODE1_INTENCLR_CMP0 (_U_(1) << RTC_MODE1_INTENCLR_CMP0_Pos)
  445. #define RTC_MODE1_INTENCLR_CMP1_Pos 1 /**< \brief (RTC_MODE1_INTENCLR) Compare 1 Interrupt Enable */
  446. #define RTC_MODE1_INTENCLR_CMP1 (_U_(1) << RTC_MODE1_INTENCLR_CMP1_Pos)
  447. #define RTC_MODE1_INTENCLR_CMP_Pos 0 /**< \brief (RTC_MODE1_INTENCLR) Compare x Interrupt Enable */
  448. #define RTC_MODE1_INTENCLR_CMP_Msk (_U_(0x3) << RTC_MODE1_INTENCLR_CMP_Pos)
  449. #define RTC_MODE1_INTENCLR_CMP(value) (RTC_MODE1_INTENCLR_CMP_Msk & ((value) << RTC_MODE1_INTENCLR_CMP_Pos))
  450. #define RTC_MODE1_INTENCLR_SYNCRDY_Pos 6 /**< \brief (RTC_MODE1_INTENCLR) Synchronization Ready Interrupt Enable */
  451. #define RTC_MODE1_INTENCLR_SYNCRDY (_U_(0x1) << RTC_MODE1_INTENCLR_SYNCRDY_Pos)
  452. #define RTC_MODE1_INTENCLR_OVF_Pos 7 /**< \brief (RTC_MODE1_INTENCLR) Overflow Interrupt Enable */
  453. #define RTC_MODE1_INTENCLR_OVF (_U_(0x1) << RTC_MODE1_INTENCLR_OVF_Pos)
  454. #define RTC_MODE1_INTENCLR_MASK _U_(0xC3) /**< \brief (RTC_MODE1_INTENCLR) MASK Register */
  455. /* -------- RTC_MODE2_INTENCLR : (RTC Offset: 0x06) (R/W 8) MODE2 MODE2 Interrupt Enable Clear -------- */
  456. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  457. typedef union {
  458. struct {
  459. uint8_t ALARM0:1; /*!< bit: 0 Alarm 0 Interrupt Enable */
  460. uint8_t :5; /*!< bit: 1.. 5 Reserved */
  461. uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready Interrupt Enable */
  462. uint8_t OVF:1; /*!< bit: 7 Overflow Interrupt Enable */
  463. } bit; /*!< Structure used for bit access */
  464. struct {
  465. uint8_t ALARM:1; /*!< bit: 0 Alarm x Interrupt Enable */
  466. uint8_t :7; /*!< bit: 1.. 7 Reserved */
  467. } vec; /*!< Structure used for vec access */
  468. uint8_t reg; /*!< Type used for register access */
  469. } RTC_MODE2_INTENCLR_Type;
  470. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  471. #define RTC_MODE2_INTENCLR_OFFSET 0x06 /**< \brief (RTC_MODE2_INTENCLR offset) MODE2 Interrupt Enable Clear */
  472. #define RTC_MODE2_INTENCLR_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE2_INTENCLR reset_value) MODE2 Interrupt Enable Clear */
  473. #define RTC_MODE2_INTENCLR_ALARM0_Pos 0 /**< \brief (RTC_MODE2_INTENCLR) Alarm 0 Interrupt Enable */
  474. #define RTC_MODE2_INTENCLR_ALARM0 (_U_(1) << RTC_MODE2_INTENCLR_ALARM0_Pos)
  475. #define RTC_MODE2_INTENCLR_ALARM_Pos 0 /**< \brief (RTC_MODE2_INTENCLR) Alarm x Interrupt Enable */
  476. #define RTC_MODE2_INTENCLR_ALARM_Msk (_U_(0x1) << RTC_MODE2_INTENCLR_ALARM_Pos)
  477. #define RTC_MODE2_INTENCLR_ALARM(value) (RTC_MODE2_INTENCLR_ALARM_Msk & ((value) << RTC_MODE2_INTENCLR_ALARM_Pos))
  478. #define RTC_MODE2_INTENCLR_SYNCRDY_Pos 6 /**< \brief (RTC_MODE2_INTENCLR) Synchronization Ready Interrupt Enable */
  479. #define RTC_MODE2_INTENCLR_SYNCRDY (_U_(0x1) << RTC_MODE2_INTENCLR_SYNCRDY_Pos)
  480. #define RTC_MODE2_INTENCLR_OVF_Pos 7 /**< \brief (RTC_MODE2_INTENCLR) Overflow Interrupt Enable */
  481. #define RTC_MODE2_INTENCLR_OVF (_U_(0x1) << RTC_MODE2_INTENCLR_OVF_Pos)
  482. #define RTC_MODE2_INTENCLR_MASK _U_(0xC1) /**< \brief (RTC_MODE2_INTENCLR) MASK Register */
  483. /* -------- RTC_MODE0_INTENSET : (RTC Offset: 0x07) (R/W 8) MODE0 MODE0 Interrupt Enable Set -------- */
  484. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  485. typedef union {
  486. struct {
  487. uint8_t CMP0:1; /*!< bit: 0 Compare 0 Interrupt Enable */
  488. uint8_t :5; /*!< bit: 1.. 5 Reserved */
  489. uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready Interrupt Enable */
  490. uint8_t OVF:1; /*!< bit: 7 Overflow Interrupt Enable */
  491. } bit; /*!< Structure used for bit access */
  492. struct {
  493. uint8_t CMP:1; /*!< bit: 0 Compare x Interrupt Enable */
  494. uint8_t :7; /*!< bit: 1.. 7 Reserved */
  495. } vec; /*!< Structure used for vec access */
  496. uint8_t reg; /*!< Type used for register access */
  497. } RTC_MODE0_INTENSET_Type;
  498. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  499. #define RTC_MODE0_INTENSET_OFFSET 0x07 /**< \brief (RTC_MODE0_INTENSET offset) MODE0 Interrupt Enable Set */
  500. #define RTC_MODE0_INTENSET_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE0_INTENSET reset_value) MODE0 Interrupt Enable Set */
  501. #define RTC_MODE0_INTENSET_CMP0_Pos 0 /**< \brief (RTC_MODE0_INTENSET) Compare 0 Interrupt Enable */
  502. #define RTC_MODE0_INTENSET_CMP0 (_U_(1) << RTC_MODE0_INTENSET_CMP0_Pos)
  503. #define RTC_MODE0_INTENSET_CMP_Pos 0 /**< \brief (RTC_MODE0_INTENSET) Compare x Interrupt Enable */
  504. #define RTC_MODE0_INTENSET_CMP_Msk (_U_(0x1) << RTC_MODE0_INTENSET_CMP_Pos)
  505. #define RTC_MODE0_INTENSET_CMP(value) (RTC_MODE0_INTENSET_CMP_Msk & ((value) << RTC_MODE0_INTENSET_CMP_Pos))
  506. #define RTC_MODE0_INTENSET_SYNCRDY_Pos 6 /**< \brief (RTC_MODE0_INTENSET) Synchronization Ready Interrupt Enable */
  507. #define RTC_MODE0_INTENSET_SYNCRDY (_U_(0x1) << RTC_MODE0_INTENSET_SYNCRDY_Pos)
  508. #define RTC_MODE0_INTENSET_OVF_Pos 7 /**< \brief (RTC_MODE0_INTENSET) Overflow Interrupt Enable */
  509. #define RTC_MODE0_INTENSET_OVF (_U_(0x1) << RTC_MODE0_INTENSET_OVF_Pos)
  510. #define RTC_MODE0_INTENSET_MASK _U_(0xC1) /**< \brief (RTC_MODE0_INTENSET) MASK Register */
  511. /* -------- RTC_MODE1_INTENSET : (RTC Offset: 0x07) (R/W 8) MODE1 MODE1 Interrupt Enable Set -------- */
  512. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  513. typedef union {
  514. struct {
  515. uint8_t CMP0:1; /*!< bit: 0 Compare 0 Interrupt Enable */
  516. uint8_t CMP1:1; /*!< bit: 1 Compare 1 Interrupt Enable */
  517. uint8_t :4; /*!< bit: 2.. 5 Reserved */
  518. uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready Interrupt Enable */
  519. uint8_t OVF:1; /*!< bit: 7 Overflow Interrupt Enable */
  520. } bit; /*!< Structure used for bit access */
  521. struct {
  522. uint8_t CMP:2; /*!< bit: 0.. 1 Compare x Interrupt Enable */
  523. uint8_t :6; /*!< bit: 2.. 7 Reserved */
  524. } vec; /*!< Structure used for vec access */
  525. uint8_t reg; /*!< Type used for register access */
  526. } RTC_MODE1_INTENSET_Type;
  527. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  528. #define RTC_MODE1_INTENSET_OFFSET 0x07 /**< \brief (RTC_MODE1_INTENSET offset) MODE1 Interrupt Enable Set */
  529. #define RTC_MODE1_INTENSET_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE1_INTENSET reset_value) MODE1 Interrupt Enable Set */
  530. #define RTC_MODE1_INTENSET_CMP0_Pos 0 /**< \brief (RTC_MODE1_INTENSET) Compare 0 Interrupt Enable */
  531. #define RTC_MODE1_INTENSET_CMP0 (_U_(1) << RTC_MODE1_INTENSET_CMP0_Pos)
  532. #define RTC_MODE1_INTENSET_CMP1_Pos 1 /**< \brief (RTC_MODE1_INTENSET) Compare 1 Interrupt Enable */
  533. #define RTC_MODE1_INTENSET_CMP1 (_U_(1) << RTC_MODE1_INTENSET_CMP1_Pos)
  534. #define RTC_MODE1_INTENSET_CMP_Pos 0 /**< \brief (RTC_MODE1_INTENSET) Compare x Interrupt Enable */
  535. #define RTC_MODE1_INTENSET_CMP_Msk (_U_(0x3) << RTC_MODE1_INTENSET_CMP_Pos)
  536. #define RTC_MODE1_INTENSET_CMP(value) (RTC_MODE1_INTENSET_CMP_Msk & ((value) << RTC_MODE1_INTENSET_CMP_Pos))
  537. #define RTC_MODE1_INTENSET_SYNCRDY_Pos 6 /**< \brief (RTC_MODE1_INTENSET) Synchronization Ready Interrupt Enable */
  538. #define RTC_MODE1_INTENSET_SYNCRDY (_U_(0x1) << RTC_MODE1_INTENSET_SYNCRDY_Pos)
  539. #define RTC_MODE1_INTENSET_OVF_Pos 7 /**< \brief (RTC_MODE1_INTENSET) Overflow Interrupt Enable */
  540. #define RTC_MODE1_INTENSET_OVF (_U_(0x1) << RTC_MODE1_INTENSET_OVF_Pos)
  541. #define RTC_MODE1_INTENSET_MASK _U_(0xC3) /**< \brief (RTC_MODE1_INTENSET) MASK Register */
  542. /* -------- RTC_MODE2_INTENSET : (RTC Offset: 0x07) (R/W 8) MODE2 MODE2 Interrupt Enable Set -------- */
  543. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  544. typedef union {
  545. struct {
  546. uint8_t ALARM0:1; /*!< bit: 0 Alarm 0 Interrupt Enable */
  547. uint8_t :5; /*!< bit: 1.. 5 Reserved */
  548. uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready Interrupt Enable */
  549. uint8_t OVF:1; /*!< bit: 7 Overflow Interrupt Enable */
  550. } bit; /*!< Structure used for bit access */
  551. struct {
  552. uint8_t ALARM:1; /*!< bit: 0 Alarm x Interrupt Enable */
  553. uint8_t :7; /*!< bit: 1.. 7 Reserved */
  554. } vec; /*!< Structure used for vec access */
  555. uint8_t reg; /*!< Type used for register access */
  556. } RTC_MODE2_INTENSET_Type;
  557. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  558. #define RTC_MODE2_INTENSET_OFFSET 0x07 /**< \brief (RTC_MODE2_INTENSET offset) MODE2 Interrupt Enable Set */
  559. #define RTC_MODE2_INTENSET_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE2_INTENSET reset_value) MODE2 Interrupt Enable Set */
  560. #define RTC_MODE2_INTENSET_ALARM0_Pos 0 /**< \brief (RTC_MODE2_INTENSET) Alarm 0 Interrupt Enable */
  561. #define RTC_MODE2_INTENSET_ALARM0 (_U_(1) << RTC_MODE2_INTENSET_ALARM0_Pos)
  562. #define RTC_MODE2_INTENSET_ALARM_Pos 0 /**< \brief (RTC_MODE2_INTENSET) Alarm x Interrupt Enable */
  563. #define RTC_MODE2_INTENSET_ALARM_Msk (_U_(0x1) << RTC_MODE2_INTENSET_ALARM_Pos)
  564. #define RTC_MODE2_INTENSET_ALARM(value) (RTC_MODE2_INTENSET_ALARM_Msk & ((value) << RTC_MODE2_INTENSET_ALARM_Pos))
  565. #define RTC_MODE2_INTENSET_SYNCRDY_Pos 6 /**< \brief (RTC_MODE2_INTENSET) Synchronization Ready Interrupt Enable */
  566. #define RTC_MODE2_INTENSET_SYNCRDY (_U_(0x1) << RTC_MODE2_INTENSET_SYNCRDY_Pos)
  567. #define RTC_MODE2_INTENSET_OVF_Pos 7 /**< \brief (RTC_MODE2_INTENSET) Overflow Interrupt Enable */
  568. #define RTC_MODE2_INTENSET_OVF (_U_(0x1) << RTC_MODE2_INTENSET_OVF_Pos)
  569. #define RTC_MODE2_INTENSET_MASK _U_(0xC1) /**< \brief (RTC_MODE2_INTENSET) MASK Register */
  570. /* -------- RTC_MODE0_INTFLAG : (RTC Offset: 0x08) (R/W 8) MODE0 MODE0 Interrupt Flag Status and Clear -------- */
  571. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  572. typedef union { // __I to avoid read-modify-write on write-to-clear register
  573. struct {
  574. __I uint8_t CMP0:1; /*!< bit: 0 Compare 0 */
  575. __I uint8_t :5; /*!< bit: 1.. 5 Reserved */
  576. __I uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready */
  577. __I uint8_t OVF:1; /*!< bit: 7 Overflow */
  578. } bit; /*!< Structure used for bit access */
  579. struct {
  580. __I uint8_t CMP:1; /*!< bit: 0 Compare x */
  581. __I uint8_t :7; /*!< bit: 1.. 7 Reserved */
  582. } vec; /*!< Structure used for vec access */
  583. uint8_t reg; /*!< Type used for register access */
  584. } RTC_MODE0_INTFLAG_Type;
  585. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  586. #define RTC_MODE0_INTFLAG_OFFSET 0x08 /**< \brief (RTC_MODE0_INTFLAG offset) MODE0 Interrupt Flag Status and Clear */
  587. #define RTC_MODE0_INTFLAG_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE0_INTFLAG reset_value) MODE0 Interrupt Flag Status and Clear */
  588. #define RTC_MODE0_INTFLAG_CMP0_Pos 0 /**< \brief (RTC_MODE0_INTFLAG) Compare 0 */
  589. #define RTC_MODE0_INTFLAG_CMP0 (_U_(1) << RTC_MODE0_INTFLAG_CMP0_Pos)
  590. #define RTC_MODE0_INTFLAG_CMP_Pos 0 /**< \brief (RTC_MODE0_INTFLAG) Compare x */
  591. #define RTC_MODE0_INTFLAG_CMP_Msk (_U_(0x1) << RTC_MODE0_INTFLAG_CMP_Pos)
  592. #define RTC_MODE0_INTFLAG_CMP(value) (RTC_MODE0_INTFLAG_CMP_Msk & ((value) << RTC_MODE0_INTFLAG_CMP_Pos))
  593. #define RTC_MODE0_INTFLAG_SYNCRDY_Pos 6 /**< \brief (RTC_MODE0_INTFLAG) Synchronization Ready */
  594. #define RTC_MODE0_INTFLAG_SYNCRDY (_U_(0x1) << RTC_MODE0_INTFLAG_SYNCRDY_Pos)
  595. #define RTC_MODE0_INTFLAG_OVF_Pos 7 /**< \brief (RTC_MODE0_INTFLAG) Overflow */
  596. #define RTC_MODE0_INTFLAG_OVF (_U_(0x1) << RTC_MODE0_INTFLAG_OVF_Pos)
  597. #define RTC_MODE0_INTFLAG_MASK _U_(0xC1) /**< \brief (RTC_MODE0_INTFLAG) MASK Register */
  598. /* -------- RTC_MODE1_INTFLAG : (RTC Offset: 0x08) (R/W 8) MODE1 MODE1 Interrupt Flag Status and Clear -------- */
  599. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  600. typedef union { // __I to avoid read-modify-write on write-to-clear register
  601. struct {
  602. __I uint8_t CMP0:1; /*!< bit: 0 Compare 0 */
  603. __I uint8_t CMP1:1; /*!< bit: 1 Compare 1 */
  604. __I uint8_t :4; /*!< bit: 2.. 5 Reserved */
  605. __I uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready */
  606. __I uint8_t OVF:1; /*!< bit: 7 Overflow */
  607. } bit; /*!< Structure used for bit access */
  608. struct {
  609. __I uint8_t CMP:2; /*!< bit: 0.. 1 Compare x */
  610. __I uint8_t :6; /*!< bit: 2.. 7 Reserved */
  611. } vec; /*!< Structure used for vec access */
  612. uint8_t reg; /*!< Type used for register access */
  613. } RTC_MODE1_INTFLAG_Type;
  614. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  615. #define RTC_MODE1_INTFLAG_OFFSET 0x08 /**< \brief (RTC_MODE1_INTFLAG offset) MODE1 Interrupt Flag Status and Clear */
  616. #define RTC_MODE1_INTFLAG_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE1_INTFLAG reset_value) MODE1 Interrupt Flag Status and Clear */
  617. #define RTC_MODE1_INTFLAG_CMP0_Pos 0 /**< \brief (RTC_MODE1_INTFLAG) Compare 0 */
  618. #define RTC_MODE1_INTFLAG_CMP0 (_U_(1) << RTC_MODE1_INTFLAG_CMP0_Pos)
  619. #define RTC_MODE1_INTFLAG_CMP1_Pos 1 /**< \brief (RTC_MODE1_INTFLAG) Compare 1 */
  620. #define RTC_MODE1_INTFLAG_CMP1 (_U_(1) << RTC_MODE1_INTFLAG_CMP1_Pos)
  621. #define RTC_MODE1_INTFLAG_CMP_Pos 0 /**< \brief (RTC_MODE1_INTFLAG) Compare x */
  622. #define RTC_MODE1_INTFLAG_CMP_Msk (_U_(0x3) << RTC_MODE1_INTFLAG_CMP_Pos)
  623. #define RTC_MODE1_INTFLAG_CMP(value) (RTC_MODE1_INTFLAG_CMP_Msk & ((value) << RTC_MODE1_INTFLAG_CMP_Pos))
  624. #define RTC_MODE1_INTFLAG_SYNCRDY_Pos 6 /**< \brief (RTC_MODE1_INTFLAG) Synchronization Ready */
  625. #define RTC_MODE1_INTFLAG_SYNCRDY (_U_(0x1) << RTC_MODE1_INTFLAG_SYNCRDY_Pos)
  626. #define RTC_MODE1_INTFLAG_OVF_Pos 7 /**< \brief (RTC_MODE1_INTFLAG) Overflow */
  627. #define RTC_MODE1_INTFLAG_OVF (_U_(0x1) << RTC_MODE1_INTFLAG_OVF_Pos)
  628. #define RTC_MODE1_INTFLAG_MASK _U_(0xC3) /**< \brief (RTC_MODE1_INTFLAG) MASK Register */
  629. /* -------- RTC_MODE2_INTFLAG : (RTC Offset: 0x08) (R/W 8) MODE2 MODE2 Interrupt Flag Status and Clear -------- */
  630. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  631. typedef union { // __I to avoid read-modify-write on write-to-clear register
  632. struct {
  633. __I uint8_t ALARM0:1; /*!< bit: 0 Alarm 0 */
  634. __I uint8_t :5; /*!< bit: 1.. 5 Reserved */
  635. __I uint8_t SYNCRDY:1; /*!< bit: 6 Synchronization Ready */
  636. __I uint8_t OVF:1; /*!< bit: 7 Overflow */
  637. } bit; /*!< Structure used for bit access */
  638. struct {
  639. __I uint8_t ALARM:1; /*!< bit: 0 Alarm x */
  640. __I uint8_t :7; /*!< bit: 1.. 7 Reserved */
  641. } vec; /*!< Structure used for vec access */
  642. uint8_t reg; /*!< Type used for register access */
  643. } RTC_MODE2_INTFLAG_Type;
  644. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  645. #define RTC_MODE2_INTFLAG_OFFSET 0x08 /**< \brief (RTC_MODE2_INTFLAG offset) MODE2 Interrupt Flag Status and Clear */
  646. #define RTC_MODE2_INTFLAG_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE2_INTFLAG reset_value) MODE2 Interrupt Flag Status and Clear */
  647. #define RTC_MODE2_INTFLAG_ALARM0_Pos 0 /**< \brief (RTC_MODE2_INTFLAG) Alarm 0 */
  648. #define RTC_MODE2_INTFLAG_ALARM0 (_U_(1) << RTC_MODE2_INTFLAG_ALARM0_Pos)
  649. #define RTC_MODE2_INTFLAG_ALARM_Pos 0 /**< \brief (RTC_MODE2_INTFLAG) Alarm x */
  650. #define RTC_MODE2_INTFLAG_ALARM_Msk (_U_(0x1) << RTC_MODE2_INTFLAG_ALARM_Pos)
  651. #define RTC_MODE2_INTFLAG_ALARM(value) (RTC_MODE2_INTFLAG_ALARM_Msk & ((value) << RTC_MODE2_INTFLAG_ALARM_Pos))
  652. #define RTC_MODE2_INTFLAG_SYNCRDY_Pos 6 /**< \brief (RTC_MODE2_INTFLAG) Synchronization Ready */
  653. #define RTC_MODE2_INTFLAG_SYNCRDY (_U_(0x1) << RTC_MODE2_INTFLAG_SYNCRDY_Pos)
  654. #define RTC_MODE2_INTFLAG_OVF_Pos 7 /**< \brief (RTC_MODE2_INTFLAG) Overflow */
  655. #define RTC_MODE2_INTFLAG_OVF (_U_(0x1) << RTC_MODE2_INTFLAG_OVF_Pos)
  656. #define RTC_MODE2_INTFLAG_MASK _U_(0xC1) /**< \brief (RTC_MODE2_INTFLAG) MASK Register */
  657. /* -------- RTC_STATUS : (RTC Offset: 0x0A) (R/W 8) Status -------- */
  658. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  659. typedef union {
  660. struct {
  661. uint8_t :7; /*!< bit: 0.. 6 Reserved */
  662. uint8_t SYNCBUSY:1; /*!< bit: 7 Synchronization Busy */
  663. } bit; /*!< Structure used for bit access */
  664. uint8_t reg; /*!< Type used for register access */
  665. } RTC_STATUS_Type;
  666. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  667. #define RTC_STATUS_OFFSET 0x0A /**< \brief (RTC_STATUS offset) Status */
  668. #define RTC_STATUS_RESETVALUE _U_(0x00) /**< \brief (RTC_STATUS reset_value) Status */
  669. #define RTC_STATUS_SYNCBUSY_Pos 7 /**< \brief (RTC_STATUS) Synchronization Busy */
  670. #define RTC_STATUS_SYNCBUSY (_U_(0x1) << RTC_STATUS_SYNCBUSY_Pos)
  671. #define RTC_STATUS_MASK _U_(0x80) /**< \brief (RTC_STATUS) MASK Register */
  672. /* -------- RTC_DBGCTRL : (RTC Offset: 0x0B) (R/W 8) Debug Control -------- */
  673. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  674. typedef union {
  675. struct {
  676. uint8_t DBGRUN:1; /*!< bit: 0 Run During Debug */
  677. uint8_t :7; /*!< bit: 1.. 7 Reserved */
  678. } bit; /*!< Structure used for bit access */
  679. uint8_t reg; /*!< Type used for register access */
  680. } RTC_DBGCTRL_Type;
  681. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  682. #define RTC_DBGCTRL_OFFSET 0x0B /**< \brief (RTC_DBGCTRL offset) Debug Control */
  683. #define RTC_DBGCTRL_RESETVALUE _U_(0x00) /**< \brief (RTC_DBGCTRL reset_value) Debug Control */
  684. #define RTC_DBGCTRL_DBGRUN_Pos 0 /**< \brief (RTC_DBGCTRL) Run During Debug */
  685. #define RTC_DBGCTRL_DBGRUN (_U_(0x1) << RTC_DBGCTRL_DBGRUN_Pos)
  686. #define RTC_DBGCTRL_MASK _U_(0x01) /**< \brief (RTC_DBGCTRL) MASK Register */
  687. /* -------- RTC_FREQCORR : (RTC Offset: 0x0C) (R/W 8) Frequency Correction -------- */
  688. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  689. typedef union {
  690. struct {
  691. uint8_t VALUE:7; /*!< bit: 0.. 6 Correction Value */
  692. uint8_t SIGN:1; /*!< bit: 7 Correction Sign */
  693. } bit; /*!< Structure used for bit access */
  694. uint8_t reg; /*!< Type used for register access */
  695. } RTC_FREQCORR_Type;
  696. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  697. #define RTC_FREQCORR_OFFSET 0x0C /**< \brief (RTC_FREQCORR offset) Frequency Correction */
  698. #define RTC_FREQCORR_RESETVALUE _U_(0x00) /**< \brief (RTC_FREQCORR reset_value) Frequency Correction */
  699. #define RTC_FREQCORR_VALUE_Pos 0 /**< \brief (RTC_FREQCORR) Correction Value */
  700. #define RTC_FREQCORR_VALUE_Msk (_U_(0x7F) << RTC_FREQCORR_VALUE_Pos)
  701. #define RTC_FREQCORR_VALUE(value) (RTC_FREQCORR_VALUE_Msk & ((value) << RTC_FREQCORR_VALUE_Pos))
  702. #define RTC_FREQCORR_SIGN_Pos 7 /**< \brief (RTC_FREQCORR) Correction Sign */
  703. #define RTC_FREQCORR_SIGN (_U_(0x1) << RTC_FREQCORR_SIGN_Pos)
  704. #define RTC_FREQCORR_MASK _U_(0xFF) /**< \brief (RTC_FREQCORR) MASK Register */
  705. /* -------- RTC_MODE0_COUNT : (RTC Offset: 0x10) (R/W 32) MODE0 MODE0 Counter Value -------- */
  706. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  707. typedef union {
  708. struct {
  709. uint32_t COUNT:32; /*!< bit: 0..31 Counter Value */
  710. } bit; /*!< Structure used for bit access */
  711. uint32_t reg; /*!< Type used for register access */
  712. } RTC_MODE0_COUNT_Type;
  713. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  714. #define RTC_MODE0_COUNT_OFFSET 0x10 /**< \brief (RTC_MODE0_COUNT offset) MODE0 Counter Value */
  715. #define RTC_MODE0_COUNT_RESETVALUE _U_(0x00000000) /**< \brief (RTC_MODE0_COUNT reset_value) MODE0 Counter Value */
  716. #define RTC_MODE0_COUNT_COUNT_Pos 0 /**< \brief (RTC_MODE0_COUNT) Counter Value */
  717. #define RTC_MODE0_COUNT_COUNT_Msk (_U_(0xFFFFFFFF) << RTC_MODE0_COUNT_COUNT_Pos)
  718. #define RTC_MODE0_COUNT_COUNT(value) (RTC_MODE0_COUNT_COUNT_Msk & ((value) << RTC_MODE0_COUNT_COUNT_Pos))
  719. #define RTC_MODE0_COUNT_MASK _U_(0xFFFFFFFF) /**< \brief (RTC_MODE0_COUNT) MASK Register */
  720. /* -------- RTC_MODE1_COUNT : (RTC Offset: 0x10) (R/W 16) MODE1 MODE1 Counter Value -------- */
  721. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  722. typedef union {
  723. struct {
  724. uint16_t COUNT:16; /*!< bit: 0..15 Counter Value */
  725. } bit; /*!< Structure used for bit access */
  726. uint16_t reg; /*!< Type used for register access */
  727. } RTC_MODE1_COUNT_Type;
  728. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  729. #define RTC_MODE1_COUNT_OFFSET 0x10 /**< \brief (RTC_MODE1_COUNT offset) MODE1 Counter Value */
  730. #define RTC_MODE1_COUNT_RESETVALUE _U_(0x0000) /**< \brief (RTC_MODE1_COUNT reset_value) MODE1 Counter Value */
  731. #define RTC_MODE1_COUNT_COUNT_Pos 0 /**< \brief (RTC_MODE1_COUNT) Counter Value */
  732. #define RTC_MODE1_COUNT_COUNT_Msk (_U_(0xFFFF) << RTC_MODE1_COUNT_COUNT_Pos)
  733. #define RTC_MODE1_COUNT_COUNT(value) (RTC_MODE1_COUNT_COUNT_Msk & ((value) << RTC_MODE1_COUNT_COUNT_Pos))
  734. #define RTC_MODE1_COUNT_MASK _U_(0xFFFF) /**< \brief (RTC_MODE1_COUNT) MASK Register */
  735. /* -------- RTC_MODE2_CLOCK : (RTC Offset: 0x10) (R/W 32) MODE2 MODE2 Clock Value -------- */
  736. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  737. typedef union {
  738. struct {
  739. uint32_t SECOND:6; /*!< bit: 0.. 5 Second */
  740. uint32_t MINUTE:6; /*!< bit: 6..11 Minute */
  741. uint32_t HOUR:5; /*!< bit: 12..16 Hour */
  742. uint32_t DAY:5; /*!< bit: 17..21 Day */
  743. uint32_t MONTH:4; /*!< bit: 22..25 Month */
  744. uint32_t YEAR:6; /*!< bit: 26..31 Year */
  745. } bit; /*!< Structure used for bit access */
  746. uint32_t reg; /*!< Type used for register access */
  747. } RTC_MODE2_CLOCK_Type;
  748. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  749. #define RTC_MODE2_CLOCK_OFFSET 0x10 /**< \brief (RTC_MODE2_CLOCK offset) MODE2 Clock Value */
  750. #define RTC_MODE2_CLOCK_RESETVALUE _U_(0x00000000) /**< \brief (RTC_MODE2_CLOCK reset_value) MODE2 Clock Value */
  751. #define RTC_MODE2_CLOCK_SECOND_Pos 0 /**< \brief (RTC_MODE2_CLOCK) Second */
  752. #define RTC_MODE2_CLOCK_SECOND_Msk (_U_(0x3F) << RTC_MODE2_CLOCK_SECOND_Pos)
  753. #define RTC_MODE2_CLOCK_SECOND(value) (RTC_MODE2_CLOCK_SECOND_Msk & ((value) << RTC_MODE2_CLOCK_SECOND_Pos))
  754. #define RTC_MODE2_CLOCK_MINUTE_Pos 6 /**< \brief (RTC_MODE2_CLOCK) Minute */
  755. #define RTC_MODE2_CLOCK_MINUTE_Msk (_U_(0x3F) << RTC_MODE2_CLOCK_MINUTE_Pos)
  756. #define RTC_MODE2_CLOCK_MINUTE(value) (RTC_MODE2_CLOCK_MINUTE_Msk & ((value) << RTC_MODE2_CLOCK_MINUTE_Pos))
  757. #define RTC_MODE2_CLOCK_HOUR_Pos 12 /**< \brief (RTC_MODE2_CLOCK) Hour */
  758. #define RTC_MODE2_CLOCK_HOUR_Msk (_U_(0x1F) << RTC_MODE2_CLOCK_HOUR_Pos)
  759. #define RTC_MODE2_CLOCK_HOUR(value) (RTC_MODE2_CLOCK_HOUR_Msk & ((value) << RTC_MODE2_CLOCK_HOUR_Pos))
  760. #define RTC_MODE2_CLOCK_HOUR_AM_Val _U_(0x0) /**< \brief (RTC_MODE2_CLOCK) AM when CLKREP in 12-hour */
  761. #define RTC_MODE2_CLOCK_HOUR_PM_Val _U_(0x10) /**< \brief (RTC_MODE2_CLOCK) PM when CLKREP in 12-hour */
  762. #define RTC_MODE2_CLOCK_HOUR_AM (RTC_MODE2_CLOCK_HOUR_AM_Val << RTC_MODE2_CLOCK_HOUR_Pos)
  763. #define RTC_MODE2_CLOCK_HOUR_PM (RTC_MODE2_CLOCK_HOUR_PM_Val << RTC_MODE2_CLOCK_HOUR_Pos)
  764. #define RTC_MODE2_CLOCK_DAY_Pos 17 /**< \brief (RTC_MODE2_CLOCK) Day */
  765. #define RTC_MODE2_CLOCK_DAY_Msk (_U_(0x1F) << RTC_MODE2_CLOCK_DAY_Pos)
  766. #define RTC_MODE2_CLOCK_DAY(value) (RTC_MODE2_CLOCK_DAY_Msk & ((value) << RTC_MODE2_CLOCK_DAY_Pos))
  767. #define RTC_MODE2_CLOCK_MONTH_Pos 22 /**< \brief (RTC_MODE2_CLOCK) Month */
  768. #define RTC_MODE2_CLOCK_MONTH_Msk (_U_(0xF) << RTC_MODE2_CLOCK_MONTH_Pos)
  769. #define RTC_MODE2_CLOCK_MONTH(value) (RTC_MODE2_CLOCK_MONTH_Msk & ((value) << RTC_MODE2_CLOCK_MONTH_Pos))
  770. #define RTC_MODE2_CLOCK_YEAR_Pos 26 /**< \brief (RTC_MODE2_CLOCK) Year */
  771. #define RTC_MODE2_CLOCK_YEAR_Msk (_U_(0x3F) << RTC_MODE2_CLOCK_YEAR_Pos)
  772. #define RTC_MODE2_CLOCK_YEAR(value) (RTC_MODE2_CLOCK_YEAR_Msk & ((value) << RTC_MODE2_CLOCK_YEAR_Pos))
  773. #define RTC_MODE2_CLOCK_MASK _U_(0xFFFFFFFF) /**< \brief (RTC_MODE2_CLOCK) MASK Register */
  774. /* -------- RTC_MODE1_PER : (RTC Offset: 0x14) (R/W 16) MODE1 MODE1 Counter Period -------- */
  775. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  776. typedef union {
  777. struct {
  778. uint16_t PER:16; /*!< bit: 0..15 Counter Period */
  779. } bit; /*!< Structure used for bit access */
  780. uint16_t reg; /*!< Type used for register access */
  781. } RTC_MODE1_PER_Type;
  782. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  783. #define RTC_MODE1_PER_OFFSET 0x14 /**< \brief (RTC_MODE1_PER offset) MODE1 Counter Period */
  784. #define RTC_MODE1_PER_RESETVALUE _U_(0x0000) /**< \brief (RTC_MODE1_PER reset_value) MODE1 Counter Period */
  785. #define RTC_MODE1_PER_PER_Pos 0 /**< \brief (RTC_MODE1_PER) Counter Period */
  786. #define RTC_MODE1_PER_PER_Msk (_U_(0xFFFF) << RTC_MODE1_PER_PER_Pos)
  787. #define RTC_MODE1_PER_PER(value) (RTC_MODE1_PER_PER_Msk & ((value) << RTC_MODE1_PER_PER_Pos))
  788. #define RTC_MODE1_PER_MASK _U_(0xFFFF) /**< \brief (RTC_MODE1_PER) MASK Register */
  789. /* -------- RTC_MODE0_COMP : (RTC Offset: 0x18) (R/W 32) MODE0 MODE0 Compare n Value -------- */
  790. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  791. typedef union {
  792. struct {
  793. uint32_t COMP:32; /*!< bit: 0..31 Compare Value */
  794. } bit; /*!< Structure used for bit access */
  795. uint32_t reg; /*!< Type used for register access */
  796. } RTC_MODE0_COMP_Type;
  797. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  798. #define RTC_MODE0_COMP_OFFSET 0x18 /**< \brief (RTC_MODE0_COMP offset) MODE0 Compare n Value */
  799. #define RTC_MODE0_COMP_RESETVALUE _U_(0x00000000) /**< \brief (RTC_MODE0_COMP reset_value) MODE0 Compare n Value */
  800. #define RTC_MODE0_COMP_COMP_Pos 0 /**< \brief (RTC_MODE0_COMP) Compare Value */
  801. #define RTC_MODE0_COMP_COMP_Msk (_U_(0xFFFFFFFF) << RTC_MODE0_COMP_COMP_Pos)
  802. #define RTC_MODE0_COMP_COMP(value) (RTC_MODE0_COMP_COMP_Msk & ((value) << RTC_MODE0_COMP_COMP_Pos))
  803. #define RTC_MODE0_COMP_MASK _U_(0xFFFFFFFF) /**< \brief (RTC_MODE0_COMP) MASK Register */
  804. /* -------- RTC_MODE1_COMP : (RTC Offset: 0x18) (R/W 16) MODE1 MODE1 Compare n Value -------- */
  805. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  806. typedef union {
  807. struct {
  808. uint16_t COMP:16; /*!< bit: 0..15 Compare Value */
  809. } bit; /*!< Structure used for bit access */
  810. uint16_t reg; /*!< Type used for register access */
  811. } RTC_MODE1_COMP_Type;
  812. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  813. #define RTC_MODE1_COMP_OFFSET 0x18 /**< \brief (RTC_MODE1_COMP offset) MODE1 Compare n Value */
  814. #define RTC_MODE1_COMP_RESETVALUE _U_(0x0000) /**< \brief (RTC_MODE1_COMP reset_value) MODE1 Compare n Value */
  815. #define RTC_MODE1_COMP_COMP_Pos 0 /**< \brief (RTC_MODE1_COMP) Compare Value */
  816. #define RTC_MODE1_COMP_COMP_Msk (_U_(0xFFFF) << RTC_MODE1_COMP_COMP_Pos)
  817. #define RTC_MODE1_COMP_COMP(value) (RTC_MODE1_COMP_COMP_Msk & ((value) << RTC_MODE1_COMP_COMP_Pos))
  818. #define RTC_MODE1_COMP_MASK _U_(0xFFFF) /**< \brief (RTC_MODE1_COMP) MASK Register */
  819. /* -------- RTC_MODE2_ALARM : (RTC Offset: 0x18) (R/W 32) MODE2 MODE2_ALARM Alarm n Value -------- */
  820. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  821. typedef union {
  822. struct {
  823. uint32_t SECOND:6; /*!< bit: 0.. 5 Second */
  824. uint32_t MINUTE:6; /*!< bit: 6..11 Minute */
  825. uint32_t HOUR:5; /*!< bit: 12..16 Hour */
  826. uint32_t DAY:5; /*!< bit: 17..21 Day */
  827. uint32_t MONTH:4; /*!< bit: 22..25 Month */
  828. uint32_t YEAR:6; /*!< bit: 26..31 Year */
  829. } bit; /*!< Structure used for bit access */
  830. uint32_t reg; /*!< Type used for register access */
  831. } RTC_MODE2_ALARM_Type;
  832. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  833. #define RTC_MODE2_ALARM_OFFSET 0x18 /**< \brief (RTC_MODE2_ALARM offset) MODE2_ALARM Alarm n Value */
  834. #define RTC_MODE2_ALARM_RESETVALUE _U_(0x00000000) /**< \brief (RTC_MODE2_ALARM reset_value) MODE2_ALARM Alarm n Value */
  835. #define RTC_MODE2_ALARM_SECOND_Pos 0 /**< \brief (RTC_MODE2_ALARM) Second */
  836. #define RTC_MODE2_ALARM_SECOND_Msk (_U_(0x3F) << RTC_MODE2_ALARM_SECOND_Pos)
  837. #define RTC_MODE2_ALARM_SECOND(value) (RTC_MODE2_ALARM_SECOND_Msk & ((value) << RTC_MODE2_ALARM_SECOND_Pos))
  838. #define RTC_MODE2_ALARM_MINUTE_Pos 6 /**< \brief (RTC_MODE2_ALARM) Minute */
  839. #define RTC_MODE2_ALARM_MINUTE_Msk (_U_(0x3F) << RTC_MODE2_ALARM_MINUTE_Pos)
  840. #define RTC_MODE2_ALARM_MINUTE(value) (RTC_MODE2_ALARM_MINUTE_Msk & ((value) << RTC_MODE2_ALARM_MINUTE_Pos))
  841. #define RTC_MODE2_ALARM_HOUR_Pos 12 /**< \brief (RTC_MODE2_ALARM) Hour */
  842. #define RTC_MODE2_ALARM_HOUR_Msk (_U_(0x1F) << RTC_MODE2_ALARM_HOUR_Pos)
  843. #define RTC_MODE2_ALARM_HOUR(value) (RTC_MODE2_ALARM_HOUR_Msk & ((value) << RTC_MODE2_ALARM_HOUR_Pos))
  844. #define RTC_MODE2_ALARM_HOUR_AM_Val _U_(0x0) /**< \brief (RTC_MODE2_ALARM) Morning hour */
  845. #define RTC_MODE2_ALARM_HOUR_PM_Val _U_(0x10) /**< \brief (RTC_MODE2_ALARM) Afternoon hour */
  846. #define RTC_MODE2_ALARM_HOUR_AM (RTC_MODE2_ALARM_HOUR_AM_Val << RTC_MODE2_ALARM_HOUR_Pos)
  847. #define RTC_MODE2_ALARM_HOUR_PM (RTC_MODE2_ALARM_HOUR_PM_Val << RTC_MODE2_ALARM_HOUR_Pos)
  848. #define RTC_MODE2_ALARM_DAY_Pos 17 /**< \brief (RTC_MODE2_ALARM) Day */
  849. #define RTC_MODE2_ALARM_DAY_Msk (_U_(0x1F) << RTC_MODE2_ALARM_DAY_Pos)
  850. #define RTC_MODE2_ALARM_DAY(value) (RTC_MODE2_ALARM_DAY_Msk & ((value) << RTC_MODE2_ALARM_DAY_Pos))
  851. #define RTC_MODE2_ALARM_MONTH_Pos 22 /**< \brief (RTC_MODE2_ALARM) Month */
  852. #define RTC_MODE2_ALARM_MONTH_Msk (_U_(0xF) << RTC_MODE2_ALARM_MONTH_Pos)
  853. #define RTC_MODE2_ALARM_MONTH(value) (RTC_MODE2_ALARM_MONTH_Msk & ((value) << RTC_MODE2_ALARM_MONTH_Pos))
  854. #define RTC_MODE2_ALARM_YEAR_Pos 26 /**< \brief (RTC_MODE2_ALARM) Year */
  855. #define RTC_MODE2_ALARM_YEAR_Msk (_U_(0x3F) << RTC_MODE2_ALARM_YEAR_Pos)
  856. #define RTC_MODE2_ALARM_YEAR(value) (RTC_MODE2_ALARM_YEAR_Msk & ((value) << RTC_MODE2_ALARM_YEAR_Pos))
  857. #define RTC_MODE2_ALARM_MASK _U_(0xFFFFFFFF) /**< \brief (RTC_MODE2_ALARM) MASK Register */
  858. /* -------- RTC_MODE2_MASK : (RTC Offset: 0x1C) (R/W 8) MODE2 MODE2_ALARM Alarm n Mask -------- */
  859. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  860. typedef union {
  861. struct {
  862. uint8_t SEL:3; /*!< bit: 0.. 2 Alarm Mask Selection */
  863. uint8_t :5; /*!< bit: 3.. 7 Reserved */
  864. } bit; /*!< Structure used for bit access */
  865. uint8_t reg; /*!< Type used for register access */
  866. } RTC_MODE2_MASK_Type;
  867. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  868. #define RTC_MODE2_MASK_OFFSET 0x1C /**< \brief (RTC_MODE2_MASK offset) MODE2_ALARM Alarm n Mask */
  869. #define RTC_MODE2_MASK_RESETVALUE _U_(0x00) /**< \brief (RTC_MODE2_MASK reset_value) MODE2_ALARM Alarm n Mask */
  870. #define RTC_MODE2_MASK_SEL_Pos 0 /**< \brief (RTC_MODE2_MASK) Alarm Mask Selection */
  871. #define RTC_MODE2_MASK_SEL_Msk (_U_(0x7) << RTC_MODE2_MASK_SEL_Pos)
  872. #define RTC_MODE2_MASK_SEL(value) (RTC_MODE2_MASK_SEL_Msk & ((value) << RTC_MODE2_MASK_SEL_Pos))
  873. #define RTC_MODE2_MASK_SEL_OFF_Val _U_(0x0) /**< \brief (RTC_MODE2_MASK) Alarm Disabled */
  874. #define RTC_MODE2_MASK_SEL_SS_Val _U_(0x1) /**< \brief (RTC_MODE2_MASK) Match seconds only */
  875. #define RTC_MODE2_MASK_SEL_MMSS_Val _U_(0x2) /**< \brief (RTC_MODE2_MASK) Match seconds and minutes only */
  876. #define RTC_MODE2_MASK_SEL_HHMMSS_Val _U_(0x3) /**< \brief (RTC_MODE2_MASK) Match seconds, minutes, and hours only */
  877. #define RTC_MODE2_MASK_SEL_DDHHMMSS_Val _U_(0x4) /**< \brief (RTC_MODE2_MASK) Match seconds, minutes, hours, and days only */
  878. #define RTC_MODE2_MASK_SEL_MMDDHHMMSS_Val _U_(0x5) /**< \brief (RTC_MODE2_MASK) Match seconds, minutes, hours, days, and months only */
  879. #define RTC_MODE2_MASK_SEL_YYMMDDHHMMSS_Val _U_(0x6) /**< \brief (RTC_MODE2_MASK) Match seconds, minutes, hours, days, months, and years */
  880. #define RTC_MODE2_MASK_SEL_OFF (RTC_MODE2_MASK_SEL_OFF_Val << RTC_MODE2_MASK_SEL_Pos)
  881. #define RTC_MODE2_MASK_SEL_SS (RTC_MODE2_MASK_SEL_SS_Val << RTC_MODE2_MASK_SEL_Pos)
  882. #define RTC_MODE2_MASK_SEL_MMSS (RTC_MODE2_MASK_SEL_MMSS_Val << RTC_MODE2_MASK_SEL_Pos)
  883. #define RTC_MODE2_MASK_SEL_HHMMSS (RTC_MODE2_MASK_SEL_HHMMSS_Val << RTC_MODE2_MASK_SEL_Pos)
  884. #define RTC_MODE2_MASK_SEL_DDHHMMSS (RTC_MODE2_MASK_SEL_DDHHMMSS_Val << RTC_MODE2_MASK_SEL_Pos)
  885. #define RTC_MODE2_MASK_SEL_MMDDHHMMSS (RTC_MODE2_MASK_SEL_MMDDHHMMSS_Val << RTC_MODE2_MASK_SEL_Pos)
  886. #define RTC_MODE2_MASK_SEL_YYMMDDHHMMSS (RTC_MODE2_MASK_SEL_YYMMDDHHMMSS_Val << RTC_MODE2_MASK_SEL_Pos)
  887. #define RTC_MODE2_MASK_MASK _U_(0x07) /**< \brief (RTC_MODE2_MASK) MASK Register */
  888. /** \brief RtcMode2Alarm hardware registers */
  889. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  890. typedef struct {
  891. __IO RTC_MODE2_ALARM_Type ALARM; /**< \brief Offset: 0x00 (R/W 32) MODE2_ALARM Alarm n Value */
  892. __IO RTC_MODE2_MASK_Type MASK; /**< \brief Offset: 0x04 (R/W 8) MODE2_ALARM Alarm n Mask */
  893. RoReg8 Reserved1[0x3];
  894. } RtcMode2Alarm;
  895. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  896. /** \brief RTC_MODE0 hardware registers */
  897. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  898. typedef struct { /* 32-bit Counter with Single 32-bit Compare */
  899. __IO RTC_MODE0_CTRL_Type CTRL; /**< \brief Offset: 0x00 (R/W 16) MODE0 Control */
  900. __IO RTC_READREQ_Type READREQ; /**< \brief Offset: 0x02 (R/W 16) Read Request */
  901. __IO RTC_MODE0_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x04 (R/W 16) MODE0 Event Control */
  902. __IO RTC_MODE0_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x06 (R/W 8) MODE0 Interrupt Enable Clear */
  903. __IO RTC_MODE0_INTENSET_Type INTENSET; /**< \brief Offset: 0x07 (R/W 8) MODE0 Interrupt Enable Set */
  904. __IO RTC_MODE0_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x08 (R/W 8) MODE0 Interrupt Flag Status and Clear */
  905. RoReg8 Reserved1[0x1];
  906. __IO RTC_STATUS_Type STATUS; /**< \brief Offset: 0x0A (R/W 8) Status */
  907. __IO RTC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x0B (R/W 8) Debug Control */
  908. __IO RTC_FREQCORR_Type FREQCORR; /**< \brief Offset: 0x0C (R/W 8) Frequency Correction */
  909. RoReg8 Reserved2[0x3];
  910. __IO RTC_MODE0_COUNT_Type COUNT; /**< \brief Offset: 0x10 (R/W 32) MODE0 Counter Value */
  911. RoReg8 Reserved3[0x4];
  912. __IO RTC_MODE0_COMP_Type COMP[1]; /**< \brief Offset: 0x18 (R/W 32) MODE0 Compare n Value */
  913. } RtcMode0;
  914. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  915. /** \brief RTC_MODE1 hardware registers */
  916. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  917. typedef struct { /* 16-bit Counter with Two 16-bit Compares */
  918. __IO RTC_MODE1_CTRL_Type CTRL; /**< \brief Offset: 0x00 (R/W 16) MODE1 Control */
  919. __IO RTC_READREQ_Type READREQ; /**< \brief Offset: 0x02 (R/W 16) Read Request */
  920. __IO RTC_MODE1_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x04 (R/W 16) MODE1 Event Control */
  921. __IO RTC_MODE1_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x06 (R/W 8) MODE1 Interrupt Enable Clear */
  922. __IO RTC_MODE1_INTENSET_Type INTENSET; /**< \brief Offset: 0x07 (R/W 8) MODE1 Interrupt Enable Set */
  923. __IO RTC_MODE1_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x08 (R/W 8) MODE1 Interrupt Flag Status and Clear */
  924. RoReg8 Reserved1[0x1];
  925. __IO RTC_STATUS_Type STATUS; /**< \brief Offset: 0x0A (R/W 8) Status */
  926. __IO RTC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x0B (R/W 8) Debug Control */
  927. __IO RTC_FREQCORR_Type FREQCORR; /**< \brief Offset: 0x0C (R/W 8) Frequency Correction */
  928. RoReg8 Reserved2[0x3];
  929. __IO RTC_MODE1_COUNT_Type COUNT; /**< \brief Offset: 0x10 (R/W 16) MODE1 Counter Value */
  930. RoReg8 Reserved3[0x2];
  931. __IO RTC_MODE1_PER_Type PER; /**< \brief Offset: 0x14 (R/W 16) MODE1 Counter Period */
  932. RoReg8 Reserved4[0x2];
  933. __IO RTC_MODE1_COMP_Type COMP[2]; /**< \brief Offset: 0x18 (R/W 16) MODE1 Compare n Value */
  934. } RtcMode1;
  935. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  936. /** \brief RTC_MODE2 hardware registers */
  937. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  938. typedef struct { /* Clock/Calendar with Alarm */
  939. __IO RTC_MODE2_CTRL_Type CTRL; /**< \brief Offset: 0x00 (R/W 16) MODE2 Control */
  940. __IO RTC_READREQ_Type READREQ; /**< \brief Offset: 0x02 (R/W 16) Read Request */
  941. __IO RTC_MODE2_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x04 (R/W 16) MODE2 Event Control */
  942. __IO RTC_MODE2_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x06 (R/W 8) MODE2 Interrupt Enable Clear */
  943. __IO RTC_MODE2_INTENSET_Type INTENSET; /**< \brief Offset: 0x07 (R/W 8) MODE2 Interrupt Enable Set */
  944. __IO RTC_MODE2_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x08 (R/W 8) MODE2 Interrupt Flag Status and Clear */
  945. RoReg8 Reserved1[0x1];
  946. __IO RTC_STATUS_Type STATUS; /**< \brief Offset: 0x0A (R/W 8) Status */
  947. __IO RTC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x0B (R/W 8) Debug Control */
  948. __IO RTC_FREQCORR_Type FREQCORR; /**< \brief Offset: 0x0C (R/W 8) Frequency Correction */
  949. RoReg8 Reserved2[0x3];
  950. __IO RTC_MODE2_CLOCK_Type CLOCK; /**< \brief Offset: 0x10 (R/W 32) MODE2 Clock Value */
  951. RoReg8 Reserved3[0x4];
  952. RtcMode2Alarm Mode2Alarm[1]; /**< \brief Offset: 0x18 RtcMode2Alarm groups [ALARM_NUM] */
  953. } RtcMode2;
  954. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  955. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  956. typedef union {
  957. RtcMode0 MODE0; /**< \brief Offset: 0x00 32-bit Counter with Single 32-bit Compare */
  958. RtcMode1 MODE1; /**< \brief Offset: 0x00 16-bit Counter with Two 16-bit Compares */
  959. RtcMode2 MODE2; /**< \brief Offset: 0x00 Clock/Calendar with Alarm */
  960. } Rtc;
  961. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  962. /*@}*/
  963. #endif /* _SAMD11_RTC_COMPONENT_ */