pm.h 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. /**
  2. * \file
  3. *
  4. * \brief Component description for PM
  5. *
  6. * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions are met:
  14. *
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. *
  18. * 2. Redistributions in binary form must reproduce the above copyright notice,
  19. * this list of conditions and the following disclaimer in the documentation
  20. * and/or other materials provided with the distribution.
  21. *
  22. * 3. The name of Atmel may not be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * 4. This software may only be redistributed and used in connection with an
  26. * Atmel microcontroller product.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
  29. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  30. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  31. * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
  32. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  34. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  36. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  37. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. * POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. * \asf_license_stop
  41. *
  42. */
  43. /*
  44. * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
  45. */
  46. #ifndef _SAMD21_PM_COMPONENT_
  47. #define _SAMD21_PM_COMPONENT_
  48. /* ========================================================================== */
  49. /** SOFTWARE API DEFINITION FOR PM */
  50. /* ========================================================================== */
  51. /** \addtogroup SAMD21_PM Power Manager */
  52. /*@{*/
  53. #define PM_U2206
  54. #define REV_PM 0x211
  55. /* -------- PM_CTRL : (PM Offset: 0x00) (R/W 8) Control -------- */
  56. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  57. typedef union {
  58. uint8_t reg; /*!< Type used for register access */
  59. } PM_CTRL_Type;
  60. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  61. #define PM_CTRL_OFFSET 0x00 /**< \brief (PM_CTRL offset) Control */
  62. #define PM_CTRL_RESETVALUE 0x00ul /**< \brief (PM_CTRL reset_value) Control */
  63. #define PM_CTRL_MASK 0x00ul /**< \brief (PM_CTRL) MASK Register */
  64. /* -------- PM_SLEEP : (PM Offset: 0x01) (R/W 8) Sleep Mode -------- */
  65. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  66. typedef union {
  67. struct {
  68. uint8_t IDLE:2; /*!< bit: 0.. 1 Idle Mode Configuration */
  69. uint8_t :6; /*!< bit: 2.. 7 Reserved */
  70. } bit; /*!< Structure used for bit access */
  71. uint8_t reg; /*!< Type used for register access */
  72. } PM_SLEEP_Type;
  73. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  74. #define PM_SLEEP_OFFSET 0x01 /**< \brief (PM_SLEEP offset) Sleep Mode */
  75. #define PM_SLEEP_RESETVALUE 0x00ul /**< \brief (PM_SLEEP reset_value) Sleep Mode */
  76. #define PM_SLEEP_IDLE_Pos 0 /**< \brief (PM_SLEEP) Idle Mode Configuration */
  77. #define PM_SLEEP_IDLE_Msk (0x3ul << PM_SLEEP_IDLE_Pos)
  78. #define PM_SLEEP_IDLE(value) ((PM_SLEEP_IDLE_Msk & ((value) << PM_SLEEP_IDLE_Pos)))
  79. #define PM_SLEEP_IDLE_CPU_Val 0x0ul /**< \brief (PM_SLEEP) The CPU clock domain is stopped */
  80. #define PM_SLEEP_IDLE_AHB_Val 0x1ul /**< \brief (PM_SLEEP) The CPU and AHB clock domains are stopped */
  81. #define PM_SLEEP_IDLE_APB_Val 0x2ul /**< \brief (PM_SLEEP) The CPU, AHB and APB clock domains are stopped */
  82. #define PM_SLEEP_IDLE_CPU (PM_SLEEP_IDLE_CPU_Val << PM_SLEEP_IDLE_Pos)
  83. #define PM_SLEEP_IDLE_AHB (PM_SLEEP_IDLE_AHB_Val << PM_SLEEP_IDLE_Pos)
  84. #define PM_SLEEP_IDLE_APB (PM_SLEEP_IDLE_APB_Val << PM_SLEEP_IDLE_Pos)
  85. #define PM_SLEEP_MASK 0x03ul /**< \brief (PM_SLEEP) MASK Register */
  86. /* -------- PM_EXTCTRL : (PM Offset: 0x02) (R/W 8) External Reset Controller -------- */
  87. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  88. typedef union {
  89. struct {
  90. uint8_t SETDIS:1; /*!< bit: 0 External Reset Disable */
  91. uint8_t :7; /*!< bit: 1.. 7 Reserved */
  92. } bit; /*!< Structure used for bit access */
  93. uint8_t reg; /*!< Type used for register access */
  94. } PM_EXTCTRL_Type;
  95. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  96. #define PM_EXTCTRL_OFFSET 0x02 /**< \brief (PM_EXTCTRL offset) External Reset Controller */
  97. #define PM_EXTCTRL_RESETVALUE 0x00ul /**< \brief (PM_EXTCTRL reset_value) External Reset Controller */
  98. #define PM_EXTCTRL_SETDIS_Pos 0 /**< \brief (PM_EXTCTRL) External Reset Disable */
  99. #define PM_EXTCTRL_SETDIS (0x1ul << PM_EXTCTRL_SETDIS_Pos)
  100. #define PM_EXTCTRL_MASK 0x01ul /**< \brief (PM_EXTCTRL) MASK Register */
  101. /* -------- PM_CPUSEL : (PM Offset: 0x08) (R/W 8) CPU Clock Select -------- */
  102. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  103. typedef union {
  104. struct {
  105. uint8_t CPUDIV:3; /*!< bit: 0.. 2 CPU Prescaler Selection */
  106. uint8_t :5; /*!< bit: 3.. 7 Reserved */
  107. } bit; /*!< Structure used for bit access */
  108. uint8_t reg; /*!< Type used for register access */
  109. } PM_CPUSEL_Type;
  110. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  111. #define PM_CPUSEL_OFFSET 0x08 /**< \brief (PM_CPUSEL offset) CPU Clock Select */
  112. #define PM_CPUSEL_RESETVALUE 0x00ul /**< \brief (PM_CPUSEL reset_value) CPU Clock Select */
  113. #define PM_CPUSEL_CPUDIV_Pos 0 /**< \brief (PM_CPUSEL) CPU Prescaler Selection */
  114. #define PM_CPUSEL_CPUDIV_Msk (0x7ul << PM_CPUSEL_CPUDIV_Pos)
  115. #define PM_CPUSEL_CPUDIV(value) ((PM_CPUSEL_CPUDIV_Msk & ((value) << PM_CPUSEL_CPUDIV_Pos)))
  116. #define PM_CPUSEL_CPUDIV_DIV1_Val 0x0ul /**< \brief (PM_CPUSEL) Divide by 1 */
  117. #define PM_CPUSEL_CPUDIV_DIV2_Val 0x1ul /**< \brief (PM_CPUSEL) Divide by 2 */
  118. #define PM_CPUSEL_CPUDIV_DIV4_Val 0x2ul /**< \brief (PM_CPUSEL) Divide by 4 */
  119. #define PM_CPUSEL_CPUDIV_DIV8_Val 0x3ul /**< \brief (PM_CPUSEL) Divide by 8 */
  120. #define PM_CPUSEL_CPUDIV_DIV16_Val 0x4ul /**< \brief (PM_CPUSEL) Divide by 16 */
  121. #define PM_CPUSEL_CPUDIV_DIV32_Val 0x5ul /**< \brief (PM_CPUSEL) Divide by 32 */
  122. #define PM_CPUSEL_CPUDIV_DIV64_Val 0x6ul /**< \brief (PM_CPUSEL) Divide by 64 */
  123. #define PM_CPUSEL_CPUDIV_DIV128_Val 0x7ul /**< \brief (PM_CPUSEL) Divide by 128 */
  124. #define PM_CPUSEL_CPUDIV_DIV1 (PM_CPUSEL_CPUDIV_DIV1_Val << PM_CPUSEL_CPUDIV_Pos)
  125. #define PM_CPUSEL_CPUDIV_DIV2 (PM_CPUSEL_CPUDIV_DIV2_Val << PM_CPUSEL_CPUDIV_Pos)
  126. #define PM_CPUSEL_CPUDIV_DIV4 (PM_CPUSEL_CPUDIV_DIV4_Val << PM_CPUSEL_CPUDIV_Pos)
  127. #define PM_CPUSEL_CPUDIV_DIV8 (PM_CPUSEL_CPUDIV_DIV8_Val << PM_CPUSEL_CPUDIV_Pos)
  128. #define PM_CPUSEL_CPUDIV_DIV16 (PM_CPUSEL_CPUDIV_DIV16_Val << PM_CPUSEL_CPUDIV_Pos)
  129. #define PM_CPUSEL_CPUDIV_DIV32 (PM_CPUSEL_CPUDIV_DIV32_Val << PM_CPUSEL_CPUDIV_Pos)
  130. #define PM_CPUSEL_CPUDIV_DIV64 (PM_CPUSEL_CPUDIV_DIV64_Val << PM_CPUSEL_CPUDIV_Pos)
  131. #define PM_CPUSEL_CPUDIV_DIV128 (PM_CPUSEL_CPUDIV_DIV128_Val << PM_CPUSEL_CPUDIV_Pos)
  132. #define PM_CPUSEL_MASK 0x07ul /**< \brief (PM_CPUSEL) MASK Register */
  133. /* -------- PM_APBASEL : (PM Offset: 0x09) (R/W 8) APBA Clock Select -------- */
  134. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  135. typedef union {
  136. struct {
  137. uint8_t APBADIV:3; /*!< bit: 0.. 2 APBA Prescaler Selection */
  138. uint8_t :5; /*!< bit: 3.. 7 Reserved */
  139. } bit; /*!< Structure used for bit access */
  140. uint8_t reg; /*!< Type used for register access */
  141. } PM_APBASEL_Type;
  142. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  143. #define PM_APBASEL_OFFSET 0x09 /**< \brief (PM_APBASEL offset) APBA Clock Select */
  144. #define PM_APBASEL_RESETVALUE 0x00ul /**< \brief (PM_APBASEL reset_value) APBA Clock Select */
  145. #define PM_APBASEL_APBADIV_Pos 0 /**< \brief (PM_APBASEL) APBA Prescaler Selection */
  146. #define PM_APBASEL_APBADIV_Msk (0x7ul << PM_APBASEL_APBADIV_Pos)
  147. #define PM_APBASEL_APBADIV(value) ((PM_APBASEL_APBADIV_Msk & ((value) << PM_APBASEL_APBADIV_Pos)))
  148. #define PM_APBASEL_APBADIV_DIV1_Val 0x0ul /**< \brief (PM_APBASEL) Divide by 1 */
  149. #define PM_APBASEL_APBADIV_DIV2_Val 0x1ul /**< \brief (PM_APBASEL) Divide by 2 */
  150. #define PM_APBASEL_APBADIV_DIV4_Val 0x2ul /**< \brief (PM_APBASEL) Divide by 4 */
  151. #define PM_APBASEL_APBADIV_DIV8_Val 0x3ul /**< \brief (PM_APBASEL) Divide by 8 */
  152. #define PM_APBASEL_APBADIV_DIV16_Val 0x4ul /**< \brief (PM_APBASEL) Divide by 16 */
  153. #define PM_APBASEL_APBADIV_DIV32_Val 0x5ul /**< \brief (PM_APBASEL) Divide by 32 */
  154. #define PM_APBASEL_APBADIV_DIV64_Val 0x6ul /**< \brief (PM_APBASEL) Divide by 64 */
  155. #define PM_APBASEL_APBADIV_DIV128_Val 0x7ul /**< \brief (PM_APBASEL) Divide by 128 */
  156. #define PM_APBASEL_APBADIV_DIV1 (PM_APBASEL_APBADIV_DIV1_Val << PM_APBASEL_APBADIV_Pos)
  157. #define PM_APBASEL_APBADIV_DIV2 (PM_APBASEL_APBADIV_DIV2_Val << PM_APBASEL_APBADIV_Pos)
  158. #define PM_APBASEL_APBADIV_DIV4 (PM_APBASEL_APBADIV_DIV4_Val << PM_APBASEL_APBADIV_Pos)
  159. #define PM_APBASEL_APBADIV_DIV8 (PM_APBASEL_APBADIV_DIV8_Val << PM_APBASEL_APBADIV_Pos)
  160. #define PM_APBASEL_APBADIV_DIV16 (PM_APBASEL_APBADIV_DIV16_Val << PM_APBASEL_APBADIV_Pos)
  161. #define PM_APBASEL_APBADIV_DIV32 (PM_APBASEL_APBADIV_DIV32_Val << PM_APBASEL_APBADIV_Pos)
  162. #define PM_APBASEL_APBADIV_DIV64 (PM_APBASEL_APBADIV_DIV64_Val << PM_APBASEL_APBADIV_Pos)
  163. #define PM_APBASEL_APBADIV_DIV128 (PM_APBASEL_APBADIV_DIV128_Val << PM_APBASEL_APBADIV_Pos)
  164. #define PM_APBASEL_MASK 0x07ul /**< \brief (PM_APBASEL) MASK Register */
  165. /* -------- PM_APBBSEL : (PM Offset: 0x0A) (R/W 8) APBB Clock Select -------- */
  166. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  167. typedef union {
  168. struct {
  169. uint8_t APBBDIV:3; /*!< bit: 0.. 2 APBB Prescaler Selection */
  170. uint8_t :5; /*!< bit: 3.. 7 Reserved */
  171. } bit; /*!< Structure used for bit access */
  172. uint8_t reg; /*!< Type used for register access */
  173. } PM_APBBSEL_Type;
  174. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  175. #define PM_APBBSEL_OFFSET 0x0A /**< \brief (PM_APBBSEL offset) APBB Clock Select */
  176. #define PM_APBBSEL_RESETVALUE 0x00ul /**< \brief (PM_APBBSEL reset_value) APBB Clock Select */
  177. #define PM_APBBSEL_APBBDIV_Pos 0 /**< \brief (PM_APBBSEL) APBB Prescaler Selection */
  178. #define PM_APBBSEL_APBBDIV_Msk (0x7ul << PM_APBBSEL_APBBDIV_Pos)
  179. #define PM_APBBSEL_APBBDIV(value) ((PM_APBBSEL_APBBDIV_Msk & ((value) << PM_APBBSEL_APBBDIV_Pos)))
  180. #define PM_APBBSEL_APBBDIV_DIV1_Val 0x0ul /**< \brief (PM_APBBSEL) Divide by 1 */
  181. #define PM_APBBSEL_APBBDIV_DIV2_Val 0x1ul /**< \brief (PM_APBBSEL) Divide by 2 */
  182. #define PM_APBBSEL_APBBDIV_DIV4_Val 0x2ul /**< \brief (PM_APBBSEL) Divide by 4 */
  183. #define PM_APBBSEL_APBBDIV_DIV8_Val 0x3ul /**< \brief (PM_APBBSEL) Divide by 8 */
  184. #define PM_APBBSEL_APBBDIV_DIV16_Val 0x4ul /**< \brief (PM_APBBSEL) Divide by 16 */
  185. #define PM_APBBSEL_APBBDIV_DIV32_Val 0x5ul /**< \brief (PM_APBBSEL) Divide by 32 */
  186. #define PM_APBBSEL_APBBDIV_DIV64_Val 0x6ul /**< \brief (PM_APBBSEL) Divide by 64 */
  187. #define PM_APBBSEL_APBBDIV_DIV128_Val 0x7ul /**< \brief (PM_APBBSEL) Divide by 128 */
  188. #define PM_APBBSEL_APBBDIV_DIV1 (PM_APBBSEL_APBBDIV_DIV1_Val << PM_APBBSEL_APBBDIV_Pos)
  189. #define PM_APBBSEL_APBBDIV_DIV2 (PM_APBBSEL_APBBDIV_DIV2_Val << PM_APBBSEL_APBBDIV_Pos)
  190. #define PM_APBBSEL_APBBDIV_DIV4 (PM_APBBSEL_APBBDIV_DIV4_Val << PM_APBBSEL_APBBDIV_Pos)
  191. #define PM_APBBSEL_APBBDIV_DIV8 (PM_APBBSEL_APBBDIV_DIV8_Val << PM_APBBSEL_APBBDIV_Pos)
  192. #define PM_APBBSEL_APBBDIV_DIV16 (PM_APBBSEL_APBBDIV_DIV16_Val << PM_APBBSEL_APBBDIV_Pos)
  193. #define PM_APBBSEL_APBBDIV_DIV32 (PM_APBBSEL_APBBDIV_DIV32_Val << PM_APBBSEL_APBBDIV_Pos)
  194. #define PM_APBBSEL_APBBDIV_DIV64 (PM_APBBSEL_APBBDIV_DIV64_Val << PM_APBBSEL_APBBDIV_Pos)
  195. #define PM_APBBSEL_APBBDIV_DIV128 (PM_APBBSEL_APBBDIV_DIV128_Val << PM_APBBSEL_APBBDIV_Pos)
  196. #define PM_APBBSEL_MASK 0x07ul /**< \brief (PM_APBBSEL) MASK Register */
  197. /* -------- PM_APBCSEL : (PM Offset: 0x0B) (R/W 8) APBC Clock Select -------- */
  198. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  199. typedef union {
  200. struct {
  201. uint8_t APBCDIV:3; /*!< bit: 0.. 2 APBC Prescaler Selection */
  202. uint8_t :5; /*!< bit: 3.. 7 Reserved */
  203. } bit; /*!< Structure used for bit access */
  204. uint8_t reg; /*!< Type used for register access */
  205. } PM_APBCSEL_Type;
  206. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  207. #define PM_APBCSEL_OFFSET 0x0B /**< \brief (PM_APBCSEL offset) APBC Clock Select */
  208. #define PM_APBCSEL_RESETVALUE 0x00ul /**< \brief (PM_APBCSEL reset_value) APBC Clock Select */
  209. #define PM_APBCSEL_APBCDIV_Pos 0 /**< \brief (PM_APBCSEL) APBC Prescaler Selection */
  210. #define PM_APBCSEL_APBCDIV_Msk (0x7ul << PM_APBCSEL_APBCDIV_Pos)
  211. #define PM_APBCSEL_APBCDIV(value) ((PM_APBCSEL_APBCDIV_Msk & ((value) << PM_APBCSEL_APBCDIV_Pos)))
  212. #define PM_APBCSEL_APBCDIV_DIV1_Val 0x0ul /**< \brief (PM_APBCSEL) Divide by 1 */
  213. #define PM_APBCSEL_APBCDIV_DIV2_Val 0x1ul /**< \brief (PM_APBCSEL) Divide by 2 */
  214. #define PM_APBCSEL_APBCDIV_DIV4_Val 0x2ul /**< \brief (PM_APBCSEL) Divide by 4 */
  215. #define PM_APBCSEL_APBCDIV_DIV8_Val 0x3ul /**< \brief (PM_APBCSEL) Divide by 8 */
  216. #define PM_APBCSEL_APBCDIV_DIV16_Val 0x4ul /**< \brief (PM_APBCSEL) Divide by 16 */
  217. #define PM_APBCSEL_APBCDIV_DIV32_Val 0x5ul /**< \brief (PM_APBCSEL) Divide by 32 */
  218. #define PM_APBCSEL_APBCDIV_DIV64_Val 0x6ul /**< \brief (PM_APBCSEL) Divide by 64 */
  219. #define PM_APBCSEL_APBCDIV_DIV128_Val 0x7ul /**< \brief (PM_APBCSEL) Divide by 128 */
  220. #define PM_APBCSEL_APBCDIV_DIV1 (PM_APBCSEL_APBCDIV_DIV1_Val << PM_APBCSEL_APBCDIV_Pos)
  221. #define PM_APBCSEL_APBCDIV_DIV2 (PM_APBCSEL_APBCDIV_DIV2_Val << PM_APBCSEL_APBCDIV_Pos)
  222. #define PM_APBCSEL_APBCDIV_DIV4 (PM_APBCSEL_APBCDIV_DIV4_Val << PM_APBCSEL_APBCDIV_Pos)
  223. #define PM_APBCSEL_APBCDIV_DIV8 (PM_APBCSEL_APBCDIV_DIV8_Val << PM_APBCSEL_APBCDIV_Pos)
  224. #define PM_APBCSEL_APBCDIV_DIV16 (PM_APBCSEL_APBCDIV_DIV16_Val << PM_APBCSEL_APBCDIV_Pos)
  225. #define PM_APBCSEL_APBCDIV_DIV32 (PM_APBCSEL_APBCDIV_DIV32_Val << PM_APBCSEL_APBCDIV_Pos)
  226. #define PM_APBCSEL_APBCDIV_DIV64 (PM_APBCSEL_APBCDIV_DIV64_Val << PM_APBCSEL_APBCDIV_Pos)
  227. #define PM_APBCSEL_APBCDIV_DIV128 (PM_APBCSEL_APBCDIV_DIV128_Val << PM_APBCSEL_APBCDIV_Pos)
  228. #define PM_APBCSEL_MASK 0x07ul /**< \brief (PM_APBCSEL) MASK Register */
  229. /* -------- PM_AHBMASK : (PM Offset: 0x14) (R/W 32) AHB Mask -------- */
  230. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  231. typedef union {
  232. struct {
  233. uint32_t HPB0_:1; /*!< bit: 0 HPB0 AHB Clock Mask */
  234. uint32_t HPB1_:1; /*!< bit: 1 HPB1 AHB Clock Mask */
  235. uint32_t HPB2_:1; /*!< bit: 2 HPB2 AHB Clock Mask */
  236. uint32_t DSU_:1; /*!< bit: 3 DSU AHB Clock Mask */
  237. uint32_t NVMCTRL_:1; /*!< bit: 4 NVMCTRL AHB Clock Mask */
  238. uint32_t DMAC_:1; /*!< bit: 5 DMAC AHB Clock Mask */
  239. uint32_t USB_:1; /*!< bit: 6 USB AHB Clock Mask */
  240. uint32_t :25; /*!< bit: 7..31 Reserved */
  241. } bit; /*!< Structure used for bit access */
  242. uint32_t reg; /*!< Type used for register access */
  243. } PM_AHBMASK_Type;
  244. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  245. #define PM_AHBMASK_OFFSET 0x14 /**< \brief (PM_AHBMASK offset) AHB Mask */
  246. #define PM_AHBMASK_RESETVALUE 0x0000007Ful /**< \brief (PM_AHBMASK reset_value) AHB Mask */
  247. #define PM_AHBMASK_HPB0_Pos 0 /**< \brief (PM_AHBMASK) HPB0 AHB Clock Mask */
  248. #define PM_AHBMASK_HPB0 (0x1ul << PM_AHBMASK_HPB0_Pos)
  249. #define PM_AHBMASK_HPB1_Pos 1 /**< \brief (PM_AHBMASK) HPB1 AHB Clock Mask */
  250. #define PM_AHBMASK_HPB1 (0x1ul << PM_AHBMASK_HPB1_Pos)
  251. #define PM_AHBMASK_HPB2_Pos 2 /**< \brief (PM_AHBMASK) HPB2 AHB Clock Mask */
  252. #define PM_AHBMASK_HPB2 (0x1ul << PM_AHBMASK_HPB2_Pos)
  253. #define PM_AHBMASK_DSU_Pos 3 /**< \brief (PM_AHBMASK) DSU AHB Clock Mask */
  254. #define PM_AHBMASK_DSU (0x1ul << PM_AHBMASK_DSU_Pos)
  255. #define PM_AHBMASK_NVMCTRL_Pos 4 /**< \brief (PM_AHBMASK) NVMCTRL AHB Clock Mask */
  256. #define PM_AHBMASK_NVMCTRL (0x1ul << PM_AHBMASK_NVMCTRL_Pos)
  257. #define PM_AHBMASK_DMAC_Pos 5 /**< \brief (PM_AHBMASK) DMAC AHB Clock Mask */
  258. #define PM_AHBMASK_DMAC (0x1ul << PM_AHBMASK_DMAC_Pos)
  259. #define PM_AHBMASK_USB_Pos 6 /**< \brief (PM_AHBMASK) USB AHB Clock Mask */
  260. #define PM_AHBMASK_USB (0x1ul << PM_AHBMASK_USB_Pos)
  261. #define PM_AHBMASK_MASK 0x0000007Ful /**< \brief (PM_AHBMASK) MASK Register */
  262. /* -------- PM_APBAMASK : (PM Offset: 0x18) (R/W 32) APBA Mask -------- */
  263. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  264. typedef union {
  265. struct {
  266. uint32_t PAC0_:1; /*!< bit: 0 PAC0 APB Clock Enable */
  267. uint32_t PM_:1; /*!< bit: 1 PM APB Clock Enable */
  268. uint32_t SYSCTRL_:1; /*!< bit: 2 SYSCTRL APB Clock Enable */
  269. uint32_t GCLK_:1; /*!< bit: 3 GCLK APB Clock Enable */
  270. uint32_t WDT_:1; /*!< bit: 4 WDT APB Clock Enable */
  271. uint32_t RTC_:1; /*!< bit: 5 RTC APB Clock Enable */
  272. uint32_t EIC_:1; /*!< bit: 6 EIC APB Clock Enable */
  273. uint32_t :25; /*!< bit: 7..31 Reserved */
  274. } bit; /*!< Structure used for bit access */
  275. uint32_t reg; /*!< Type used for register access */
  276. } PM_APBAMASK_Type;
  277. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  278. #define PM_APBAMASK_OFFSET 0x18 /**< \brief (PM_APBAMASK offset) APBA Mask */
  279. #define PM_APBAMASK_RESETVALUE 0x0000007Ful /**< \brief (PM_APBAMASK reset_value) APBA Mask */
  280. #define PM_APBAMASK_PAC0_Pos 0 /**< \brief (PM_APBAMASK) PAC0 APB Clock Enable */
  281. #define PM_APBAMASK_PAC0 (0x1ul << PM_APBAMASK_PAC0_Pos)
  282. #define PM_APBAMASK_PM_Pos 1 /**< \brief (PM_APBAMASK) PM APB Clock Enable */
  283. #define PM_APBAMASK_PM (0x1ul << PM_APBAMASK_PM_Pos)
  284. #define PM_APBAMASK_SYSCTRL_Pos 2 /**< \brief (PM_APBAMASK) SYSCTRL APB Clock Enable */
  285. #define PM_APBAMASK_SYSCTRL (0x1ul << PM_APBAMASK_SYSCTRL_Pos)
  286. #define PM_APBAMASK_GCLK_Pos 3 /**< \brief (PM_APBAMASK) GCLK APB Clock Enable */
  287. #define PM_APBAMASK_GCLK (0x1ul << PM_APBAMASK_GCLK_Pos)
  288. #define PM_APBAMASK_WDT_Pos 4 /**< \brief (PM_APBAMASK) WDT APB Clock Enable */
  289. #define PM_APBAMASK_WDT (0x1ul << PM_APBAMASK_WDT_Pos)
  290. #define PM_APBAMASK_RTC_Pos 5 /**< \brief (PM_APBAMASK) RTC APB Clock Enable */
  291. #define PM_APBAMASK_RTC (0x1ul << PM_APBAMASK_RTC_Pos)
  292. #define PM_APBAMASK_EIC_Pos 6 /**< \brief (PM_APBAMASK) EIC APB Clock Enable */
  293. #define PM_APBAMASK_EIC (0x1ul << PM_APBAMASK_EIC_Pos)
  294. #define PM_APBAMASK_MASK 0x0000007Ful /**< \brief (PM_APBAMASK) MASK Register */
  295. /* -------- PM_APBBMASK : (PM Offset: 0x1C) (R/W 32) APBB Mask -------- */
  296. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  297. typedef union {
  298. struct {
  299. uint32_t PAC1_:1; /*!< bit: 0 PAC1 APB Clock Enable */
  300. uint32_t DSU_:1; /*!< bit: 1 DSU APB Clock Enable */
  301. uint32_t NVMCTRL_:1; /*!< bit: 2 NVMCTRL APB Clock Enable */
  302. uint32_t PORT_:1; /*!< bit: 3 PORT APB Clock Enable */
  303. uint32_t DMAC_:1; /*!< bit: 4 DMAC APB Clock Enable */
  304. uint32_t USB_:1; /*!< bit: 5 USB APB Clock Enable */
  305. uint32_t HMATRIX_:1; /*!< bit: 6 HMATRIX APB Clock Enable */
  306. uint32_t :25; /*!< bit: 7..31 Reserved */
  307. } bit; /*!< Structure used for bit access */
  308. uint32_t reg; /*!< Type used for register access */
  309. } PM_APBBMASK_Type;
  310. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  311. #define PM_APBBMASK_OFFSET 0x1C /**< \brief (PM_APBBMASK offset) APBB Mask */
  312. #define PM_APBBMASK_RESETVALUE 0x0000007Ful /**< \brief (PM_APBBMASK reset_value) APBB Mask */
  313. #define PM_APBBMASK_PAC1_Pos 0 /**< \brief (PM_APBBMASK) PAC1 APB Clock Enable */
  314. #define PM_APBBMASK_PAC1 (0x1ul << PM_APBBMASK_PAC1_Pos)
  315. #define PM_APBBMASK_DSU_Pos 1 /**< \brief (PM_APBBMASK) DSU APB Clock Enable */
  316. #define PM_APBBMASK_DSU (0x1ul << PM_APBBMASK_DSU_Pos)
  317. #define PM_APBBMASK_NVMCTRL_Pos 2 /**< \brief (PM_APBBMASK) NVMCTRL APB Clock Enable */
  318. #define PM_APBBMASK_NVMCTRL (0x1ul << PM_APBBMASK_NVMCTRL_Pos)
  319. #define PM_APBBMASK_PORT_Pos 3 /**< \brief (PM_APBBMASK) PORT APB Clock Enable */
  320. #define PM_APBBMASK_PORT (0x1ul << PM_APBBMASK_PORT_Pos)
  321. #define PM_APBBMASK_DMAC_Pos 4 /**< \brief (PM_APBBMASK) DMAC APB Clock Enable */
  322. #define PM_APBBMASK_DMAC (0x1ul << PM_APBBMASK_DMAC_Pos)
  323. #define PM_APBBMASK_USB_Pos 5 /**< \brief (PM_APBBMASK) USB APB Clock Enable */
  324. #define PM_APBBMASK_USB (0x1ul << PM_APBBMASK_USB_Pos)
  325. #define PM_APBBMASK_HMATRIX_Pos 6 /**< \brief (PM_APBBMASK) HMATRIX APB Clock Enable */
  326. #define PM_APBBMASK_HMATRIX (0x1ul << PM_APBBMASK_HMATRIX_Pos)
  327. #define PM_APBBMASK_MASK 0x0000007Ful /**< \brief (PM_APBBMASK) MASK Register */
  328. /* -------- PM_APBCMASK : (PM Offset: 0x20) (R/W 32) APBC Mask -------- */
  329. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  330. typedef union {
  331. struct {
  332. uint32_t PAC2_:1; /*!< bit: 0 PAC2 APB Clock Enable */
  333. uint32_t EVSYS_:1; /*!< bit: 1 EVSYS APB Clock Enable */
  334. uint32_t SERCOM0_:1; /*!< bit: 2 SERCOM0 APB Clock Enable */
  335. uint32_t SERCOM1_:1; /*!< bit: 3 SERCOM1 APB Clock Enable */
  336. uint32_t SERCOM2_:1; /*!< bit: 4 SERCOM2 APB Clock Enable */
  337. uint32_t SERCOM3_:1; /*!< bit: 5 SERCOM3 APB Clock Enable */
  338. uint32_t SERCOM4_:1; /*!< bit: 6 SERCOM4 APB Clock Enable */
  339. uint32_t SERCOM5_:1; /*!< bit: 7 SERCOM5 APB Clock Enable */
  340. uint32_t TCC0_:1; /*!< bit: 8 TCC0 APB Clock Enable */
  341. uint32_t TCC1_:1; /*!< bit: 9 TCC1 APB Clock Enable */
  342. uint32_t TCC2_:1; /*!< bit: 10 TCC2 APB Clock Enable */
  343. uint32_t TC3_:1; /*!< bit: 11 TC3 APB Clock Enable */
  344. uint32_t TC4_:1; /*!< bit: 12 TC4 APB Clock Enable */
  345. uint32_t TC5_:1; /*!< bit: 13 TC5 APB Clock Enable */
  346. uint32_t TC6_:1; /*!< bit: 14 TC6 APB Clock Enable */
  347. uint32_t TC7_:1; /*!< bit: 15 TC7 APB Clock Enable */
  348. uint32_t ADC_:1; /*!< bit: 16 ADC APB Clock Enable */
  349. uint32_t AC_:1; /*!< bit: 17 AC APB Clock Enable */
  350. uint32_t DAC_:1; /*!< bit: 18 DAC APB Clock Enable */
  351. uint32_t PTC_:1; /*!< bit: 19 PTC APB Clock Enable */
  352. uint32_t I2S_:1; /*!< bit: 20 I2S APB Clock Enable */
  353. uint32_t AC1_:1; /*!< bit: 21 AC1 APB Clock Enable */
  354. uint32_t LINCTRL_:1; /*!< bit: 22 LINCTRL APB Clock Enable */
  355. uint32_t :9; /*!< bit: 23..31 Reserved */
  356. } bit; /*!< Structure used for bit access */
  357. uint32_t reg; /*!< Type used for register access */
  358. } PM_APBCMASK_Type;
  359. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  360. #define PM_APBCMASK_OFFSET 0x20 /**< \brief (PM_APBCMASK offset) APBC Mask */
  361. #define PM_APBCMASK_RESETVALUE 0x00010000ul /**< \brief (PM_APBCMASK reset_value) APBC Mask */
  362. #define PM_APBCMASK_PAC2_Pos 0 /**< \brief (PM_APBCMASK) PAC2 APB Clock Enable */
  363. #define PM_APBCMASK_PAC2 (0x1ul << PM_APBCMASK_PAC2_Pos)
  364. #define PM_APBCMASK_EVSYS_Pos 1 /**< \brief (PM_APBCMASK) EVSYS APB Clock Enable */
  365. #define PM_APBCMASK_EVSYS (0x1ul << PM_APBCMASK_EVSYS_Pos)
  366. #define PM_APBCMASK_SERCOM0_Pos 2 /**< \brief (PM_APBCMASK) SERCOM0 APB Clock Enable */
  367. #define PM_APBCMASK_SERCOM0 (0x1ul << PM_APBCMASK_SERCOM0_Pos)
  368. #define PM_APBCMASK_SERCOM1_Pos 3 /**< \brief (PM_APBCMASK) SERCOM1 APB Clock Enable */
  369. #define PM_APBCMASK_SERCOM1 (0x1ul << PM_APBCMASK_SERCOM1_Pos)
  370. #define PM_APBCMASK_SERCOM2_Pos 4 /**< \brief (PM_APBCMASK) SERCOM2 APB Clock Enable */
  371. #define PM_APBCMASK_SERCOM2 (0x1ul << PM_APBCMASK_SERCOM2_Pos)
  372. #define PM_APBCMASK_SERCOM3_Pos 5 /**< \brief (PM_APBCMASK) SERCOM3 APB Clock Enable */
  373. #define PM_APBCMASK_SERCOM3 (0x1ul << PM_APBCMASK_SERCOM3_Pos)
  374. #define PM_APBCMASK_SERCOM4_Pos 6 /**< \brief (PM_APBCMASK) SERCOM4 APB Clock Enable */
  375. #define PM_APBCMASK_SERCOM4 (0x1ul << PM_APBCMASK_SERCOM4_Pos)
  376. #define PM_APBCMASK_SERCOM5_Pos 7 /**< \brief (PM_APBCMASK) SERCOM5 APB Clock Enable */
  377. #define PM_APBCMASK_SERCOM5 (0x1ul << PM_APBCMASK_SERCOM5_Pos)
  378. #define PM_APBCMASK_TCC0_Pos 8 /**< \brief (PM_APBCMASK) TCC0 APB Clock Enable */
  379. #define PM_APBCMASK_TCC0 (0x1ul << PM_APBCMASK_TCC0_Pos)
  380. #define PM_APBCMASK_TCC1_Pos 9 /**< \brief (PM_APBCMASK) TCC1 APB Clock Enable */
  381. #define PM_APBCMASK_TCC1 (0x1ul << PM_APBCMASK_TCC1_Pos)
  382. #define PM_APBCMASK_TCC2_Pos 10 /**< \brief (PM_APBCMASK) TCC2 APB Clock Enable */
  383. #define PM_APBCMASK_TCC2 (0x1ul << PM_APBCMASK_TCC2_Pos)
  384. #define PM_APBCMASK_TC3_Pos 11 /**< \brief (PM_APBCMASK) TC3 APB Clock Enable */
  385. #define PM_APBCMASK_TC3 (0x1ul << PM_APBCMASK_TC3_Pos)
  386. #define PM_APBCMASK_TC4_Pos 12 /**< \brief (PM_APBCMASK) TC4 APB Clock Enable */
  387. #define PM_APBCMASK_TC4 (0x1ul << PM_APBCMASK_TC4_Pos)
  388. #define PM_APBCMASK_TC5_Pos 13 /**< \brief (PM_APBCMASK) TC5 APB Clock Enable */
  389. #define PM_APBCMASK_TC5 (0x1ul << PM_APBCMASK_TC5_Pos)
  390. #define PM_APBCMASK_TC6_Pos 14 /**< \brief (PM_APBCMASK) TC6 APB Clock Enable */
  391. #define PM_APBCMASK_TC6 (0x1ul << PM_APBCMASK_TC6_Pos)
  392. #define PM_APBCMASK_TC7_Pos 15 /**< \brief (PM_APBCMASK) TC7 APB Clock Enable */
  393. #define PM_APBCMASK_TC7 (0x1ul << PM_APBCMASK_TC7_Pos)
  394. #define PM_APBCMASK_ADC_Pos 16 /**< \brief (PM_APBCMASK) ADC APB Clock Enable */
  395. #define PM_APBCMASK_ADC (0x1ul << PM_APBCMASK_ADC_Pos)
  396. #define PM_APBCMASK_AC_Pos 17 /**< \brief (PM_APBCMASK) AC APB Clock Enable */
  397. #define PM_APBCMASK_AC (0x1ul << PM_APBCMASK_AC_Pos)
  398. #define PM_APBCMASK_DAC_Pos 18 /**< \brief (PM_APBCMASK) DAC APB Clock Enable */
  399. #define PM_APBCMASK_DAC (0x1ul << PM_APBCMASK_DAC_Pos)
  400. #define PM_APBCMASK_PTC_Pos 19 /**< \brief (PM_APBCMASK) PTC APB Clock Enable */
  401. #define PM_APBCMASK_PTC (0x1ul << PM_APBCMASK_PTC_Pos)
  402. #define PM_APBCMASK_I2S_Pos 20 /**< \brief (PM_APBCMASK) I2S APB Clock Enable */
  403. #define PM_APBCMASK_I2S (0x1ul << PM_APBCMASK_I2S_Pos)
  404. #define PM_APBCMASK_AC1_Pos 21 /**< \brief (PM_APBCMASK) AC1 APB Clock Enable */
  405. #define PM_APBCMASK_AC1 (0x1ul << PM_APBCMASK_AC1_Pos)
  406. #define PM_APBCMASK_LINCTRL_Pos 22 /**< \brief (PM_APBCMASK) LINCTRL APB Clock Enable */
  407. #define PM_APBCMASK_LINCTRL (0x1ul << PM_APBCMASK_LINCTRL_Pos)
  408. #define PM_APBCMASK_MASK 0x007FFFFFul /**< \brief (PM_APBCMASK) MASK Register */
  409. /* -------- PM_INTENCLR : (PM Offset: 0x34) (R/W 8) Interrupt Enable Clear -------- */
  410. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  411. typedef union {
  412. struct {
  413. uint8_t CKRDY:1; /*!< bit: 0 Clock Ready Interrupt Enable */
  414. uint8_t :7; /*!< bit: 1.. 7 Reserved */
  415. } bit; /*!< Structure used for bit access */
  416. uint8_t reg; /*!< Type used for register access */
  417. } PM_INTENCLR_Type;
  418. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  419. #define PM_INTENCLR_OFFSET 0x34 /**< \brief (PM_INTENCLR offset) Interrupt Enable Clear */
  420. #define PM_INTENCLR_RESETVALUE 0x00ul /**< \brief (PM_INTENCLR reset_value) Interrupt Enable Clear */
  421. #define PM_INTENCLR_CKRDY_Pos 0 /**< \brief (PM_INTENCLR) Clock Ready Interrupt Enable */
  422. #define PM_INTENCLR_CKRDY (0x1ul << PM_INTENCLR_CKRDY_Pos)
  423. #define PM_INTENCLR_MASK 0x01ul /**< \brief (PM_INTENCLR) MASK Register */
  424. /* -------- PM_INTENSET : (PM Offset: 0x35) (R/W 8) Interrupt Enable Set -------- */
  425. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  426. typedef union {
  427. struct {
  428. uint8_t CKRDY:1; /*!< bit: 0 Clock Ready Interrupt Enable */
  429. uint8_t :7; /*!< bit: 1.. 7 Reserved */
  430. } bit; /*!< Structure used for bit access */
  431. uint8_t reg; /*!< Type used for register access */
  432. } PM_INTENSET_Type;
  433. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  434. #define PM_INTENSET_OFFSET 0x35 /**< \brief (PM_INTENSET offset) Interrupt Enable Set */
  435. #define PM_INTENSET_RESETVALUE 0x00ul /**< \brief (PM_INTENSET reset_value) Interrupt Enable Set */
  436. #define PM_INTENSET_CKRDY_Pos 0 /**< \brief (PM_INTENSET) Clock Ready Interrupt Enable */
  437. #define PM_INTENSET_CKRDY (0x1ul << PM_INTENSET_CKRDY_Pos)
  438. #define PM_INTENSET_MASK 0x01ul /**< \brief (PM_INTENSET) MASK Register */
  439. /* -------- PM_INTFLAG : (PM Offset: 0x36) (R/W 8) Interrupt Flag Status and Clear -------- */
  440. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  441. typedef union {
  442. struct {
  443. uint8_t CKRDY:1; /*!< bit: 0 Clock Ready */
  444. uint8_t :7; /*!< bit: 1.. 7 Reserved */
  445. } bit; /*!< Structure used for bit access */
  446. uint8_t reg; /*!< Type used for register access */
  447. } PM_INTFLAG_Type;
  448. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  449. #define PM_INTFLAG_OFFSET 0x36 /**< \brief (PM_INTFLAG offset) Interrupt Flag Status and Clear */
  450. #define PM_INTFLAG_RESETVALUE 0x00ul /**< \brief (PM_INTFLAG reset_value) Interrupt Flag Status and Clear */
  451. #define PM_INTFLAG_CKRDY_Pos 0 /**< \brief (PM_INTFLAG) Clock Ready */
  452. #define PM_INTFLAG_CKRDY (0x1ul << PM_INTFLAG_CKRDY_Pos)
  453. #define PM_INTFLAG_MASK 0x01ul /**< \brief (PM_INTFLAG) MASK Register */
  454. /* -------- PM_RCAUSE : (PM Offset: 0x38) (R/ 8) Reset Cause -------- */
  455. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  456. typedef union {
  457. struct {
  458. uint8_t POR:1; /*!< bit: 0 Power On Reset */
  459. uint8_t BOD12:1; /*!< bit: 1 Brown Out 12 Detector Reset */
  460. uint8_t BOD33:1; /*!< bit: 2 Brown Out 33 Detector Reset */
  461. uint8_t :1; /*!< bit: 3 Reserved */
  462. uint8_t EXT:1; /*!< bit: 4 External Reset */
  463. uint8_t WDT:1; /*!< bit: 5 Watchdog Reset */
  464. uint8_t SYST:1; /*!< bit: 6 System Reset Request */
  465. uint8_t :1; /*!< bit: 7 Reserved */
  466. } bit; /*!< Structure used for bit access */
  467. uint8_t reg; /*!< Type used for register access */
  468. } PM_RCAUSE_Type;
  469. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  470. #define PM_RCAUSE_OFFSET 0x38 /**< \brief (PM_RCAUSE offset) Reset Cause */
  471. #define PM_RCAUSE_RESETVALUE 0x01ul /**< \brief (PM_RCAUSE reset_value) Reset Cause */
  472. #define PM_RCAUSE_POR_Pos 0 /**< \brief (PM_RCAUSE) Power On Reset */
  473. #define PM_RCAUSE_POR (0x1ul << PM_RCAUSE_POR_Pos)
  474. #define PM_RCAUSE_BOD12_Pos 1 /**< \brief (PM_RCAUSE) Brown Out 12 Detector Reset */
  475. #define PM_RCAUSE_BOD12 (0x1ul << PM_RCAUSE_BOD12_Pos)
  476. #define PM_RCAUSE_BOD33_Pos 2 /**< \brief (PM_RCAUSE) Brown Out 33 Detector Reset */
  477. #define PM_RCAUSE_BOD33 (0x1ul << PM_RCAUSE_BOD33_Pos)
  478. #define PM_RCAUSE_EXT_Pos 4 /**< \brief (PM_RCAUSE) External Reset */
  479. #define PM_RCAUSE_EXT (0x1ul << PM_RCAUSE_EXT_Pos)
  480. #define PM_RCAUSE_WDT_Pos 5 /**< \brief (PM_RCAUSE) Watchdog Reset */
  481. #define PM_RCAUSE_WDT (0x1ul << PM_RCAUSE_WDT_Pos)
  482. #define PM_RCAUSE_SYST_Pos 6 /**< \brief (PM_RCAUSE) System Reset Request */
  483. #define PM_RCAUSE_SYST (0x1ul << PM_RCAUSE_SYST_Pos)
  484. #define PM_RCAUSE_MASK 0x77ul /**< \brief (PM_RCAUSE) MASK Register */
  485. /** \brief PM hardware registers */
  486. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  487. typedef struct {
  488. __IO PM_CTRL_Type CTRL; /**< \brief Offset: 0x00 (R/W 8) Control */
  489. __IO PM_SLEEP_Type SLEEP; /**< \brief Offset: 0x01 (R/W 8) Sleep Mode */
  490. __IO PM_EXTCTRL_Type EXTCTRL; /**< \brief Offset: 0x02 (R/W 8) External Reset Controller */
  491. RoReg8 Reserved1[0x5];
  492. __IO PM_CPUSEL_Type CPUSEL; /**< \brief Offset: 0x08 (R/W 8) CPU Clock Select */
  493. __IO PM_APBASEL_Type APBASEL; /**< \brief Offset: 0x09 (R/W 8) APBA Clock Select */
  494. __IO PM_APBBSEL_Type APBBSEL; /**< \brief Offset: 0x0A (R/W 8) APBB Clock Select */
  495. __IO PM_APBCSEL_Type APBCSEL; /**< \brief Offset: 0x0B (R/W 8) APBC Clock Select */
  496. RoReg8 Reserved2[0x8];
  497. __IO PM_AHBMASK_Type AHBMASK; /**< \brief Offset: 0x14 (R/W 32) AHB Mask */
  498. __IO PM_APBAMASK_Type APBAMASK; /**< \brief Offset: 0x18 (R/W 32) APBA Mask */
  499. __IO PM_APBBMASK_Type APBBMASK; /**< \brief Offset: 0x1C (R/W 32) APBB Mask */
  500. __IO PM_APBCMASK_Type APBCMASK; /**< \brief Offset: 0x20 (R/W 32) APBC Mask */
  501. RoReg8 Reserved3[0x10];
  502. __IO PM_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x34 (R/W 8) Interrupt Enable Clear */
  503. __IO PM_INTENSET_Type INTENSET; /**< \brief Offset: 0x35 (R/W 8) Interrupt Enable Set */
  504. __IO PM_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x36 (R/W 8) Interrupt Flag Status and Clear */
  505. RoReg8 Reserved4[0x1];
  506. __I PM_RCAUSE_Type RCAUSE; /**< \brief Offset: 0x38 (R/ 8) Reset Cause */
  507. } Pm;
  508. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  509. /*@}*/
  510. #endif /* _SAMD21_PM_COMPONENT_ */