evsys.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /**
  2. * \file
  3. *
  4. * \brief Instance description for EVSYS
  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_EVSYS_INSTANCE_
  47. #define _SAMD21_EVSYS_INSTANCE_
  48. /* ========== Register definition for EVSYS peripheral ========== */
  49. #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  50. #define REG_EVSYS_CTRL (0x42000400U) /**< \brief (EVSYS) Control */
  51. #define REG_EVSYS_CHANNEL (0x42000404U) /**< \brief (EVSYS) Channel */
  52. #define REG_EVSYS_USER (0x42000408U) /**< \brief (EVSYS) User Multiplexer */
  53. #define REG_EVSYS_CHSTATUS (0x4200040CU) /**< \brief (EVSYS) Channel Status */
  54. #define REG_EVSYS_INTENCLR (0x42000410U) /**< \brief (EVSYS) Interrupt Enable Clear */
  55. #define REG_EVSYS_INTENSET (0x42000414U) /**< \brief (EVSYS) Interrupt Enable Set */
  56. #define REG_EVSYS_INTFLAG (0x42000418U) /**< \brief (EVSYS) Interrupt Flag Status and Clear */
  57. #else
  58. #define REG_EVSYS_CTRL (*(WoReg8 *)0x42000400U) /**< \brief (EVSYS) Control */
  59. #define REG_EVSYS_CHANNEL (*(RwReg *)0x42000404U) /**< \brief (EVSYS) Channel */
  60. #define REG_EVSYS_USER (*(RwReg16*)0x42000408U) /**< \brief (EVSYS) User Multiplexer */
  61. #define REG_EVSYS_CHSTATUS (*(RoReg *)0x4200040CU) /**< \brief (EVSYS) Channel Status */
  62. #define REG_EVSYS_INTENCLR (*(RwReg *)0x42000410U) /**< \brief (EVSYS) Interrupt Enable Clear */
  63. #define REG_EVSYS_INTENSET (*(RwReg *)0x42000414U) /**< \brief (EVSYS) Interrupt Enable Set */
  64. #define REG_EVSYS_INTFLAG (*(RwReg *)0x42000418U) /**< \brief (EVSYS) Interrupt Flag Status and Clear */
  65. #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  66. /* ========== Instance parameters for EVSYS peripheral ========== */
  67. #define EVSYS_CHANNELS 12 // Number of Channels
  68. #define EVSYS_CHANNELS_BITS 4 // Number of bits to select Channel
  69. #define EVSYS_CHANNELS_MSB 11 // Number of Channels - 1
  70. #define EVSYS_EXTEVT_NUM 0 // Number of External Event Generators
  71. #define EVSYS_GCLK_ID_0 7
  72. #define EVSYS_GCLK_ID_1 8
  73. #define EVSYS_GCLK_ID_2 9
  74. #define EVSYS_GCLK_ID_3 10
  75. #define EVSYS_GCLK_ID_4 11
  76. #define EVSYS_GCLK_ID_5 12
  77. #define EVSYS_GCLK_ID_6 13
  78. #define EVSYS_GCLK_ID_7 14
  79. #define EVSYS_GCLK_ID_8 15
  80. #define EVSYS_GCLK_ID_9 16
  81. #define EVSYS_GCLK_ID_10 17
  82. #define EVSYS_GCLK_ID_11 18
  83. #define EVSYS_GCLK_ID_LSB 7
  84. #define EVSYS_GCLK_ID_MSB 18
  85. #define EVSYS_GCLK_ID_SIZE 12
  86. #define EVSYS_GENERATORS 76 // Total Number of Event Generators
  87. #define EVSYS_GENERATORS_BITS 7 // Number of bits to select Event Generator
  88. #define EVSYS_USERS 31 // Total Number of Event Users
  89. #define EVSYS_USERS_BITS 5 // Number of bits to select Event User
  90. // GENERATORS
  91. #define EVSYS_ID_GEN_RTC_CMP_0 1
  92. #define EVSYS_ID_GEN_RTC_CMP_1 2
  93. #define EVSYS_ID_GEN_RTC_OVF 3
  94. #define EVSYS_ID_GEN_RTC_PER_0 4
  95. #define EVSYS_ID_GEN_RTC_PER_1 5
  96. #define EVSYS_ID_GEN_RTC_PER_2 6
  97. #define EVSYS_ID_GEN_RTC_PER_3 7
  98. #define EVSYS_ID_GEN_RTC_PER_4 8
  99. #define EVSYS_ID_GEN_RTC_PER_5 9
  100. #define EVSYS_ID_GEN_RTC_PER_6 10
  101. #define EVSYS_ID_GEN_RTC_PER_7 11
  102. #define EVSYS_ID_GEN_EIC_EXTINT_0 12
  103. #define EVSYS_ID_GEN_EIC_EXTINT_1 13
  104. #define EVSYS_ID_GEN_EIC_EXTINT_2 14
  105. #define EVSYS_ID_GEN_EIC_EXTINT_3 15
  106. #define EVSYS_ID_GEN_EIC_EXTINT_4 16
  107. #define EVSYS_ID_GEN_EIC_EXTINT_5 17
  108. #define EVSYS_ID_GEN_EIC_EXTINT_6 18
  109. #define EVSYS_ID_GEN_EIC_EXTINT_7 19
  110. #define EVSYS_ID_GEN_EIC_EXTINT_8 20
  111. #define EVSYS_ID_GEN_EIC_EXTINT_9 21
  112. #define EVSYS_ID_GEN_EIC_EXTINT_10 22
  113. #define EVSYS_ID_GEN_EIC_EXTINT_11 23
  114. #define EVSYS_ID_GEN_EIC_EXTINT_12 24
  115. #define EVSYS_ID_GEN_EIC_EXTINT_13 25
  116. #define EVSYS_ID_GEN_EIC_EXTINT_14 26
  117. #define EVSYS_ID_GEN_EIC_EXTINT_15 27
  118. #define EVSYS_ID_GEN_EIC_EXTINT_16 28
  119. #define EVSYS_ID_GEN_EIC_EXTINT_17 29
  120. #define EVSYS_ID_GEN_DMAC_CH_0 30
  121. #define EVSYS_ID_GEN_DMAC_CH_1 31
  122. #define EVSYS_ID_GEN_DMAC_CH_2 32
  123. #define EVSYS_ID_GEN_DMAC_CH_3 33
  124. #define EVSYS_ID_GEN_TCC0_OVF 34
  125. #define EVSYS_ID_GEN_TCC0_TRG 35
  126. #define EVSYS_ID_GEN_TCC0_CNT 36
  127. #define EVSYS_ID_GEN_TCC0_MCX_0 37
  128. #define EVSYS_ID_GEN_TCC0_MCX_1 38
  129. #define EVSYS_ID_GEN_TCC0_MCX_2 39
  130. #define EVSYS_ID_GEN_TCC0_MCX_3 40
  131. #define EVSYS_ID_GEN_TCC1_OVF 41
  132. #define EVSYS_ID_GEN_TCC1_TRG 42
  133. #define EVSYS_ID_GEN_TCC1_CNT 43
  134. #define EVSYS_ID_GEN_TCC1_MCX_0 44
  135. #define EVSYS_ID_GEN_TCC1_MCX_1 45
  136. #define EVSYS_ID_GEN_TCC2_OVF 46
  137. #define EVSYS_ID_GEN_TCC2_TRG 47
  138. #define EVSYS_ID_GEN_TCC2_CNT 48
  139. #define EVSYS_ID_GEN_TCC2_MCX_0 49
  140. #define EVSYS_ID_GEN_TCC2_MCX_1 50
  141. #define EVSYS_ID_GEN_TC3_OVF 51
  142. #define EVSYS_ID_GEN_TC3_MCX_0 52
  143. #define EVSYS_ID_GEN_TC3_MCX_1 53
  144. #define EVSYS_ID_GEN_TC4_OVF 54
  145. #define EVSYS_ID_GEN_TC4_MCX_0 55
  146. #define EVSYS_ID_GEN_TC4_MCX_1 56
  147. #define EVSYS_ID_GEN_TC5_OVF 57
  148. #define EVSYS_ID_GEN_TC5_MCX_0 58
  149. #define EVSYS_ID_GEN_TC5_MCX_1 59
  150. #define EVSYS_ID_GEN_TC6_OVF 60
  151. #define EVSYS_ID_GEN_TC6_MCX_0 61
  152. #define EVSYS_ID_GEN_TC6_MCX_1 62
  153. #define EVSYS_ID_GEN_TC7_OVF 63
  154. #define EVSYS_ID_GEN_TC7_MCX_0 64
  155. #define EVSYS_ID_GEN_TC7_MCX_1 65
  156. #define EVSYS_ID_GEN_ADC_RESRDY 66
  157. #define EVSYS_ID_GEN_ADC_WINMON 67
  158. #define EVSYS_ID_GEN_AC_COMP_0 68
  159. #define EVSYS_ID_GEN_AC_COMP_1 69
  160. #define EVSYS_ID_GEN_AC_WIN_0 70
  161. #define EVSYS_ID_GEN_DAC_EMPTY 71
  162. #define EVSYS_ID_GEN_PTC_EOC 72
  163. #define EVSYS_ID_GEN_PTC_WCOMP 73
  164. #define EVSYS_ID_GEN_AC1_COMP_0 74
  165. #define EVSYS_ID_GEN_AC1_COMP_1 75
  166. #define EVSYS_ID_GEN_AC1_WIN_0 76
  167. // USERS
  168. #define EVSYS_ID_USER_DMAC_CH_0 0
  169. #define EVSYS_ID_USER_DMAC_CH_1 1
  170. #define EVSYS_ID_USER_DMAC_CH_2 2
  171. #define EVSYS_ID_USER_DMAC_CH_3 3
  172. #define EVSYS_ID_USER_TCC0_EV_0 4
  173. #define EVSYS_ID_USER_TCC0_EV_1 5
  174. #define EVSYS_ID_USER_TCC0_MC_0 6
  175. #define EVSYS_ID_USER_TCC0_MC_1 7
  176. #define EVSYS_ID_USER_TCC0_MC_2 8
  177. #define EVSYS_ID_USER_TCC0_MC_3 9
  178. #define EVSYS_ID_USER_TCC1_EV_0 10
  179. #define EVSYS_ID_USER_TCC1_EV_1 11
  180. #define EVSYS_ID_USER_TCC1_MC_0 12
  181. #define EVSYS_ID_USER_TCC1_MC_1 13
  182. #define EVSYS_ID_USER_TCC2_EV_0 14
  183. #define EVSYS_ID_USER_TCC2_EV_1 15
  184. #define EVSYS_ID_USER_TCC2_MC_0 16
  185. #define EVSYS_ID_USER_TCC2_MC_1 17
  186. #define EVSYS_ID_USER_TC3_EVU 18
  187. #define EVSYS_ID_USER_TC4_EVU 19
  188. #define EVSYS_ID_USER_TC5_EVU 20
  189. #define EVSYS_ID_USER_TC6_EVU 21
  190. #define EVSYS_ID_USER_TC7_EVU 22
  191. #define EVSYS_ID_USER_ADC_START 23
  192. #define EVSYS_ID_USER_ADC_SYNC 24
  193. #define EVSYS_ID_USER_AC_SOC_0 25
  194. #define EVSYS_ID_USER_AC_SOC_1 26
  195. #define EVSYS_ID_USER_DAC_START 27
  196. #define EVSYS_ID_USER_PTC_STCONV 28
  197. #define EVSYS_ID_USER_AC1_SOC_0 29
  198. #define EVSYS_ID_USER_AC1_SOC_1 30
  199. #endif /* _SAMD21_EVSYS_INSTANCE_ */