1 /**
2  * \file
3  *
4  * \brief Instance description for AC
5  *
6  * Copyright (c) 2016 Atmel Corporation,
7  *                    a wholly owned subsidiary of Microchip Technology Inc.
8  *
9  * \asf_license_start
10  *
11  * \page License
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License");
14  * you may not use this file except in compliance with the License.
15  * You may obtain a copy of the Licence at
16  *
17  *     http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  *
25  * \asf_license_stop
26  *
27  */
28 
29 #ifndef _SAMR21_AC_INSTANCE_
30 #define _SAMR21_AC_INSTANCE_
31 
32 /* ========== Register definition for AC peripheral ========== */
33 #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
34 #define REG_AC_CTRLA               (0x42004400) /**< \brief (AC) Control A */
35 #define REG_AC_CTRLB               (0x42004401) /**< \brief (AC) Control B */
36 #define REG_AC_EVCTRL              (0x42004402) /**< \brief (AC) Event Control */
37 #define REG_AC_INTENCLR            (0x42004404) /**< \brief (AC) Interrupt Enable Clear */
38 #define REG_AC_INTENSET            (0x42004405) /**< \brief (AC) Interrupt Enable Set */
39 #define REG_AC_INTFLAG             (0x42004406) /**< \brief (AC) Interrupt Flag Status and Clear */
40 #define REG_AC_STATUSA             (0x42004408) /**< \brief (AC) Status A */
41 #define REG_AC_STATUSB             (0x42004409) /**< \brief (AC) Status B */
42 #define REG_AC_STATUSC             (0x4200440A) /**< \brief (AC) Status C */
43 #define REG_AC_WINCTRL             (0x4200440C) /**< \brief (AC) Window Control */
44 #define REG_AC_COMPCTRL0           (0x42004410) /**< \brief (AC) Comparator Control 0 */
45 #define REG_AC_COMPCTRL1           (0x42004414) /**< \brief (AC) Comparator Control 1 */
46 #define REG_AC_SCALER0             (0x42004420) /**< \brief (AC) Scaler 0 */
47 #define REG_AC_SCALER1             (0x42004421) /**< \brief (AC) Scaler 1 */
48 #else
49 #define REG_AC_CTRLA               (*(RwReg8 *)0x42004400UL) /**< \brief (AC) Control A */
50 #define REG_AC_CTRLB               (*(WoReg8 *)0x42004401UL) /**< \brief (AC) Control B */
51 #define REG_AC_EVCTRL              (*(RwReg16*)0x42004402UL) /**< \brief (AC) Event Control */
52 #define REG_AC_INTENCLR            (*(RwReg8 *)0x42004404UL) /**< \brief (AC) Interrupt Enable Clear */
53 #define REG_AC_INTENSET            (*(RwReg8 *)0x42004405UL) /**< \brief (AC) Interrupt Enable Set */
54 #define REG_AC_INTFLAG             (*(RwReg8 *)0x42004406UL) /**< \brief (AC) Interrupt Flag Status and Clear */
55 #define REG_AC_STATUSA             (*(RoReg8 *)0x42004408UL) /**< \brief (AC) Status A */
56 #define REG_AC_STATUSB             (*(RoReg8 *)0x42004409UL) /**< \brief (AC) Status B */
57 #define REG_AC_STATUSC             (*(RoReg8 *)0x4200440AUL) /**< \brief (AC) Status C */
58 #define REG_AC_WINCTRL             (*(RwReg8 *)0x4200440CUL) /**< \brief (AC) Window Control */
59 #define REG_AC_COMPCTRL0           (*(RwReg  *)0x42004410UL) /**< \brief (AC) Comparator Control 0 */
60 #define REG_AC_COMPCTRL1           (*(RwReg  *)0x42004414UL) /**< \brief (AC) Comparator Control 1 */
61 #define REG_AC_SCALER0             (*(RwReg8 *)0x42004420UL) /**< \brief (AC) Scaler 0 */
62 #define REG_AC_SCALER1             (*(RwReg8 *)0x42004421UL) /**< \brief (AC) Scaler 1 */
63 #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
64 
65 /* ========== Instance parameters for AC peripheral ========== */
66 #define AC_CMP_NUM                  2        // Number of comparators
67 #define AC_GCLK_ID_ANA              32       // Index of Generic Clock for analog
68 #define AC_GCLK_ID_DIG              31       // Index of Generic Clock for digital
69 #define AC_NUM_CMP                  2
70 #define AC_PAIRS                    1        // Number of pairs of comparators
71 
72 #endif /* _SAMR21_AC_INSTANCE_ */
73