pm.h 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. /**
  2. * \brief Component description for PM
  3. *
  4. * Copyright (c) 2021 Microchip Technology Inc. and its subsidiaries.
  5. *
  6. * Subject to your compliance with these terms, you may use Microchip software and any derivatives
  7. * exclusively with Microchip products. It is your responsibility to comply with third party license
  8. * terms applicable to your use of third party software (including open source software) that may
  9. * accompany Microchip software.
  10. *
  11. * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY,
  12. * APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND
  13. * FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
  16. * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
  17. * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
  18. * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT
  19. * EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
  20. *
  21. */
  22. /* file generated from device description version 2019-11-25T06:52:33Z */
  23. #ifndef _SAMD21_PM_COMPONENT_H_
  24. #define _SAMD21_PM_COMPONENT_H_
  25. /* ************************************************************************** */
  26. /* SOFTWARE API DEFINITION FOR PM */
  27. /* ************************************************************************** */
  28. /* -------- PM_CTRL : (PM Offset: 0x00) (R/W 8) Control -------- */
  29. #define PM_CTRL_RESETVALUE _U_(0x00) /**< (PM_CTRL) Control Reset Value */
  30. #define PM_CTRL_Msk _U_(0x00) /**< (PM_CTRL) Register Mask */
  31. /* -------- PM_SLEEP : (PM Offset: 0x01) (R/W 8) Sleep Mode -------- */
  32. #define PM_SLEEP_RESETVALUE _U_(0x00) /**< (PM_SLEEP) Sleep Mode Reset Value */
  33. #define PM_SLEEP_IDLE_Pos _U_(0) /**< (PM_SLEEP) Idle Mode Configuration Position */
  34. #define PM_SLEEP_IDLE_Msk (_U_(0x3) << PM_SLEEP_IDLE_Pos) /**< (PM_SLEEP) Idle Mode Configuration Mask */
  35. #define PM_SLEEP_IDLE(value) (PM_SLEEP_IDLE_Msk & ((value) << PM_SLEEP_IDLE_Pos))
  36. #define PM_SLEEP_IDLE_CPU_Val _U_(0x0) /**< (PM_SLEEP) The CPU clock domain is stopped */
  37. #define PM_SLEEP_IDLE_AHB_Val _U_(0x1) /**< (PM_SLEEP) The CPU and AHB clock domains are stopped */
  38. #define PM_SLEEP_IDLE_APB_Val _U_(0x2) /**< (PM_SLEEP) The CPU, AHB and APB clock domains are stopped */
  39. #define PM_SLEEP_IDLE_CPU (PM_SLEEP_IDLE_CPU_Val << PM_SLEEP_IDLE_Pos) /**< (PM_SLEEP) The CPU clock domain is stopped Position */
  40. #define PM_SLEEP_IDLE_AHB (PM_SLEEP_IDLE_AHB_Val << PM_SLEEP_IDLE_Pos) /**< (PM_SLEEP) The CPU and AHB clock domains are stopped Position */
  41. #define PM_SLEEP_IDLE_APB (PM_SLEEP_IDLE_APB_Val << PM_SLEEP_IDLE_Pos) /**< (PM_SLEEP) The CPU, AHB and APB clock domains are stopped Position */
  42. #define PM_SLEEP_Msk _U_(0x03) /**< (PM_SLEEP) Register Mask */
  43. /* -------- PM_CPUSEL : (PM Offset: 0x08) (R/W 8) CPU Clock Select -------- */
  44. #define PM_CPUSEL_RESETVALUE _U_(0x00) /**< (PM_CPUSEL) CPU Clock Select Reset Value */
  45. #define PM_CPUSEL_CPUDIV_Pos _U_(0) /**< (PM_CPUSEL) CPU Prescaler Selection Position */
  46. #define PM_CPUSEL_CPUDIV_Msk (_U_(0x7) << PM_CPUSEL_CPUDIV_Pos) /**< (PM_CPUSEL) CPU Prescaler Selection Mask */
  47. #define PM_CPUSEL_CPUDIV(value) (PM_CPUSEL_CPUDIV_Msk & ((value) << PM_CPUSEL_CPUDIV_Pos))
  48. #define PM_CPUSEL_CPUDIV_DIV1_Val _U_(0x0) /**< (PM_CPUSEL) Divide by 1 */
  49. #define PM_CPUSEL_CPUDIV_DIV2_Val _U_(0x1) /**< (PM_CPUSEL) Divide by 2 */
  50. #define PM_CPUSEL_CPUDIV_DIV4_Val _U_(0x2) /**< (PM_CPUSEL) Divide by 4 */
  51. #define PM_CPUSEL_CPUDIV_DIV8_Val _U_(0x3) /**< (PM_CPUSEL) Divide by 8 */
  52. #define PM_CPUSEL_CPUDIV_DIV16_Val _U_(0x4) /**< (PM_CPUSEL) Divide by 16 */
  53. #define PM_CPUSEL_CPUDIV_DIV32_Val _U_(0x5) /**< (PM_CPUSEL) Divide by 32 */
  54. #define PM_CPUSEL_CPUDIV_DIV64_Val _U_(0x6) /**< (PM_CPUSEL) Divide by 64 */
  55. #define PM_CPUSEL_CPUDIV_DIV128_Val _U_(0x7) /**< (PM_CPUSEL) Divide by 128 */
  56. #define PM_CPUSEL_CPUDIV_DIV1 (PM_CPUSEL_CPUDIV_DIV1_Val << PM_CPUSEL_CPUDIV_Pos) /**< (PM_CPUSEL) Divide by 1 Position */
  57. #define PM_CPUSEL_CPUDIV_DIV2 (PM_CPUSEL_CPUDIV_DIV2_Val << PM_CPUSEL_CPUDIV_Pos) /**< (PM_CPUSEL) Divide by 2 Position */
  58. #define PM_CPUSEL_CPUDIV_DIV4 (PM_CPUSEL_CPUDIV_DIV4_Val << PM_CPUSEL_CPUDIV_Pos) /**< (PM_CPUSEL) Divide by 4 Position */
  59. #define PM_CPUSEL_CPUDIV_DIV8 (PM_CPUSEL_CPUDIV_DIV8_Val << PM_CPUSEL_CPUDIV_Pos) /**< (PM_CPUSEL) Divide by 8 Position */
  60. #define PM_CPUSEL_CPUDIV_DIV16 (PM_CPUSEL_CPUDIV_DIV16_Val << PM_CPUSEL_CPUDIV_Pos) /**< (PM_CPUSEL) Divide by 16 Position */
  61. #define PM_CPUSEL_CPUDIV_DIV32 (PM_CPUSEL_CPUDIV_DIV32_Val << PM_CPUSEL_CPUDIV_Pos) /**< (PM_CPUSEL) Divide by 32 Position */
  62. #define PM_CPUSEL_CPUDIV_DIV64 (PM_CPUSEL_CPUDIV_DIV64_Val << PM_CPUSEL_CPUDIV_Pos) /**< (PM_CPUSEL) Divide by 64 Position */
  63. #define PM_CPUSEL_CPUDIV_DIV128 (PM_CPUSEL_CPUDIV_DIV128_Val << PM_CPUSEL_CPUDIV_Pos) /**< (PM_CPUSEL) Divide by 128 Position */
  64. #define PM_CPUSEL_Msk _U_(0x07) /**< (PM_CPUSEL) Register Mask */
  65. /* -------- PM_APBASEL : (PM Offset: 0x09) (R/W 8) APBA Clock Select -------- */
  66. #define PM_APBASEL_RESETVALUE _U_(0x00) /**< (PM_APBASEL) APBA Clock Select Reset Value */
  67. #define PM_APBASEL_APBADIV_Pos _U_(0) /**< (PM_APBASEL) APBA Prescaler Selection Position */
  68. #define PM_APBASEL_APBADIV_Msk (_U_(0x7) << PM_APBASEL_APBADIV_Pos) /**< (PM_APBASEL) APBA Prescaler Selection Mask */
  69. #define PM_APBASEL_APBADIV(value) (PM_APBASEL_APBADIV_Msk & ((value) << PM_APBASEL_APBADIV_Pos))
  70. #define PM_APBASEL_APBADIV_DIV1_Val _U_(0x0) /**< (PM_APBASEL) Divide by 1 */
  71. #define PM_APBASEL_APBADIV_DIV2_Val _U_(0x1) /**< (PM_APBASEL) Divide by 2 */
  72. #define PM_APBASEL_APBADIV_DIV4_Val _U_(0x2) /**< (PM_APBASEL) Divide by 4 */
  73. #define PM_APBASEL_APBADIV_DIV8_Val _U_(0x3) /**< (PM_APBASEL) Divide by 8 */
  74. #define PM_APBASEL_APBADIV_DIV16_Val _U_(0x4) /**< (PM_APBASEL) Divide by 16 */
  75. #define PM_APBASEL_APBADIV_DIV32_Val _U_(0x5) /**< (PM_APBASEL) Divide by 32 */
  76. #define PM_APBASEL_APBADIV_DIV64_Val _U_(0x6) /**< (PM_APBASEL) Divide by 64 */
  77. #define PM_APBASEL_APBADIV_DIV128_Val _U_(0x7) /**< (PM_APBASEL) Divide by 128 */
  78. #define PM_APBASEL_APBADIV_DIV1 (PM_APBASEL_APBADIV_DIV1_Val << PM_APBASEL_APBADIV_Pos) /**< (PM_APBASEL) Divide by 1 Position */
  79. #define PM_APBASEL_APBADIV_DIV2 (PM_APBASEL_APBADIV_DIV2_Val << PM_APBASEL_APBADIV_Pos) /**< (PM_APBASEL) Divide by 2 Position */
  80. #define PM_APBASEL_APBADIV_DIV4 (PM_APBASEL_APBADIV_DIV4_Val << PM_APBASEL_APBADIV_Pos) /**< (PM_APBASEL) Divide by 4 Position */
  81. #define PM_APBASEL_APBADIV_DIV8 (PM_APBASEL_APBADIV_DIV8_Val << PM_APBASEL_APBADIV_Pos) /**< (PM_APBASEL) Divide by 8 Position */
  82. #define PM_APBASEL_APBADIV_DIV16 (PM_APBASEL_APBADIV_DIV16_Val << PM_APBASEL_APBADIV_Pos) /**< (PM_APBASEL) Divide by 16 Position */
  83. #define PM_APBASEL_APBADIV_DIV32 (PM_APBASEL_APBADIV_DIV32_Val << PM_APBASEL_APBADIV_Pos) /**< (PM_APBASEL) Divide by 32 Position */
  84. #define PM_APBASEL_APBADIV_DIV64 (PM_APBASEL_APBADIV_DIV64_Val << PM_APBASEL_APBADIV_Pos) /**< (PM_APBASEL) Divide by 64 Position */
  85. #define PM_APBASEL_APBADIV_DIV128 (PM_APBASEL_APBADIV_DIV128_Val << PM_APBASEL_APBADIV_Pos) /**< (PM_APBASEL) Divide by 128 Position */
  86. #define PM_APBASEL_Msk _U_(0x07) /**< (PM_APBASEL) Register Mask */
  87. /* -------- PM_APBBSEL : (PM Offset: 0x0A) (R/W 8) APBB Clock Select -------- */
  88. #define PM_APBBSEL_RESETVALUE _U_(0x00) /**< (PM_APBBSEL) APBB Clock Select Reset Value */
  89. #define PM_APBBSEL_APBBDIV_Pos _U_(0) /**< (PM_APBBSEL) APBB Prescaler Selection Position */
  90. #define PM_APBBSEL_APBBDIV_Msk (_U_(0x7) << PM_APBBSEL_APBBDIV_Pos) /**< (PM_APBBSEL) APBB Prescaler Selection Mask */
  91. #define PM_APBBSEL_APBBDIV(value) (PM_APBBSEL_APBBDIV_Msk & ((value) << PM_APBBSEL_APBBDIV_Pos))
  92. #define PM_APBBSEL_APBBDIV_DIV1_Val _U_(0x0) /**< (PM_APBBSEL) Divide by 1 */
  93. #define PM_APBBSEL_APBBDIV_DIV2_Val _U_(0x1) /**< (PM_APBBSEL) Divide by 2 */
  94. #define PM_APBBSEL_APBBDIV_DIV4_Val _U_(0x2) /**< (PM_APBBSEL) Divide by 4 */
  95. #define PM_APBBSEL_APBBDIV_DIV8_Val _U_(0x3) /**< (PM_APBBSEL) Divide by 8 */
  96. #define PM_APBBSEL_APBBDIV_DIV16_Val _U_(0x4) /**< (PM_APBBSEL) Divide by 16 */
  97. #define PM_APBBSEL_APBBDIV_DIV32_Val _U_(0x5) /**< (PM_APBBSEL) Divide by 32 */
  98. #define PM_APBBSEL_APBBDIV_DIV64_Val _U_(0x6) /**< (PM_APBBSEL) Divide by 64 */
  99. #define PM_APBBSEL_APBBDIV_DIV128_Val _U_(0x7) /**< (PM_APBBSEL) Divide by 128 */
  100. #define PM_APBBSEL_APBBDIV_DIV1 (PM_APBBSEL_APBBDIV_DIV1_Val << PM_APBBSEL_APBBDIV_Pos) /**< (PM_APBBSEL) Divide by 1 Position */
  101. #define PM_APBBSEL_APBBDIV_DIV2 (PM_APBBSEL_APBBDIV_DIV2_Val << PM_APBBSEL_APBBDIV_Pos) /**< (PM_APBBSEL) Divide by 2 Position */
  102. #define PM_APBBSEL_APBBDIV_DIV4 (PM_APBBSEL_APBBDIV_DIV4_Val << PM_APBBSEL_APBBDIV_Pos) /**< (PM_APBBSEL) Divide by 4 Position */
  103. #define PM_APBBSEL_APBBDIV_DIV8 (PM_APBBSEL_APBBDIV_DIV8_Val << PM_APBBSEL_APBBDIV_Pos) /**< (PM_APBBSEL) Divide by 8 Position */
  104. #define PM_APBBSEL_APBBDIV_DIV16 (PM_APBBSEL_APBBDIV_DIV16_Val << PM_APBBSEL_APBBDIV_Pos) /**< (PM_APBBSEL) Divide by 16 Position */
  105. #define PM_APBBSEL_APBBDIV_DIV32 (PM_APBBSEL_APBBDIV_DIV32_Val << PM_APBBSEL_APBBDIV_Pos) /**< (PM_APBBSEL) Divide by 32 Position */
  106. #define PM_APBBSEL_APBBDIV_DIV64 (PM_APBBSEL_APBBDIV_DIV64_Val << PM_APBBSEL_APBBDIV_Pos) /**< (PM_APBBSEL) Divide by 64 Position */
  107. #define PM_APBBSEL_APBBDIV_DIV128 (PM_APBBSEL_APBBDIV_DIV128_Val << PM_APBBSEL_APBBDIV_Pos) /**< (PM_APBBSEL) Divide by 128 Position */
  108. #define PM_APBBSEL_Msk _U_(0x07) /**< (PM_APBBSEL) Register Mask */
  109. /* -------- PM_APBCSEL : (PM Offset: 0x0B) (R/W 8) APBC Clock Select -------- */
  110. #define PM_APBCSEL_RESETVALUE _U_(0x00) /**< (PM_APBCSEL) APBC Clock Select Reset Value */
  111. #define PM_APBCSEL_APBCDIV_Pos _U_(0) /**< (PM_APBCSEL) APBC Prescaler Selection Position */
  112. #define PM_APBCSEL_APBCDIV_Msk (_U_(0x7) << PM_APBCSEL_APBCDIV_Pos) /**< (PM_APBCSEL) APBC Prescaler Selection Mask */
  113. #define PM_APBCSEL_APBCDIV(value) (PM_APBCSEL_APBCDIV_Msk & ((value) << PM_APBCSEL_APBCDIV_Pos))
  114. #define PM_APBCSEL_APBCDIV_DIV1_Val _U_(0x0) /**< (PM_APBCSEL) Divide by 1 */
  115. #define PM_APBCSEL_APBCDIV_DIV2_Val _U_(0x1) /**< (PM_APBCSEL) Divide by 2 */
  116. #define PM_APBCSEL_APBCDIV_DIV4_Val _U_(0x2) /**< (PM_APBCSEL) Divide by 4 */
  117. #define PM_APBCSEL_APBCDIV_DIV8_Val _U_(0x3) /**< (PM_APBCSEL) Divide by 8 */
  118. #define PM_APBCSEL_APBCDIV_DIV16_Val _U_(0x4) /**< (PM_APBCSEL) Divide by 16 */
  119. #define PM_APBCSEL_APBCDIV_DIV32_Val _U_(0x5) /**< (PM_APBCSEL) Divide by 32 */
  120. #define PM_APBCSEL_APBCDIV_DIV64_Val _U_(0x6) /**< (PM_APBCSEL) Divide by 64 */
  121. #define PM_APBCSEL_APBCDIV_DIV128_Val _U_(0x7) /**< (PM_APBCSEL) Divide by 128 */
  122. #define PM_APBCSEL_APBCDIV_DIV1 (PM_APBCSEL_APBCDIV_DIV1_Val << PM_APBCSEL_APBCDIV_Pos) /**< (PM_APBCSEL) Divide by 1 Position */
  123. #define PM_APBCSEL_APBCDIV_DIV2 (PM_APBCSEL_APBCDIV_DIV2_Val << PM_APBCSEL_APBCDIV_Pos) /**< (PM_APBCSEL) Divide by 2 Position */
  124. #define PM_APBCSEL_APBCDIV_DIV4 (PM_APBCSEL_APBCDIV_DIV4_Val << PM_APBCSEL_APBCDIV_Pos) /**< (PM_APBCSEL) Divide by 4 Position */
  125. #define PM_APBCSEL_APBCDIV_DIV8 (PM_APBCSEL_APBCDIV_DIV8_Val << PM_APBCSEL_APBCDIV_Pos) /**< (PM_APBCSEL) Divide by 8 Position */
  126. #define PM_APBCSEL_APBCDIV_DIV16 (PM_APBCSEL_APBCDIV_DIV16_Val << PM_APBCSEL_APBCDIV_Pos) /**< (PM_APBCSEL) Divide by 16 Position */
  127. #define PM_APBCSEL_APBCDIV_DIV32 (PM_APBCSEL_APBCDIV_DIV32_Val << PM_APBCSEL_APBCDIV_Pos) /**< (PM_APBCSEL) Divide by 32 Position */
  128. #define PM_APBCSEL_APBCDIV_DIV64 (PM_APBCSEL_APBCDIV_DIV64_Val << PM_APBCSEL_APBCDIV_Pos) /**< (PM_APBCSEL) Divide by 64 Position */
  129. #define PM_APBCSEL_APBCDIV_DIV128 (PM_APBCSEL_APBCDIV_DIV128_Val << PM_APBCSEL_APBCDIV_Pos) /**< (PM_APBCSEL) Divide by 128 Position */
  130. #define PM_APBCSEL_Msk _U_(0x07) /**< (PM_APBCSEL) Register Mask */
  131. /* -------- PM_AHBMASK : (PM Offset: 0x14) (R/W 32) AHB Mask -------- */
  132. #define PM_AHBMASK_RESETVALUE _U_(0x7F) /**< (PM_AHBMASK) AHB Mask Reset Value */
  133. #define PM_AHBMASK_HPB0_Pos _U_(0) /**< (PM_AHBMASK) HPB0 AHB Clock Mask Position */
  134. #define PM_AHBMASK_HPB0_Msk (_U_(0x1) << PM_AHBMASK_HPB0_Pos) /**< (PM_AHBMASK) HPB0 AHB Clock Mask Mask */
  135. #define PM_AHBMASK_HPB0(value) (PM_AHBMASK_HPB0_Msk & ((value) << PM_AHBMASK_HPB0_Pos))
  136. #define PM_AHBMASK_HPB1_Pos _U_(1) /**< (PM_AHBMASK) HPB1 AHB Clock Mask Position */
  137. #define PM_AHBMASK_HPB1_Msk (_U_(0x1) << PM_AHBMASK_HPB1_Pos) /**< (PM_AHBMASK) HPB1 AHB Clock Mask Mask */
  138. #define PM_AHBMASK_HPB1(value) (PM_AHBMASK_HPB1_Msk & ((value) << PM_AHBMASK_HPB1_Pos))
  139. #define PM_AHBMASK_HPB2_Pos _U_(2) /**< (PM_AHBMASK) HPB2 AHB Clock Mask Position */
  140. #define PM_AHBMASK_HPB2_Msk (_U_(0x1) << PM_AHBMASK_HPB2_Pos) /**< (PM_AHBMASK) HPB2 AHB Clock Mask Mask */
  141. #define PM_AHBMASK_HPB2(value) (PM_AHBMASK_HPB2_Msk & ((value) << PM_AHBMASK_HPB2_Pos))
  142. #define PM_AHBMASK_DSU_Pos _U_(3) /**< (PM_AHBMASK) DSU AHB Clock Mask Position */
  143. #define PM_AHBMASK_DSU_Msk (_U_(0x1) << PM_AHBMASK_DSU_Pos) /**< (PM_AHBMASK) DSU AHB Clock Mask Mask */
  144. #define PM_AHBMASK_DSU(value) (PM_AHBMASK_DSU_Msk & ((value) << PM_AHBMASK_DSU_Pos))
  145. #define PM_AHBMASK_NVMCTRL_Pos _U_(4) /**< (PM_AHBMASK) NVMCTRL AHB Clock Mask Position */
  146. #define PM_AHBMASK_NVMCTRL_Msk (_U_(0x1) << PM_AHBMASK_NVMCTRL_Pos) /**< (PM_AHBMASK) NVMCTRL AHB Clock Mask Mask */
  147. #define PM_AHBMASK_NVMCTRL(value) (PM_AHBMASK_NVMCTRL_Msk & ((value) << PM_AHBMASK_NVMCTRL_Pos))
  148. #define PM_AHBMASK_DMAC_Pos _U_(5) /**< (PM_AHBMASK) DMAC AHB Clock Mask Position */
  149. #define PM_AHBMASK_DMAC_Msk (_U_(0x1) << PM_AHBMASK_DMAC_Pos) /**< (PM_AHBMASK) DMAC AHB Clock Mask Mask */
  150. #define PM_AHBMASK_DMAC(value) (PM_AHBMASK_DMAC_Msk & ((value) << PM_AHBMASK_DMAC_Pos))
  151. #define PM_AHBMASK_USB_Pos _U_(6) /**< (PM_AHBMASK) USB AHB Clock Mask Position */
  152. #define PM_AHBMASK_USB_Msk (_U_(0x1) << PM_AHBMASK_USB_Pos) /**< (PM_AHBMASK) USB AHB Clock Mask Mask */
  153. #define PM_AHBMASK_USB(value) (PM_AHBMASK_USB_Msk & ((value) << PM_AHBMASK_USB_Pos))
  154. #define PM_AHBMASK_Msk _U_(0x0000007F) /**< (PM_AHBMASK) Register Mask */
  155. #define PM_AHBMASK_HPB_Pos _U_(0) /**< (PM_AHBMASK Position) HPBx AHB Clock Mask */
  156. #define PM_AHBMASK_HPB_Msk (_U_(0x7) << PM_AHBMASK_HPB_Pos) /**< (PM_AHBMASK Mask) HPB */
  157. #define PM_AHBMASK_HPB(value) (PM_AHBMASK_HPB_Msk & ((value) << PM_AHBMASK_HPB_Pos))
  158. /* -------- PM_APBAMASK : (PM Offset: 0x18) (R/W 32) APBA Mask -------- */
  159. #define PM_APBAMASK_RESETVALUE _U_(0x7F) /**< (PM_APBAMASK) APBA Mask Reset Value */
  160. #define PM_APBAMASK_PAC0_Pos _U_(0) /**< (PM_APBAMASK) PAC0 APB Clock Enable Position */
  161. #define PM_APBAMASK_PAC0_Msk (_U_(0x1) << PM_APBAMASK_PAC0_Pos) /**< (PM_APBAMASK) PAC0 APB Clock Enable Mask */
  162. #define PM_APBAMASK_PAC0(value) (PM_APBAMASK_PAC0_Msk & ((value) << PM_APBAMASK_PAC0_Pos))
  163. #define PM_APBAMASK_PM_Pos _U_(1) /**< (PM_APBAMASK) PM APB Clock Enable Position */
  164. #define PM_APBAMASK_PM_Msk (_U_(0x1) << PM_APBAMASK_PM_Pos) /**< (PM_APBAMASK) PM APB Clock Enable Mask */
  165. #define PM_APBAMASK_PM(value) (PM_APBAMASK_PM_Msk & ((value) << PM_APBAMASK_PM_Pos))
  166. #define PM_APBAMASK_SYSCTRL_Pos _U_(2) /**< (PM_APBAMASK) SYSCTRL APB Clock Enable Position */
  167. #define PM_APBAMASK_SYSCTRL_Msk (_U_(0x1) << PM_APBAMASK_SYSCTRL_Pos) /**< (PM_APBAMASK) SYSCTRL APB Clock Enable Mask */
  168. #define PM_APBAMASK_SYSCTRL(value) (PM_APBAMASK_SYSCTRL_Msk & ((value) << PM_APBAMASK_SYSCTRL_Pos))
  169. #define PM_APBAMASK_GCLK_Pos _U_(3) /**< (PM_APBAMASK) GCLK APB Clock Enable Position */
  170. #define PM_APBAMASK_GCLK_Msk (_U_(0x1) << PM_APBAMASK_GCLK_Pos) /**< (PM_APBAMASK) GCLK APB Clock Enable Mask */
  171. #define PM_APBAMASK_GCLK(value) (PM_APBAMASK_GCLK_Msk & ((value) << PM_APBAMASK_GCLK_Pos))
  172. #define PM_APBAMASK_WDT_Pos _U_(4) /**< (PM_APBAMASK) WDT APB Clock Enable Position */
  173. #define PM_APBAMASK_WDT_Msk (_U_(0x1) << PM_APBAMASK_WDT_Pos) /**< (PM_APBAMASK) WDT APB Clock Enable Mask */
  174. #define PM_APBAMASK_WDT(value) (PM_APBAMASK_WDT_Msk & ((value) << PM_APBAMASK_WDT_Pos))
  175. #define PM_APBAMASK_RTC_Pos _U_(5) /**< (PM_APBAMASK) RTC APB Clock Enable Position */
  176. #define PM_APBAMASK_RTC_Msk (_U_(0x1) << PM_APBAMASK_RTC_Pos) /**< (PM_APBAMASK) RTC APB Clock Enable Mask */
  177. #define PM_APBAMASK_RTC(value) (PM_APBAMASK_RTC_Msk & ((value) << PM_APBAMASK_RTC_Pos))
  178. #define PM_APBAMASK_EIC_Pos _U_(6) /**< (PM_APBAMASK) EIC APB Clock Enable Position */
  179. #define PM_APBAMASK_EIC_Msk (_U_(0x1) << PM_APBAMASK_EIC_Pos) /**< (PM_APBAMASK) EIC APB Clock Enable Mask */
  180. #define PM_APBAMASK_EIC(value) (PM_APBAMASK_EIC_Msk & ((value) << PM_APBAMASK_EIC_Pos))
  181. #define PM_APBAMASK_Msk _U_(0x0000007F) /**< (PM_APBAMASK) Register Mask */
  182. #define PM_APBAMASK_PAC_Pos _U_(0) /**< (PM_APBAMASK Position) PACx APB Clock Enable */
  183. #define PM_APBAMASK_PAC_Msk (_U_(0x1) << PM_APBAMASK_PAC_Pos) /**< (PM_APBAMASK Mask) PAC */
  184. #define PM_APBAMASK_PAC(value) (PM_APBAMASK_PAC_Msk & ((value) << PM_APBAMASK_PAC_Pos))
  185. /* -------- PM_APBBMASK : (PM Offset: 0x1C) (R/W 32) APBB Mask -------- */
  186. #define PM_APBBMASK_RESETVALUE _U_(0x7F) /**< (PM_APBBMASK) APBB Mask Reset Value */
  187. #define PM_APBBMASK_PAC1_Pos _U_(0) /**< (PM_APBBMASK) PAC1 APB Clock Enable Position */
  188. #define PM_APBBMASK_PAC1_Msk (_U_(0x1) << PM_APBBMASK_PAC1_Pos) /**< (PM_APBBMASK) PAC1 APB Clock Enable Mask */
  189. #define PM_APBBMASK_PAC1(value) (PM_APBBMASK_PAC1_Msk & ((value) << PM_APBBMASK_PAC1_Pos))
  190. #define PM_APBBMASK_DSU_Pos _U_(1) /**< (PM_APBBMASK) DSU APB Clock Enable Position */
  191. #define PM_APBBMASK_DSU_Msk (_U_(0x1) << PM_APBBMASK_DSU_Pos) /**< (PM_APBBMASK) DSU APB Clock Enable Mask */
  192. #define PM_APBBMASK_DSU(value) (PM_APBBMASK_DSU_Msk & ((value) << PM_APBBMASK_DSU_Pos))
  193. #define PM_APBBMASK_NVMCTRL_Pos _U_(2) /**< (PM_APBBMASK) NVMCTRL APB Clock Enable Position */
  194. #define PM_APBBMASK_NVMCTRL_Msk (_U_(0x1) << PM_APBBMASK_NVMCTRL_Pos) /**< (PM_APBBMASK) NVMCTRL APB Clock Enable Mask */
  195. #define PM_APBBMASK_NVMCTRL(value) (PM_APBBMASK_NVMCTRL_Msk & ((value) << PM_APBBMASK_NVMCTRL_Pos))
  196. #define PM_APBBMASK_PORT_Pos _U_(3) /**< (PM_APBBMASK) PORT APB Clock Enable Position */
  197. #define PM_APBBMASK_PORT_Msk (_U_(0x1) << PM_APBBMASK_PORT_Pos) /**< (PM_APBBMASK) PORT APB Clock Enable Mask */
  198. #define PM_APBBMASK_PORT(value) (PM_APBBMASK_PORT_Msk & ((value) << PM_APBBMASK_PORT_Pos))
  199. #define PM_APBBMASK_DMAC_Pos _U_(4) /**< (PM_APBBMASK) DMAC APB Clock Enable Position */
  200. #define PM_APBBMASK_DMAC_Msk (_U_(0x1) << PM_APBBMASK_DMAC_Pos) /**< (PM_APBBMASK) DMAC APB Clock Enable Mask */
  201. #define PM_APBBMASK_DMAC(value) (PM_APBBMASK_DMAC_Msk & ((value) << PM_APBBMASK_DMAC_Pos))
  202. #define PM_APBBMASK_USB_Pos _U_(5) /**< (PM_APBBMASK) USB APB Clock Enable Position */
  203. #define PM_APBBMASK_USB_Msk (_U_(0x1) << PM_APBBMASK_USB_Pos) /**< (PM_APBBMASK) USB APB Clock Enable Mask */
  204. #define PM_APBBMASK_USB(value) (PM_APBBMASK_USB_Msk & ((value) << PM_APBBMASK_USB_Pos))
  205. #define PM_APBBMASK_HMATRIX_Pos _U_(6) /**< (PM_APBBMASK) HMATRIX APB Clock Enable Position */
  206. #define PM_APBBMASK_HMATRIX_Msk (_U_(0x1) << PM_APBBMASK_HMATRIX_Pos) /**< (PM_APBBMASK) HMATRIX APB Clock Enable Mask */
  207. #define PM_APBBMASK_HMATRIX(value) (PM_APBBMASK_HMATRIX_Msk & ((value) << PM_APBBMASK_HMATRIX_Pos))
  208. #define PM_APBBMASK_Msk _U_(0x0000007F) /**< (PM_APBBMASK) Register Mask */
  209. #define PM_APBBMASK_PAC_Pos _U_(0) /**< (PM_APBBMASK Position) PACx APB Clock Enable */
  210. #define PM_APBBMASK_PAC_Msk (_U_(0x1) << PM_APBBMASK_PAC_Pos) /**< (PM_APBBMASK Mask) PAC */
  211. #define PM_APBBMASK_PAC(value) (PM_APBBMASK_PAC_Msk & ((value) << PM_APBBMASK_PAC_Pos))
  212. /* -------- PM_APBCMASK : (PM Offset: 0x20) (R/W 32) APBC Mask -------- */
  213. #define PM_APBCMASK_RESETVALUE _U_(0x10000) /**< (PM_APBCMASK) APBC Mask Reset Value */
  214. #define PM_APBCMASK_PAC2_Pos _U_(0) /**< (PM_APBCMASK) PAC2 APB Clock Enable Position */
  215. #define PM_APBCMASK_PAC2_Msk (_U_(0x1) << PM_APBCMASK_PAC2_Pos) /**< (PM_APBCMASK) PAC2 APB Clock Enable Mask */
  216. #define PM_APBCMASK_PAC2(value) (PM_APBCMASK_PAC2_Msk & ((value) << PM_APBCMASK_PAC2_Pos))
  217. #define PM_APBCMASK_EVSYS_Pos _U_(1) /**< (PM_APBCMASK) EVSYS APB Clock Enable Position */
  218. #define PM_APBCMASK_EVSYS_Msk (_U_(0x1) << PM_APBCMASK_EVSYS_Pos) /**< (PM_APBCMASK) EVSYS APB Clock Enable Mask */
  219. #define PM_APBCMASK_EVSYS(value) (PM_APBCMASK_EVSYS_Msk & ((value) << PM_APBCMASK_EVSYS_Pos))
  220. #define PM_APBCMASK_SERCOM0_Pos _U_(2) /**< (PM_APBCMASK) SERCOM0 APB Clock Enable Position */
  221. #define PM_APBCMASK_SERCOM0_Msk (_U_(0x1) << PM_APBCMASK_SERCOM0_Pos) /**< (PM_APBCMASK) SERCOM0 APB Clock Enable Mask */
  222. #define PM_APBCMASK_SERCOM0(value) (PM_APBCMASK_SERCOM0_Msk & ((value) << PM_APBCMASK_SERCOM0_Pos))
  223. #define PM_APBCMASK_SERCOM1_Pos _U_(3) /**< (PM_APBCMASK) SERCOM1 APB Clock Enable Position */
  224. #define PM_APBCMASK_SERCOM1_Msk (_U_(0x1) << PM_APBCMASK_SERCOM1_Pos) /**< (PM_APBCMASK) SERCOM1 APB Clock Enable Mask */
  225. #define PM_APBCMASK_SERCOM1(value) (PM_APBCMASK_SERCOM1_Msk & ((value) << PM_APBCMASK_SERCOM1_Pos))
  226. #define PM_APBCMASK_SERCOM2_Pos _U_(4) /**< (PM_APBCMASK) SERCOM2 APB Clock Enable Position */
  227. #define PM_APBCMASK_SERCOM2_Msk (_U_(0x1) << PM_APBCMASK_SERCOM2_Pos) /**< (PM_APBCMASK) SERCOM2 APB Clock Enable Mask */
  228. #define PM_APBCMASK_SERCOM2(value) (PM_APBCMASK_SERCOM2_Msk & ((value) << PM_APBCMASK_SERCOM2_Pos))
  229. #define PM_APBCMASK_SERCOM3_Pos _U_(5) /**< (PM_APBCMASK) SERCOM3 APB Clock Enable Position */
  230. #define PM_APBCMASK_SERCOM3_Msk (_U_(0x1) << PM_APBCMASK_SERCOM3_Pos) /**< (PM_APBCMASK) SERCOM3 APB Clock Enable Mask */
  231. #define PM_APBCMASK_SERCOM3(value) (PM_APBCMASK_SERCOM3_Msk & ((value) << PM_APBCMASK_SERCOM3_Pos))
  232. #define PM_APBCMASK_SERCOM4_Pos _U_(6) /**< (PM_APBCMASK) SERCOM4 APB Clock Enable Position */
  233. #define PM_APBCMASK_SERCOM4_Msk (_U_(0x1) << PM_APBCMASK_SERCOM4_Pos) /**< (PM_APBCMASK) SERCOM4 APB Clock Enable Mask */
  234. #define PM_APBCMASK_SERCOM4(value) (PM_APBCMASK_SERCOM4_Msk & ((value) << PM_APBCMASK_SERCOM4_Pos))
  235. #define PM_APBCMASK_SERCOM5_Pos _U_(7) /**< (PM_APBCMASK) SERCOM5 APB Clock Enable Position */
  236. #define PM_APBCMASK_SERCOM5_Msk (_U_(0x1) << PM_APBCMASK_SERCOM5_Pos) /**< (PM_APBCMASK) SERCOM5 APB Clock Enable Mask */
  237. #define PM_APBCMASK_SERCOM5(value) (PM_APBCMASK_SERCOM5_Msk & ((value) << PM_APBCMASK_SERCOM5_Pos))
  238. #define PM_APBCMASK_TCC0_Pos _U_(8) /**< (PM_APBCMASK) TCC0 APB Clock Enable Position */
  239. #define PM_APBCMASK_TCC0_Msk (_U_(0x1) << PM_APBCMASK_TCC0_Pos) /**< (PM_APBCMASK) TCC0 APB Clock Enable Mask */
  240. #define PM_APBCMASK_TCC0(value) (PM_APBCMASK_TCC0_Msk & ((value) << PM_APBCMASK_TCC0_Pos))
  241. #define PM_APBCMASK_TCC1_Pos _U_(9) /**< (PM_APBCMASK) TCC1 APB Clock Enable Position */
  242. #define PM_APBCMASK_TCC1_Msk (_U_(0x1) << PM_APBCMASK_TCC1_Pos) /**< (PM_APBCMASK) TCC1 APB Clock Enable Mask */
  243. #define PM_APBCMASK_TCC1(value) (PM_APBCMASK_TCC1_Msk & ((value) << PM_APBCMASK_TCC1_Pos))
  244. #define PM_APBCMASK_TCC2_Pos _U_(10) /**< (PM_APBCMASK) TCC2 APB Clock Enable Position */
  245. #define PM_APBCMASK_TCC2_Msk (_U_(0x1) << PM_APBCMASK_TCC2_Pos) /**< (PM_APBCMASK) TCC2 APB Clock Enable Mask */
  246. #define PM_APBCMASK_TCC2(value) (PM_APBCMASK_TCC2_Msk & ((value) << PM_APBCMASK_TCC2_Pos))
  247. #define PM_APBCMASK_TC3_Pos _U_(11) /**< (PM_APBCMASK) TC3 APB Clock Enable Position */
  248. #define PM_APBCMASK_TC3_Msk (_U_(0x1) << PM_APBCMASK_TC3_Pos) /**< (PM_APBCMASK) TC3 APB Clock Enable Mask */
  249. #define PM_APBCMASK_TC3(value) (PM_APBCMASK_TC3_Msk & ((value) << PM_APBCMASK_TC3_Pos))
  250. #define PM_APBCMASK_TC4_Pos _U_(12) /**< (PM_APBCMASK) TC4 APB Clock Enable Position */
  251. #define PM_APBCMASK_TC4_Msk (_U_(0x1) << PM_APBCMASK_TC4_Pos) /**< (PM_APBCMASK) TC4 APB Clock Enable Mask */
  252. #define PM_APBCMASK_TC4(value) (PM_APBCMASK_TC4_Msk & ((value) << PM_APBCMASK_TC4_Pos))
  253. #define PM_APBCMASK_TC5_Pos _U_(13) /**< (PM_APBCMASK) TC5 APB Clock Enable Position */
  254. #define PM_APBCMASK_TC5_Msk (_U_(0x1) << PM_APBCMASK_TC5_Pos) /**< (PM_APBCMASK) TC5 APB Clock Enable Mask */
  255. #define PM_APBCMASK_TC5(value) (PM_APBCMASK_TC5_Msk & ((value) << PM_APBCMASK_TC5_Pos))
  256. #define PM_APBCMASK_TC6_Pos _U_(14) /**< (PM_APBCMASK) TC6 APB Clock Enable Position */
  257. #define PM_APBCMASK_TC6_Msk (_U_(0x1) << PM_APBCMASK_TC6_Pos) /**< (PM_APBCMASK) TC6 APB Clock Enable Mask */
  258. #define PM_APBCMASK_TC6(value) (PM_APBCMASK_TC6_Msk & ((value) << PM_APBCMASK_TC6_Pos))
  259. #define PM_APBCMASK_TC7_Pos _U_(15) /**< (PM_APBCMASK) TC7 APB Clock Enable Position */
  260. #define PM_APBCMASK_TC7_Msk (_U_(0x1) << PM_APBCMASK_TC7_Pos) /**< (PM_APBCMASK) TC7 APB Clock Enable Mask */
  261. #define PM_APBCMASK_TC7(value) (PM_APBCMASK_TC7_Msk & ((value) << PM_APBCMASK_TC7_Pos))
  262. #define PM_APBCMASK_ADC_Pos _U_(16) /**< (PM_APBCMASK) ADC APB Clock Enable Position */
  263. #define PM_APBCMASK_ADC_Msk (_U_(0x1) << PM_APBCMASK_ADC_Pos) /**< (PM_APBCMASK) ADC APB Clock Enable Mask */
  264. #define PM_APBCMASK_ADC(value) (PM_APBCMASK_ADC_Msk & ((value) << PM_APBCMASK_ADC_Pos))
  265. #define PM_APBCMASK_AC_Pos _U_(17) /**< (PM_APBCMASK) AC APB Clock Enable Position */
  266. #define PM_APBCMASK_AC_Msk (_U_(0x1) << PM_APBCMASK_AC_Pos) /**< (PM_APBCMASK) AC APB Clock Enable Mask */
  267. #define PM_APBCMASK_AC(value) (PM_APBCMASK_AC_Msk & ((value) << PM_APBCMASK_AC_Pos))
  268. #define PM_APBCMASK_DAC_Pos _U_(18) /**< (PM_APBCMASK) DAC APB Clock Enable Position */
  269. #define PM_APBCMASK_DAC_Msk (_U_(0x1) << PM_APBCMASK_DAC_Pos) /**< (PM_APBCMASK) DAC APB Clock Enable Mask */
  270. #define PM_APBCMASK_DAC(value) (PM_APBCMASK_DAC_Msk & ((value) << PM_APBCMASK_DAC_Pos))
  271. #define PM_APBCMASK_PTC_Pos _U_(19) /**< (PM_APBCMASK) PTC APB Clock Enable Position */
  272. #define PM_APBCMASK_PTC_Msk (_U_(0x1) << PM_APBCMASK_PTC_Pos) /**< (PM_APBCMASK) PTC APB Clock Enable Mask */
  273. #define PM_APBCMASK_PTC(value) (PM_APBCMASK_PTC_Msk & ((value) << PM_APBCMASK_PTC_Pos))
  274. #define PM_APBCMASK_I2S_Pos _U_(20) /**< (PM_APBCMASK) I2S APB Clock Enable Position */
  275. #define PM_APBCMASK_I2S_Msk (_U_(0x1) << PM_APBCMASK_I2S_Pos) /**< (PM_APBCMASK) I2S APB Clock Enable Mask */
  276. #define PM_APBCMASK_I2S(value) (PM_APBCMASK_I2S_Msk & ((value) << PM_APBCMASK_I2S_Pos))
  277. #define PM_APBCMASK_Msk _U_(0x001FFFFF) /**< (PM_APBCMASK) Register Mask */
  278. #define PM_APBCMASK_PAC_Pos _U_(0) /**< (PM_APBCMASK Position) PAC2 APB Clock Enable */
  279. #define PM_APBCMASK_PAC_Msk (_U_(0x1) << PM_APBCMASK_PAC_Pos) /**< (PM_APBCMASK Mask) PAC */
  280. #define PM_APBCMASK_PAC(value) (PM_APBCMASK_PAC_Msk & ((value) << PM_APBCMASK_PAC_Pos))
  281. #define PM_APBCMASK_SERCOM_Pos _U_(2) /**< (PM_APBCMASK Position) SERCOMx APB Clock Enable */
  282. #define PM_APBCMASK_SERCOM_Msk (_U_(0x3F) << PM_APBCMASK_SERCOM_Pos) /**< (PM_APBCMASK Mask) SERCOM */
  283. #define PM_APBCMASK_SERCOM(value) (PM_APBCMASK_SERCOM_Msk & ((value) << PM_APBCMASK_SERCOM_Pos))
  284. #define PM_APBCMASK_TCC_Pos _U_(8) /**< (PM_APBCMASK Position) TCCx APB Clock Enable */
  285. #define PM_APBCMASK_TCC_Msk (_U_(0x7) << PM_APBCMASK_TCC_Pos) /**< (PM_APBCMASK Mask) TCC */
  286. #define PM_APBCMASK_TCC(value) (PM_APBCMASK_TCC_Msk & ((value) << PM_APBCMASK_TCC_Pos))
  287. #define PM_APBCMASK_TC_Pos _U_(11) /**< (PM_APBCMASK Position) TC3 APB Clock Enable */
  288. #define PM_APBCMASK_TC_Msk (_U_(0x1F) << PM_APBCMASK_TC_Pos) /**< (PM_APBCMASK Mask) TC */
  289. #define PM_APBCMASK_TC(value) (PM_APBCMASK_TC_Msk & ((value) << PM_APBCMASK_TC_Pos))
  290. /* -------- PM_INTENCLR : (PM Offset: 0x34) (R/W 8) Interrupt Enable Clear -------- */
  291. #define PM_INTENCLR_RESETVALUE _U_(0x00) /**< (PM_INTENCLR) Interrupt Enable Clear Reset Value */
  292. #define PM_INTENCLR_CKRDY_Pos _U_(0) /**< (PM_INTENCLR) Clock Ready Interrupt Enable Position */
  293. #define PM_INTENCLR_CKRDY_Msk (_U_(0x1) << PM_INTENCLR_CKRDY_Pos) /**< (PM_INTENCLR) Clock Ready Interrupt Enable Mask */
  294. #define PM_INTENCLR_CKRDY(value) (PM_INTENCLR_CKRDY_Msk & ((value) << PM_INTENCLR_CKRDY_Pos))
  295. #define PM_INTENCLR_Msk _U_(0x01) /**< (PM_INTENCLR) Register Mask */
  296. /* -------- PM_INTENSET : (PM Offset: 0x35) (R/W 8) Interrupt Enable Set -------- */
  297. #define PM_INTENSET_RESETVALUE _U_(0x00) /**< (PM_INTENSET) Interrupt Enable Set Reset Value */
  298. #define PM_INTENSET_CKRDY_Pos _U_(0) /**< (PM_INTENSET) Clock Ready Interrupt Enable Position */
  299. #define PM_INTENSET_CKRDY_Msk (_U_(0x1) << PM_INTENSET_CKRDY_Pos) /**< (PM_INTENSET) Clock Ready Interrupt Enable Mask */
  300. #define PM_INTENSET_CKRDY(value) (PM_INTENSET_CKRDY_Msk & ((value) << PM_INTENSET_CKRDY_Pos))
  301. #define PM_INTENSET_Msk _U_(0x01) /**< (PM_INTENSET) Register Mask */
  302. /* -------- PM_INTFLAG : (PM Offset: 0x36) (R/W 8) Interrupt Flag Status and Clear -------- */
  303. #define PM_INTFLAG_RESETVALUE _U_(0x00) /**< (PM_INTFLAG) Interrupt Flag Status and Clear Reset Value */
  304. #define PM_INTFLAG_CKRDY_Pos _U_(0) /**< (PM_INTFLAG) Clock Ready Position */
  305. #define PM_INTFLAG_CKRDY_Msk (_U_(0x1) << PM_INTFLAG_CKRDY_Pos) /**< (PM_INTFLAG) Clock Ready Mask */
  306. #define PM_INTFLAG_CKRDY(value) (PM_INTFLAG_CKRDY_Msk & ((value) << PM_INTFLAG_CKRDY_Pos))
  307. #define PM_INTFLAG_Msk _U_(0x01) /**< (PM_INTFLAG) Register Mask */
  308. /* -------- PM_RCAUSE : (PM Offset: 0x38) ( R/ 8) Reset Cause -------- */
  309. #define PM_RCAUSE_RESETVALUE _U_(0x01) /**< (PM_RCAUSE) Reset Cause Reset Value */
  310. #define PM_RCAUSE_POR_Pos _U_(0) /**< (PM_RCAUSE) Power On Reset Position */
  311. #define PM_RCAUSE_POR_Msk (_U_(0x1) << PM_RCAUSE_POR_Pos) /**< (PM_RCAUSE) Power On Reset Mask */
  312. #define PM_RCAUSE_POR(value) (PM_RCAUSE_POR_Msk & ((value) << PM_RCAUSE_POR_Pos))
  313. #define PM_RCAUSE_BOD12_Pos _U_(1) /**< (PM_RCAUSE) Brown Out 12 Detector Reset Position */
  314. #define PM_RCAUSE_BOD12_Msk (_U_(0x1) << PM_RCAUSE_BOD12_Pos) /**< (PM_RCAUSE) Brown Out 12 Detector Reset Mask */
  315. #define PM_RCAUSE_BOD12(value) (PM_RCAUSE_BOD12_Msk & ((value) << PM_RCAUSE_BOD12_Pos))
  316. #define PM_RCAUSE_BOD33_Pos _U_(2) /**< (PM_RCAUSE) Brown Out 33 Detector Reset Position */
  317. #define PM_RCAUSE_BOD33_Msk (_U_(0x1) << PM_RCAUSE_BOD33_Pos) /**< (PM_RCAUSE) Brown Out 33 Detector Reset Mask */
  318. #define PM_RCAUSE_BOD33(value) (PM_RCAUSE_BOD33_Msk & ((value) << PM_RCAUSE_BOD33_Pos))
  319. #define PM_RCAUSE_EXT_Pos _U_(4) /**< (PM_RCAUSE) External Reset Position */
  320. #define PM_RCAUSE_EXT_Msk (_U_(0x1) << PM_RCAUSE_EXT_Pos) /**< (PM_RCAUSE) External Reset Mask */
  321. #define PM_RCAUSE_EXT(value) (PM_RCAUSE_EXT_Msk & ((value) << PM_RCAUSE_EXT_Pos))
  322. #define PM_RCAUSE_WDT_Pos _U_(5) /**< (PM_RCAUSE) Watchdog Reset Position */
  323. #define PM_RCAUSE_WDT_Msk (_U_(0x1) << PM_RCAUSE_WDT_Pos) /**< (PM_RCAUSE) Watchdog Reset Mask */
  324. #define PM_RCAUSE_WDT(value) (PM_RCAUSE_WDT_Msk & ((value) << PM_RCAUSE_WDT_Pos))
  325. #define PM_RCAUSE_SYST_Pos _U_(6) /**< (PM_RCAUSE) System Reset Request Position */
  326. #define PM_RCAUSE_SYST_Msk (_U_(0x1) << PM_RCAUSE_SYST_Pos) /**< (PM_RCAUSE) System Reset Request Mask */
  327. #define PM_RCAUSE_SYST(value) (PM_RCAUSE_SYST_Msk & ((value) << PM_RCAUSE_SYST_Pos))
  328. #define PM_RCAUSE_Msk _U_(0x77) /**< (PM_RCAUSE) Register Mask */
  329. #define PM_RCAUSE_BOD_Pos _U_(1) /**< (PM_RCAUSE Position) Brown Out x2 Detector Reset */
  330. #define PM_RCAUSE_BOD_Msk (_U_(0x3) << PM_RCAUSE_BOD_Pos) /**< (PM_RCAUSE Mask) BOD */
  331. #define PM_RCAUSE_BOD(value) (PM_RCAUSE_BOD_Msk & ((value) << PM_RCAUSE_BOD_Pos))
  332. /** \brief PM register offsets definitions */
  333. #define PM_CTRL_REG_OFST (0x00) /**< (PM_CTRL) Control Offset */
  334. #define PM_SLEEP_REG_OFST (0x01) /**< (PM_SLEEP) Sleep Mode Offset */
  335. #define PM_CPUSEL_REG_OFST (0x08) /**< (PM_CPUSEL) CPU Clock Select Offset */
  336. #define PM_APBASEL_REG_OFST (0x09) /**< (PM_APBASEL) APBA Clock Select Offset */
  337. #define PM_APBBSEL_REG_OFST (0x0A) /**< (PM_APBBSEL) APBB Clock Select Offset */
  338. #define PM_APBCSEL_REG_OFST (0x0B) /**< (PM_APBCSEL) APBC Clock Select Offset */
  339. #define PM_AHBMASK_REG_OFST (0x14) /**< (PM_AHBMASK) AHB Mask Offset */
  340. #define PM_APBAMASK_REG_OFST (0x18) /**< (PM_APBAMASK) APBA Mask Offset */
  341. #define PM_APBBMASK_REG_OFST (0x1C) /**< (PM_APBBMASK) APBB Mask Offset */
  342. #define PM_APBCMASK_REG_OFST (0x20) /**< (PM_APBCMASK) APBC Mask Offset */
  343. #define PM_INTENCLR_REG_OFST (0x34) /**< (PM_INTENCLR) Interrupt Enable Clear Offset */
  344. #define PM_INTENSET_REG_OFST (0x35) /**< (PM_INTENSET) Interrupt Enable Set Offset */
  345. #define PM_INTFLAG_REG_OFST (0x36) /**< (PM_INTFLAG) Interrupt Flag Status and Clear Offset */
  346. #define PM_RCAUSE_REG_OFST (0x38) /**< (PM_RCAUSE) Reset Cause Offset */
  347. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  348. /** \brief PM register API structure */
  349. typedef struct
  350. { /* Power Manager */
  351. __IO uint8_t PM_CTRL; /**< Offset: 0x00 (R/W 8) Control */
  352. __IO uint8_t PM_SLEEP; /**< Offset: 0x01 (R/W 8) Sleep Mode */
  353. __I uint8_t Reserved1[0x06];
  354. __IO uint8_t PM_CPUSEL; /**< Offset: 0x08 (R/W 8) CPU Clock Select */
  355. __IO uint8_t PM_APBASEL; /**< Offset: 0x09 (R/W 8) APBA Clock Select */
  356. __IO uint8_t PM_APBBSEL; /**< Offset: 0x0A (R/W 8) APBB Clock Select */
  357. __IO uint8_t PM_APBCSEL; /**< Offset: 0x0B (R/W 8) APBC Clock Select */
  358. __I uint8_t Reserved2[0x08];
  359. __IO uint32_t PM_AHBMASK; /**< Offset: 0x14 (R/W 32) AHB Mask */
  360. __IO uint32_t PM_APBAMASK; /**< Offset: 0x18 (R/W 32) APBA Mask */
  361. __IO uint32_t PM_APBBMASK; /**< Offset: 0x1C (R/W 32) APBB Mask */
  362. __IO uint32_t PM_APBCMASK; /**< Offset: 0x20 (R/W 32) APBC Mask */
  363. __I uint8_t Reserved3[0x10];
  364. __IO uint8_t PM_INTENCLR; /**< Offset: 0x34 (R/W 8) Interrupt Enable Clear */
  365. __IO uint8_t PM_INTENSET; /**< Offset: 0x35 (R/W 8) Interrupt Enable Set */
  366. __IO uint8_t PM_INTFLAG; /**< Offset: 0x36 (R/W 8) Interrupt Flag Status and Clear */
  367. __I uint8_t Reserved4[0x01];
  368. __I uint8_t PM_RCAUSE; /**< Offset: 0x38 (R/ 8) Reset Cause */
  369. } pm_registers_t;
  370. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  371. #endif /* _SAMD21_PM_COMPONENT_H_ */