evsys.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /**
  2. * \file
  3. *
  4. * \brief Instance 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_INSTANCE_
  30. #define _SAMD11_EVSYS_INSTANCE_
  31. /* ========== Register definition for EVSYS peripheral ========== */
  32. #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  33. #define REG_EVSYS_CTRL (0x42000400) /**< \brief (EVSYS) Control */
  34. #define REG_EVSYS_CHANNEL (0x42000404) /**< \brief (EVSYS) Channel */
  35. #define REG_EVSYS_USER (0x42000408) /**< \brief (EVSYS) User Multiplexer */
  36. #define REG_EVSYS_CHSTATUS (0x4200040C) /**< \brief (EVSYS) Channel Status */
  37. #define REG_EVSYS_INTENCLR (0x42000410) /**< \brief (EVSYS) Interrupt Enable Clear */
  38. #define REG_EVSYS_INTENSET (0x42000414) /**< \brief (EVSYS) Interrupt Enable Set */
  39. #define REG_EVSYS_INTFLAG (0x42000418) /**< \brief (EVSYS) Interrupt Flag Status and Clear */
  40. #else
  41. #define REG_EVSYS_CTRL (*(WoReg8 *)0x42000400UL) /**< \brief (EVSYS) Control */
  42. #define REG_EVSYS_CHANNEL (*(RwReg *)0x42000404UL) /**< \brief (EVSYS) Channel */
  43. #define REG_EVSYS_USER (*(RwReg16*)0x42000408UL) /**< \brief (EVSYS) User Multiplexer */
  44. #define REG_EVSYS_CHSTATUS (*(RoReg *)0x4200040CUL) /**< \brief (EVSYS) Channel Status */
  45. #define REG_EVSYS_INTENCLR (*(RwReg *)0x42000410UL) /**< \brief (EVSYS) Interrupt Enable Clear */
  46. #define REG_EVSYS_INTENSET (*(RwReg *)0x42000414UL) /**< \brief (EVSYS) Interrupt Enable Set */
  47. #define REG_EVSYS_INTFLAG (*(RwReg *)0x42000418UL) /**< \brief (EVSYS) Interrupt Flag Status and Clear */
  48. #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  49. /* ========== Instance parameters for EVSYS peripheral ========== */
  50. #define EVSYS_CHANNELS 6 // Number of Channels
  51. #define EVSYS_CHANNELS_BITS 3 // Number of bits to select Channel
  52. #define EVSYS_CHANNELS_MSB 5 // Number of Channels - 1
  53. #define EVSYS_EXTEVT_NUM 0 // Number of External Event Generators
  54. #define EVSYS_GCLK_ID_0 7
  55. #define EVSYS_GCLK_ID_1 8
  56. #define EVSYS_GCLK_ID_2 9
  57. #define EVSYS_GCLK_ID_3 10
  58. #define EVSYS_GCLK_ID_4 11
  59. #define EVSYS_GCLK_ID_5 12
  60. #define EVSYS_GCLK_ID_LSB 7
  61. #define EVSYS_GCLK_ID_MSB 12
  62. #define EVSYS_GCLK_ID_SIZE 6
  63. #define EVSYS_GENERATORS 44 // Total Number of Event Generators
  64. #define EVSYS_GENERATORS_BITS 6 // Number of bits to select Event Generator
  65. #define EVSYS_USERS 18 // Total Number of Event Users
  66. #define EVSYS_USERS_BITS 5 // Number of bits to select Event User
  67. // GENERATORS
  68. #define EVSYS_ID_GEN_RTC_CMP_0 1
  69. #define EVSYS_ID_GEN_RTC_CMP_1 2
  70. #define EVSYS_ID_GEN_RTC_OVF 3
  71. #define EVSYS_ID_GEN_RTC_PER_0 4
  72. #define EVSYS_ID_GEN_RTC_PER_1 5
  73. #define EVSYS_ID_GEN_RTC_PER_2 6
  74. #define EVSYS_ID_GEN_RTC_PER_3 7
  75. #define EVSYS_ID_GEN_RTC_PER_4 8
  76. #define EVSYS_ID_GEN_RTC_PER_5 9
  77. #define EVSYS_ID_GEN_RTC_PER_6 10
  78. #define EVSYS_ID_GEN_RTC_PER_7 11
  79. #define EVSYS_ID_GEN_EIC_EXTINT_0 12
  80. #define EVSYS_ID_GEN_EIC_EXTINT_1 13
  81. #define EVSYS_ID_GEN_EIC_EXTINT_2 14
  82. #define EVSYS_ID_GEN_EIC_EXTINT_3 15
  83. #define EVSYS_ID_GEN_EIC_EXTINT_4 16
  84. #define EVSYS_ID_GEN_EIC_EXTINT_5 17
  85. #define EVSYS_ID_GEN_EIC_EXTINT_6 18
  86. #define EVSYS_ID_GEN_EIC_EXTINT_7 19
  87. #define EVSYS_ID_GEN_DMAC_CH_0 20
  88. #define EVSYS_ID_GEN_DMAC_CH_1 21
  89. #define EVSYS_ID_GEN_DMAC_CH_2 22
  90. #define EVSYS_ID_GEN_DMAC_CH_3 23
  91. #define EVSYS_ID_GEN_TCC0_OVF 24
  92. #define EVSYS_ID_GEN_TCC0_TRG 25
  93. #define EVSYS_ID_GEN_TCC0_CNT 26
  94. #define EVSYS_ID_GEN_TCC0_MCX_0 27
  95. #define EVSYS_ID_GEN_TCC0_MCX_1 28
  96. #define EVSYS_ID_GEN_TCC0_MCX_2 29
  97. #define EVSYS_ID_GEN_TCC0_MCX_3 30
  98. #define EVSYS_ID_GEN_TC1_OVF 31
  99. #define EVSYS_ID_GEN_TC1_MCX_0 32
  100. #define EVSYS_ID_GEN_TC1_MCX_1 33
  101. #define EVSYS_ID_GEN_TC2_OVF 34
  102. #define EVSYS_ID_GEN_TC2_MCX_0 35
  103. #define EVSYS_ID_GEN_TC2_MCX_1 36
  104. #define EVSYS_ID_GEN_ADC_RESRDY 37
  105. #define EVSYS_ID_GEN_ADC_WINMON 38
  106. #define EVSYS_ID_GEN_AC_COMP_0 39
  107. #define EVSYS_ID_GEN_AC_COMP_1 40
  108. #define EVSYS_ID_GEN_AC_WIN_0 41
  109. #define EVSYS_ID_GEN_DAC_EMPTY 42
  110. // USERS
  111. #define EVSYS_ID_USER_DMAC_CH_0 0
  112. #define EVSYS_ID_USER_DMAC_CH_1 1
  113. #define EVSYS_ID_USER_DMAC_CH_2 2
  114. #define EVSYS_ID_USER_DMAC_CH_3 3
  115. #define EVSYS_ID_USER_TCC0_EV_0 4
  116. #define EVSYS_ID_USER_TCC0_EV_1 5
  117. #define EVSYS_ID_USER_TCC0_MC_0 6
  118. #define EVSYS_ID_USER_TCC0_MC_1 7
  119. #define EVSYS_ID_USER_TCC0_MC_2 8
  120. #define EVSYS_ID_USER_TCC0_MC_3 9
  121. #define EVSYS_ID_USER_TC1_EVU 10
  122. #define EVSYS_ID_USER_TC2_EVU 11
  123. #define EVSYS_ID_USER_ADC_START 12
  124. #define EVSYS_ID_USER_ADC_SYNC 13
  125. #define EVSYS_ID_USER_AC_SOC_0 14
  126. #define EVSYS_ID_USER_AC_SOC_1 15
  127. #define EVSYS_ID_USER_DAC_START 16
  128. #endif /* _SAMD11_EVSYS_INSTANCE_ */