ac.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. * \file
  3. *
  4. * \brief Instance description for AC
  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_AC_INSTANCE_
  30. #define _SAMD11_AC_INSTANCE_
  31. /* ========== Register definition for AC peripheral ========== */
  32. #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  33. #define REG_AC_CTRLA (0x42002400) /**< \brief (AC) Control A */
  34. #define REG_AC_CTRLB (0x42002401) /**< \brief (AC) Control B */
  35. #define REG_AC_EVCTRL (0x42002402) /**< \brief (AC) Event Control */
  36. #define REG_AC_INTENCLR (0x42002404) /**< \brief (AC) Interrupt Enable Clear */
  37. #define REG_AC_INTENSET (0x42002405) /**< \brief (AC) Interrupt Enable Set */
  38. #define REG_AC_INTFLAG (0x42002406) /**< \brief (AC) Interrupt Flag Status and Clear */
  39. #define REG_AC_STATUSA (0x42002408) /**< \brief (AC) Status A */
  40. #define REG_AC_STATUSB (0x42002409) /**< \brief (AC) Status B */
  41. #define REG_AC_STATUSC (0x4200240A) /**< \brief (AC) Status C */
  42. #define REG_AC_WINCTRL (0x4200240C) /**< \brief (AC) Window Control */
  43. #define REG_AC_COMPCTRL0 (0x42002410) /**< \brief (AC) Comparator Control 0 */
  44. #define REG_AC_COMPCTRL1 (0x42002414) /**< \brief (AC) Comparator Control 1 */
  45. #define REG_AC_SCALER0 (0x42002420) /**< \brief (AC) Scaler 0 */
  46. #define REG_AC_SCALER1 (0x42002421) /**< \brief (AC) Scaler 1 */
  47. #else
  48. #define REG_AC_CTRLA (*(RwReg8 *)0x42002400UL) /**< \brief (AC) Control A */
  49. #define REG_AC_CTRLB (*(WoReg8 *)0x42002401UL) /**< \brief (AC) Control B */
  50. #define REG_AC_EVCTRL (*(RwReg16*)0x42002402UL) /**< \brief (AC) Event Control */
  51. #define REG_AC_INTENCLR (*(RwReg8 *)0x42002404UL) /**< \brief (AC) Interrupt Enable Clear */
  52. #define REG_AC_INTENSET (*(RwReg8 *)0x42002405UL) /**< \brief (AC) Interrupt Enable Set */
  53. #define REG_AC_INTFLAG (*(RwReg8 *)0x42002406UL) /**< \brief (AC) Interrupt Flag Status and Clear */
  54. #define REG_AC_STATUSA (*(RoReg8 *)0x42002408UL) /**< \brief (AC) Status A */
  55. #define REG_AC_STATUSB (*(RoReg8 *)0x42002409UL) /**< \brief (AC) Status B */
  56. #define REG_AC_STATUSC (*(RoReg8 *)0x4200240AUL) /**< \brief (AC) Status C */
  57. #define REG_AC_WINCTRL (*(RwReg8 *)0x4200240CUL) /**< \brief (AC) Window Control */
  58. #define REG_AC_COMPCTRL0 (*(RwReg *)0x42002410UL) /**< \brief (AC) Comparator Control 0 */
  59. #define REG_AC_COMPCTRL1 (*(RwReg *)0x42002414UL) /**< \brief (AC) Comparator Control 1 */
  60. #define REG_AC_SCALER0 (*(RwReg8 *)0x42002420UL) /**< \brief (AC) Scaler 0 */
  61. #define REG_AC_SCALER1 (*(RwReg8 *)0x42002421UL) /**< \brief (AC) Scaler 1 */
  62. #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  63. /* ========== Instance parameters for AC peripheral ========== */
  64. #define AC_CMP_NUM 2 // Number of comparators
  65. #define AC_GCLK_ID_ANA 21 // Index of Generic Clock for analog
  66. #define AC_GCLK_ID_DIG 20 // Index of Generic Clock for digital
  67. #define AC_NUM_CMP 2
  68. #define AC_PAIRS 1 // Number of pairs of comparators
  69. #endif /* _SAMD11_AC_INSTANCE_ */