evsys.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. /**
  2. * \file
  3. *
  4. * \brief Component description for EVSYS
  5. *
  6. * Copyright (c) 2018 Microchip Technology Inc.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the Licence at
  17. *
  18. * http://www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  22. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. * \asf_license_stop
  27. *
  28. */
  29. #ifndef _SAMD11_EVSYS_COMPONENT_
  30. #define _SAMD11_EVSYS_COMPONENT_
  31. /* ========================================================================== */
  32. /** SOFTWARE API DEFINITION FOR EVSYS */
  33. /* ========================================================================== */
  34. /** \addtogroup SAMD11_EVSYS Event System Interface */
  35. /*@{*/
  36. #define EVSYS_U2208
  37. #define REV_EVSYS 0x101
  38. /* -------- EVSYS_CTRL : (EVSYS Offset: 0x00) ( /W 8) Control -------- */
  39. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  40. typedef union {
  41. struct {
  42. uint8_t SWRST:1; /*!< bit: 0 Software Reset */
  43. uint8_t :3; /*!< bit: 1.. 3 Reserved */
  44. uint8_t GCLKREQ:1; /*!< bit: 4 Generic Clock Requests */
  45. uint8_t :3; /*!< bit: 5.. 7 Reserved */
  46. } bit; /*!< Structure used for bit access */
  47. uint8_t reg; /*!< Type used for register access */
  48. } EVSYS_CTRL_Type;
  49. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  50. #define EVSYS_CTRL_OFFSET 0x00 /**< \brief (EVSYS_CTRL offset) Control */
  51. #define EVSYS_CTRL_RESETVALUE _U_(0x00) /**< \brief (EVSYS_CTRL reset_value) Control */
  52. #define EVSYS_CTRL_SWRST_Pos 0 /**< \brief (EVSYS_CTRL) Software Reset */
  53. #define EVSYS_CTRL_SWRST (_U_(0x1) << EVSYS_CTRL_SWRST_Pos)
  54. #define EVSYS_CTRL_GCLKREQ_Pos 4 /**< \brief (EVSYS_CTRL) Generic Clock Requests */
  55. #define EVSYS_CTRL_GCLKREQ (_U_(0x1) << EVSYS_CTRL_GCLKREQ_Pos)
  56. #define EVSYS_CTRL_MASK _U_(0x11) /**< \brief (EVSYS_CTRL) MASK Register */
  57. /* -------- EVSYS_CHANNEL : (EVSYS Offset: 0x04) (R/W 32) Channel -------- */
  58. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  59. typedef union {
  60. struct {
  61. uint32_t CHANNEL:3; /*!< bit: 0.. 2 Channel Selection */
  62. uint32_t :5; /*!< bit: 3.. 7 Reserved */
  63. uint32_t SWEVT:1; /*!< bit: 8 Software Event */
  64. uint32_t :7; /*!< bit: 9..15 Reserved */
  65. uint32_t EVGEN:6; /*!< bit: 16..21 Event Generator Selection */
  66. uint32_t :2; /*!< bit: 22..23 Reserved */
  67. uint32_t PATH:2; /*!< bit: 24..25 Path Selection */
  68. uint32_t EDGSEL:2; /*!< bit: 26..27 Edge Detection Selection */
  69. uint32_t :4; /*!< bit: 28..31 Reserved */
  70. } bit; /*!< Structure used for bit access */
  71. uint32_t reg; /*!< Type used for register access */
  72. } EVSYS_CHANNEL_Type;
  73. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  74. #define EVSYS_CHANNEL_OFFSET 0x04 /**< \brief (EVSYS_CHANNEL offset) Channel */
  75. #define EVSYS_CHANNEL_RESETVALUE _U_(0x00000000) /**< \brief (EVSYS_CHANNEL reset_value) Channel */
  76. #define EVSYS_CHANNEL_CHANNEL_Pos 0 /**< \brief (EVSYS_CHANNEL) Channel Selection */
  77. #define EVSYS_CHANNEL_CHANNEL_Msk (_U_(0x7) << EVSYS_CHANNEL_CHANNEL_Pos)
  78. #define EVSYS_CHANNEL_CHANNEL(value) (EVSYS_CHANNEL_CHANNEL_Msk & ((value) << EVSYS_CHANNEL_CHANNEL_Pos))
  79. #define EVSYS_CHANNEL_SWEVT_Pos 8 /**< \brief (EVSYS_CHANNEL) Software Event */
  80. #define EVSYS_CHANNEL_SWEVT (_U_(0x1) << EVSYS_CHANNEL_SWEVT_Pos)
  81. #define EVSYS_CHANNEL_EVGEN_Pos 16 /**< \brief (EVSYS_CHANNEL) Event Generator Selection */
  82. #define EVSYS_CHANNEL_EVGEN_Msk (_U_(0x3F) << EVSYS_CHANNEL_EVGEN_Pos)
  83. #define EVSYS_CHANNEL_EVGEN(value) (EVSYS_CHANNEL_EVGEN_Msk & ((value) << EVSYS_CHANNEL_EVGEN_Pos))
  84. #define EVSYS_CHANNEL_PATH_Pos 24 /**< \brief (EVSYS_CHANNEL) Path Selection */
  85. #define EVSYS_CHANNEL_PATH_Msk (_U_(0x3) << EVSYS_CHANNEL_PATH_Pos)
  86. #define EVSYS_CHANNEL_PATH(value) (EVSYS_CHANNEL_PATH_Msk & ((value) << EVSYS_CHANNEL_PATH_Pos))
  87. #define EVSYS_CHANNEL_PATH_SYNCHRONOUS_Val _U_(0x0) /**< \brief (EVSYS_CHANNEL) Synchronous path */
  88. #define EVSYS_CHANNEL_PATH_RESYNCHRONIZED_Val _U_(0x1) /**< \brief (EVSYS_CHANNEL) Resynchronized path */
  89. #define EVSYS_CHANNEL_PATH_ASYNCHRONOUS_Val _U_(0x2) /**< \brief (EVSYS_CHANNEL) Asynchronous path */
  90. #define EVSYS_CHANNEL_PATH_SYNCHRONOUS (EVSYS_CHANNEL_PATH_SYNCHRONOUS_Val << EVSYS_CHANNEL_PATH_Pos)
  91. #define EVSYS_CHANNEL_PATH_RESYNCHRONIZED (EVSYS_CHANNEL_PATH_RESYNCHRONIZED_Val << EVSYS_CHANNEL_PATH_Pos)
  92. #define EVSYS_CHANNEL_PATH_ASYNCHRONOUS (EVSYS_CHANNEL_PATH_ASYNCHRONOUS_Val << EVSYS_CHANNEL_PATH_Pos)
  93. #define EVSYS_CHANNEL_EDGSEL_Pos 26 /**< \brief (EVSYS_CHANNEL) Edge Detection Selection */
  94. #define EVSYS_CHANNEL_EDGSEL_Msk (_U_(0x3) << EVSYS_CHANNEL_EDGSEL_Pos)
  95. #define EVSYS_CHANNEL_EDGSEL(value) (EVSYS_CHANNEL_EDGSEL_Msk & ((value) << EVSYS_CHANNEL_EDGSEL_Pos))
  96. #define EVSYS_CHANNEL_EDGSEL_NO_EVT_OUTPUT_Val _U_(0x0) /**< \brief (EVSYS_CHANNEL) No event output when using the resynchronized or synchronous path */
  97. #define EVSYS_CHANNEL_EDGSEL_RISING_EDGE_Val _U_(0x1) /**< \brief (EVSYS_CHANNEL) Event detection only on the rising edge of the signal from the event generator when using the resynchronized or synchronous path */
  98. #define EVSYS_CHANNEL_EDGSEL_FALLING_EDGE_Val _U_(0x2) /**< \brief (EVSYS_CHANNEL) Event detection only on the falling edge of the signal from the event generator when using the resynchronized or synchronous path */
  99. #define EVSYS_CHANNEL_EDGSEL_BOTH_EDGES_Val _U_(0x3) /**< \brief (EVSYS_CHANNEL) Event detection on rising and falling edges of the signal from the event generator when using the resynchronized or synchronous path */
  100. #define EVSYS_CHANNEL_EDGSEL_NO_EVT_OUTPUT (EVSYS_CHANNEL_EDGSEL_NO_EVT_OUTPUT_Val << EVSYS_CHANNEL_EDGSEL_Pos)
  101. #define EVSYS_CHANNEL_EDGSEL_RISING_EDGE (EVSYS_CHANNEL_EDGSEL_RISING_EDGE_Val << EVSYS_CHANNEL_EDGSEL_Pos)
  102. #define EVSYS_CHANNEL_EDGSEL_FALLING_EDGE (EVSYS_CHANNEL_EDGSEL_FALLING_EDGE_Val << EVSYS_CHANNEL_EDGSEL_Pos)
  103. #define EVSYS_CHANNEL_EDGSEL_BOTH_EDGES (EVSYS_CHANNEL_EDGSEL_BOTH_EDGES_Val << EVSYS_CHANNEL_EDGSEL_Pos)
  104. #define EVSYS_CHANNEL_MASK _U_(0x0F3F0107) /**< \brief (EVSYS_CHANNEL) MASK Register */
  105. /* -------- EVSYS_USER : (EVSYS Offset: 0x08) (R/W 16) User Multiplexer -------- */
  106. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  107. typedef union {
  108. struct {
  109. uint16_t USER:5; /*!< bit: 0.. 4 User Multiplexer Selection */
  110. uint16_t :3; /*!< bit: 5.. 7 Reserved */
  111. uint16_t CHANNEL:4; /*!< bit: 8..11 Channel Event Selection */
  112. uint16_t :4; /*!< bit: 12..15 Reserved */
  113. } bit; /*!< Structure used for bit access */
  114. uint16_t reg; /*!< Type used for register access */
  115. } EVSYS_USER_Type;
  116. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  117. #define EVSYS_USER_OFFSET 0x08 /**< \brief (EVSYS_USER offset) User Multiplexer */
  118. #define EVSYS_USER_RESETVALUE _U_(0x0000) /**< \brief (EVSYS_USER reset_value) User Multiplexer */
  119. #define EVSYS_USER_USER_Pos 0 /**< \brief (EVSYS_USER) User Multiplexer Selection */
  120. #define EVSYS_USER_USER_Msk (_U_(0x1F) << EVSYS_USER_USER_Pos)
  121. #define EVSYS_USER_USER(value) (EVSYS_USER_USER_Msk & ((value) << EVSYS_USER_USER_Pos))
  122. #define EVSYS_USER_CHANNEL_Pos 8 /**< \brief (EVSYS_USER) Channel Event Selection */
  123. #define EVSYS_USER_CHANNEL_Msk (_U_(0xF) << EVSYS_USER_CHANNEL_Pos)
  124. #define EVSYS_USER_CHANNEL(value) (EVSYS_USER_CHANNEL_Msk & ((value) << EVSYS_USER_CHANNEL_Pos))
  125. #define EVSYS_USER_CHANNEL_0_Val _U_(0x0) /**< \brief (EVSYS_USER) No Channel Output Selected */
  126. #define EVSYS_USER_CHANNEL_0 (EVSYS_USER_CHANNEL_0_Val << EVSYS_USER_CHANNEL_Pos)
  127. #define EVSYS_USER_MASK _U_(0x0F1F) /**< \brief (EVSYS_USER) MASK Register */
  128. /* -------- EVSYS_CHSTATUS : (EVSYS Offset: 0x0C) (R/ 32) Channel Status -------- */
  129. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  130. typedef union {
  131. struct {
  132. uint32_t USRRDY0:1; /*!< bit: 0 Channel 0 User Ready */
  133. uint32_t USRRDY1:1; /*!< bit: 1 Channel 1 User Ready */
  134. uint32_t USRRDY2:1; /*!< bit: 2 Channel 2 User Ready */
  135. uint32_t USRRDY3:1; /*!< bit: 3 Channel 3 User Ready */
  136. uint32_t USRRDY4:1; /*!< bit: 4 Channel 4 User Ready */
  137. uint32_t USRRDY5:1; /*!< bit: 5 Channel 5 User Ready */
  138. uint32_t :2; /*!< bit: 6.. 7 Reserved */
  139. uint32_t CHBUSY0:1; /*!< bit: 8 Channel 0 Busy */
  140. uint32_t CHBUSY1:1; /*!< bit: 9 Channel 1 Busy */
  141. uint32_t CHBUSY2:1; /*!< bit: 10 Channel 2 Busy */
  142. uint32_t CHBUSY3:1; /*!< bit: 11 Channel 3 Busy */
  143. uint32_t CHBUSY4:1; /*!< bit: 12 Channel 4 Busy */
  144. uint32_t CHBUSY5:1; /*!< bit: 13 Channel 5 Busy */
  145. uint32_t :18; /*!< bit: 14..31 Reserved */
  146. } bit; /*!< Structure used for bit access */
  147. struct {
  148. uint32_t USRRDY:6; /*!< bit: 0.. 5 Channel x User Ready */
  149. uint32_t :2; /*!< bit: 6.. 7 Reserved */
  150. uint32_t CHBUSY:6; /*!< bit: 8..13 Channel x Busy */
  151. uint32_t :18; /*!< bit: 14..31 Reserved */
  152. } vec; /*!< Structure used for vec access */
  153. uint32_t reg; /*!< Type used for register access */
  154. } EVSYS_CHSTATUS_Type;
  155. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  156. #define EVSYS_CHSTATUS_OFFSET 0x0C /**< \brief (EVSYS_CHSTATUS offset) Channel Status */
  157. #define EVSYS_CHSTATUS_RESETVALUE _U_(0x0000003F) /**< \brief (EVSYS_CHSTATUS reset_value) Channel Status */
  158. #define EVSYS_CHSTATUS_USRRDY0_Pos 0 /**< \brief (EVSYS_CHSTATUS) Channel 0 User Ready */
  159. #define EVSYS_CHSTATUS_USRRDY0 (_U_(1) << EVSYS_CHSTATUS_USRRDY0_Pos)
  160. #define EVSYS_CHSTATUS_USRRDY1_Pos 1 /**< \brief (EVSYS_CHSTATUS) Channel 1 User Ready */
  161. #define EVSYS_CHSTATUS_USRRDY1 (_U_(1) << EVSYS_CHSTATUS_USRRDY1_Pos)
  162. #define EVSYS_CHSTATUS_USRRDY2_Pos 2 /**< \brief (EVSYS_CHSTATUS) Channel 2 User Ready */
  163. #define EVSYS_CHSTATUS_USRRDY2 (_U_(1) << EVSYS_CHSTATUS_USRRDY2_Pos)
  164. #define EVSYS_CHSTATUS_USRRDY3_Pos 3 /**< \brief (EVSYS_CHSTATUS) Channel 3 User Ready */
  165. #define EVSYS_CHSTATUS_USRRDY3 (_U_(1) << EVSYS_CHSTATUS_USRRDY3_Pos)
  166. #define EVSYS_CHSTATUS_USRRDY4_Pos 4 /**< \brief (EVSYS_CHSTATUS) Channel 4 User Ready */
  167. #define EVSYS_CHSTATUS_USRRDY4 (_U_(1) << EVSYS_CHSTATUS_USRRDY4_Pos)
  168. #define EVSYS_CHSTATUS_USRRDY5_Pos 5 /**< \brief (EVSYS_CHSTATUS) Channel 5 User Ready */
  169. #define EVSYS_CHSTATUS_USRRDY5 (_U_(1) << EVSYS_CHSTATUS_USRRDY5_Pos)
  170. #define EVSYS_CHSTATUS_USRRDY_Pos 0 /**< \brief (EVSYS_CHSTATUS) Channel x User Ready */
  171. #define EVSYS_CHSTATUS_USRRDY_Msk (_U_(0x3F) << EVSYS_CHSTATUS_USRRDY_Pos)
  172. #define EVSYS_CHSTATUS_USRRDY(value) (EVSYS_CHSTATUS_USRRDY_Msk & ((value) << EVSYS_CHSTATUS_USRRDY_Pos))
  173. #define EVSYS_CHSTATUS_CHBUSY0_Pos 8 /**< \brief (EVSYS_CHSTATUS) Channel 0 Busy */
  174. #define EVSYS_CHSTATUS_CHBUSY0 (_U_(1) << EVSYS_CHSTATUS_CHBUSY0_Pos)
  175. #define EVSYS_CHSTATUS_CHBUSY1_Pos 9 /**< \brief (EVSYS_CHSTATUS) Channel 1 Busy */
  176. #define EVSYS_CHSTATUS_CHBUSY1 (_U_(1) << EVSYS_CHSTATUS_CHBUSY1_Pos)
  177. #define EVSYS_CHSTATUS_CHBUSY2_Pos 10 /**< \brief (EVSYS_CHSTATUS) Channel 2 Busy */
  178. #define EVSYS_CHSTATUS_CHBUSY2 (_U_(1) << EVSYS_CHSTATUS_CHBUSY2_Pos)
  179. #define EVSYS_CHSTATUS_CHBUSY3_Pos 11 /**< \brief (EVSYS_CHSTATUS) Channel 3 Busy */
  180. #define EVSYS_CHSTATUS_CHBUSY3 (_U_(1) << EVSYS_CHSTATUS_CHBUSY3_Pos)
  181. #define EVSYS_CHSTATUS_CHBUSY4_Pos 12 /**< \brief (EVSYS_CHSTATUS) Channel 4 Busy */
  182. #define EVSYS_CHSTATUS_CHBUSY4 (_U_(1) << EVSYS_CHSTATUS_CHBUSY4_Pos)
  183. #define EVSYS_CHSTATUS_CHBUSY5_Pos 13 /**< \brief (EVSYS_CHSTATUS) Channel 5 Busy */
  184. #define EVSYS_CHSTATUS_CHBUSY5 (_U_(1) << EVSYS_CHSTATUS_CHBUSY5_Pos)
  185. #define EVSYS_CHSTATUS_CHBUSY_Pos 8 /**< \brief (EVSYS_CHSTATUS) Channel x Busy */
  186. #define EVSYS_CHSTATUS_CHBUSY_Msk (_U_(0x3F) << EVSYS_CHSTATUS_CHBUSY_Pos)
  187. #define EVSYS_CHSTATUS_CHBUSY(value) (EVSYS_CHSTATUS_CHBUSY_Msk & ((value) << EVSYS_CHSTATUS_CHBUSY_Pos))
  188. #define EVSYS_CHSTATUS_MASK _U_(0x00003F3F) /**< \brief (EVSYS_CHSTATUS) MASK Register */
  189. /* -------- EVSYS_INTENCLR : (EVSYS Offset: 0x10) (R/W 32) Interrupt Enable Clear -------- */
  190. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  191. typedef union {
  192. struct {
  193. uint32_t OVR0:1; /*!< bit: 0 Channel 0 Overrun Interrupt Enable */
  194. uint32_t OVR1:1; /*!< bit: 1 Channel 1 Overrun Interrupt Enable */
  195. uint32_t OVR2:1; /*!< bit: 2 Channel 2 Overrun Interrupt Enable */
  196. uint32_t OVR3:1; /*!< bit: 3 Channel 3 Overrun Interrupt Enable */
  197. uint32_t OVR4:1; /*!< bit: 4 Channel 4 Overrun Interrupt Enable */
  198. uint32_t OVR5:1; /*!< bit: 5 Channel 5 Overrun Interrupt Enable */
  199. uint32_t :2; /*!< bit: 6.. 7 Reserved */
  200. uint32_t EVD0:1; /*!< bit: 8 Channel 0 Event Detection Interrupt Enable */
  201. uint32_t EVD1:1; /*!< bit: 9 Channel 1 Event Detection Interrupt Enable */
  202. uint32_t EVD2:1; /*!< bit: 10 Channel 2 Event Detection Interrupt Enable */
  203. uint32_t EVD3:1; /*!< bit: 11 Channel 3 Event Detection Interrupt Enable */
  204. uint32_t EVD4:1; /*!< bit: 12 Channel 4 Event Detection Interrupt Enable */
  205. uint32_t EVD5:1; /*!< bit: 13 Channel 5 Event Detection Interrupt Enable */
  206. uint32_t :18; /*!< bit: 14..31 Reserved */
  207. } bit; /*!< Structure used for bit access */
  208. struct {
  209. uint32_t OVR:6; /*!< bit: 0.. 5 Channel x Overrun Interrupt Enable */
  210. uint32_t :2; /*!< bit: 6.. 7 Reserved */
  211. uint32_t EVD:6; /*!< bit: 8..13 Channel x Event Detection Interrupt Enable */
  212. uint32_t :18; /*!< bit: 14..31 Reserved */
  213. } vec; /*!< Structure used for vec access */
  214. uint32_t reg; /*!< Type used for register access */
  215. } EVSYS_INTENCLR_Type;
  216. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  217. #define EVSYS_INTENCLR_OFFSET 0x10 /**< \brief (EVSYS_INTENCLR offset) Interrupt Enable Clear */
  218. #define EVSYS_INTENCLR_RESETVALUE _U_(0x00000000) /**< \brief (EVSYS_INTENCLR reset_value) Interrupt Enable Clear */
  219. #define EVSYS_INTENCLR_OVR0_Pos 0 /**< \brief (EVSYS_INTENCLR) Channel 0 Overrun Interrupt Enable */
  220. #define EVSYS_INTENCLR_OVR0 (_U_(1) << EVSYS_INTENCLR_OVR0_Pos)
  221. #define EVSYS_INTENCLR_OVR1_Pos 1 /**< \brief (EVSYS_INTENCLR) Channel 1 Overrun Interrupt Enable */
  222. #define EVSYS_INTENCLR_OVR1 (_U_(1) << EVSYS_INTENCLR_OVR1_Pos)
  223. #define EVSYS_INTENCLR_OVR2_Pos 2 /**< \brief (EVSYS_INTENCLR) Channel 2 Overrun Interrupt Enable */
  224. #define EVSYS_INTENCLR_OVR2 (_U_(1) << EVSYS_INTENCLR_OVR2_Pos)
  225. #define EVSYS_INTENCLR_OVR3_Pos 3 /**< \brief (EVSYS_INTENCLR) Channel 3 Overrun Interrupt Enable */
  226. #define EVSYS_INTENCLR_OVR3 (_U_(1) << EVSYS_INTENCLR_OVR3_Pos)
  227. #define EVSYS_INTENCLR_OVR4_Pos 4 /**< \brief (EVSYS_INTENCLR) Channel 4 Overrun Interrupt Enable */
  228. #define EVSYS_INTENCLR_OVR4 (_U_(1) << EVSYS_INTENCLR_OVR4_Pos)
  229. #define EVSYS_INTENCLR_OVR5_Pos 5 /**< \brief (EVSYS_INTENCLR) Channel 5 Overrun Interrupt Enable */
  230. #define EVSYS_INTENCLR_OVR5 (_U_(1) << EVSYS_INTENCLR_OVR5_Pos)
  231. #define EVSYS_INTENCLR_OVR_Pos 0 /**< \brief (EVSYS_INTENCLR) Channel x Overrun Interrupt Enable */
  232. #define EVSYS_INTENCLR_OVR_Msk (_U_(0x3F) << EVSYS_INTENCLR_OVR_Pos)
  233. #define EVSYS_INTENCLR_OVR(value) (EVSYS_INTENCLR_OVR_Msk & ((value) << EVSYS_INTENCLR_OVR_Pos))
  234. #define EVSYS_INTENCLR_EVD0_Pos 8 /**< \brief (EVSYS_INTENCLR) Channel 0 Event Detection Interrupt Enable */
  235. #define EVSYS_INTENCLR_EVD0 (_U_(1) << EVSYS_INTENCLR_EVD0_Pos)
  236. #define EVSYS_INTENCLR_EVD1_Pos 9 /**< \brief (EVSYS_INTENCLR) Channel 1 Event Detection Interrupt Enable */
  237. #define EVSYS_INTENCLR_EVD1 (_U_(1) << EVSYS_INTENCLR_EVD1_Pos)
  238. #define EVSYS_INTENCLR_EVD2_Pos 10 /**< \brief (EVSYS_INTENCLR) Channel 2 Event Detection Interrupt Enable */
  239. #define EVSYS_INTENCLR_EVD2 (_U_(1) << EVSYS_INTENCLR_EVD2_Pos)
  240. #define EVSYS_INTENCLR_EVD3_Pos 11 /**< \brief (EVSYS_INTENCLR) Channel 3 Event Detection Interrupt Enable */
  241. #define EVSYS_INTENCLR_EVD3 (_U_(1) << EVSYS_INTENCLR_EVD3_Pos)
  242. #define EVSYS_INTENCLR_EVD4_Pos 12 /**< \brief (EVSYS_INTENCLR) Channel 4 Event Detection Interrupt Enable */
  243. #define EVSYS_INTENCLR_EVD4 (_U_(1) << EVSYS_INTENCLR_EVD4_Pos)
  244. #define EVSYS_INTENCLR_EVD5_Pos 13 /**< \brief (EVSYS_INTENCLR) Channel 5 Event Detection Interrupt Enable */
  245. #define EVSYS_INTENCLR_EVD5 (_U_(1) << EVSYS_INTENCLR_EVD5_Pos)
  246. #define EVSYS_INTENCLR_EVD_Pos 8 /**< \brief (EVSYS_INTENCLR) Channel x Event Detection Interrupt Enable */
  247. #define EVSYS_INTENCLR_EVD_Msk (_U_(0x3F) << EVSYS_INTENCLR_EVD_Pos)
  248. #define EVSYS_INTENCLR_EVD(value) (EVSYS_INTENCLR_EVD_Msk & ((value) << EVSYS_INTENCLR_EVD_Pos))
  249. #define EVSYS_INTENCLR_MASK _U_(0x00003F3F) /**< \brief (EVSYS_INTENCLR) MASK Register */
  250. /* -------- EVSYS_INTENSET : (EVSYS Offset: 0x14) (R/W 32) Interrupt Enable Set -------- */
  251. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  252. typedef union {
  253. struct {
  254. uint32_t OVR0:1; /*!< bit: 0 Channel 0 Overrun Interrupt Enable */
  255. uint32_t OVR1:1; /*!< bit: 1 Channel 1 Overrun Interrupt Enable */
  256. uint32_t OVR2:1; /*!< bit: 2 Channel 2 Overrun Interrupt Enable */
  257. uint32_t OVR3:1; /*!< bit: 3 Channel 3 Overrun Interrupt Enable */
  258. uint32_t OVR4:1; /*!< bit: 4 Channel 4 Overrun Interrupt Enable */
  259. uint32_t OVR5:1; /*!< bit: 5 Channel 5 Overrun Interrupt Enable */
  260. uint32_t :2; /*!< bit: 6.. 7 Reserved */
  261. uint32_t EVD0:1; /*!< bit: 8 Channel 0 Event Detection Interrupt Enable */
  262. uint32_t EVD1:1; /*!< bit: 9 Channel 1 Event Detection Interrupt Enable */
  263. uint32_t EVD2:1; /*!< bit: 10 Channel 2 Event Detection Interrupt Enable */
  264. uint32_t EVD3:1; /*!< bit: 11 Channel 3 Event Detection Interrupt Enable */
  265. uint32_t EVD4:1; /*!< bit: 12 Channel 4 Event Detection Interrupt Enable */
  266. uint32_t EVD5:1; /*!< bit: 13 Channel 5 Event Detection Interrupt Enable */
  267. uint32_t :18; /*!< bit: 14..31 Reserved */
  268. } bit; /*!< Structure used for bit access */
  269. struct {
  270. uint32_t OVR:6; /*!< bit: 0.. 5 Channel x Overrun Interrupt Enable */
  271. uint32_t :2; /*!< bit: 6.. 7 Reserved */
  272. uint32_t EVD:6; /*!< bit: 8..13 Channel x Event Detection Interrupt Enable */
  273. uint32_t :18; /*!< bit: 14..31 Reserved */
  274. } vec; /*!< Structure used for vec access */
  275. uint32_t reg; /*!< Type used for register access */
  276. } EVSYS_INTENSET_Type;
  277. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  278. #define EVSYS_INTENSET_OFFSET 0x14 /**< \brief (EVSYS_INTENSET offset) Interrupt Enable Set */
  279. #define EVSYS_INTENSET_RESETVALUE _U_(0x00000000) /**< \brief (EVSYS_INTENSET reset_value) Interrupt Enable Set */
  280. #define EVSYS_INTENSET_OVR0_Pos 0 /**< \brief (EVSYS_INTENSET) Channel 0 Overrun Interrupt Enable */
  281. #define EVSYS_INTENSET_OVR0 (_U_(1) << EVSYS_INTENSET_OVR0_Pos)
  282. #define EVSYS_INTENSET_OVR1_Pos 1 /**< \brief (EVSYS_INTENSET) Channel 1 Overrun Interrupt Enable */
  283. #define EVSYS_INTENSET_OVR1 (_U_(1) << EVSYS_INTENSET_OVR1_Pos)
  284. #define EVSYS_INTENSET_OVR2_Pos 2 /**< \brief (EVSYS_INTENSET) Channel 2 Overrun Interrupt Enable */
  285. #define EVSYS_INTENSET_OVR2 (_U_(1) << EVSYS_INTENSET_OVR2_Pos)
  286. #define EVSYS_INTENSET_OVR3_Pos 3 /**< \brief (EVSYS_INTENSET) Channel 3 Overrun Interrupt Enable */
  287. #define EVSYS_INTENSET_OVR3 (_U_(1) << EVSYS_INTENSET_OVR3_Pos)
  288. #define EVSYS_INTENSET_OVR4_Pos 4 /**< \brief (EVSYS_INTENSET) Channel 4 Overrun Interrupt Enable */
  289. #define EVSYS_INTENSET_OVR4 (_U_(1) << EVSYS_INTENSET_OVR4_Pos)
  290. #define EVSYS_INTENSET_OVR5_Pos 5 /**< \brief (EVSYS_INTENSET) Channel 5 Overrun Interrupt Enable */
  291. #define EVSYS_INTENSET_OVR5 (_U_(1) << EVSYS_INTENSET_OVR5_Pos)
  292. #define EVSYS_INTENSET_OVR_Pos 0 /**< \brief (EVSYS_INTENSET) Channel x Overrun Interrupt Enable */
  293. #define EVSYS_INTENSET_OVR_Msk (_U_(0x3F) << EVSYS_INTENSET_OVR_Pos)
  294. #define EVSYS_INTENSET_OVR(value) (EVSYS_INTENSET_OVR_Msk & ((value) << EVSYS_INTENSET_OVR_Pos))
  295. #define EVSYS_INTENSET_EVD0_Pos 8 /**< \brief (EVSYS_INTENSET) Channel 0 Event Detection Interrupt Enable */
  296. #define EVSYS_INTENSET_EVD0 (_U_(1) << EVSYS_INTENSET_EVD0_Pos)
  297. #define EVSYS_INTENSET_EVD1_Pos 9 /**< \brief (EVSYS_INTENSET) Channel 1 Event Detection Interrupt Enable */
  298. #define EVSYS_INTENSET_EVD1 (_U_(1) << EVSYS_INTENSET_EVD1_Pos)
  299. #define EVSYS_INTENSET_EVD2_Pos 10 /**< \brief (EVSYS_INTENSET) Channel 2 Event Detection Interrupt Enable */
  300. #define EVSYS_INTENSET_EVD2 (_U_(1) << EVSYS_INTENSET_EVD2_Pos)
  301. #define EVSYS_INTENSET_EVD3_Pos 11 /**< \brief (EVSYS_INTENSET) Channel 3 Event Detection Interrupt Enable */
  302. #define EVSYS_INTENSET_EVD3 (_U_(1) << EVSYS_INTENSET_EVD3_Pos)
  303. #define EVSYS_INTENSET_EVD4_Pos 12 /**< \brief (EVSYS_INTENSET) Channel 4 Event Detection Interrupt Enable */
  304. #define EVSYS_INTENSET_EVD4 (_U_(1) << EVSYS_INTENSET_EVD4_Pos)
  305. #define EVSYS_INTENSET_EVD5_Pos 13 /**< \brief (EVSYS_INTENSET) Channel 5 Event Detection Interrupt Enable */
  306. #define EVSYS_INTENSET_EVD5 (_U_(1) << EVSYS_INTENSET_EVD5_Pos)
  307. #define EVSYS_INTENSET_EVD_Pos 8 /**< \brief (EVSYS_INTENSET) Channel x Event Detection Interrupt Enable */
  308. #define EVSYS_INTENSET_EVD_Msk (_U_(0x3F) << EVSYS_INTENSET_EVD_Pos)
  309. #define EVSYS_INTENSET_EVD(value) (EVSYS_INTENSET_EVD_Msk & ((value) << EVSYS_INTENSET_EVD_Pos))
  310. #define EVSYS_INTENSET_MASK _U_(0x00003F3F) /**< \brief (EVSYS_INTENSET) MASK Register */
  311. /* -------- EVSYS_INTFLAG : (EVSYS Offset: 0x18) (R/W 32) Interrupt Flag Status and Clear -------- */
  312. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  313. typedef union { // __I to avoid read-modify-write on write-to-clear register
  314. struct {
  315. __I uint32_t OVR0:1; /*!< bit: 0 Channel 0 Overrun */
  316. __I uint32_t OVR1:1; /*!< bit: 1 Channel 1 Overrun */
  317. __I uint32_t OVR2:1; /*!< bit: 2 Channel 2 Overrun */
  318. __I uint32_t OVR3:1; /*!< bit: 3 Channel 3 Overrun */
  319. __I uint32_t OVR4:1; /*!< bit: 4 Channel 4 Overrun */
  320. __I uint32_t OVR5:1; /*!< bit: 5 Channel 5 Overrun */
  321. __I uint32_t :2; /*!< bit: 6.. 7 Reserved */
  322. __I uint32_t EVD0:1; /*!< bit: 8 Channel 0 Event Detection */
  323. __I uint32_t EVD1:1; /*!< bit: 9 Channel 1 Event Detection */
  324. __I uint32_t EVD2:1; /*!< bit: 10 Channel 2 Event Detection */
  325. __I uint32_t EVD3:1; /*!< bit: 11 Channel 3 Event Detection */
  326. __I uint32_t EVD4:1; /*!< bit: 12 Channel 4 Event Detection */
  327. __I uint32_t EVD5:1; /*!< bit: 13 Channel 5 Event Detection */
  328. __I uint32_t :18; /*!< bit: 14..31 Reserved */
  329. } bit; /*!< Structure used for bit access */
  330. struct {
  331. __I uint32_t OVR:6; /*!< bit: 0.. 5 Channel x Overrun */
  332. __I uint32_t :2; /*!< bit: 6.. 7 Reserved */
  333. __I uint32_t EVD:6; /*!< bit: 8..13 Channel x Event Detection */
  334. __I uint32_t :18; /*!< bit: 14..31 Reserved */
  335. } vec; /*!< Structure used for vec access */
  336. uint32_t reg; /*!< Type used for register access */
  337. } EVSYS_INTFLAG_Type;
  338. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  339. #define EVSYS_INTFLAG_OFFSET 0x18 /**< \brief (EVSYS_INTFLAG offset) Interrupt Flag Status and Clear */
  340. #define EVSYS_INTFLAG_RESETVALUE _U_(0x00000000) /**< \brief (EVSYS_INTFLAG reset_value) Interrupt Flag Status and Clear */
  341. #define EVSYS_INTFLAG_OVR0_Pos 0 /**< \brief (EVSYS_INTFLAG) Channel 0 Overrun */
  342. #define EVSYS_INTFLAG_OVR0 (_U_(1) << EVSYS_INTFLAG_OVR0_Pos)
  343. #define EVSYS_INTFLAG_OVR1_Pos 1 /**< \brief (EVSYS_INTFLAG) Channel 1 Overrun */
  344. #define EVSYS_INTFLAG_OVR1 (_U_(1) << EVSYS_INTFLAG_OVR1_Pos)
  345. #define EVSYS_INTFLAG_OVR2_Pos 2 /**< \brief (EVSYS_INTFLAG) Channel 2 Overrun */
  346. #define EVSYS_INTFLAG_OVR2 (_U_(1) << EVSYS_INTFLAG_OVR2_Pos)
  347. #define EVSYS_INTFLAG_OVR3_Pos 3 /**< \brief (EVSYS_INTFLAG) Channel 3 Overrun */
  348. #define EVSYS_INTFLAG_OVR3 (_U_(1) << EVSYS_INTFLAG_OVR3_Pos)
  349. #define EVSYS_INTFLAG_OVR4_Pos 4 /**< \brief (EVSYS_INTFLAG) Channel 4 Overrun */
  350. #define EVSYS_INTFLAG_OVR4 (_U_(1) << EVSYS_INTFLAG_OVR4_Pos)
  351. #define EVSYS_INTFLAG_OVR5_Pos 5 /**< \brief (EVSYS_INTFLAG) Channel 5 Overrun */
  352. #define EVSYS_INTFLAG_OVR5 (_U_(1) << EVSYS_INTFLAG_OVR5_Pos)
  353. #define EVSYS_INTFLAG_OVR_Pos 0 /**< \brief (EVSYS_INTFLAG) Channel x Overrun */
  354. #define EVSYS_INTFLAG_OVR_Msk (_U_(0x3F) << EVSYS_INTFLAG_OVR_Pos)
  355. #define EVSYS_INTFLAG_OVR(value) (EVSYS_INTFLAG_OVR_Msk & ((value) << EVSYS_INTFLAG_OVR_Pos))
  356. #define EVSYS_INTFLAG_EVD0_Pos 8 /**< \brief (EVSYS_INTFLAG) Channel 0 Event Detection */
  357. #define EVSYS_INTFLAG_EVD0 (_U_(1) << EVSYS_INTFLAG_EVD0_Pos)
  358. #define EVSYS_INTFLAG_EVD1_Pos 9 /**< \brief (EVSYS_INTFLAG) Channel 1 Event Detection */
  359. #define EVSYS_INTFLAG_EVD1 (_U_(1) << EVSYS_INTFLAG_EVD1_Pos)
  360. #define EVSYS_INTFLAG_EVD2_Pos 10 /**< \brief (EVSYS_INTFLAG) Channel 2 Event Detection */
  361. #define EVSYS_INTFLAG_EVD2 (_U_(1) << EVSYS_INTFLAG_EVD2_Pos)
  362. #define EVSYS_INTFLAG_EVD3_Pos 11 /**< \brief (EVSYS_INTFLAG) Channel 3 Event Detection */
  363. #define EVSYS_INTFLAG_EVD3 (_U_(1) << EVSYS_INTFLAG_EVD3_Pos)
  364. #define EVSYS_INTFLAG_EVD4_Pos 12 /**< \brief (EVSYS_INTFLAG) Channel 4 Event Detection */
  365. #define EVSYS_INTFLAG_EVD4 (_U_(1) << EVSYS_INTFLAG_EVD4_Pos)
  366. #define EVSYS_INTFLAG_EVD5_Pos 13 /**< \brief (EVSYS_INTFLAG) Channel 5 Event Detection */
  367. #define EVSYS_INTFLAG_EVD5 (_U_(1) << EVSYS_INTFLAG_EVD5_Pos)
  368. #define EVSYS_INTFLAG_EVD_Pos 8 /**< \brief (EVSYS_INTFLAG) Channel x Event Detection */
  369. #define EVSYS_INTFLAG_EVD_Msk (_U_(0x3F) << EVSYS_INTFLAG_EVD_Pos)
  370. #define EVSYS_INTFLAG_EVD(value) (EVSYS_INTFLAG_EVD_Msk & ((value) << EVSYS_INTFLAG_EVD_Pos))
  371. #define EVSYS_INTFLAG_MASK _U_(0x00003F3F) /**< \brief (EVSYS_INTFLAG) MASK Register */
  372. /** \brief EVSYS hardware registers */
  373. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  374. typedef struct {
  375. __O EVSYS_CTRL_Type CTRL; /**< \brief Offset: 0x00 ( /W 8) Control */
  376. RoReg8 Reserved1[0x3];
  377. __IO EVSYS_CHANNEL_Type CHANNEL; /**< \brief Offset: 0x04 (R/W 32) Channel */
  378. __IO EVSYS_USER_Type USER; /**< \brief Offset: 0x08 (R/W 16) User Multiplexer */
  379. RoReg8 Reserved2[0x2];
  380. __I EVSYS_CHSTATUS_Type CHSTATUS; /**< \brief Offset: 0x0C (R/ 32) Channel Status */
  381. __IO EVSYS_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x10 (R/W 32) Interrupt Enable Clear */
  382. __IO EVSYS_INTENSET_Type INTENSET; /**< \brief Offset: 0x14 (R/W 32) Interrupt Enable Set */
  383. __IO EVSYS_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x18 (R/W 32) Interrupt Flag Status and Clear */
  384. } Evsys;
  385. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  386. /*@}*/
  387. #endif /* _SAMD11_EVSYS_COMPONENT_ */