rtc.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /**
  2. * \file
  3. *
  4. * \brief Instance description for RTC
  5. *
  6. * Copyright (c) 2018 Microchip Technology Inc.
  7. *
  8. * \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");
  15. * you may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License 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,
  22. * WITHOUT 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. * \license_stop
  27. *
  28. */
  29. /* file generated from device description version 2018-05-30T11:07:17Z */
  30. #ifndef _SAML11_RTC_INSTANCE_H_
  31. #define _SAML11_RTC_INSTANCE_H_
  32. /* ========== Register definition for RTC peripheral ========== */
  33. #if (defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  34. #define REG_RTC_DBGCTRL (0x4000240E) /**< (RTC) Debug Control */
  35. #define REG_RTC_FREQCORR (0x40002414) /**< (RTC) Frequency Correction */
  36. #define REG_RTC_GP (0x40002440) /**< (RTC) General Purpose */
  37. #define REG_RTC_GP0 (0x40002440) /**< (RTC) General Purpose 0 */
  38. #define REG_RTC_GP1 (0x40002444) /**< (RTC) General Purpose 1 */
  39. #define REG_RTC_TAMPCTRL (0x40002460) /**< (RTC) Tamper Control */
  40. #define REG_RTC_TAMPID (0x40002468) /**< (RTC) Tamper ID */
  41. #define REG_RTC_TAMPCTRLB (0x4000246C) /**< (RTC) Tamper Control B */
  42. #define REG_RTC_MODE0_CTRLA (0x40002400) /**< (RTC) MODE0 Control A */
  43. #define REG_RTC_MODE0_CTRLB (0x40002402) /**< (RTC) MODE0 Control B */
  44. #define REG_RTC_MODE0_EVCTRL (0x40002404) /**< (RTC) MODE0 Event Control */
  45. #define REG_RTC_MODE0_INTENCLR (0x40002408) /**< (RTC) MODE0 Interrupt Enable Clear */
  46. #define REG_RTC_MODE0_INTENSET (0x4000240A) /**< (RTC) MODE0 Interrupt Enable Set */
  47. #define REG_RTC_MODE0_INTFLAG (0x4000240C) /**< (RTC) MODE0 Interrupt Flag Status and Clear */
  48. #define REG_RTC_MODE0_SYNCBUSY (0x40002410) /**< (RTC) MODE0 Synchronization Busy Status */
  49. #define REG_RTC_MODE0_COUNT (0x40002418) /**< (RTC) MODE0 Counter Value */
  50. #define REG_RTC_MODE0_COMP (0x40002420) /**< (RTC) MODE0 Compare n Value */
  51. #define REG_RTC_MODE0_COMP0 (0x40002420) /**< (RTC) MODE0 Compare 0 Value */
  52. #define REG_RTC_MODE0_TIMESTAMP (0x40002464) /**< (RTC) MODE0 Timestamp */
  53. #define REG_RTC_MODE1_CTRLA (0x40002400) /**< (RTC) MODE1 Control A */
  54. #define REG_RTC_MODE1_CTRLB (0x40002402) /**< (RTC) MODE1 Control B */
  55. #define REG_RTC_MODE1_EVCTRL (0x40002404) /**< (RTC) MODE1 Event Control */
  56. #define REG_RTC_MODE1_INTENCLR (0x40002408) /**< (RTC) MODE1 Interrupt Enable Clear */
  57. #define REG_RTC_MODE1_INTENSET (0x4000240A) /**< (RTC) MODE1 Interrupt Enable Set */
  58. #define REG_RTC_MODE1_INTFLAG (0x4000240C) /**< (RTC) MODE1 Interrupt Flag Status and Clear */
  59. #define REG_RTC_MODE1_SYNCBUSY (0x40002410) /**< (RTC) MODE1 Synchronization Busy Status */
  60. #define REG_RTC_MODE1_COUNT (0x40002418) /**< (RTC) MODE1 Counter Value */
  61. #define REG_RTC_MODE1_PER (0x4000241C) /**< (RTC) MODE1 Counter Period */
  62. #define REG_RTC_MODE1_COMP (0x40002420) /**< (RTC) MODE1 Compare n Value */
  63. #define REG_RTC_MODE1_COMP0 (0x40002420) /**< (RTC) MODE1 Compare 0 Value */
  64. #define REG_RTC_MODE1_COMP1 (0x40002422) /**< (RTC) MODE1 Compare 1 Value */
  65. #define REG_RTC_MODE1_TIMESTAMP (0x40002464) /**< (RTC) MODE1 Timestamp */
  66. #define REG_RTC_MODE2_ALARM0 (0x40002420) /**< (RTC) MODE2_ALARM Alarm 0 Value */
  67. #define REG_RTC_MODE2_MASK0 (0x40002424) /**< (RTC) MODE2_ALARM Alarm 0 Mask */
  68. #define REG_RTC_MODE2_CTRLA (0x40002400) /**< (RTC) MODE2 Control A */
  69. #define REG_RTC_MODE2_CTRLB (0x40002402) /**< (RTC) MODE2 Control B */
  70. #define REG_RTC_MODE2_EVCTRL (0x40002404) /**< (RTC) MODE2 Event Control */
  71. #define REG_RTC_MODE2_INTENCLR (0x40002408) /**< (RTC) MODE2 Interrupt Enable Clear */
  72. #define REG_RTC_MODE2_INTENSET (0x4000240A) /**< (RTC) MODE2 Interrupt Enable Set */
  73. #define REG_RTC_MODE2_INTFLAG (0x4000240C) /**< (RTC) MODE2 Interrupt Flag Status and Clear */
  74. #define REG_RTC_MODE2_SYNCBUSY (0x40002410) /**< (RTC) MODE2 Synchronization Busy Status */
  75. #define REG_RTC_MODE2_CLOCK (0x40002418) /**< (RTC) MODE2 Clock Value */
  76. #define REG_RTC_MODE2_TIMESTAMP (0x40002464) /**< (RTC) MODE2 Timestamp */
  77. #else
  78. #define REG_RTC_DBGCTRL (*(__IO uint8_t*)0x4000240EU) /**< (RTC) Debug Control */
  79. #define REG_RTC_FREQCORR (*(__IO uint8_t*)0x40002414U) /**< (RTC) Frequency Correction */
  80. #define REG_RTC_GP (*(__IO uint32_t*)0x40002440U) /**< (RTC) General Purpose */
  81. #define REG_RTC_GP0 (*(__IO uint32_t*)0x40002440U) /**< (RTC) General Purpose 0 */
  82. #define REG_RTC_GP1 (*(__IO uint32_t*)0x40002444U) /**< (RTC) General Purpose 1 */
  83. #define REG_RTC_TAMPCTRL (*(__IO uint32_t*)0x40002460U) /**< (RTC) Tamper Control */
  84. #define REG_RTC_TAMPID (*(__IO uint32_t*)0x40002468U) /**< (RTC) Tamper ID */
  85. #define REG_RTC_TAMPCTRLB (*(__IO uint32_t*)0x4000246CU) /**< (RTC) Tamper Control B */
  86. #define REG_RTC_MODE0_CTRLA (*(__IO uint16_t*)0x40002400U) /**< (RTC) MODE0 Control A */
  87. #define REG_RTC_MODE0_CTRLB (*(__IO uint16_t*)0x40002402U) /**< (RTC) MODE0 Control B */
  88. #define REG_RTC_MODE0_EVCTRL (*(__IO uint32_t*)0x40002404U) /**< (RTC) MODE0 Event Control */
  89. #define REG_RTC_MODE0_INTENCLR (*(__IO uint16_t*)0x40002408U) /**< (RTC) MODE0 Interrupt Enable Clear */
  90. #define REG_RTC_MODE0_INTENSET (*(__IO uint16_t*)0x4000240AU) /**< (RTC) MODE0 Interrupt Enable Set */
  91. #define REG_RTC_MODE0_INTFLAG (*(__IO uint16_t*)0x4000240CU) /**< (RTC) MODE0 Interrupt Flag Status and Clear */
  92. #define REG_RTC_MODE0_SYNCBUSY (*(__I uint32_t*)0x40002410U) /**< (RTC) MODE0 Synchronization Busy Status */
  93. #define REG_RTC_MODE0_COUNT (*(__IO uint32_t*)0x40002418U) /**< (RTC) MODE0 Counter Value */
  94. #define REG_RTC_MODE0_COMP (*(__IO uint32_t*)0x40002420U) /**< (RTC) MODE0 Compare n Value */
  95. #define REG_RTC_MODE0_COMP0 (*(__IO uint32_t*)0x40002420U) /**< (RTC) MODE0 Compare 0 Value */
  96. #define REG_RTC_MODE0_TIMESTAMP (*(__I uint32_t*)0x40002464U) /**< (RTC) MODE0 Timestamp */
  97. #define REG_RTC_MODE1_CTRLA (*(__IO uint16_t*)0x40002400U) /**< (RTC) MODE1 Control A */
  98. #define REG_RTC_MODE1_CTRLB (*(__IO uint16_t*)0x40002402U) /**< (RTC) MODE1 Control B */
  99. #define REG_RTC_MODE1_EVCTRL (*(__IO uint32_t*)0x40002404U) /**< (RTC) MODE1 Event Control */
  100. #define REG_RTC_MODE1_INTENCLR (*(__IO uint16_t*)0x40002408U) /**< (RTC) MODE1 Interrupt Enable Clear */
  101. #define REG_RTC_MODE1_INTENSET (*(__IO uint16_t*)0x4000240AU) /**< (RTC) MODE1 Interrupt Enable Set */
  102. #define REG_RTC_MODE1_INTFLAG (*(__IO uint16_t*)0x4000240CU) /**< (RTC) MODE1 Interrupt Flag Status and Clear */
  103. #define REG_RTC_MODE1_SYNCBUSY (*(__I uint32_t*)0x40002410U) /**< (RTC) MODE1 Synchronization Busy Status */
  104. #define REG_RTC_MODE1_COUNT (*(__IO uint16_t*)0x40002418U) /**< (RTC) MODE1 Counter Value */
  105. #define REG_RTC_MODE1_PER (*(__IO uint16_t*)0x4000241CU) /**< (RTC) MODE1 Counter Period */
  106. #define REG_RTC_MODE1_COMP (*(__IO uint16_t*)0x40002420U) /**< (RTC) MODE1 Compare n Value */
  107. #define REG_RTC_MODE1_COMP0 (*(__IO uint16_t*)0x40002420U) /**< (RTC) MODE1 Compare 0 Value */
  108. #define REG_RTC_MODE1_COMP1 (*(__IO uint16_t*)0x40002422U) /**< (RTC) MODE1 Compare 1 Value */
  109. #define REG_RTC_MODE1_TIMESTAMP (*(__I uint32_t*)0x40002464U) /**< (RTC) MODE1 Timestamp */
  110. #define REG_RTC_MODE2_ALARM0 (*(__IO uint32_t*)0x40002420U) /**< (RTC) MODE2_ALARM Alarm 0 Value */
  111. #define REG_RTC_MODE2_MASK0 (*(__IO uint8_t*)0x40002424U) /**< (RTC) MODE2_ALARM Alarm 0 Mask */
  112. #define REG_RTC_MODE2_CTRLA (*(__IO uint16_t*)0x40002400U) /**< (RTC) MODE2 Control A */
  113. #define REG_RTC_MODE2_CTRLB (*(__IO uint16_t*)0x40002402U) /**< (RTC) MODE2 Control B */
  114. #define REG_RTC_MODE2_EVCTRL (*(__IO uint32_t*)0x40002404U) /**< (RTC) MODE2 Event Control */
  115. #define REG_RTC_MODE2_INTENCLR (*(__IO uint16_t*)0x40002408U) /**< (RTC) MODE2 Interrupt Enable Clear */
  116. #define REG_RTC_MODE2_INTENSET (*(__IO uint16_t*)0x4000240AU) /**< (RTC) MODE2 Interrupt Enable Set */
  117. #define REG_RTC_MODE2_INTFLAG (*(__IO uint16_t*)0x4000240CU) /**< (RTC) MODE2 Interrupt Flag Status and Clear */
  118. #define REG_RTC_MODE2_SYNCBUSY (*(__I uint32_t*)0x40002410U) /**< (RTC) MODE2 Synchronization Busy Status */
  119. #define REG_RTC_MODE2_CLOCK (*(__IO uint32_t*)0x40002418U) /**< (RTC) MODE2 Clock Value */
  120. #define REG_RTC_MODE2_TIMESTAMP (*(__I uint32_t*)0x40002464U) /**< (RTC) MODE2 Timestamp */
  121. #endif /* (defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  122. /* ========== Instance Parameter definitions for RTC peripheral ========== */
  123. #define RTC_DMAC_ID_TIMESTAMP 1 /* DMA RTC timestamp trigger */
  124. #define RTC_GPR_NUM 2 /* Number of General-Purpose Registers */
  125. #define RTC_NUM_OF_ALARMS 1 /* Number of Alarms */
  126. #define RTC_NUM_OF_BKREGS 0 /* Number of Backup Registers */
  127. #define RTC_NUM_OF_COMP16 2 /* Number of 16-bit Comparators */
  128. #define RTC_NUM_OF_COMP32 1 /* Number of 32-bit Comparators */
  129. #define RTC_NUM_OF_TAMPERS 4 /* Number of Tamper Inputs */
  130. #define RTC_PER_NUM 8 /* Number of Periodic Intervals */
  131. #define RTC_INSTANCE_ID 9
  132. #endif /* _SAML11_RTC_INSTANCE_ */