mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Wed Jul 01 09:45:11 2015 +0100
Revision:
579:53297373a894
Child:
592:a274ee790e56
Synchronized with git revision d5b4d2ab9c47edb4dc5776e7177b0c2263459081

Full URL: https://github.com/mbedmicro/mbed/commit/d5b4d2ab9c47edb4dc5776e7177b0c2263459081/

Initial version of drivers for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 579:53297373a894 1 /**
mbed_official 579:53297373a894 2 * \file
mbed_official 579:53297373a894 3 *
mbed_official 579:53297373a894 4 * \brief Component description for AC
mbed_official 579:53297373a894 5 *
mbed_official 579:53297373a894 6 * Copyright (c) 2014 Atmel Corporation. All rights reserved.
mbed_official 579:53297373a894 7 *
mbed_official 579:53297373a894 8 * \asf_license_start
mbed_official 579:53297373a894 9 *
mbed_official 579:53297373a894 10 * \page License
mbed_official 579:53297373a894 11 *
mbed_official 579:53297373a894 12 * Redistribution and use in source and binary forms, with or without
mbed_official 579:53297373a894 13 * modification, are permitted provided that the following conditions are met:
mbed_official 579:53297373a894 14 *
mbed_official 579:53297373a894 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 579:53297373a894 16 * this list of conditions and the following disclaimer.
mbed_official 579:53297373a894 17 *
mbed_official 579:53297373a894 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 579:53297373a894 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 579:53297373a894 20 * and/or other materials provided with the distribution.
mbed_official 579:53297373a894 21 *
mbed_official 579:53297373a894 22 * 3. The name of Atmel may not be used to endorse or promote products derived
mbed_official 579:53297373a894 23 * from this software without specific prior written permission.
mbed_official 579:53297373a894 24 *
mbed_official 579:53297373a894 25 * 4. This software may only be redistributed and used in connection with an
mbed_official 579:53297373a894 26 * Atmel microcontroller product.
mbed_official 579:53297373a894 27 *
mbed_official 579:53297373a894 28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
mbed_official 579:53297373a894 29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
mbed_official 579:53297373a894 30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
mbed_official 579:53297373a894 31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
mbed_official 579:53297373a894 32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 579:53297373a894 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
mbed_official 579:53297373a894 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
mbed_official 579:53297373a894 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
mbed_official 579:53297373a894 36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
mbed_official 579:53297373a894 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 579:53297373a894 38 * POSSIBILITY OF SUCH DAMAGE.
mbed_official 579:53297373a894 39 *
mbed_official 579:53297373a894 40 * \asf_license_stop
mbed_official 579:53297373a894 41 *
mbed_official 579:53297373a894 42 */
mbed_official 579:53297373a894 43 /**
mbed_official 579:53297373a894 44 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
mbed_official 579:53297373a894 45 */
mbed_official 579:53297373a894 46
mbed_official 579:53297373a894 47 #ifndef _SAMD21_AC_COMPONENT_
mbed_official 579:53297373a894 48 #define _SAMD21_AC_COMPONENT_
mbed_official 579:53297373a894 49
mbed_official 579:53297373a894 50 /* ========================================================================== */
mbed_official 579:53297373a894 51 /** SOFTWARE API DEFINITION FOR AC */
mbed_official 579:53297373a894 52 /* ========================================================================== */
mbed_official 579:53297373a894 53 /** \addtogroup SAMD21_AC Analog Comparators */
mbed_official 579:53297373a894 54 /*@{*/
mbed_official 579:53297373a894 55
mbed_official 579:53297373a894 56 #define AC_U2205
mbed_official 579:53297373a894 57 #define REV_AC 0x111
mbed_official 579:53297373a894 58
mbed_official 579:53297373a894 59 /* -------- AC_CTRLA : (AC Offset: 0x00) (R/W 8) Control A -------- */
mbed_official 579:53297373a894 60 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 61 typedef union {
mbed_official 579:53297373a894 62 struct {
mbed_official 579:53297373a894 63 uint8_t SWRST:1; /*!< bit: 0 Software Reset */
mbed_official 579:53297373a894 64 uint8_t ENABLE:1; /*!< bit: 1 Enable */
mbed_official 579:53297373a894 65 uint8_t RUNSTDBY:1; /*!< bit: 2 Run in Standby */
mbed_official 579:53297373a894 66 uint8_t :4; /*!< bit: 3.. 6 Reserved */
mbed_official 579:53297373a894 67 uint8_t LPMUX:1; /*!< bit: 7 Low-Power Mux */
mbed_official 579:53297373a894 68 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 69 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 70 } AC_CTRLA_Type;
mbed_official 579:53297373a894 71 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 72
mbed_official 579:53297373a894 73 #define AC_CTRLA_OFFSET 0x00 /**< \brief (AC_CTRLA offset) Control A */
mbed_official 579:53297373a894 74 #define AC_CTRLA_RESETVALUE 0x00ul /**< \brief (AC_CTRLA reset_value) Control A */
mbed_official 579:53297373a894 75
mbed_official 579:53297373a894 76 #define AC_CTRLA_SWRST_Pos 0 /**< \brief (AC_CTRLA) Software Reset */
mbed_official 579:53297373a894 77 #define AC_CTRLA_SWRST (0x1ul << AC_CTRLA_SWRST_Pos)
mbed_official 579:53297373a894 78 #define AC_CTRLA_ENABLE_Pos 1 /**< \brief (AC_CTRLA) Enable */
mbed_official 579:53297373a894 79 #define AC_CTRLA_ENABLE (0x1ul << AC_CTRLA_ENABLE_Pos)
mbed_official 579:53297373a894 80 #define AC_CTRLA_RUNSTDBY_Pos 2 /**< \brief (AC_CTRLA) Run in Standby */
mbed_official 579:53297373a894 81 #define AC_CTRLA_RUNSTDBY_Msk (0x1ul << AC_CTRLA_RUNSTDBY_Pos)
mbed_official 579:53297373a894 82 #define AC_CTRLA_RUNSTDBY(value) ((AC_CTRLA_RUNSTDBY_Msk & ((value) << AC_CTRLA_RUNSTDBY_Pos)))
mbed_official 579:53297373a894 83 #define AC_CTRLA_LPMUX_Pos 7 /**< \brief (AC_CTRLA) Low-Power Mux */
mbed_official 579:53297373a894 84 #define AC_CTRLA_LPMUX (0x1ul << AC_CTRLA_LPMUX_Pos)
mbed_official 579:53297373a894 85 #define AC_CTRLA_MASK 0x87ul /**< \brief (AC_CTRLA) MASK Register */
mbed_official 579:53297373a894 86
mbed_official 579:53297373a894 87 /* -------- AC_CTRLB : (AC Offset: 0x01) ( /W 8) Control B -------- */
mbed_official 579:53297373a894 88 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 89 typedef union {
mbed_official 579:53297373a894 90 struct {
mbed_official 579:53297373a894 91 uint8_t START0:1; /*!< bit: 0 Comparator 0 Start Comparison */
mbed_official 579:53297373a894 92 uint8_t START1:1; /*!< bit: 1 Comparator 1 Start Comparison */
mbed_official 579:53297373a894 93 uint8_t :6; /*!< bit: 2.. 7 Reserved */
mbed_official 579:53297373a894 94 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 95 struct {
mbed_official 579:53297373a894 96 uint8_t START:2; /*!< bit: 0.. 1 Comparator x Start Comparison */
mbed_official 579:53297373a894 97 uint8_t :6; /*!< bit: 2.. 7 Reserved */
mbed_official 579:53297373a894 98 } vec; /*!< Structure used for vec access */
mbed_official 579:53297373a894 99 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 100 } AC_CTRLB_Type;
mbed_official 579:53297373a894 101 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 102
mbed_official 579:53297373a894 103 #define AC_CTRLB_OFFSET 0x01 /**< \brief (AC_CTRLB offset) Control B */
mbed_official 579:53297373a894 104 #define AC_CTRLB_RESETVALUE 0x00ul /**< \brief (AC_CTRLB reset_value) Control B */
mbed_official 579:53297373a894 105
mbed_official 579:53297373a894 106 #define AC_CTRLB_START0_Pos 0 /**< \brief (AC_CTRLB) Comparator 0 Start Comparison */
mbed_official 579:53297373a894 107 #define AC_CTRLB_START0 (1 << AC_CTRLB_START0_Pos)
mbed_official 579:53297373a894 108 #define AC_CTRLB_START1_Pos 1 /**< \brief (AC_CTRLB) Comparator 1 Start Comparison */
mbed_official 579:53297373a894 109 #define AC_CTRLB_START1 (1 << AC_CTRLB_START1_Pos)
mbed_official 579:53297373a894 110 #define AC_CTRLB_START_Pos 0 /**< \brief (AC_CTRLB) Comparator x Start Comparison */
mbed_official 579:53297373a894 111 #define AC_CTRLB_START_Msk (0x3ul << AC_CTRLB_START_Pos)
mbed_official 579:53297373a894 112 #define AC_CTRLB_START(value) ((AC_CTRLB_START_Msk & ((value) << AC_CTRLB_START_Pos)))
mbed_official 579:53297373a894 113 #define AC_CTRLB_MASK 0x03ul /**< \brief (AC_CTRLB) MASK Register */
mbed_official 579:53297373a894 114
mbed_official 579:53297373a894 115 /* -------- AC_EVCTRL : (AC Offset: 0x02) (R/W 16) Event Control -------- */
mbed_official 579:53297373a894 116 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 117 typedef union {
mbed_official 579:53297373a894 118 struct {
mbed_official 579:53297373a894 119 uint16_t COMPEO0:1; /*!< bit: 0 Comparator 0 Event Output Enable */
mbed_official 579:53297373a894 120 uint16_t COMPEO1:1; /*!< bit: 1 Comparator 1 Event Output Enable */
mbed_official 579:53297373a894 121 uint16_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 122 uint16_t WINEO0:1; /*!< bit: 4 Window 0 Event Output Enable */
mbed_official 579:53297373a894 123 uint16_t :3; /*!< bit: 5.. 7 Reserved */
mbed_official 579:53297373a894 124 uint16_t COMPEI0:1; /*!< bit: 8 Comparator 0 Event Input */
mbed_official 579:53297373a894 125 uint16_t COMPEI1:1; /*!< bit: 9 Comparator 1 Event Input */
mbed_official 579:53297373a894 126 uint16_t :6; /*!< bit: 10..15 Reserved */
mbed_official 579:53297373a894 127 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 128 struct {
mbed_official 579:53297373a894 129 uint16_t COMPEO:2; /*!< bit: 0.. 1 Comparator x Event Output Enable */
mbed_official 579:53297373a894 130 uint16_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 131 uint16_t WINEO:1; /*!< bit: 4 Window x Event Output Enable */
mbed_official 579:53297373a894 132 uint16_t :3; /*!< bit: 5.. 7 Reserved */
mbed_official 579:53297373a894 133 uint16_t COMPEI:2; /*!< bit: 8.. 9 Comparator x Event Input */
mbed_official 579:53297373a894 134 uint16_t :6; /*!< bit: 10..15 Reserved */
mbed_official 579:53297373a894 135 } vec; /*!< Structure used for vec access */
mbed_official 579:53297373a894 136 uint16_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 137 } AC_EVCTRL_Type;
mbed_official 579:53297373a894 138 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 139
mbed_official 579:53297373a894 140 #define AC_EVCTRL_OFFSET 0x02 /**< \brief (AC_EVCTRL offset) Event Control */
mbed_official 579:53297373a894 141 #define AC_EVCTRL_RESETVALUE 0x0000ul /**< \brief (AC_EVCTRL reset_value) Event Control */
mbed_official 579:53297373a894 142
mbed_official 579:53297373a894 143 #define AC_EVCTRL_COMPEO0_Pos 0 /**< \brief (AC_EVCTRL) Comparator 0 Event Output Enable */
mbed_official 579:53297373a894 144 #define AC_EVCTRL_COMPEO0 (1 << AC_EVCTRL_COMPEO0_Pos)
mbed_official 579:53297373a894 145 #define AC_EVCTRL_COMPEO1_Pos 1 /**< \brief (AC_EVCTRL) Comparator 1 Event Output Enable */
mbed_official 579:53297373a894 146 #define AC_EVCTRL_COMPEO1 (1 << AC_EVCTRL_COMPEO1_Pos)
mbed_official 579:53297373a894 147 #define AC_EVCTRL_COMPEO_Pos 0 /**< \brief (AC_EVCTRL) Comparator x Event Output Enable */
mbed_official 579:53297373a894 148 #define AC_EVCTRL_COMPEO_Msk (0x3ul << AC_EVCTRL_COMPEO_Pos)
mbed_official 579:53297373a894 149 #define AC_EVCTRL_COMPEO(value) ((AC_EVCTRL_COMPEO_Msk & ((value) << AC_EVCTRL_COMPEO_Pos)))
mbed_official 579:53297373a894 150 #define AC_EVCTRL_WINEO0_Pos 4 /**< \brief (AC_EVCTRL) Window 0 Event Output Enable */
mbed_official 579:53297373a894 151 #define AC_EVCTRL_WINEO0 (1 << AC_EVCTRL_WINEO0_Pos)
mbed_official 579:53297373a894 152 #define AC_EVCTRL_WINEO_Pos 4 /**< \brief (AC_EVCTRL) Window x Event Output Enable */
mbed_official 579:53297373a894 153 #define AC_EVCTRL_WINEO_Msk (0x1ul << AC_EVCTRL_WINEO_Pos)
mbed_official 579:53297373a894 154 #define AC_EVCTRL_WINEO(value) ((AC_EVCTRL_WINEO_Msk & ((value) << AC_EVCTRL_WINEO_Pos)))
mbed_official 579:53297373a894 155 #define AC_EVCTRL_COMPEI0_Pos 8 /**< \brief (AC_EVCTRL) Comparator 0 Event Input */
mbed_official 579:53297373a894 156 #define AC_EVCTRL_COMPEI0 (1 << AC_EVCTRL_COMPEI0_Pos)
mbed_official 579:53297373a894 157 #define AC_EVCTRL_COMPEI1_Pos 9 /**< \brief (AC_EVCTRL) Comparator 1 Event Input */
mbed_official 579:53297373a894 158 #define AC_EVCTRL_COMPEI1 (1 << AC_EVCTRL_COMPEI1_Pos)
mbed_official 579:53297373a894 159 #define AC_EVCTRL_COMPEI_Pos 8 /**< \brief (AC_EVCTRL) Comparator x Event Input */
mbed_official 579:53297373a894 160 #define AC_EVCTRL_COMPEI_Msk (0x3ul << AC_EVCTRL_COMPEI_Pos)
mbed_official 579:53297373a894 161 #define AC_EVCTRL_COMPEI(value) ((AC_EVCTRL_COMPEI_Msk & ((value) << AC_EVCTRL_COMPEI_Pos)))
mbed_official 579:53297373a894 162 #define AC_EVCTRL_MASK 0x0313ul /**< \brief (AC_EVCTRL) MASK Register */
mbed_official 579:53297373a894 163
mbed_official 579:53297373a894 164 /* -------- AC_INTENCLR : (AC Offset: 0x04) (R/W 8) Interrupt Enable Clear -------- */
mbed_official 579:53297373a894 165 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 166 typedef union {
mbed_official 579:53297373a894 167 struct {
mbed_official 579:53297373a894 168 uint8_t COMP0:1; /*!< bit: 0 Comparator 0 Interrupt Enable */
mbed_official 579:53297373a894 169 uint8_t COMP1:1; /*!< bit: 1 Comparator 1 Interrupt Enable */
mbed_official 579:53297373a894 170 uint8_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 171 uint8_t WIN0:1; /*!< bit: 4 Window 0 Interrupt Enable */
mbed_official 579:53297373a894 172 uint8_t :3; /*!< bit: 5.. 7 Reserved */
mbed_official 579:53297373a894 173 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 174 struct {
mbed_official 579:53297373a894 175 uint8_t COMP:2; /*!< bit: 0.. 1 Comparator x Interrupt Enable */
mbed_official 579:53297373a894 176 uint8_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 177 uint8_t WIN:1; /*!< bit: 4 Window x Interrupt Enable */
mbed_official 579:53297373a894 178 uint8_t :3; /*!< bit: 5.. 7 Reserved */
mbed_official 579:53297373a894 179 } vec; /*!< Structure used for vec access */
mbed_official 579:53297373a894 180 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 181 } AC_INTENCLR_Type;
mbed_official 579:53297373a894 182 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 183
mbed_official 579:53297373a894 184 #define AC_INTENCLR_OFFSET 0x04 /**< \brief (AC_INTENCLR offset) Interrupt Enable Clear */
mbed_official 579:53297373a894 185 #define AC_INTENCLR_RESETVALUE 0x00ul /**< \brief (AC_INTENCLR reset_value) Interrupt Enable Clear */
mbed_official 579:53297373a894 186
mbed_official 579:53297373a894 187 #define AC_INTENCLR_COMP0_Pos 0 /**< \brief (AC_INTENCLR) Comparator 0 Interrupt Enable */
mbed_official 579:53297373a894 188 #define AC_INTENCLR_COMP0 (1 << AC_INTENCLR_COMP0_Pos)
mbed_official 579:53297373a894 189 #define AC_INTENCLR_COMP1_Pos 1 /**< \brief (AC_INTENCLR) Comparator 1 Interrupt Enable */
mbed_official 579:53297373a894 190 #define AC_INTENCLR_COMP1 (1 << AC_INTENCLR_COMP1_Pos)
mbed_official 579:53297373a894 191 #define AC_INTENCLR_COMP_Pos 0 /**< \brief (AC_INTENCLR) Comparator x Interrupt Enable */
mbed_official 579:53297373a894 192 #define AC_INTENCLR_COMP_Msk (0x3ul << AC_INTENCLR_COMP_Pos)
mbed_official 579:53297373a894 193 #define AC_INTENCLR_COMP(value) ((AC_INTENCLR_COMP_Msk & ((value) << AC_INTENCLR_COMP_Pos)))
mbed_official 579:53297373a894 194 #define AC_INTENCLR_WIN0_Pos 4 /**< \brief (AC_INTENCLR) Window 0 Interrupt Enable */
mbed_official 579:53297373a894 195 #define AC_INTENCLR_WIN0 (1 << AC_INTENCLR_WIN0_Pos)
mbed_official 579:53297373a894 196 #define AC_INTENCLR_WIN_Pos 4 /**< \brief (AC_INTENCLR) Window x Interrupt Enable */
mbed_official 579:53297373a894 197 #define AC_INTENCLR_WIN_Msk (0x1ul << AC_INTENCLR_WIN_Pos)
mbed_official 579:53297373a894 198 #define AC_INTENCLR_WIN(value) ((AC_INTENCLR_WIN_Msk & ((value) << AC_INTENCLR_WIN_Pos)))
mbed_official 579:53297373a894 199 #define AC_INTENCLR_MASK 0x13ul /**< \brief (AC_INTENCLR) MASK Register */
mbed_official 579:53297373a894 200
mbed_official 579:53297373a894 201 /* -------- AC_INTENSET : (AC Offset: 0x05) (R/W 8) Interrupt Enable Set -------- */
mbed_official 579:53297373a894 202 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 203 typedef union {
mbed_official 579:53297373a894 204 struct {
mbed_official 579:53297373a894 205 uint8_t COMP0:1; /*!< bit: 0 Comparator 0 Interrupt Enable */
mbed_official 579:53297373a894 206 uint8_t COMP1:1; /*!< bit: 1 Comparator 1 Interrupt Enable */
mbed_official 579:53297373a894 207 uint8_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 208 uint8_t WIN0:1; /*!< bit: 4 Window 0 Interrupt Enable */
mbed_official 579:53297373a894 209 uint8_t :3; /*!< bit: 5.. 7 Reserved */
mbed_official 579:53297373a894 210 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 211 struct {
mbed_official 579:53297373a894 212 uint8_t COMP:2; /*!< bit: 0.. 1 Comparator x Interrupt Enable */
mbed_official 579:53297373a894 213 uint8_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 214 uint8_t WIN:1; /*!< bit: 4 Window x Interrupt Enable */
mbed_official 579:53297373a894 215 uint8_t :3; /*!< bit: 5.. 7 Reserved */
mbed_official 579:53297373a894 216 } vec; /*!< Structure used for vec access */
mbed_official 579:53297373a894 217 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 218 } AC_INTENSET_Type;
mbed_official 579:53297373a894 219 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 220
mbed_official 579:53297373a894 221 #define AC_INTENSET_OFFSET 0x05 /**< \brief (AC_INTENSET offset) Interrupt Enable Set */
mbed_official 579:53297373a894 222 #define AC_INTENSET_RESETVALUE 0x00ul /**< \brief (AC_INTENSET reset_value) Interrupt Enable Set */
mbed_official 579:53297373a894 223
mbed_official 579:53297373a894 224 #define AC_INTENSET_COMP0_Pos 0 /**< \brief (AC_INTENSET) Comparator 0 Interrupt Enable */
mbed_official 579:53297373a894 225 #define AC_INTENSET_COMP0 (1 << AC_INTENSET_COMP0_Pos)
mbed_official 579:53297373a894 226 #define AC_INTENSET_COMP1_Pos 1 /**< \brief (AC_INTENSET) Comparator 1 Interrupt Enable */
mbed_official 579:53297373a894 227 #define AC_INTENSET_COMP1 (1 << AC_INTENSET_COMP1_Pos)
mbed_official 579:53297373a894 228 #define AC_INTENSET_COMP_Pos 0 /**< \brief (AC_INTENSET) Comparator x Interrupt Enable */
mbed_official 579:53297373a894 229 #define AC_INTENSET_COMP_Msk (0x3ul << AC_INTENSET_COMP_Pos)
mbed_official 579:53297373a894 230 #define AC_INTENSET_COMP(value) ((AC_INTENSET_COMP_Msk & ((value) << AC_INTENSET_COMP_Pos)))
mbed_official 579:53297373a894 231 #define AC_INTENSET_WIN0_Pos 4 /**< \brief (AC_INTENSET) Window 0 Interrupt Enable */
mbed_official 579:53297373a894 232 #define AC_INTENSET_WIN0 (1 << AC_INTENSET_WIN0_Pos)
mbed_official 579:53297373a894 233 #define AC_INTENSET_WIN_Pos 4 /**< \brief (AC_INTENSET) Window x Interrupt Enable */
mbed_official 579:53297373a894 234 #define AC_INTENSET_WIN_Msk (0x1ul << AC_INTENSET_WIN_Pos)
mbed_official 579:53297373a894 235 #define AC_INTENSET_WIN(value) ((AC_INTENSET_WIN_Msk & ((value) << AC_INTENSET_WIN_Pos)))
mbed_official 579:53297373a894 236 #define AC_INTENSET_MASK 0x13ul /**< \brief (AC_INTENSET) MASK Register */
mbed_official 579:53297373a894 237
mbed_official 579:53297373a894 238 /* -------- AC_INTFLAG : (AC Offset: 0x06) (R/W 8) Interrupt Flag Status and Clear -------- */
mbed_official 579:53297373a894 239 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 240 typedef union {
mbed_official 579:53297373a894 241 struct {
mbed_official 579:53297373a894 242 uint8_t COMP0:1; /*!< bit: 0 Comparator 0 */
mbed_official 579:53297373a894 243 uint8_t COMP1:1; /*!< bit: 1 Comparator 1 */
mbed_official 579:53297373a894 244 uint8_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 245 uint8_t WIN0:1; /*!< bit: 4 Window 0 */
mbed_official 579:53297373a894 246 uint8_t :3; /*!< bit: 5.. 7 Reserved */
mbed_official 579:53297373a894 247 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 248 struct {
mbed_official 579:53297373a894 249 uint8_t COMP:2; /*!< bit: 0.. 1 Comparator x */
mbed_official 579:53297373a894 250 uint8_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 251 uint8_t WIN:1; /*!< bit: 4 Window x */
mbed_official 579:53297373a894 252 uint8_t :3; /*!< bit: 5.. 7 Reserved */
mbed_official 579:53297373a894 253 } vec; /*!< Structure used for vec access */
mbed_official 579:53297373a894 254 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 255 } AC_INTFLAG_Type;
mbed_official 579:53297373a894 256 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 257
mbed_official 579:53297373a894 258 #define AC_INTFLAG_OFFSET 0x06 /**< \brief (AC_INTFLAG offset) Interrupt Flag Status and Clear */
mbed_official 579:53297373a894 259 #define AC_INTFLAG_RESETVALUE 0x00ul /**< \brief (AC_INTFLAG reset_value) Interrupt Flag Status and Clear */
mbed_official 579:53297373a894 260
mbed_official 579:53297373a894 261 #define AC_INTFLAG_COMP0_Pos 0 /**< \brief (AC_INTFLAG) Comparator 0 */
mbed_official 579:53297373a894 262 #define AC_INTFLAG_COMP0 (1 << AC_INTFLAG_COMP0_Pos)
mbed_official 579:53297373a894 263 #define AC_INTFLAG_COMP1_Pos 1 /**< \brief (AC_INTFLAG) Comparator 1 */
mbed_official 579:53297373a894 264 #define AC_INTFLAG_COMP1 (1 << AC_INTFLAG_COMP1_Pos)
mbed_official 579:53297373a894 265 #define AC_INTFLAG_COMP_Pos 0 /**< \brief (AC_INTFLAG) Comparator x */
mbed_official 579:53297373a894 266 #define AC_INTFLAG_COMP_Msk (0x3ul << AC_INTFLAG_COMP_Pos)
mbed_official 579:53297373a894 267 #define AC_INTFLAG_COMP(value) ((AC_INTFLAG_COMP_Msk & ((value) << AC_INTFLAG_COMP_Pos)))
mbed_official 579:53297373a894 268 #define AC_INTFLAG_WIN0_Pos 4 /**< \brief (AC_INTFLAG) Window 0 */
mbed_official 579:53297373a894 269 #define AC_INTFLAG_WIN0 (1 << AC_INTFLAG_WIN0_Pos)
mbed_official 579:53297373a894 270 #define AC_INTFLAG_WIN_Pos 4 /**< \brief (AC_INTFLAG) Window x */
mbed_official 579:53297373a894 271 #define AC_INTFLAG_WIN_Msk (0x1ul << AC_INTFLAG_WIN_Pos)
mbed_official 579:53297373a894 272 #define AC_INTFLAG_WIN(value) ((AC_INTFLAG_WIN_Msk & ((value) << AC_INTFLAG_WIN_Pos)))
mbed_official 579:53297373a894 273 #define AC_INTFLAG_MASK 0x13ul /**< \brief (AC_INTFLAG) MASK Register */
mbed_official 579:53297373a894 274
mbed_official 579:53297373a894 275 /* -------- AC_STATUSA : (AC Offset: 0x08) (R/ 8) Status A -------- */
mbed_official 579:53297373a894 276 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 277 typedef union {
mbed_official 579:53297373a894 278 struct {
mbed_official 579:53297373a894 279 uint8_t STATE0:1; /*!< bit: 0 Comparator 0 Current State */
mbed_official 579:53297373a894 280 uint8_t STATE1:1; /*!< bit: 1 Comparator 1 Current State */
mbed_official 579:53297373a894 281 uint8_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 282 uint8_t WSTATE0:2; /*!< bit: 4.. 5 Window 0 Current State */
mbed_official 579:53297373a894 283 uint8_t :2; /*!< bit: 6.. 7 Reserved */
mbed_official 579:53297373a894 284 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 285 struct {
mbed_official 579:53297373a894 286 uint8_t STATE:2; /*!< bit: 0.. 1 Comparator x Current State */
mbed_official 579:53297373a894 287 uint8_t :6; /*!< bit: 2.. 7 Reserved */
mbed_official 579:53297373a894 288 } vec; /*!< Structure used for vec access */
mbed_official 579:53297373a894 289 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 290 } AC_STATUSA_Type;
mbed_official 579:53297373a894 291 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 292
mbed_official 579:53297373a894 293 #define AC_STATUSA_OFFSET 0x08 /**< \brief (AC_STATUSA offset) Status A */
mbed_official 579:53297373a894 294 #define AC_STATUSA_RESETVALUE 0x00ul /**< \brief (AC_STATUSA reset_value) Status A */
mbed_official 579:53297373a894 295
mbed_official 579:53297373a894 296 #define AC_STATUSA_STATE0_Pos 0 /**< \brief (AC_STATUSA) Comparator 0 Current State */
mbed_official 579:53297373a894 297 #define AC_STATUSA_STATE0 (1 << AC_STATUSA_STATE0_Pos)
mbed_official 579:53297373a894 298 #define AC_STATUSA_STATE1_Pos 1 /**< \brief (AC_STATUSA) Comparator 1 Current State */
mbed_official 579:53297373a894 299 #define AC_STATUSA_STATE1 (1 << AC_STATUSA_STATE1_Pos)
mbed_official 579:53297373a894 300 #define AC_STATUSA_STATE_Pos 0 /**< \brief (AC_STATUSA) Comparator x Current State */
mbed_official 579:53297373a894 301 #define AC_STATUSA_STATE_Msk (0x3ul << AC_STATUSA_STATE_Pos)
mbed_official 579:53297373a894 302 #define AC_STATUSA_STATE(value) ((AC_STATUSA_STATE_Msk & ((value) << AC_STATUSA_STATE_Pos)))
mbed_official 579:53297373a894 303 #define AC_STATUSA_WSTATE0_Pos 4 /**< \brief (AC_STATUSA) Window 0 Current State */
mbed_official 579:53297373a894 304 #define AC_STATUSA_WSTATE0_Msk (0x3ul << AC_STATUSA_WSTATE0_Pos)
mbed_official 579:53297373a894 305 #define AC_STATUSA_WSTATE0(value) ((AC_STATUSA_WSTATE0_Msk & ((value) << AC_STATUSA_WSTATE0_Pos)))
mbed_official 579:53297373a894 306 #define AC_STATUSA_WSTATE0_ABOVE_Val 0x0ul /**< \brief (AC_STATUSA) Signal is above window */
mbed_official 579:53297373a894 307 #define AC_STATUSA_WSTATE0_INSIDE_Val 0x1ul /**< \brief (AC_STATUSA) Signal is inside window */
mbed_official 579:53297373a894 308 #define AC_STATUSA_WSTATE0_BELOW_Val 0x2ul /**< \brief (AC_STATUSA) Signal is below window */
mbed_official 579:53297373a894 309 #define AC_STATUSA_WSTATE0_ABOVE (AC_STATUSA_WSTATE0_ABOVE_Val << AC_STATUSA_WSTATE0_Pos)
mbed_official 579:53297373a894 310 #define AC_STATUSA_WSTATE0_INSIDE (AC_STATUSA_WSTATE0_INSIDE_Val << AC_STATUSA_WSTATE0_Pos)
mbed_official 579:53297373a894 311 #define AC_STATUSA_WSTATE0_BELOW (AC_STATUSA_WSTATE0_BELOW_Val << AC_STATUSA_WSTATE0_Pos)
mbed_official 579:53297373a894 312 #define AC_STATUSA_MASK 0x33ul /**< \brief (AC_STATUSA) MASK Register */
mbed_official 579:53297373a894 313
mbed_official 579:53297373a894 314 /* -------- AC_STATUSB : (AC Offset: 0x09) (R/ 8) Status B -------- */
mbed_official 579:53297373a894 315 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 316 typedef union {
mbed_official 579:53297373a894 317 struct {
mbed_official 579:53297373a894 318 uint8_t READY0:1; /*!< bit: 0 Comparator 0 Ready */
mbed_official 579:53297373a894 319 uint8_t READY1:1; /*!< bit: 1 Comparator 1 Ready */
mbed_official 579:53297373a894 320 uint8_t :5; /*!< bit: 2.. 6 Reserved */
mbed_official 579:53297373a894 321 uint8_t SYNCBUSY:1; /*!< bit: 7 Synchronization Busy */
mbed_official 579:53297373a894 322 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 323 struct {
mbed_official 579:53297373a894 324 uint8_t READY:2; /*!< bit: 0.. 1 Comparator x Ready */
mbed_official 579:53297373a894 325 uint8_t :6; /*!< bit: 2.. 7 Reserved */
mbed_official 579:53297373a894 326 } vec; /*!< Structure used for vec access */
mbed_official 579:53297373a894 327 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 328 } AC_STATUSB_Type;
mbed_official 579:53297373a894 329 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 330
mbed_official 579:53297373a894 331 #define AC_STATUSB_OFFSET 0x09 /**< \brief (AC_STATUSB offset) Status B */
mbed_official 579:53297373a894 332 #define AC_STATUSB_RESETVALUE 0x00ul /**< \brief (AC_STATUSB reset_value) Status B */
mbed_official 579:53297373a894 333
mbed_official 579:53297373a894 334 #define AC_STATUSB_READY0_Pos 0 /**< \brief (AC_STATUSB) Comparator 0 Ready */
mbed_official 579:53297373a894 335 #define AC_STATUSB_READY0 (1 << AC_STATUSB_READY0_Pos)
mbed_official 579:53297373a894 336 #define AC_STATUSB_READY1_Pos 1 /**< \brief (AC_STATUSB) Comparator 1 Ready */
mbed_official 579:53297373a894 337 #define AC_STATUSB_READY1 (1 << AC_STATUSB_READY1_Pos)
mbed_official 579:53297373a894 338 #define AC_STATUSB_READY_Pos 0 /**< \brief (AC_STATUSB) Comparator x Ready */
mbed_official 579:53297373a894 339 #define AC_STATUSB_READY_Msk (0x3ul << AC_STATUSB_READY_Pos)
mbed_official 579:53297373a894 340 #define AC_STATUSB_READY(value) ((AC_STATUSB_READY_Msk & ((value) << AC_STATUSB_READY_Pos)))
mbed_official 579:53297373a894 341 #define AC_STATUSB_SYNCBUSY_Pos 7 /**< \brief (AC_STATUSB) Synchronization Busy */
mbed_official 579:53297373a894 342 #define AC_STATUSB_SYNCBUSY (0x1ul << AC_STATUSB_SYNCBUSY_Pos)
mbed_official 579:53297373a894 343 #define AC_STATUSB_MASK 0x83ul /**< \brief (AC_STATUSB) MASK Register */
mbed_official 579:53297373a894 344
mbed_official 579:53297373a894 345 /* -------- AC_STATUSC : (AC Offset: 0x0A) (R/ 8) Status C -------- */
mbed_official 579:53297373a894 346 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 347 typedef union {
mbed_official 579:53297373a894 348 struct {
mbed_official 579:53297373a894 349 uint8_t STATE0:1; /*!< bit: 0 Comparator 0 Current State */
mbed_official 579:53297373a894 350 uint8_t STATE1:1; /*!< bit: 1 Comparator 1 Current State */
mbed_official 579:53297373a894 351 uint8_t :2; /*!< bit: 2.. 3 Reserved */
mbed_official 579:53297373a894 352 uint8_t WSTATE0:2; /*!< bit: 4.. 5 Window 0 Current State */
mbed_official 579:53297373a894 353 uint8_t :2; /*!< bit: 6.. 7 Reserved */
mbed_official 579:53297373a894 354 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 355 struct {
mbed_official 579:53297373a894 356 uint8_t STATE:2; /*!< bit: 0.. 1 Comparator x Current State */
mbed_official 579:53297373a894 357 uint8_t :6; /*!< bit: 2.. 7 Reserved */
mbed_official 579:53297373a894 358 } vec; /*!< Structure used for vec access */
mbed_official 579:53297373a894 359 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 360 } AC_STATUSC_Type;
mbed_official 579:53297373a894 361 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 362
mbed_official 579:53297373a894 363 #define AC_STATUSC_OFFSET 0x0A /**< \brief (AC_STATUSC offset) Status C */
mbed_official 579:53297373a894 364 #define AC_STATUSC_RESETVALUE 0x00ul /**< \brief (AC_STATUSC reset_value) Status C */
mbed_official 579:53297373a894 365
mbed_official 579:53297373a894 366 #define AC_STATUSC_STATE0_Pos 0 /**< \brief (AC_STATUSC) Comparator 0 Current State */
mbed_official 579:53297373a894 367 #define AC_STATUSC_STATE0 (1 << AC_STATUSC_STATE0_Pos)
mbed_official 579:53297373a894 368 #define AC_STATUSC_STATE1_Pos 1 /**< \brief (AC_STATUSC) Comparator 1 Current State */
mbed_official 579:53297373a894 369 #define AC_STATUSC_STATE1 (1 << AC_STATUSC_STATE1_Pos)
mbed_official 579:53297373a894 370 #define AC_STATUSC_STATE_Pos 0 /**< \brief (AC_STATUSC) Comparator x Current State */
mbed_official 579:53297373a894 371 #define AC_STATUSC_STATE_Msk (0x3ul << AC_STATUSC_STATE_Pos)
mbed_official 579:53297373a894 372 #define AC_STATUSC_STATE(value) ((AC_STATUSC_STATE_Msk & ((value) << AC_STATUSC_STATE_Pos)))
mbed_official 579:53297373a894 373 #define AC_STATUSC_WSTATE0_Pos 4 /**< \brief (AC_STATUSC) Window 0 Current State */
mbed_official 579:53297373a894 374 #define AC_STATUSC_WSTATE0_Msk (0x3ul << AC_STATUSC_WSTATE0_Pos)
mbed_official 579:53297373a894 375 #define AC_STATUSC_WSTATE0(value) ((AC_STATUSC_WSTATE0_Msk & ((value) << AC_STATUSC_WSTATE0_Pos)))
mbed_official 579:53297373a894 376 #define AC_STATUSC_WSTATE0_ABOVE_Val 0x0ul /**< \brief (AC_STATUSC) Signal is above window */
mbed_official 579:53297373a894 377 #define AC_STATUSC_WSTATE0_INSIDE_Val 0x1ul /**< \brief (AC_STATUSC) Signal is inside window */
mbed_official 579:53297373a894 378 #define AC_STATUSC_WSTATE0_BELOW_Val 0x2ul /**< \brief (AC_STATUSC) Signal is below window */
mbed_official 579:53297373a894 379 #define AC_STATUSC_WSTATE0_ABOVE (AC_STATUSC_WSTATE0_ABOVE_Val << AC_STATUSC_WSTATE0_Pos)
mbed_official 579:53297373a894 380 #define AC_STATUSC_WSTATE0_INSIDE (AC_STATUSC_WSTATE0_INSIDE_Val << AC_STATUSC_WSTATE0_Pos)
mbed_official 579:53297373a894 381 #define AC_STATUSC_WSTATE0_BELOW (AC_STATUSC_WSTATE0_BELOW_Val << AC_STATUSC_WSTATE0_Pos)
mbed_official 579:53297373a894 382 #define AC_STATUSC_MASK 0x33ul /**< \brief (AC_STATUSC) MASK Register */
mbed_official 579:53297373a894 383
mbed_official 579:53297373a894 384 /* -------- AC_WINCTRL : (AC Offset: 0x0C) (R/W 8) Window Control -------- */
mbed_official 579:53297373a894 385 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 386 typedef union {
mbed_official 579:53297373a894 387 struct {
mbed_official 579:53297373a894 388 uint8_t WEN0:1; /*!< bit: 0 Window 0 Mode Enable */
mbed_official 579:53297373a894 389 uint8_t WINTSEL0:2; /*!< bit: 1.. 2 Window 0 Interrupt Selection */
mbed_official 579:53297373a894 390 uint8_t :5; /*!< bit: 3.. 7 Reserved */
mbed_official 579:53297373a894 391 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 392 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 393 } AC_WINCTRL_Type;
mbed_official 579:53297373a894 394 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 395
mbed_official 579:53297373a894 396 #define AC_WINCTRL_OFFSET 0x0C /**< \brief (AC_WINCTRL offset) Window Control */
mbed_official 579:53297373a894 397 #define AC_WINCTRL_RESETVALUE 0x00ul /**< \brief (AC_WINCTRL reset_value) Window Control */
mbed_official 579:53297373a894 398
mbed_official 579:53297373a894 399 #define AC_WINCTRL_WEN0_Pos 0 /**< \brief (AC_WINCTRL) Window 0 Mode Enable */
mbed_official 579:53297373a894 400 #define AC_WINCTRL_WEN0 (0x1ul << AC_WINCTRL_WEN0_Pos)
mbed_official 579:53297373a894 401 #define AC_WINCTRL_WINTSEL0_Pos 1 /**< \brief (AC_WINCTRL) Window 0 Interrupt Selection */
mbed_official 579:53297373a894 402 #define AC_WINCTRL_WINTSEL0_Msk (0x3ul << AC_WINCTRL_WINTSEL0_Pos)
mbed_official 579:53297373a894 403 #define AC_WINCTRL_WINTSEL0(value) ((AC_WINCTRL_WINTSEL0_Msk & ((value) << AC_WINCTRL_WINTSEL0_Pos)))
mbed_official 579:53297373a894 404 #define AC_WINCTRL_WINTSEL0_ABOVE_Val 0x0ul /**< \brief (AC_WINCTRL) Interrupt on signal above window */
mbed_official 579:53297373a894 405 #define AC_WINCTRL_WINTSEL0_INSIDE_Val 0x1ul /**< \brief (AC_WINCTRL) Interrupt on signal inside window */
mbed_official 579:53297373a894 406 #define AC_WINCTRL_WINTSEL0_BELOW_Val 0x2ul /**< \brief (AC_WINCTRL) Interrupt on signal below window */
mbed_official 579:53297373a894 407 #define AC_WINCTRL_WINTSEL0_OUTSIDE_Val 0x3ul /**< \brief (AC_WINCTRL) Interrupt on signal outside window */
mbed_official 579:53297373a894 408 #define AC_WINCTRL_WINTSEL0_ABOVE (AC_WINCTRL_WINTSEL0_ABOVE_Val << AC_WINCTRL_WINTSEL0_Pos)
mbed_official 579:53297373a894 409 #define AC_WINCTRL_WINTSEL0_INSIDE (AC_WINCTRL_WINTSEL0_INSIDE_Val << AC_WINCTRL_WINTSEL0_Pos)
mbed_official 579:53297373a894 410 #define AC_WINCTRL_WINTSEL0_BELOW (AC_WINCTRL_WINTSEL0_BELOW_Val << AC_WINCTRL_WINTSEL0_Pos)
mbed_official 579:53297373a894 411 #define AC_WINCTRL_WINTSEL0_OUTSIDE (AC_WINCTRL_WINTSEL0_OUTSIDE_Val << AC_WINCTRL_WINTSEL0_Pos)
mbed_official 579:53297373a894 412 #define AC_WINCTRL_MASK 0x07ul /**< \brief (AC_WINCTRL) MASK Register */
mbed_official 579:53297373a894 413
mbed_official 579:53297373a894 414 /* -------- AC_COMPCTRL : (AC Offset: 0x10) (R/W 32) Comparator Control n -------- */
mbed_official 579:53297373a894 415 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 416 typedef union {
mbed_official 579:53297373a894 417 struct {
mbed_official 579:53297373a894 418 uint32_t ENABLE:1; /*!< bit: 0 Enable */
mbed_official 579:53297373a894 419 uint32_t SINGLE:1; /*!< bit: 1 Single-Shot Mode */
mbed_official 579:53297373a894 420 uint32_t SPEED:2; /*!< bit: 2.. 3 Speed Selection */
mbed_official 579:53297373a894 421 uint32_t :1; /*!< bit: 4 Reserved */
mbed_official 579:53297373a894 422 uint32_t INTSEL:2; /*!< bit: 5.. 6 Interrupt Selection */
mbed_official 579:53297373a894 423 uint32_t :1; /*!< bit: 7 Reserved */
mbed_official 579:53297373a894 424 uint32_t MUXNEG:3; /*!< bit: 8..10 Negative Input Mux Selection */
mbed_official 579:53297373a894 425 uint32_t :1; /*!< bit: 11 Reserved */
mbed_official 579:53297373a894 426 uint32_t MUXPOS:2; /*!< bit: 12..13 Positive Input Mux Selection */
mbed_official 579:53297373a894 427 uint32_t :1; /*!< bit: 14 Reserved */
mbed_official 579:53297373a894 428 uint32_t SWAP:1; /*!< bit: 15 Swap Inputs and Invert */
mbed_official 579:53297373a894 429 uint32_t OUT:2; /*!< bit: 16..17 Output */
mbed_official 579:53297373a894 430 uint32_t :1; /*!< bit: 18 Reserved */
mbed_official 579:53297373a894 431 uint32_t HYST:1; /*!< bit: 19 Hysteresis Enable */
mbed_official 579:53297373a894 432 uint32_t :4; /*!< bit: 20..23 Reserved */
mbed_official 579:53297373a894 433 uint32_t FLEN:3; /*!< bit: 24..26 Filter Length */
mbed_official 579:53297373a894 434 uint32_t :5; /*!< bit: 27..31 Reserved */
mbed_official 579:53297373a894 435 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 436 uint32_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 437 } AC_COMPCTRL_Type;
mbed_official 579:53297373a894 438 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 439
mbed_official 579:53297373a894 440 #define AC_COMPCTRL_OFFSET 0x10 /**< \brief (AC_COMPCTRL offset) Comparator Control n */
mbed_official 579:53297373a894 441 #define AC_COMPCTRL_RESETVALUE 0x00000000ul /**< \brief (AC_COMPCTRL reset_value) Comparator Control n */
mbed_official 579:53297373a894 442
mbed_official 579:53297373a894 443 #define AC_COMPCTRL_ENABLE_Pos 0 /**< \brief (AC_COMPCTRL) Enable */
mbed_official 579:53297373a894 444 #define AC_COMPCTRL_ENABLE (0x1ul << AC_COMPCTRL_ENABLE_Pos)
mbed_official 579:53297373a894 445 #define AC_COMPCTRL_SINGLE_Pos 1 /**< \brief (AC_COMPCTRL) Single-Shot Mode */
mbed_official 579:53297373a894 446 #define AC_COMPCTRL_SINGLE (0x1ul << AC_COMPCTRL_SINGLE_Pos)
mbed_official 579:53297373a894 447 #define AC_COMPCTRL_SPEED_Pos 2 /**< \brief (AC_COMPCTRL) Speed Selection */
mbed_official 579:53297373a894 448 #define AC_COMPCTRL_SPEED_Msk (0x3ul << AC_COMPCTRL_SPEED_Pos)
mbed_official 579:53297373a894 449 #define AC_COMPCTRL_SPEED(value) ((AC_COMPCTRL_SPEED_Msk & ((value) << AC_COMPCTRL_SPEED_Pos)))
mbed_official 579:53297373a894 450 #define AC_COMPCTRL_SPEED_LOW_Val 0x0ul /**< \brief (AC_COMPCTRL) Low speed */
mbed_official 579:53297373a894 451 #define AC_COMPCTRL_SPEED_HIGH_Val 0x1ul /**< \brief (AC_COMPCTRL) High speed */
mbed_official 579:53297373a894 452 #define AC_COMPCTRL_SPEED_LOW (AC_COMPCTRL_SPEED_LOW_Val << AC_COMPCTRL_SPEED_Pos)
mbed_official 579:53297373a894 453 #define AC_COMPCTRL_SPEED_HIGH (AC_COMPCTRL_SPEED_HIGH_Val << AC_COMPCTRL_SPEED_Pos)
mbed_official 579:53297373a894 454 #define AC_COMPCTRL_INTSEL_Pos 5 /**< \brief (AC_COMPCTRL) Interrupt Selection */
mbed_official 579:53297373a894 455 #define AC_COMPCTRL_INTSEL_Msk (0x3ul << AC_COMPCTRL_INTSEL_Pos)
mbed_official 579:53297373a894 456 #define AC_COMPCTRL_INTSEL(value) ((AC_COMPCTRL_INTSEL_Msk & ((value) << AC_COMPCTRL_INTSEL_Pos)))
mbed_official 579:53297373a894 457 #define AC_COMPCTRL_INTSEL_TOGGLE_Val 0x0ul /**< \brief (AC_COMPCTRL) Interrupt on comparator output toggle */
mbed_official 579:53297373a894 458 #define AC_COMPCTRL_INTSEL_RISING_Val 0x1ul /**< \brief (AC_COMPCTRL) Interrupt on comparator output rising */
mbed_official 579:53297373a894 459 #define AC_COMPCTRL_INTSEL_FALLING_Val 0x2ul /**< \brief (AC_COMPCTRL) Interrupt on comparator output falling */
mbed_official 579:53297373a894 460 #define AC_COMPCTRL_INTSEL_EOC_Val 0x3ul /**< \brief (AC_COMPCTRL) Interrupt on end of comparison (single-shot mode only) */
mbed_official 579:53297373a894 461 #define AC_COMPCTRL_INTSEL_TOGGLE (AC_COMPCTRL_INTSEL_TOGGLE_Val << AC_COMPCTRL_INTSEL_Pos)
mbed_official 579:53297373a894 462 #define AC_COMPCTRL_INTSEL_RISING (AC_COMPCTRL_INTSEL_RISING_Val << AC_COMPCTRL_INTSEL_Pos)
mbed_official 579:53297373a894 463 #define AC_COMPCTRL_INTSEL_FALLING (AC_COMPCTRL_INTSEL_FALLING_Val << AC_COMPCTRL_INTSEL_Pos)
mbed_official 579:53297373a894 464 #define AC_COMPCTRL_INTSEL_EOC (AC_COMPCTRL_INTSEL_EOC_Val << AC_COMPCTRL_INTSEL_Pos)
mbed_official 579:53297373a894 465 #define AC_COMPCTRL_MUXNEG_Pos 8 /**< \brief (AC_COMPCTRL) Negative Input Mux Selection */
mbed_official 579:53297373a894 466 #define AC_COMPCTRL_MUXNEG_Msk (0x7ul << AC_COMPCTRL_MUXNEG_Pos)
mbed_official 579:53297373a894 467 #define AC_COMPCTRL_MUXNEG(value) ((AC_COMPCTRL_MUXNEG_Msk & ((value) << AC_COMPCTRL_MUXNEG_Pos)))
mbed_official 579:53297373a894 468 #define AC_COMPCTRL_MUXNEG_PIN0_Val 0x0ul /**< \brief (AC_COMPCTRL) I/O pin 0 */
mbed_official 579:53297373a894 469 #define AC_COMPCTRL_MUXNEG_PIN1_Val 0x1ul /**< \brief (AC_COMPCTRL) I/O pin 1 */
mbed_official 579:53297373a894 470 #define AC_COMPCTRL_MUXNEG_PIN2_Val 0x2ul /**< \brief (AC_COMPCTRL) I/O pin 2 */
mbed_official 579:53297373a894 471 #define AC_COMPCTRL_MUXNEG_PIN3_Val 0x3ul /**< \brief (AC_COMPCTRL) I/O pin 3 */
mbed_official 579:53297373a894 472 #define AC_COMPCTRL_MUXNEG_GND_Val 0x4ul /**< \brief (AC_COMPCTRL) Ground */
mbed_official 579:53297373a894 473 #define AC_COMPCTRL_MUXNEG_VSCALE_Val 0x5ul /**< \brief (AC_COMPCTRL) VDD scaler */
mbed_official 579:53297373a894 474 #define AC_COMPCTRL_MUXNEG_BANDGAP_Val 0x6ul /**< \brief (AC_COMPCTRL) Internal bandgap voltage */
mbed_official 579:53297373a894 475 #define AC_COMPCTRL_MUXNEG_DAC_Val 0x7ul /**< \brief (AC_COMPCTRL) DAC output */
mbed_official 579:53297373a894 476 #define AC_COMPCTRL_MUXNEG_PIN0 (AC_COMPCTRL_MUXNEG_PIN0_Val << AC_COMPCTRL_MUXNEG_Pos)
mbed_official 579:53297373a894 477 #define AC_COMPCTRL_MUXNEG_PIN1 (AC_COMPCTRL_MUXNEG_PIN1_Val << AC_COMPCTRL_MUXNEG_Pos)
mbed_official 579:53297373a894 478 #define AC_COMPCTRL_MUXNEG_PIN2 (AC_COMPCTRL_MUXNEG_PIN2_Val << AC_COMPCTRL_MUXNEG_Pos)
mbed_official 579:53297373a894 479 #define AC_COMPCTRL_MUXNEG_PIN3 (AC_COMPCTRL_MUXNEG_PIN3_Val << AC_COMPCTRL_MUXNEG_Pos)
mbed_official 579:53297373a894 480 #define AC_COMPCTRL_MUXNEG_GND (AC_COMPCTRL_MUXNEG_GND_Val << AC_COMPCTRL_MUXNEG_Pos)
mbed_official 579:53297373a894 481 #define AC_COMPCTRL_MUXNEG_VSCALE (AC_COMPCTRL_MUXNEG_VSCALE_Val << AC_COMPCTRL_MUXNEG_Pos)
mbed_official 579:53297373a894 482 #define AC_COMPCTRL_MUXNEG_BANDGAP (AC_COMPCTRL_MUXNEG_BANDGAP_Val << AC_COMPCTRL_MUXNEG_Pos)
mbed_official 579:53297373a894 483 #define AC_COMPCTRL_MUXNEG_DAC (AC_COMPCTRL_MUXNEG_DAC_Val << AC_COMPCTRL_MUXNEG_Pos)
mbed_official 579:53297373a894 484 #define AC_COMPCTRL_MUXPOS_Pos 12 /**< \brief (AC_COMPCTRL) Positive Input Mux Selection */
mbed_official 579:53297373a894 485 #define AC_COMPCTRL_MUXPOS_Msk (0x3ul << AC_COMPCTRL_MUXPOS_Pos)
mbed_official 579:53297373a894 486 #define AC_COMPCTRL_MUXPOS(value) ((AC_COMPCTRL_MUXPOS_Msk & ((value) << AC_COMPCTRL_MUXPOS_Pos)))
mbed_official 579:53297373a894 487 #define AC_COMPCTRL_MUXPOS_PIN0_Val 0x0ul /**< \brief (AC_COMPCTRL) I/O pin 0 */
mbed_official 579:53297373a894 488 #define AC_COMPCTRL_MUXPOS_PIN1_Val 0x1ul /**< \brief (AC_COMPCTRL) I/O pin 1 */
mbed_official 579:53297373a894 489 #define AC_COMPCTRL_MUXPOS_PIN2_Val 0x2ul /**< \brief (AC_COMPCTRL) I/O pin 2 */
mbed_official 579:53297373a894 490 #define AC_COMPCTRL_MUXPOS_PIN3_Val 0x3ul /**< \brief (AC_COMPCTRL) I/O pin 3 */
mbed_official 579:53297373a894 491 #define AC_COMPCTRL_MUXPOS_PIN0 (AC_COMPCTRL_MUXPOS_PIN0_Val << AC_COMPCTRL_MUXPOS_Pos)
mbed_official 579:53297373a894 492 #define AC_COMPCTRL_MUXPOS_PIN1 (AC_COMPCTRL_MUXPOS_PIN1_Val << AC_COMPCTRL_MUXPOS_Pos)
mbed_official 579:53297373a894 493 #define AC_COMPCTRL_MUXPOS_PIN2 (AC_COMPCTRL_MUXPOS_PIN2_Val << AC_COMPCTRL_MUXPOS_Pos)
mbed_official 579:53297373a894 494 #define AC_COMPCTRL_MUXPOS_PIN3 (AC_COMPCTRL_MUXPOS_PIN3_Val << AC_COMPCTRL_MUXPOS_Pos)
mbed_official 579:53297373a894 495 #define AC_COMPCTRL_SWAP_Pos 15 /**< \brief (AC_COMPCTRL) Swap Inputs and Invert */
mbed_official 579:53297373a894 496 #define AC_COMPCTRL_SWAP (0x1ul << AC_COMPCTRL_SWAP_Pos)
mbed_official 579:53297373a894 497 #define AC_COMPCTRL_OUT_Pos 16 /**< \brief (AC_COMPCTRL) Output */
mbed_official 579:53297373a894 498 #define AC_COMPCTRL_OUT_Msk (0x3ul << AC_COMPCTRL_OUT_Pos)
mbed_official 579:53297373a894 499 #define AC_COMPCTRL_OUT(value) ((AC_COMPCTRL_OUT_Msk & ((value) << AC_COMPCTRL_OUT_Pos)))
mbed_official 579:53297373a894 500 #define AC_COMPCTRL_OUT_OFF_Val 0x0ul /**< \brief (AC_COMPCTRL) The output of COMPn is not routed to the COMPn I/O port */
mbed_official 579:53297373a894 501 #define AC_COMPCTRL_OUT_ASYNC_Val 0x1ul /**< \brief (AC_COMPCTRL) The asynchronous output of COMPn is routed to the COMPn I/O port */
mbed_official 579:53297373a894 502 #define AC_COMPCTRL_OUT_SYNC_Val 0x2ul /**< \brief (AC_COMPCTRL) The synchronous output (including filtering) of COMPn is routed to the COMPn I/O port */
mbed_official 579:53297373a894 503 #define AC_COMPCTRL_OUT_OFF (AC_COMPCTRL_OUT_OFF_Val << AC_COMPCTRL_OUT_Pos)
mbed_official 579:53297373a894 504 #define AC_COMPCTRL_OUT_ASYNC (AC_COMPCTRL_OUT_ASYNC_Val << AC_COMPCTRL_OUT_Pos)
mbed_official 579:53297373a894 505 #define AC_COMPCTRL_OUT_SYNC (AC_COMPCTRL_OUT_SYNC_Val << AC_COMPCTRL_OUT_Pos)
mbed_official 579:53297373a894 506 #define AC_COMPCTRL_HYST_Pos 19 /**< \brief (AC_COMPCTRL) Hysteresis Enable */
mbed_official 579:53297373a894 507 #define AC_COMPCTRL_HYST (0x1ul << AC_COMPCTRL_HYST_Pos)
mbed_official 579:53297373a894 508 #define AC_COMPCTRL_FLEN_Pos 24 /**< \brief (AC_COMPCTRL) Filter Length */
mbed_official 579:53297373a894 509 #define AC_COMPCTRL_FLEN_Msk (0x7ul << AC_COMPCTRL_FLEN_Pos)
mbed_official 579:53297373a894 510 #define AC_COMPCTRL_FLEN(value) ((AC_COMPCTRL_FLEN_Msk & ((value) << AC_COMPCTRL_FLEN_Pos)))
mbed_official 579:53297373a894 511 #define AC_COMPCTRL_FLEN_OFF_Val 0x0ul /**< \brief (AC_COMPCTRL) No filtering */
mbed_official 579:53297373a894 512 #define AC_COMPCTRL_FLEN_MAJ3_Val 0x1ul /**< \brief (AC_COMPCTRL) 3-bit majority function (2 of 3) */
mbed_official 579:53297373a894 513 #define AC_COMPCTRL_FLEN_MAJ5_Val 0x2ul /**< \brief (AC_COMPCTRL) 5-bit majority function (3 of 5) */
mbed_official 579:53297373a894 514 #define AC_COMPCTRL_FLEN_OFF (AC_COMPCTRL_FLEN_OFF_Val << AC_COMPCTRL_FLEN_Pos)
mbed_official 579:53297373a894 515 #define AC_COMPCTRL_FLEN_MAJ3 (AC_COMPCTRL_FLEN_MAJ3_Val << AC_COMPCTRL_FLEN_Pos)
mbed_official 579:53297373a894 516 #define AC_COMPCTRL_FLEN_MAJ5 (AC_COMPCTRL_FLEN_MAJ5_Val << AC_COMPCTRL_FLEN_Pos)
mbed_official 579:53297373a894 517 #define AC_COMPCTRL_MASK 0x070BB76Ful /**< \brief (AC_COMPCTRL) MASK Register */
mbed_official 579:53297373a894 518
mbed_official 579:53297373a894 519 /* -------- AC_SCALER : (AC Offset: 0x20) (R/W 8) Scaler n -------- */
mbed_official 579:53297373a894 520 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 521 typedef union {
mbed_official 579:53297373a894 522 struct {
mbed_official 579:53297373a894 523 uint8_t VALUE:6; /*!< bit: 0.. 5 Scaler Value */
mbed_official 579:53297373a894 524 uint8_t :2; /*!< bit: 6.. 7 Reserved */
mbed_official 579:53297373a894 525 } bit; /*!< Structure used for bit access */
mbed_official 579:53297373a894 526 uint8_t reg; /*!< Type used for register access */
mbed_official 579:53297373a894 527 } AC_SCALER_Type;
mbed_official 579:53297373a894 528 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 529
mbed_official 579:53297373a894 530 #define AC_SCALER_OFFSET 0x20 /**< \brief (AC_SCALER offset) Scaler n */
mbed_official 579:53297373a894 531 #define AC_SCALER_RESETVALUE 0x00ul /**< \brief (AC_SCALER reset_value) Scaler n */
mbed_official 579:53297373a894 532
mbed_official 579:53297373a894 533 #define AC_SCALER_VALUE_Pos 0 /**< \brief (AC_SCALER) Scaler Value */
mbed_official 579:53297373a894 534 #define AC_SCALER_VALUE_Msk (0x3Ful << AC_SCALER_VALUE_Pos)
mbed_official 579:53297373a894 535 #define AC_SCALER_VALUE(value) ((AC_SCALER_VALUE_Msk & ((value) << AC_SCALER_VALUE_Pos)))
mbed_official 579:53297373a894 536 #define AC_SCALER_MASK 0x3Ful /**< \brief (AC_SCALER) MASK Register */
mbed_official 579:53297373a894 537
mbed_official 579:53297373a894 538 /** \brief AC hardware registers */
mbed_official 579:53297373a894 539 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
mbed_official 579:53297373a894 540 typedef struct {
mbed_official 579:53297373a894 541 __IO AC_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 8) Control A */
mbed_official 579:53297373a894 542 __O AC_CTRLB_Type CTRLB; /**< \brief Offset: 0x01 ( /W 8) Control B */
mbed_official 579:53297373a894 543 __IO AC_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x02 (R/W 16) Event Control */
mbed_official 579:53297373a894 544 __IO AC_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x04 (R/W 8) Interrupt Enable Clear */
mbed_official 579:53297373a894 545 __IO AC_INTENSET_Type INTENSET; /**< \brief Offset: 0x05 (R/W 8) Interrupt Enable Set */
mbed_official 579:53297373a894 546 __IO AC_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x06 (R/W 8) Interrupt Flag Status and Clear */
mbed_official 579:53297373a894 547 RoReg8 Reserved1[0x1];
mbed_official 579:53297373a894 548 __I AC_STATUSA_Type STATUSA; /**< \brief Offset: 0x08 (R/ 8) Status A */
mbed_official 579:53297373a894 549 __I AC_STATUSB_Type STATUSB; /**< \brief Offset: 0x09 (R/ 8) Status B */
mbed_official 579:53297373a894 550 __I AC_STATUSC_Type STATUSC; /**< \brief Offset: 0x0A (R/ 8) Status C */
mbed_official 579:53297373a894 551 RoReg8 Reserved2[0x1];
mbed_official 579:53297373a894 552 __IO AC_WINCTRL_Type WINCTRL; /**< \brief Offset: 0x0C (R/W 8) Window Control */
mbed_official 579:53297373a894 553 RoReg8 Reserved3[0x3];
mbed_official 579:53297373a894 554 __IO AC_COMPCTRL_Type COMPCTRL[2]; /**< \brief Offset: 0x10 (R/W 32) Comparator Control n */
mbed_official 579:53297373a894 555 RoReg8 Reserved4[0x8];
mbed_official 579:53297373a894 556 __IO AC_SCALER_Type SCALER[2]; /**< \brief Offset: 0x20 (R/W 8) Scaler n */
mbed_official 579:53297373a894 557 } Ac;
mbed_official 579:53297373a894 558 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
mbed_official 579:53297373a894 559
mbed_official 579:53297373a894 560 /*@}*/
mbed_official 579:53297373a894 561
mbed_official 579:53297373a894 562 #endif /* _SAMD21_AC_COMPONENT_ */