wdt.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. /**
  2. * \file
  3. *
  4. * \brief Component description for WDT
  5. *
  6. * Copyright (c) 2018 Microchip Technology Inc.
  7. *
  8. * \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");
  15. * you may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License 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,
  22. * WITHOUT 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. * \license_stop
  27. *
  28. */
  29. /* file generated from device description version 2018-05-30T11:07:17Z */
  30. #ifndef _SAML11_WDT_COMPONENT_H_
  31. #define _SAML11_WDT_COMPONENT_H_
  32. #define _SAML11_WDT_COMPONENT_ /**< \deprecated Backward compatibility for ASF */
  33. /** \addtogroup SAML_SAML11 Watchdog Timer
  34. * @{
  35. */
  36. /* ========================================================================== */
  37. /** SOFTWARE API DEFINITION FOR WDT */
  38. /* ========================================================================== */
  39. #define WDT_U2251 /**< (WDT) Module ID */
  40. #define REV_WDT 0x200 /**< (WDT) Module revision */
  41. /* -------- WDT_CTRLA : (WDT Offset: 0x00) (R/W 8) Control -------- */
  42. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  43. typedef union {
  44. struct {
  45. uint8_t :1; /**< bit: 0 Reserved */
  46. uint8_t ENABLE:1; /**< bit: 1 Enable */
  47. uint8_t WEN:1; /**< bit: 2 Watchdog Timer Window Mode Enable */
  48. uint8_t :3; /**< bit: 3..5 Reserved */
  49. uint8_t RUNSTDBY:1; /**< bit: 6 Run During Standby */
  50. uint8_t ALWAYSON:1; /**< bit: 7 Always-On */
  51. } bit; /**< Structure used for bit access */
  52. uint8_t reg; /**< Type used for register access */
  53. } WDT_CTRLA_Type;
  54. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  55. #define WDT_CTRLA_OFFSET (0x00) /**< (WDT_CTRLA) Control Offset */
  56. #define WDT_CTRLA_RESETVALUE _U_(0x00) /**< (WDT_CTRLA) Control Reset Value */
  57. #define WDT_CTRLA_ENABLE_Pos 1 /**< (WDT_CTRLA) Enable Position */
  58. #define WDT_CTRLA_ENABLE_Msk (_U_(0x1) << WDT_CTRLA_ENABLE_Pos) /**< (WDT_CTRLA) Enable Mask */
  59. #define WDT_CTRLA_ENABLE WDT_CTRLA_ENABLE_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_CTRLA_ENABLE_Msk instead */
  60. #define WDT_CTRLA_WEN_Pos 2 /**< (WDT_CTRLA) Watchdog Timer Window Mode Enable Position */
  61. #define WDT_CTRLA_WEN_Msk (_U_(0x1) << WDT_CTRLA_WEN_Pos) /**< (WDT_CTRLA) Watchdog Timer Window Mode Enable Mask */
  62. #define WDT_CTRLA_WEN WDT_CTRLA_WEN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_CTRLA_WEN_Msk instead */
  63. #define WDT_CTRLA_RUNSTDBY_Pos 6 /**< (WDT_CTRLA) Run During Standby Position */
  64. #define WDT_CTRLA_RUNSTDBY_Msk (_U_(0x1) << WDT_CTRLA_RUNSTDBY_Pos) /**< (WDT_CTRLA) Run During Standby Mask */
  65. #define WDT_CTRLA_RUNSTDBY WDT_CTRLA_RUNSTDBY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_CTRLA_RUNSTDBY_Msk instead */
  66. #define WDT_CTRLA_ALWAYSON_Pos 7 /**< (WDT_CTRLA) Always-On Position */
  67. #define WDT_CTRLA_ALWAYSON_Msk (_U_(0x1) << WDT_CTRLA_ALWAYSON_Pos) /**< (WDT_CTRLA) Always-On Mask */
  68. #define WDT_CTRLA_ALWAYSON WDT_CTRLA_ALWAYSON_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_CTRLA_ALWAYSON_Msk instead */
  69. #define WDT_CTRLA_MASK _U_(0xC6) /**< \deprecated (WDT_CTRLA) Register MASK (Use WDT_CTRLA_Msk instead) */
  70. #define WDT_CTRLA_Msk _U_(0xC6) /**< (WDT_CTRLA) Register Mask */
  71. /* -------- WDT_CONFIG : (WDT Offset: 0x01) (R/W 8) Configuration -------- */
  72. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  73. typedef union {
  74. struct {
  75. uint8_t PER:4; /**< bit: 0..3 Time-Out Period */
  76. uint8_t WINDOW:4; /**< bit: 4..7 Window Mode Time-Out Period */
  77. } bit; /**< Structure used for bit access */
  78. uint8_t reg; /**< Type used for register access */
  79. } WDT_CONFIG_Type;
  80. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  81. #define WDT_CONFIG_OFFSET (0x01) /**< (WDT_CONFIG) Configuration Offset */
  82. #define WDT_CONFIG_RESETVALUE _U_(0xBB) /**< (WDT_CONFIG) Configuration Reset Value */
  83. #define WDT_CONFIG_PER_Pos 0 /**< (WDT_CONFIG) Time-Out Period Position */
  84. #define WDT_CONFIG_PER_Msk (_U_(0xF) << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) Time-Out Period Mask */
  85. #define WDT_CONFIG_PER(value) (WDT_CONFIG_PER_Msk & ((value) << WDT_CONFIG_PER_Pos))
  86. #define WDT_CONFIG_PER_CYC8_Val _U_(0x0) /**< (WDT_CONFIG) 8 clock cycles */
  87. #define WDT_CONFIG_PER_CYC16_Val _U_(0x1) /**< (WDT_CONFIG) 16 clock cycles */
  88. #define WDT_CONFIG_PER_CYC32_Val _U_(0x2) /**< (WDT_CONFIG) 32 clock cycles */
  89. #define WDT_CONFIG_PER_CYC64_Val _U_(0x3) /**< (WDT_CONFIG) 64 clock cycles */
  90. #define WDT_CONFIG_PER_CYC128_Val _U_(0x4) /**< (WDT_CONFIG) 128 clock cycles */
  91. #define WDT_CONFIG_PER_CYC256_Val _U_(0x5) /**< (WDT_CONFIG) 256 clock cycles */
  92. #define WDT_CONFIG_PER_CYC512_Val _U_(0x6) /**< (WDT_CONFIG) 512 clock cycles */
  93. #define WDT_CONFIG_PER_CYC1024_Val _U_(0x7) /**< (WDT_CONFIG) 1024 clock cycles */
  94. #define WDT_CONFIG_PER_CYC2048_Val _U_(0x8) /**< (WDT_CONFIG) 2048 clock cycles */
  95. #define WDT_CONFIG_PER_CYC4096_Val _U_(0x9) /**< (WDT_CONFIG) 4096 clock cycles */
  96. #define WDT_CONFIG_PER_CYC8192_Val _U_(0xA) /**< (WDT_CONFIG) 8192 clock cycles */
  97. #define WDT_CONFIG_PER_CYC16384_Val _U_(0xB) /**< (WDT_CONFIG) 16384 clock cycles */
  98. #define WDT_CONFIG_PER_CYC8 (WDT_CONFIG_PER_CYC8_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 8 clock cycles Position */
  99. #define WDT_CONFIG_PER_CYC16 (WDT_CONFIG_PER_CYC16_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 16 clock cycles Position */
  100. #define WDT_CONFIG_PER_CYC32 (WDT_CONFIG_PER_CYC32_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 32 clock cycles Position */
  101. #define WDT_CONFIG_PER_CYC64 (WDT_CONFIG_PER_CYC64_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 64 clock cycles Position */
  102. #define WDT_CONFIG_PER_CYC128 (WDT_CONFIG_PER_CYC128_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 128 clock cycles Position */
  103. #define WDT_CONFIG_PER_CYC256 (WDT_CONFIG_PER_CYC256_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 256 clock cycles Position */
  104. #define WDT_CONFIG_PER_CYC512 (WDT_CONFIG_PER_CYC512_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 512 clock cycles Position */
  105. #define WDT_CONFIG_PER_CYC1024 (WDT_CONFIG_PER_CYC1024_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 1024 clock cycles Position */
  106. #define WDT_CONFIG_PER_CYC2048 (WDT_CONFIG_PER_CYC2048_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 2048 clock cycles Position */
  107. #define WDT_CONFIG_PER_CYC4096 (WDT_CONFIG_PER_CYC4096_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 4096 clock cycles Position */
  108. #define WDT_CONFIG_PER_CYC8192 (WDT_CONFIG_PER_CYC8192_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 8192 clock cycles Position */
  109. #define WDT_CONFIG_PER_CYC16384 (WDT_CONFIG_PER_CYC16384_Val << WDT_CONFIG_PER_Pos) /**< (WDT_CONFIG) 16384 clock cycles Position */
  110. #define WDT_CONFIG_WINDOW_Pos 4 /**< (WDT_CONFIG) Window Mode Time-Out Period Position */
  111. #define WDT_CONFIG_WINDOW_Msk (_U_(0xF) << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) Window Mode Time-Out Period Mask */
  112. #define WDT_CONFIG_WINDOW(value) (WDT_CONFIG_WINDOW_Msk & ((value) << WDT_CONFIG_WINDOW_Pos))
  113. #define WDT_CONFIG_WINDOW_CYC8_Val _U_(0x0) /**< (WDT_CONFIG) 8 clock cycles */
  114. #define WDT_CONFIG_WINDOW_CYC16_Val _U_(0x1) /**< (WDT_CONFIG) 16 clock cycles */
  115. #define WDT_CONFIG_WINDOW_CYC32_Val _U_(0x2) /**< (WDT_CONFIG) 32 clock cycles */
  116. #define WDT_CONFIG_WINDOW_CYC64_Val _U_(0x3) /**< (WDT_CONFIG) 64 clock cycles */
  117. #define WDT_CONFIG_WINDOW_CYC128_Val _U_(0x4) /**< (WDT_CONFIG) 128 clock cycles */
  118. #define WDT_CONFIG_WINDOW_CYC256_Val _U_(0x5) /**< (WDT_CONFIG) 256 clock cycles */
  119. #define WDT_CONFIG_WINDOW_CYC512_Val _U_(0x6) /**< (WDT_CONFIG) 512 clock cycles */
  120. #define WDT_CONFIG_WINDOW_CYC1024_Val _U_(0x7) /**< (WDT_CONFIG) 1024 clock cycles */
  121. #define WDT_CONFIG_WINDOW_CYC2048_Val _U_(0x8) /**< (WDT_CONFIG) 2048 clock cycles */
  122. #define WDT_CONFIG_WINDOW_CYC4096_Val _U_(0x9) /**< (WDT_CONFIG) 4096 clock cycles */
  123. #define WDT_CONFIG_WINDOW_CYC8192_Val _U_(0xA) /**< (WDT_CONFIG) 8192 clock cycles */
  124. #define WDT_CONFIG_WINDOW_CYC16384_Val _U_(0xB) /**< (WDT_CONFIG) 16384 clock cycles */
  125. #define WDT_CONFIG_WINDOW_CYC8 (WDT_CONFIG_WINDOW_CYC8_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 8 clock cycles Position */
  126. #define WDT_CONFIG_WINDOW_CYC16 (WDT_CONFIG_WINDOW_CYC16_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 16 clock cycles Position */
  127. #define WDT_CONFIG_WINDOW_CYC32 (WDT_CONFIG_WINDOW_CYC32_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 32 clock cycles Position */
  128. #define WDT_CONFIG_WINDOW_CYC64 (WDT_CONFIG_WINDOW_CYC64_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 64 clock cycles Position */
  129. #define WDT_CONFIG_WINDOW_CYC128 (WDT_CONFIG_WINDOW_CYC128_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 128 clock cycles Position */
  130. #define WDT_CONFIG_WINDOW_CYC256 (WDT_CONFIG_WINDOW_CYC256_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 256 clock cycles Position */
  131. #define WDT_CONFIG_WINDOW_CYC512 (WDT_CONFIG_WINDOW_CYC512_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 512 clock cycles Position */
  132. #define WDT_CONFIG_WINDOW_CYC1024 (WDT_CONFIG_WINDOW_CYC1024_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 1024 clock cycles Position */
  133. #define WDT_CONFIG_WINDOW_CYC2048 (WDT_CONFIG_WINDOW_CYC2048_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 2048 clock cycles Position */
  134. #define WDT_CONFIG_WINDOW_CYC4096 (WDT_CONFIG_WINDOW_CYC4096_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 4096 clock cycles Position */
  135. #define WDT_CONFIG_WINDOW_CYC8192 (WDT_CONFIG_WINDOW_CYC8192_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 8192 clock cycles Position */
  136. #define WDT_CONFIG_WINDOW_CYC16384 (WDT_CONFIG_WINDOW_CYC16384_Val << WDT_CONFIG_WINDOW_Pos) /**< (WDT_CONFIG) 16384 clock cycles Position */
  137. #define WDT_CONFIG_MASK _U_(0xFF) /**< \deprecated (WDT_CONFIG) Register MASK (Use WDT_CONFIG_Msk instead) */
  138. #define WDT_CONFIG_Msk _U_(0xFF) /**< (WDT_CONFIG) Register Mask */
  139. /* -------- WDT_EWCTRL : (WDT Offset: 0x02) (R/W 8) Early Warning Interrupt Control -------- */
  140. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  141. typedef union {
  142. struct {
  143. uint8_t EWOFFSET:4; /**< bit: 0..3 Early Warning Interrupt Time Offset */
  144. uint8_t :4; /**< bit: 4..7 Reserved */
  145. } bit; /**< Structure used for bit access */
  146. uint8_t reg; /**< Type used for register access */
  147. } WDT_EWCTRL_Type;
  148. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  149. #define WDT_EWCTRL_OFFSET (0x02) /**< (WDT_EWCTRL) Early Warning Interrupt Control Offset */
  150. #define WDT_EWCTRL_RESETVALUE _U_(0x0B) /**< (WDT_EWCTRL) Early Warning Interrupt Control Reset Value */
  151. #define WDT_EWCTRL_EWOFFSET_Pos 0 /**< (WDT_EWCTRL) Early Warning Interrupt Time Offset Position */
  152. #define WDT_EWCTRL_EWOFFSET_Msk (_U_(0xF) << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) Early Warning Interrupt Time Offset Mask */
  153. #define WDT_EWCTRL_EWOFFSET(value) (WDT_EWCTRL_EWOFFSET_Msk & ((value) << WDT_EWCTRL_EWOFFSET_Pos))
  154. #define WDT_EWCTRL_EWOFFSET_CYC8_Val _U_(0x0) /**< (WDT_EWCTRL) 8 clock cycles */
  155. #define WDT_EWCTRL_EWOFFSET_CYC16_Val _U_(0x1) /**< (WDT_EWCTRL) 16 clock cycles */
  156. #define WDT_EWCTRL_EWOFFSET_CYC32_Val _U_(0x2) /**< (WDT_EWCTRL) 32 clock cycles */
  157. #define WDT_EWCTRL_EWOFFSET_CYC64_Val _U_(0x3) /**< (WDT_EWCTRL) 64 clock cycles */
  158. #define WDT_EWCTRL_EWOFFSET_CYC128_Val _U_(0x4) /**< (WDT_EWCTRL) 128 clock cycles */
  159. #define WDT_EWCTRL_EWOFFSET_CYC256_Val _U_(0x5) /**< (WDT_EWCTRL) 256 clock cycles */
  160. #define WDT_EWCTRL_EWOFFSET_CYC512_Val _U_(0x6) /**< (WDT_EWCTRL) 512 clock cycles */
  161. #define WDT_EWCTRL_EWOFFSET_CYC1024_Val _U_(0x7) /**< (WDT_EWCTRL) 1024 clock cycles */
  162. #define WDT_EWCTRL_EWOFFSET_CYC2048_Val _U_(0x8) /**< (WDT_EWCTRL) 2048 clock cycles */
  163. #define WDT_EWCTRL_EWOFFSET_CYC4096_Val _U_(0x9) /**< (WDT_EWCTRL) 4096 clock cycles */
  164. #define WDT_EWCTRL_EWOFFSET_CYC8192_Val _U_(0xA) /**< (WDT_EWCTRL) 8192 clock cycles */
  165. #define WDT_EWCTRL_EWOFFSET_CYC16384_Val _U_(0xB) /**< (WDT_EWCTRL) 16384 clock cycles */
  166. #define WDT_EWCTRL_EWOFFSET_CYC8 (WDT_EWCTRL_EWOFFSET_CYC8_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 8 clock cycles Position */
  167. #define WDT_EWCTRL_EWOFFSET_CYC16 (WDT_EWCTRL_EWOFFSET_CYC16_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 16 clock cycles Position */
  168. #define WDT_EWCTRL_EWOFFSET_CYC32 (WDT_EWCTRL_EWOFFSET_CYC32_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 32 clock cycles Position */
  169. #define WDT_EWCTRL_EWOFFSET_CYC64 (WDT_EWCTRL_EWOFFSET_CYC64_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 64 clock cycles Position */
  170. #define WDT_EWCTRL_EWOFFSET_CYC128 (WDT_EWCTRL_EWOFFSET_CYC128_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 128 clock cycles Position */
  171. #define WDT_EWCTRL_EWOFFSET_CYC256 (WDT_EWCTRL_EWOFFSET_CYC256_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 256 clock cycles Position */
  172. #define WDT_EWCTRL_EWOFFSET_CYC512 (WDT_EWCTRL_EWOFFSET_CYC512_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 512 clock cycles Position */
  173. #define WDT_EWCTRL_EWOFFSET_CYC1024 (WDT_EWCTRL_EWOFFSET_CYC1024_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 1024 clock cycles Position */
  174. #define WDT_EWCTRL_EWOFFSET_CYC2048 (WDT_EWCTRL_EWOFFSET_CYC2048_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 2048 clock cycles Position */
  175. #define WDT_EWCTRL_EWOFFSET_CYC4096 (WDT_EWCTRL_EWOFFSET_CYC4096_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 4096 clock cycles Position */
  176. #define WDT_EWCTRL_EWOFFSET_CYC8192 (WDT_EWCTRL_EWOFFSET_CYC8192_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 8192 clock cycles Position */
  177. #define WDT_EWCTRL_EWOFFSET_CYC16384 (WDT_EWCTRL_EWOFFSET_CYC16384_Val << WDT_EWCTRL_EWOFFSET_Pos) /**< (WDT_EWCTRL) 16384 clock cycles Position */
  178. #define WDT_EWCTRL_MASK _U_(0x0F) /**< \deprecated (WDT_EWCTRL) Register MASK (Use WDT_EWCTRL_Msk instead) */
  179. #define WDT_EWCTRL_Msk _U_(0x0F) /**< (WDT_EWCTRL) Register Mask */
  180. /* -------- WDT_INTENCLR : (WDT Offset: 0x04) (R/W 8) Interrupt Enable Clear -------- */
  181. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  182. typedef union {
  183. struct {
  184. uint8_t EW:1; /**< bit: 0 Early Warning Interrupt Enable */
  185. uint8_t :7; /**< bit: 1..7 Reserved */
  186. } bit; /**< Structure used for bit access */
  187. uint8_t reg; /**< Type used for register access */
  188. } WDT_INTENCLR_Type;
  189. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  190. #define WDT_INTENCLR_OFFSET (0x04) /**< (WDT_INTENCLR) Interrupt Enable Clear Offset */
  191. #define WDT_INTENCLR_RESETVALUE _U_(0x00) /**< (WDT_INTENCLR) Interrupt Enable Clear Reset Value */
  192. #define WDT_INTENCLR_EW_Pos 0 /**< (WDT_INTENCLR) Early Warning Interrupt Enable Position */
  193. #define WDT_INTENCLR_EW_Msk (_U_(0x1) << WDT_INTENCLR_EW_Pos) /**< (WDT_INTENCLR) Early Warning Interrupt Enable Mask */
  194. #define WDT_INTENCLR_EW WDT_INTENCLR_EW_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_INTENCLR_EW_Msk instead */
  195. #define WDT_INTENCLR_MASK _U_(0x01) /**< \deprecated (WDT_INTENCLR) Register MASK (Use WDT_INTENCLR_Msk instead) */
  196. #define WDT_INTENCLR_Msk _U_(0x01) /**< (WDT_INTENCLR) Register Mask */
  197. /* -------- WDT_INTENSET : (WDT Offset: 0x05) (R/W 8) Interrupt Enable Set -------- */
  198. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  199. typedef union {
  200. struct {
  201. uint8_t EW:1; /**< bit: 0 Early Warning Interrupt Enable */
  202. uint8_t :7; /**< bit: 1..7 Reserved */
  203. } bit; /**< Structure used for bit access */
  204. uint8_t reg; /**< Type used for register access */
  205. } WDT_INTENSET_Type;
  206. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  207. #define WDT_INTENSET_OFFSET (0x05) /**< (WDT_INTENSET) Interrupt Enable Set Offset */
  208. #define WDT_INTENSET_RESETVALUE _U_(0x00) /**< (WDT_INTENSET) Interrupt Enable Set Reset Value */
  209. #define WDT_INTENSET_EW_Pos 0 /**< (WDT_INTENSET) Early Warning Interrupt Enable Position */
  210. #define WDT_INTENSET_EW_Msk (_U_(0x1) << WDT_INTENSET_EW_Pos) /**< (WDT_INTENSET) Early Warning Interrupt Enable Mask */
  211. #define WDT_INTENSET_EW WDT_INTENSET_EW_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_INTENSET_EW_Msk instead */
  212. #define WDT_INTENSET_MASK _U_(0x01) /**< \deprecated (WDT_INTENSET) Register MASK (Use WDT_INTENSET_Msk instead) */
  213. #define WDT_INTENSET_Msk _U_(0x01) /**< (WDT_INTENSET) Register Mask */
  214. /* -------- WDT_INTFLAG : (WDT Offset: 0x06) (R/W 8) Interrupt Flag Status and Clear -------- */
  215. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  216. typedef union { // __I to avoid read-modify-write on write-to-clear register
  217. struct {
  218. __I uint8_t EW:1; /**< bit: 0 Early Warning */
  219. __I uint8_t :7; /**< bit: 1..7 Reserved */
  220. } bit; /**< Structure used for bit access */
  221. uint8_t reg; /**< Type used for register access */
  222. } WDT_INTFLAG_Type;
  223. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  224. #define WDT_INTFLAG_OFFSET (0x06) /**< (WDT_INTFLAG) Interrupt Flag Status and Clear Offset */
  225. #define WDT_INTFLAG_RESETVALUE _U_(0x00) /**< (WDT_INTFLAG) Interrupt Flag Status and Clear Reset Value */
  226. #define WDT_INTFLAG_EW_Pos 0 /**< (WDT_INTFLAG) Early Warning Position */
  227. #define WDT_INTFLAG_EW_Msk (_U_(0x1) << WDT_INTFLAG_EW_Pos) /**< (WDT_INTFLAG) Early Warning Mask */
  228. #define WDT_INTFLAG_EW WDT_INTFLAG_EW_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_INTFLAG_EW_Msk instead */
  229. #define WDT_INTFLAG_MASK _U_(0x01) /**< \deprecated (WDT_INTFLAG) Register MASK (Use WDT_INTFLAG_Msk instead) */
  230. #define WDT_INTFLAG_Msk _U_(0x01) /**< (WDT_INTFLAG) Register Mask */
  231. /* -------- WDT_SYNCBUSY : (WDT Offset: 0x08) (R/ 32) Synchronization Busy -------- */
  232. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  233. typedef union {
  234. struct {
  235. uint32_t :1; /**< bit: 0 Reserved */
  236. uint32_t ENABLE:1; /**< bit: 1 Enable Synchronization Busy */
  237. uint32_t WEN:1; /**< bit: 2 Window Enable Synchronization Busy */
  238. uint32_t RUNSTDBY:1; /**< bit: 3 Run During Standby Synchronization Busy */
  239. uint32_t ALWAYSON:1; /**< bit: 4 Always-On Synchronization Busy */
  240. uint32_t CLEAR:1; /**< bit: 5 Clear Synchronization Busy */
  241. uint32_t :26; /**< bit: 6..31 Reserved */
  242. } bit; /**< Structure used for bit access */
  243. uint32_t reg; /**< Type used for register access */
  244. } WDT_SYNCBUSY_Type;
  245. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  246. #define WDT_SYNCBUSY_OFFSET (0x08) /**< (WDT_SYNCBUSY) Synchronization Busy Offset */
  247. #define WDT_SYNCBUSY_RESETVALUE _U_(0x00) /**< (WDT_SYNCBUSY) Synchronization Busy Reset Value */
  248. #define WDT_SYNCBUSY_ENABLE_Pos 1 /**< (WDT_SYNCBUSY) Enable Synchronization Busy Position */
  249. #define WDT_SYNCBUSY_ENABLE_Msk (_U_(0x1) << WDT_SYNCBUSY_ENABLE_Pos) /**< (WDT_SYNCBUSY) Enable Synchronization Busy Mask */
  250. #define WDT_SYNCBUSY_ENABLE WDT_SYNCBUSY_ENABLE_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_SYNCBUSY_ENABLE_Msk instead */
  251. #define WDT_SYNCBUSY_WEN_Pos 2 /**< (WDT_SYNCBUSY) Window Enable Synchronization Busy Position */
  252. #define WDT_SYNCBUSY_WEN_Msk (_U_(0x1) << WDT_SYNCBUSY_WEN_Pos) /**< (WDT_SYNCBUSY) Window Enable Synchronization Busy Mask */
  253. #define WDT_SYNCBUSY_WEN WDT_SYNCBUSY_WEN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_SYNCBUSY_WEN_Msk instead */
  254. #define WDT_SYNCBUSY_RUNSTDBY_Pos 3 /**< (WDT_SYNCBUSY) Run During Standby Synchronization Busy Position */
  255. #define WDT_SYNCBUSY_RUNSTDBY_Msk (_U_(0x1) << WDT_SYNCBUSY_RUNSTDBY_Pos) /**< (WDT_SYNCBUSY) Run During Standby Synchronization Busy Mask */
  256. #define WDT_SYNCBUSY_RUNSTDBY WDT_SYNCBUSY_RUNSTDBY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_SYNCBUSY_RUNSTDBY_Msk instead */
  257. #define WDT_SYNCBUSY_ALWAYSON_Pos 4 /**< (WDT_SYNCBUSY) Always-On Synchronization Busy Position */
  258. #define WDT_SYNCBUSY_ALWAYSON_Msk (_U_(0x1) << WDT_SYNCBUSY_ALWAYSON_Pos) /**< (WDT_SYNCBUSY) Always-On Synchronization Busy Mask */
  259. #define WDT_SYNCBUSY_ALWAYSON WDT_SYNCBUSY_ALWAYSON_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_SYNCBUSY_ALWAYSON_Msk instead */
  260. #define WDT_SYNCBUSY_CLEAR_Pos 5 /**< (WDT_SYNCBUSY) Clear Synchronization Busy Position */
  261. #define WDT_SYNCBUSY_CLEAR_Msk (_U_(0x1) << WDT_SYNCBUSY_CLEAR_Pos) /**< (WDT_SYNCBUSY) Clear Synchronization Busy Mask */
  262. #define WDT_SYNCBUSY_CLEAR WDT_SYNCBUSY_CLEAR_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use WDT_SYNCBUSY_CLEAR_Msk instead */
  263. #define WDT_SYNCBUSY_MASK _U_(0x3E) /**< \deprecated (WDT_SYNCBUSY) Register MASK (Use WDT_SYNCBUSY_Msk instead) */
  264. #define WDT_SYNCBUSY_Msk _U_(0x3E) /**< (WDT_SYNCBUSY) Register Mask */
  265. /* -------- WDT_CLEAR : (WDT Offset: 0x0c) (/W 8) Clear -------- */
  266. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  267. typedef union {
  268. struct {
  269. uint8_t CLEAR:8; /**< bit: 0..7 Watchdog Clear */
  270. } bit; /**< Structure used for bit access */
  271. uint8_t reg; /**< Type used for register access */
  272. } WDT_CLEAR_Type;
  273. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  274. #define WDT_CLEAR_OFFSET (0x0C) /**< (WDT_CLEAR) Clear Offset */
  275. #define WDT_CLEAR_RESETVALUE _U_(0x00) /**< (WDT_CLEAR) Clear Reset Value */
  276. #define WDT_CLEAR_CLEAR_Pos 0 /**< (WDT_CLEAR) Watchdog Clear Position */
  277. #define WDT_CLEAR_CLEAR_Msk (_U_(0xFF) << WDT_CLEAR_CLEAR_Pos) /**< (WDT_CLEAR) Watchdog Clear Mask */
  278. #define WDT_CLEAR_CLEAR(value) (WDT_CLEAR_CLEAR_Msk & ((value) << WDT_CLEAR_CLEAR_Pos))
  279. #define WDT_CLEAR_CLEAR_KEY_Val _U_(0xA5) /**< (WDT_CLEAR) Clear Key */
  280. #define WDT_CLEAR_CLEAR_KEY (WDT_CLEAR_CLEAR_KEY_Val << WDT_CLEAR_CLEAR_Pos) /**< (WDT_CLEAR) Clear Key Position */
  281. #define WDT_CLEAR_MASK _U_(0xFF) /**< \deprecated (WDT_CLEAR) Register MASK (Use WDT_CLEAR_Msk instead) */
  282. #define WDT_CLEAR_Msk _U_(0xFF) /**< (WDT_CLEAR) Register Mask */
  283. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  284. /** \brief WDT hardware registers */
  285. typedef struct { /* Watchdog Timer */
  286. __IO WDT_CTRLA_Type CTRLA; /**< Offset: 0x00 (R/W 8) Control */
  287. __IO WDT_CONFIG_Type CONFIG; /**< Offset: 0x01 (R/W 8) Configuration */
  288. __IO WDT_EWCTRL_Type EWCTRL; /**< Offset: 0x02 (R/W 8) Early Warning Interrupt Control */
  289. __I uint8_t Reserved1[1];
  290. __IO WDT_INTENCLR_Type INTENCLR; /**< Offset: 0x04 (R/W 8) Interrupt Enable Clear */
  291. __IO WDT_INTENSET_Type INTENSET; /**< Offset: 0x05 (R/W 8) Interrupt Enable Set */
  292. __IO WDT_INTFLAG_Type INTFLAG; /**< Offset: 0x06 (R/W 8) Interrupt Flag Status and Clear */
  293. __I uint8_t Reserved2[1];
  294. __I WDT_SYNCBUSY_Type SYNCBUSY; /**< Offset: 0x08 (R/ 32) Synchronization Busy */
  295. __O WDT_CLEAR_Type CLEAR; /**< Offset: 0x0C ( /W 8) Clear */
  296. } Wdt;
  297. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  298. /** @} end of Watchdog Timer */
  299. #endif /* _SAML11_WDT_COMPONENT_H_ */