1 /** 2 * \file 3 * 4 * \brief Component description for TCC 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 30 #ifndef _SAML21_TCC_COMPONENT_ 31 #define _SAML21_TCC_COMPONENT_ 32 33 /* ========================================================================== */ 34 /** SOFTWARE API DEFINITION FOR TCC */ 35 /* ========================================================================== */ 36 /** \addtogroup SAML21_TCC Timer Counter Control */ 37 /*@{*/ 38 39 #define TCC_U2213 40 #define REV_TCC 0x300 41 42 /* -------- TCC_CTRLA : (TCC Offset: 0x00) (R/W 32) Control A -------- */ 43 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 44 typedef union { 45 struct { 46 uint32_t SWRST:1; /*!< bit: 0 Software Reset */ 47 uint32_t ENABLE:1; /*!< bit: 1 Enable */ 48 uint32_t :3; /*!< bit: 2.. 4 Reserved */ 49 uint32_t RESOLUTION:2; /*!< bit: 5.. 6 Enhanced Resolution */ 50 uint32_t :1; /*!< bit: 7 Reserved */ 51 uint32_t PRESCALER:3; /*!< bit: 8..10 Prescaler */ 52 uint32_t RUNSTDBY:1; /*!< bit: 11 Run in Standby */ 53 uint32_t PRESCSYNC:2; /*!< bit: 12..13 Prescaler and Counter Synchronization Selection */ 54 uint32_t ALOCK:1; /*!< bit: 14 Auto Lock */ 55 uint32_t MSYNC:1; /*!< bit: 15 Master Synchronization (only for TCC Slave Instance) */ 56 uint32_t :7; /*!< bit: 16..22 Reserved */ 57 uint32_t DMAOS:1; /*!< bit: 23 DMA One-shot Trigger Mode */ 58 uint32_t CPTEN0:1; /*!< bit: 24 Capture Channel 0 Enable */ 59 uint32_t CPTEN1:1; /*!< bit: 25 Capture Channel 1 Enable */ 60 uint32_t CPTEN2:1; /*!< bit: 26 Capture Channel 2 Enable */ 61 uint32_t CPTEN3:1; /*!< bit: 27 Capture Channel 3 Enable */ 62 uint32_t :4; /*!< bit: 28..31 Reserved */ 63 } bit; /*!< Structure used for bit access */ 64 struct { 65 uint32_t :24; /*!< bit: 0..23 Reserved */ 66 uint32_t CPTEN:4; /*!< bit: 24..27 Capture Channel x Enable */ 67 uint32_t :4; /*!< bit: 28..31 Reserved */ 68 } vec; /*!< Structure used for vec access */ 69 uint32_t reg; /*!< Type used for register access */ 70 } TCC_CTRLA_Type; 71 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 72 73 #define TCC_CTRLA_OFFSET 0x00 /**< \brief (TCC_CTRLA offset) Control A */ 74 #define TCC_CTRLA_RESETVALUE _U_(0x00000000) /**< \brief (TCC_CTRLA reset_value) Control A */ 75 76 #define TCC_CTRLA_SWRST_Pos 0 /**< \brief (TCC_CTRLA) Software Reset */ 77 #define TCC_CTRLA_SWRST (_U_(0x1) << TCC_CTRLA_SWRST_Pos) 78 #define TCC_CTRLA_ENABLE_Pos 1 /**< \brief (TCC_CTRLA) Enable */ 79 #define TCC_CTRLA_ENABLE (_U_(0x1) << TCC_CTRLA_ENABLE_Pos) 80 #define TCC_CTRLA_RESOLUTION_Pos 5 /**< \brief (TCC_CTRLA) Enhanced Resolution */ 81 #define TCC_CTRLA_RESOLUTION_Msk (_U_(0x3) << TCC_CTRLA_RESOLUTION_Pos) 82 #define TCC_CTRLA_RESOLUTION(value) (TCC_CTRLA_RESOLUTION_Msk & ((value) << TCC_CTRLA_RESOLUTION_Pos)) 83 #define TCC_CTRLA_RESOLUTION_NONE_Val _U_(0x0) /**< \brief (TCC_CTRLA) Dithering is disabled */ 84 #define TCC_CTRLA_RESOLUTION_DITH4_Val _U_(0x1) /**< \brief (TCC_CTRLA) Dithering is done every 16 PWM frames */ 85 #define TCC_CTRLA_RESOLUTION_DITH5_Val _U_(0x2) /**< \brief (TCC_CTRLA) Dithering is done every 32 PWM frames */ 86 #define TCC_CTRLA_RESOLUTION_DITH6_Val _U_(0x3) /**< \brief (TCC_CTRLA) Dithering is done every 64 PWM frames */ 87 #define TCC_CTRLA_RESOLUTION_NONE (TCC_CTRLA_RESOLUTION_NONE_Val << TCC_CTRLA_RESOLUTION_Pos) 88 #define TCC_CTRLA_RESOLUTION_DITH4 (TCC_CTRLA_RESOLUTION_DITH4_Val << TCC_CTRLA_RESOLUTION_Pos) 89 #define TCC_CTRLA_RESOLUTION_DITH5 (TCC_CTRLA_RESOLUTION_DITH5_Val << TCC_CTRLA_RESOLUTION_Pos) 90 #define TCC_CTRLA_RESOLUTION_DITH6 (TCC_CTRLA_RESOLUTION_DITH6_Val << TCC_CTRLA_RESOLUTION_Pos) 91 #define TCC_CTRLA_PRESCALER_Pos 8 /**< \brief (TCC_CTRLA) Prescaler */ 92 #define TCC_CTRLA_PRESCALER_Msk (_U_(0x7) << TCC_CTRLA_PRESCALER_Pos) 93 #define TCC_CTRLA_PRESCALER(value) (TCC_CTRLA_PRESCALER_Msk & ((value) << TCC_CTRLA_PRESCALER_Pos)) 94 #define TCC_CTRLA_PRESCALER_DIV1_Val _U_(0x0) /**< \brief (TCC_CTRLA) No division */ 95 #define TCC_CTRLA_PRESCALER_DIV2_Val _U_(0x1) /**< \brief (TCC_CTRLA) Divide by 2 */ 96 #define TCC_CTRLA_PRESCALER_DIV4_Val _U_(0x2) /**< \brief (TCC_CTRLA) Divide by 4 */ 97 #define TCC_CTRLA_PRESCALER_DIV8_Val _U_(0x3) /**< \brief (TCC_CTRLA) Divide by 8 */ 98 #define TCC_CTRLA_PRESCALER_DIV16_Val _U_(0x4) /**< \brief (TCC_CTRLA) Divide by 16 */ 99 #define TCC_CTRLA_PRESCALER_DIV64_Val _U_(0x5) /**< \brief (TCC_CTRLA) Divide by 64 */ 100 #define TCC_CTRLA_PRESCALER_DIV256_Val _U_(0x6) /**< \brief (TCC_CTRLA) Divide by 256 */ 101 #define TCC_CTRLA_PRESCALER_DIV1024_Val _U_(0x7) /**< \brief (TCC_CTRLA) Divide by 1024 */ 102 #define TCC_CTRLA_PRESCALER_DIV1 (TCC_CTRLA_PRESCALER_DIV1_Val << TCC_CTRLA_PRESCALER_Pos) 103 #define TCC_CTRLA_PRESCALER_DIV2 (TCC_CTRLA_PRESCALER_DIV2_Val << TCC_CTRLA_PRESCALER_Pos) 104 #define TCC_CTRLA_PRESCALER_DIV4 (TCC_CTRLA_PRESCALER_DIV4_Val << TCC_CTRLA_PRESCALER_Pos) 105 #define TCC_CTRLA_PRESCALER_DIV8 (TCC_CTRLA_PRESCALER_DIV8_Val << TCC_CTRLA_PRESCALER_Pos) 106 #define TCC_CTRLA_PRESCALER_DIV16 (TCC_CTRLA_PRESCALER_DIV16_Val << TCC_CTRLA_PRESCALER_Pos) 107 #define TCC_CTRLA_PRESCALER_DIV64 (TCC_CTRLA_PRESCALER_DIV64_Val << TCC_CTRLA_PRESCALER_Pos) 108 #define TCC_CTRLA_PRESCALER_DIV256 (TCC_CTRLA_PRESCALER_DIV256_Val << TCC_CTRLA_PRESCALER_Pos) 109 #define TCC_CTRLA_PRESCALER_DIV1024 (TCC_CTRLA_PRESCALER_DIV1024_Val << TCC_CTRLA_PRESCALER_Pos) 110 #define TCC_CTRLA_RUNSTDBY_Pos 11 /**< \brief (TCC_CTRLA) Run in Standby */ 111 #define TCC_CTRLA_RUNSTDBY (_U_(0x1) << TCC_CTRLA_RUNSTDBY_Pos) 112 #define TCC_CTRLA_PRESCSYNC_Pos 12 /**< \brief (TCC_CTRLA) Prescaler and Counter Synchronization Selection */ 113 #define TCC_CTRLA_PRESCSYNC_Msk (_U_(0x3) << TCC_CTRLA_PRESCSYNC_Pos) 114 #define TCC_CTRLA_PRESCSYNC(value) (TCC_CTRLA_PRESCSYNC_Msk & ((value) << TCC_CTRLA_PRESCSYNC_Pos)) 115 #define TCC_CTRLA_PRESCSYNC_GCLK_Val _U_(0x0) /**< \brief (TCC_CTRLA) Reload or reset counter on next GCLK */ 116 #define TCC_CTRLA_PRESCSYNC_PRESC_Val _U_(0x1) /**< \brief (TCC_CTRLA) Reload or reset counter on next prescaler clock */ 117 #define TCC_CTRLA_PRESCSYNC_RESYNC_Val _U_(0x2) /**< \brief (TCC_CTRLA) Reload or reset counter on next GCLK and reset prescaler counter */ 118 #define TCC_CTRLA_PRESCSYNC_GCLK (TCC_CTRLA_PRESCSYNC_GCLK_Val << TCC_CTRLA_PRESCSYNC_Pos) 119 #define TCC_CTRLA_PRESCSYNC_PRESC (TCC_CTRLA_PRESCSYNC_PRESC_Val << TCC_CTRLA_PRESCSYNC_Pos) 120 #define TCC_CTRLA_PRESCSYNC_RESYNC (TCC_CTRLA_PRESCSYNC_RESYNC_Val << TCC_CTRLA_PRESCSYNC_Pos) 121 #define TCC_CTRLA_ALOCK_Pos 14 /**< \brief (TCC_CTRLA) Auto Lock */ 122 #define TCC_CTRLA_ALOCK (_U_(0x1) << TCC_CTRLA_ALOCK_Pos) 123 #define TCC_CTRLA_MSYNC_Pos 15 /**< \brief (TCC_CTRLA) Master Synchronization (only for TCC Slave Instance) */ 124 #define TCC_CTRLA_MSYNC (_U_(0x1) << TCC_CTRLA_MSYNC_Pos) 125 #define TCC_CTRLA_DMAOS_Pos 23 /**< \brief (TCC_CTRLA) DMA One-shot Trigger Mode */ 126 #define TCC_CTRLA_DMAOS (_U_(0x1) << TCC_CTRLA_DMAOS_Pos) 127 #define TCC_CTRLA_CPTEN0_Pos 24 /**< \brief (TCC_CTRLA) Capture Channel 0 Enable */ 128 #define TCC_CTRLA_CPTEN0 (_U_(1) << TCC_CTRLA_CPTEN0_Pos) 129 #define TCC_CTRLA_CPTEN1_Pos 25 /**< \brief (TCC_CTRLA) Capture Channel 1 Enable */ 130 #define TCC_CTRLA_CPTEN1 (_U_(1) << TCC_CTRLA_CPTEN1_Pos) 131 #define TCC_CTRLA_CPTEN2_Pos 26 /**< \brief (TCC_CTRLA) Capture Channel 2 Enable */ 132 #define TCC_CTRLA_CPTEN2 (_U_(1) << TCC_CTRLA_CPTEN2_Pos) 133 #define TCC_CTRLA_CPTEN3_Pos 27 /**< \brief (TCC_CTRLA) Capture Channel 3 Enable */ 134 #define TCC_CTRLA_CPTEN3 (_U_(1) << TCC_CTRLA_CPTEN3_Pos) 135 #define TCC_CTRLA_CPTEN_Pos 24 /**< \brief (TCC_CTRLA) Capture Channel x Enable */ 136 #define TCC_CTRLA_CPTEN_Msk (_U_(0xF) << TCC_CTRLA_CPTEN_Pos) 137 #define TCC_CTRLA_CPTEN(value) (TCC_CTRLA_CPTEN_Msk & ((value) << TCC_CTRLA_CPTEN_Pos)) 138 #define TCC_CTRLA_MASK _U_(0x0F80FF63) /**< \brief (TCC_CTRLA) MASK Register */ 139 140 /* -------- TCC_CTRLBCLR : (TCC Offset: 0x04) (R/W 8) Control B Clear -------- */ 141 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 142 typedef union { 143 struct { 144 uint8_t DIR:1; /*!< bit: 0 Counter Direction */ 145 uint8_t LUPD:1; /*!< bit: 1 Lock Update */ 146 uint8_t ONESHOT:1; /*!< bit: 2 One-Shot */ 147 uint8_t IDXCMD:2; /*!< bit: 3.. 4 Ramp Index Command */ 148 uint8_t CMD:3; /*!< bit: 5.. 7 TCC Command */ 149 } bit; /*!< Structure used for bit access */ 150 uint8_t reg; /*!< Type used for register access */ 151 } TCC_CTRLBCLR_Type; 152 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 153 154 #define TCC_CTRLBCLR_OFFSET 0x04 /**< \brief (TCC_CTRLBCLR offset) Control B Clear */ 155 #define TCC_CTRLBCLR_RESETVALUE _U_(0x00) /**< \brief (TCC_CTRLBCLR reset_value) Control B Clear */ 156 157 #define TCC_CTRLBCLR_DIR_Pos 0 /**< \brief (TCC_CTRLBCLR) Counter Direction */ 158 #define TCC_CTRLBCLR_DIR (_U_(0x1) << TCC_CTRLBCLR_DIR_Pos) 159 #define TCC_CTRLBCLR_LUPD_Pos 1 /**< \brief (TCC_CTRLBCLR) Lock Update */ 160 #define TCC_CTRLBCLR_LUPD (_U_(0x1) << TCC_CTRLBCLR_LUPD_Pos) 161 #define TCC_CTRLBCLR_ONESHOT_Pos 2 /**< \brief (TCC_CTRLBCLR) One-Shot */ 162 #define TCC_CTRLBCLR_ONESHOT (_U_(0x1) << TCC_CTRLBCLR_ONESHOT_Pos) 163 #define TCC_CTRLBCLR_IDXCMD_Pos 3 /**< \brief (TCC_CTRLBCLR) Ramp Index Command */ 164 #define TCC_CTRLBCLR_IDXCMD_Msk (_U_(0x3) << TCC_CTRLBCLR_IDXCMD_Pos) 165 #define TCC_CTRLBCLR_IDXCMD(value) (TCC_CTRLBCLR_IDXCMD_Msk & ((value) << TCC_CTRLBCLR_IDXCMD_Pos)) 166 #define TCC_CTRLBCLR_IDXCMD_DISABLE_Val _U_(0x0) /**< \brief (TCC_CTRLBCLR) Command disabled: Index toggles between cycles A and B */ 167 #define TCC_CTRLBCLR_IDXCMD_SET_Val _U_(0x1) /**< \brief (TCC_CTRLBCLR) Set index: cycle B will be forced in the next cycle */ 168 #define TCC_CTRLBCLR_IDXCMD_CLEAR_Val _U_(0x2) /**< \brief (TCC_CTRLBCLR) Clear index: cycle A will be forced in the next cycle */ 169 #define TCC_CTRLBCLR_IDXCMD_HOLD_Val _U_(0x3) /**< \brief (TCC_CTRLBCLR) Hold index: the next cycle will be the same as the current cycle */ 170 #define TCC_CTRLBCLR_IDXCMD_DISABLE (TCC_CTRLBCLR_IDXCMD_DISABLE_Val << TCC_CTRLBCLR_IDXCMD_Pos) 171 #define TCC_CTRLBCLR_IDXCMD_SET (TCC_CTRLBCLR_IDXCMD_SET_Val << TCC_CTRLBCLR_IDXCMD_Pos) 172 #define TCC_CTRLBCLR_IDXCMD_CLEAR (TCC_CTRLBCLR_IDXCMD_CLEAR_Val << TCC_CTRLBCLR_IDXCMD_Pos) 173 #define TCC_CTRLBCLR_IDXCMD_HOLD (TCC_CTRLBCLR_IDXCMD_HOLD_Val << TCC_CTRLBCLR_IDXCMD_Pos) 174 #define TCC_CTRLBCLR_CMD_Pos 5 /**< \brief (TCC_CTRLBCLR) TCC Command */ 175 #define TCC_CTRLBCLR_CMD_Msk (_U_(0x7) << TCC_CTRLBCLR_CMD_Pos) 176 #define TCC_CTRLBCLR_CMD(value) (TCC_CTRLBCLR_CMD_Msk & ((value) << TCC_CTRLBCLR_CMD_Pos)) 177 #define TCC_CTRLBCLR_CMD_NONE_Val _U_(0x0) /**< \brief (TCC_CTRLBCLR) No action */ 178 #define TCC_CTRLBCLR_CMD_RETRIGGER_Val _U_(0x1) /**< \brief (TCC_CTRLBCLR) Clear start, restart or retrigger */ 179 #define TCC_CTRLBCLR_CMD_STOP_Val _U_(0x2) /**< \brief (TCC_CTRLBCLR) Force stop */ 180 #define TCC_CTRLBCLR_CMD_UPDATE_Val _U_(0x3) /**< \brief (TCC_CTRLBCLR) Force update or double buffered registers */ 181 #define TCC_CTRLBCLR_CMD_READSYNC_Val _U_(0x4) /**< \brief (TCC_CTRLBCLR) Force COUNT read synchronization */ 182 #define TCC_CTRLBCLR_CMD_DMAOS_Val _U_(0x5) /**< \brief (TCC_CTRLBCLR) One-shot DMA trigger */ 183 #define TCC_CTRLBCLR_CMD_NONE (TCC_CTRLBCLR_CMD_NONE_Val << TCC_CTRLBCLR_CMD_Pos) 184 #define TCC_CTRLBCLR_CMD_RETRIGGER (TCC_CTRLBCLR_CMD_RETRIGGER_Val << TCC_CTRLBCLR_CMD_Pos) 185 #define TCC_CTRLBCLR_CMD_STOP (TCC_CTRLBCLR_CMD_STOP_Val << TCC_CTRLBCLR_CMD_Pos) 186 #define TCC_CTRLBCLR_CMD_UPDATE (TCC_CTRLBCLR_CMD_UPDATE_Val << TCC_CTRLBCLR_CMD_Pos) 187 #define TCC_CTRLBCLR_CMD_READSYNC (TCC_CTRLBCLR_CMD_READSYNC_Val << TCC_CTRLBCLR_CMD_Pos) 188 #define TCC_CTRLBCLR_CMD_DMAOS (TCC_CTRLBCLR_CMD_DMAOS_Val << TCC_CTRLBCLR_CMD_Pos) 189 #define TCC_CTRLBCLR_MASK _U_(0xFF) /**< \brief (TCC_CTRLBCLR) MASK Register */ 190 191 /* -------- TCC_CTRLBSET : (TCC Offset: 0x05) (R/W 8) Control B Set -------- */ 192 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 193 typedef union { 194 struct { 195 uint8_t DIR:1; /*!< bit: 0 Counter Direction */ 196 uint8_t LUPD:1; /*!< bit: 1 Lock Update */ 197 uint8_t ONESHOT:1; /*!< bit: 2 One-Shot */ 198 uint8_t IDXCMD:2; /*!< bit: 3.. 4 Ramp Index Command */ 199 uint8_t CMD:3; /*!< bit: 5.. 7 TCC Command */ 200 } bit; /*!< Structure used for bit access */ 201 uint8_t reg; /*!< Type used for register access */ 202 } TCC_CTRLBSET_Type; 203 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 204 205 #define TCC_CTRLBSET_OFFSET 0x05 /**< \brief (TCC_CTRLBSET offset) Control B Set */ 206 #define TCC_CTRLBSET_RESETVALUE _U_(0x00) /**< \brief (TCC_CTRLBSET reset_value) Control B Set */ 207 208 #define TCC_CTRLBSET_DIR_Pos 0 /**< \brief (TCC_CTRLBSET) Counter Direction */ 209 #define TCC_CTRLBSET_DIR (_U_(0x1) << TCC_CTRLBSET_DIR_Pos) 210 #define TCC_CTRLBSET_LUPD_Pos 1 /**< \brief (TCC_CTRLBSET) Lock Update */ 211 #define TCC_CTRLBSET_LUPD (_U_(0x1) << TCC_CTRLBSET_LUPD_Pos) 212 #define TCC_CTRLBSET_ONESHOT_Pos 2 /**< \brief (TCC_CTRLBSET) One-Shot */ 213 #define TCC_CTRLBSET_ONESHOT (_U_(0x1) << TCC_CTRLBSET_ONESHOT_Pos) 214 #define TCC_CTRLBSET_IDXCMD_Pos 3 /**< \brief (TCC_CTRLBSET) Ramp Index Command */ 215 #define TCC_CTRLBSET_IDXCMD_Msk (_U_(0x3) << TCC_CTRLBSET_IDXCMD_Pos) 216 #define TCC_CTRLBSET_IDXCMD(value) (TCC_CTRLBSET_IDXCMD_Msk & ((value) << TCC_CTRLBSET_IDXCMD_Pos)) 217 #define TCC_CTRLBSET_IDXCMD_DISABLE_Val _U_(0x0) /**< \brief (TCC_CTRLBSET) Command disabled: Index toggles between cycles A and B */ 218 #define TCC_CTRLBSET_IDXCMD_SET_Val _U_(0x1) /**< \brief (TCC_CTRLBSET) Set index: cycle B will be forced in the next cycle */ 219 #define TCC_CTRLBSET_IDXCMD_CLEAR_Val _U_(0x2) /**< \brief (TCC_CTRLBSET) Clear index: cycle A will be forced in the next cycle */ 220 #define TCC_CTRLBSET_IDXCMD_HOLD_Val _U_(0x3) /**< \brief (TCC_CTRLBSET) Hold index: the next cycle will be the same as the current cycle */ 221 #define TCC_CTRLBSET_IDXCMD_DISABLE (TCC_CTRLBSET_IDXCMD_DISABLE_Val << TCC_CTRLBSET_IDXCMD_Pos) 222 #define TCC_CTRLBSET_IDXCMD_SET (TCC_CTRLBSET_IDXCMD_SET_Val << TCC_CTRLBSET_IDXCMD_Pos) 223 #define TCC_CTRLBSET_IDXCMD_CLEAR (TCC_CTRLBSET_IDXCMD_CLEAR_Val << TCC_CTRLBSET_IDXCMD_Pos) 224 #define TCC_CTRLBSET_IDXCMD_HOLD (TCC_CTRLBSET_IDXCMD_HOLD_Val << TCC_CTRLBSET_IDXCMD_Pos) 225 #define TCC_CTRLBSET_CMD_Pos 5 /**< \brief (TCC_CTRLBSET) TCC Command */ 226 #define TCC_CTRLBSET_CMD_Msk (_U_(0x7) << TCC_CTRLBSET_CMD_Pos) 227 #define TCC_CTRLBSET_CMD(value) (TCC_CTRLBSET_CMD_Msk & ((value) << TCC_CTRLBSET_CMD_Pos)) 228 #define TCC_CTRLBSET_CMD_NONE_Val _U_(0x0) /**< \brief (TCC_CTRLBSET) No action */ 229 #define TCC_CTRLBSET_CMD_RETRIGGER_Val _U_(0x1) /**< \brief (TCC_CTRLBSET) Clear start, restart or retrigger */ 230 #define TCC_CTRLBSET_CMD_STOP_Val _U_(0x2) /**< \brief (TCC_CTRLBSET) Force stop */ 231 #define TCC_CTRLBSET_CMD_UPDATE_Val _U_(0x3) /**< \brief (TCC_CTRLBSET) Force update or double buffered registers */ 232 #define TCC_CTRLBSET_CMD_READSYNC_Val _U_(0x4) /**< \brief (TCC_CTRLBSET) Force COUNT read synchronization */ 233 #define TCC_CTRLBSET_CMD_DMAOS_Val _U_(0x5) /**< \brief (TCC_CTRLBSET) One-shot DMA trigger */ 234 #define TCC_CTRLBSET_CMD_NONE (TCC_CTRLBSET_CMD_NONE_Val << TCC_CTRLBSET_CMD_Pos) 235 #define TCC_CTRLBSET_CMD_RETRIGGER (TCC_CTRLBSET_CMD_RETRIGGER_Val << TCC_CTRLBSET_CMD_Pos) 236 #define TCC_CTRLBSET_CMD_STOP (TCC_CTRLBSET_CMD_STOP_Val << TCC_CTRLBSET_CMD_Pos) 237 #define TCC_CTRLBSET_CMD_UPDATE (TCC_CTRLBSET_CMD_UPDATE_Val << TCC_CTRLBSET_CMD_Pos) 238 #define TCC_CTRLBSET_CMD_READSYNC (TCC_CTRLBSET_CMD_READSYNC_Val << TCC_CTRLBSET_CMD_Pos) 239 #define TCC_CTRLBSET_CMD_DMAOS (TCC_CTRLBSET_CMD_DMAOS_Val << TCC_CTRLBSET_CMD_Pos) 240 #define TCC_CTRLBSET_MASK _U_(0xFF) /**< \brief (TCC_CTRLBSET) MASK Register */ 241 242 /* -------- TCC_SYNCBUSY : (TCC Offset: 0x08) (R/ 32) Synchronization Busy -------- */ 243 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 244 typedef union { 245 struct { 246 uint32_t SWRST:1; /*!< bit: 0 Swrst Busy */ 247 uint32_t ENABLE:1; /*!< bit: 1 Enable Busy */ 248 uint32_t CTRLB:1; /*!< bit: 2 Ctrlb Busy */ 249 uint32_t STATUS:1; /*!< bit: 3 Status Busy */ 250 uint32_t COUNT:1; /*!< bit: 4 Count Busy */ 251 uint32_t PATT:1; /*!< bit: 5 Pattern Busy */ 252 uint32_t WAVE:1; /*!< bit: 6 Wave Busy */ 253 uint32_t PER:1; /*!< bit: 7 Period Busy */ 254 uint32_t CC0:1; /*!< bit: 8 Compare Channel 0 Busy */ 255 uint32_t CC1:1; /*!< bit: 9 Compare Channel 1 Busy */ 256 uint32_t CC2:1; /*!< bit: 10 Compare Channel 2 Busy */ 257 uint32_t CC3:1; /*!< bit: 11 Compare Channel 3 Busy */ 258 uint32_t :20; /*!< bit: 12..31 Reserved */ 259 } bit; /*!< Structure used for bit access */ 260 struct { 261 uint32_t :8; /*!< bit: 0.. 7 Reserved */ 262 uint32_t CC:4; /*!< bit: 8..11 Compare Channel x Busy */ 263 uint32_t :20; /*!< bit: 12..31 Reserved */ 264 } vec; /*!< Structure used for vec access */ 265 uint32_t reg; /*!< Type used for register access */ 266 } TCC_SYNCBUSY_Type; 267 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 268 269 #define TCC_SYNCBUSY_OFFSET 0x08 /**< \brief (TCC_SYNCBUSY offset) Synchronization Busy */ 270 #define TCC_SYNCBUSY_RESETVALUE _U_(0x00000000) /**< \brief (TCC_SYNCBUSY reset_value) Synchronization Busy */ 271 272 #define TCC_SYNCBUSY_SWRST_Pos 0 /**< \brief (TCC_SYNCBUSY) Swrst Busy */ 273 #define TCC_SYNCBUSY_SWRST (_U_(0x1) << TCC_SYNCBUSY_SWRST_Pos) 274 #define TCC_SYNCBUSY_ENABLE_Pos 1 /**< \brief (TCC_SYNCBUSY) Enable Busy */ 275 #define TCC_SYNCBUSY_ENABLE (_U_(0x1) << TCC_SYNCBUSY_ENABLE_Pos) 276 #define TCC_SYNCBUSY_CTRLB_Pos 2 /**< \brief (TCC_SYNCBUSY) Ctrlb Busy */ 277 #define TCC_SYNCBUSY_CTRLB (_U_(0x1) << TCC_SYNCBUSY_CTRLB_Pos) 278 #define TCC_SYNCBUSY_STATUS_Pos 3 /**< \brief (TCC_SYNCBUSY) Status Busy */ 279 #define TCC_SYNCBUSY_STATUS (_U_(0x1) << TCC_SYNCBUSY_STATUS_Pos) 280 #define TCC_SYNCBUSY_COUNT_Pos 4 /**< \brief (TCC_SYNCBUSY) Count Busy */ 281 #define TCC_SYNCBUSY_COUNT (_U_(0x1) << TCC_SYNCBUSY_COUNT_Pos) 282 #define TCC_SYNCBUSY_PATT_Pos 5 /**< \brief (TCC_SYNCBUSY) Pattern Busy */ 283 #define TCC_SYNCBUSY_PATT (_U_(0x1) << TCC_SYNCBUSY_PATT_Pos) 284 #define TCC_SYNCBUSY_WAVE_Pos 6 /**< \brief (TCC_SYNCBUSY) Wave Busy */ 285 #define TCC_SYNCBUSY_WAVE (_U_(0x1) << TCC_SYNCBUSY_WAVE_Pos) 286 #define TCC_SYNCBUSY_PER_Pos 7 /**< \brief (TCC_SYNCBUSY) Period Busy */ 287 #define TCC_SYNCBUSY_PER (_U_(0x1) << TCC_SYNCBUSY_PER_Pos) 288 #define TCC_SYNCBUSY_CC0_Pos 8 /**< \brief (TCC_SYNCBUSY) Compare Channel 0 Busy */ 289 #define TCC_SYNCBUSY_CC0 (_U_(1) << TCC_SYNCBUSY_CC0_Pos) 290 #define TCC_SYNCBUSY_CC1_Pos 9 /**< \brief (TCC_SYNCBUSY) Compare Channel 1 Busy */ 291 #define TCC_SYNCBUSY_CC1 (_U_(1) << TCC_SYNCBUSY_CC1_Pos) 292 #define TCC_SYNCBUSY_CC2_Pos 10 /**< \brief (TCC_SYNCBUSY) Compare Channel 2 Busy */ 293 #define TCC_SYNCBUSY_CC2 (_U_(1) << TCC_SYNCBUSY_CC2_Pos) 294 #define TCC_SYNCBUSY_CC3_Pos 11 /**< \brief (TCC_SYNCBUSY) Compare Channel 3 Busy */ 295 #define TCC_SYNCBUSY_CC3 (_U_(1) << TCC_SYNCBUSY_CC3_Pos) 296 #define TCC_SYNCBUSY_CC_Pos 8 /**< \brief (TCC_SYNCBUSY) Compare Channel x Busy */ 297 #define TCC_SYNCBUSY_CC_Msk (_U_(0xF) << TCC_SYNCBUSY_CC_Pos) 298 #define TCC_SYNCBUSY_CC(value) (TCC_SYNCBUSY_CC_Msk & ((value) << TCC_SYNCBUSY_CC_Pos)) 299 #define TCC_SYNCBUSY_MASK _U_(0x00000FFF) /**< \brief (TCC_SYNCBUSY) MASK Register */ 300 301 /* -------- TCC_FCTRLA : (TCC Offset: 0x0C) (R/W 32) Recoverable Fault A Configuration -------- */ 302 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 303 typedef union { 304 struct { 305 uint32_t SRC:2; /*!< bit: 0.. 1 Fault A Source */ 306 uint32_t :1; /*!< bit: 2 Reserved */ 307 uint32_t KEEP:1; /*!< bit: 3 Fault A Keeper */ 308 uint32_t QUAL:1; /*!< bit: 4 Fault A Qualification */ 309 uint32_t BLANK:2; /*!< bit: 5.. 6 Fault A Blanking Mode */ 310 uint32_t RESTART:1; /*!< bit: 7 Fault A Restart */ 311 uint32_t HALT:2; /*!< bit: 8.. 9 Fault A Halt Mode */ 312 uint32_t CHSEL:2; /*!< bit: 10..11 Fault A Capture Channel */ 313 uint32_t CAPTURE:3; /*!< bit: 12..14 Fault A Capture Action */ 314 uint32_t BLANKPRESC:1; /*!< bit: 15 Fault A Blanking Prescaler */ 315 uint32_t BLANKVAL:8; /*!< bit: 16..23 Fault A Blanking Time */ 316 uint32_t FILTERVAL:4; /*!< bit: 24..27 Fault A Filter Value */ 317 uint32_t :4; /*!< bit: 28..31 Reserved */ 318 } bit; /*!< Structure used for bit access */ 319 uint32_t reg; /*!< Type used for register access */ 320 } TCC_FCTRLA_Type; 321 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 322 323 #define TCC_FCTRLA_OFFSET 0x0C /**< \brief (TCC_FCTRLA offset) Recoverable Fault A Configuration */ 324 #define TCC_FCTRLA_RESETVALUE _U_(0x00000000) /**< \brief (TCC_FCTRLA reset_value) Recoverable Fault A Configuration */ 325 326 #define TCC_FCTRLA_SRC_Pos 0 /**< \brief (TCC_FCTRLA) Fault A Source */ 327 #define TCC_FCTRLA_SRC_Msk (_U_(0x3) << TCC_FCTRLA_SRC_Pos) 328 #define TCC_FCTRLA_SRC(value) (TCC_FCTRLA_SRC_Msk & ((value) << TCC_FCTRLA_SRC_Pos)) 329 #define TCC_FCTRLA_SRC_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLA) Fault input disabled */ 330 #define TCC_FCTRLA_SRC_ENABLE_Val _U_(0x1) /**< \brief (TCC_FCTRLA) MCEx (x=0,1) event input */ 331 #define TCC_FCTRLA_SRC_INVERT_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Inverted MCEx (x=0,1) event input */ 332 #define TCC_FCTRLA_SRC_ALTFAULT_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Alternate fault (A or B) state at the end of the previous period */ 333 #define TCC_FCTRLA_SRC_DISABLE (TCC_FCTRLA_SRC_DISABLE_Val << TCC_FCTRLA_SRC_Pos) 334 #define TCC_FCTRLA_SRC_ENABLE (TCC_FCTRLA_SRC_ENABLE_Val << TCC_FCTRLA_SRC_Pos) 335 #define TCC_FCTRLA_SRC_INVERT (TCC_FCTRLA_SRC_INVERT_Val << TCC_FCTRLA_SRC_Pos) 336 #define TCC_FCTRLA_SRC_ALTFAULT (TCC_FCTRLA_SRC_ALTFAULT_Val << TCC_FCTRLA_SRC_Pos) 337 #define TCC_FCTRLA_KEEP_Pos 3 /**< \brief (TCC_FCTRLA) Fault A Keeper */ 338 #define TCC_FCTRLA_KEEP (_U_(0x1) << TCC_FCTRLA_KEEP_Pos) 339 #define TCC_FCTRLA_QUAL_Pos 4 /**< \brief (TCC_FCTRLA) Fault A Qualification */ 340 #define TCC_FCTRLA_QUAL (_U_(0x1) << TCC_FCTRLA_QUAL_Pos) 341 #define TCC_FCTRLA_BLANK_Pos 5 /**< \brief (TCC_FCTRLA) Fault A Blanking Mode */ 342 #define TCC_FCTRLA_BLANK_Msk (_U_(0x3) << TCC_FCTRLA_BLANK_Pos) 343 #define TCC_FCTRLA_BLANK(value) (TCC_FCTRLA_BLANK_Msk & ((value) << TCC_FCTRLA_BLANK_Pos)) 344 #define TCC_FCTRLA_BLANK_START_Val _U_(0x0) /**< \brief (TCC_FCTRLA) Blanking applied from start of the ramp */ 345 #define TCC_FCTRLA_BLANK_RISE_Val _U_(0x1) /**< \brief (TCC_FCTRLA) Blanking applied from rising edge of the output waveform */ 346 #define TCC_FCTRLA_BLANK_FALL_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Blanking applied from falling edge of the output waveform */ 347 #define TCC_FCTRLA_BLANK_BOTH_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Blanking applied from each toggle of the output waveform */ 348 #define TCC_FCTRLA_BLANK_START (TCC_FCTRLA_BLANK_START_Val << TCC_FCTRLA_BLANK_Pos) 349 #define TCC_FCTRLA_BLANK_RISE (TCC_FCTRLA_BLANK_RISE_Val << TCC_FCTRLA_BLANK_Pos) 350 #define TCC_FCTRLA_BLANK_FALL (TCC_FCTRLA_BLANK_FALL_Val << TCC_FCTRLA_BLANK_Pos) 351 #define TCC_FCTRLA_BLANK_BOTH (TCC_FCTRLA_BLANK_BOTH_Val << TCC_FCTRLA_BLANK_Pos) 352 #define TCC_FCTRLA_RESTART_Pos 7 /**< \brief (TCC_FCTRLA) Fault A Restart */ 353 #define TCC_FCTRLA_RESTART (_U_(0x1) << TCC_FCTRLA_RESTART_Pos) 354 #define TCC_FCTRLA_HALT_Pos 8 /**< \brief (TCC_FCTRLA) Fault A Halt Mode */ 355 #define TCC_FCTRLA_HALT_Msk (_U_(0x3) << TCC_FCTRLA_HALT_Pos) 356 #define TCC_FCTRLA_HALT(value) (TCC_FCTRLA_HALT_Msk & ((value) << TCC_FCTRLA_HALT_Pos)) 357 #define TCC_FCTRLA_HALT_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLA) Halt action disabled */ 358 #define TCC_FCTRLA_HALT_HW_Val _U_(0x1) /**< \brief (TCC_FCTRLA) Hardware halt action */ 359 #define TCC_FCTRLA_HALT_SW_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Software halt action */ 360 #define TCC_FCTRLA_HALT_NR_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Non-recoverable fault */ 361 #define TCC_FCTRLA_HALT_DISABLE (TCC_FCTRLA_HALT_DISABLE_Val << TCC_FCTRLA_HALT_Pos) 362 #define TCC_FCTRLA_HALT_HW (TCC_FCTRLA_HALT_HW_Val << TCC_FCTRLA_HALT_Pos) 363 #define TCC_FCTRLA_HALT_SW (TCC_FCTRLA_HALT_SW_Val << TCC_FCTRLA_HALT_Pos) 364 #define TCC_FCTRLA_HALT_NR (TCC_FCTRLA_HALT_NR_Val << TCC_FCTRLA_HALT_Pos) 365 #define TCC_FCTRLA_CHSEL_Pos 10 /**< \brief (TCC_FCTRLA) Fault A Capture Channel */ 366 #define TCC_FCTRLA_CHSEL_Msk (_U_(0x3) << TCC_FCTRLA_CHSEL_Pos) 367 #define TCC_FCTRLA_CHSEL(value) (TCC_FCTRLA_CHSEL_Msk & ((value) << TCC_FCTRLA_CHSEL_Pos)) 368 #define TCC_FCTRLA_CHSEL_CC0_Val _U_(0x0) /**< \brief (TCC_FCTRLA) Capture value stored in channel 0 */ 369 #define TCC_FCTRLA_CHSEL_CC1_Val _U_(0x1) /**< \brief (TCC_FCTRLA) Capture value stored in channel 1 */ 370 #define TCC_FCTRLA_CHSEL_CC2_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Capture value stored in channel 2 */ 371 #define TCC_FCTRLA_CHSEL_CC3_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Capture value stored in channel 3 */ 372 #define TCC_FCTRLA_CHSEL_CC0 (TCC_FCTRLA_CHSEL_CC0_Val << TCC_FCTRLA_CHSEL_Pos) 373 #define TCC_FCTRLA_CHSEL_CC1 (TCC_FCTRLA_CHSEL_CC1_Val << TCC_FCTRLA_CHSEL_Pos) 374 #define TCC_FCTRLA_CHSEL_CC2 (TCC_FCTRLA_CHSEL_CC2_Val << TCC_FCTRLA_CHSEL_Pos) 375 #define TCC_FCTRLA_CHSEL_CC3 (TCC_FCTRLA_CHSEL_CC3_Val << TCC_FCTRLA_CHSEL_Pos) 376 #define TCC_FCTRLA_CAPTURE_Pos 12 /**< \brief (TCC_FCTRLA) Fault A Capture Action */ 377 #define TCC_FCTRLA_CAPTURE_Msk (_U_(0x7) << TCC_FCTRLA_CAPTURE_Pos) 378 #define TCC_FCTRLA_CAPTURE(value) (TCC_FCTRLA_CAPTURE_Msk & ((value) << TCC_FCTRLA_CAPTURE_Pos)) 379 #define TCC_FCTRLA_CAPTURE_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLA) No capture */ 380 #define TCC_FCTRLA_CAPTURE_CAPT_Val _U_(0x1) /**< \brief (TCC_FCTRLA) Capture on fault */ 381 #define TCC_FCTRLA_CAPTURE_CAPTMIN_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Minimum capture */ 382 #define TCC_FCTRLA_CAPTURE_CAPTMAX_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Maximum capture */ 383 #define TCC_FCTRLA_CAPTURE_LOCMIN_Val _U_(0x4) /**< \brief (TCC_FCTRLA) Minimum local detection */ 384 #define TCC_FCTRLA_CAPTURE_LOCMAX_Val _U_(0x5) /**< \brief (TCC_FCTRLA) Maximum local detection */ 385 #define TCC_FCTRLA_CAPTURE_DERIV0_Val _U_(0x6) /**< \brief (TCC_FCTRLA) Minimum and maximum local detection */ 386 #define TCC_FCTRLA_CAPTURE_CAPTMARK_Val _U_(0x7) /**< \brief (TCC_FCTRLA) Capture with ramp index as MSB value */ 387 #define TCC_FCTRLA_CAPTURE_DISABLE (TCC_FCTRLA_CAPTURE_DISABLE_Val << TCC_FCTRLA_CAPTURE_Pos) 388 #define TCC_FCTRLA_CAPTURE_CAPT (TCC_FCTRLA_CAPTURE_CAPT_Val << TCC_FCTRLA_CAPTURE_Pos) 389 #define TCC_FCTRLA_CAPTURE_CAPTMIN (TCC_FCTRLA_CAPTURE_CAPTMIN_Val << TCC_FCTRLA_CAPTURE_Pos) 390 #define TCC_FCTRLA_CAPTURE_CAPTMAX (TCC_FCTRLA_CAPTURE_CAPTMAX_Val << TCC_FCTRLA_CAPTURE_Pos) 391 #define TCC_FCTRLA_CAPTURE_LOCMIN (TCC_FCTRLA_CAPTURE_LOCMIN_Val << TCC_FCTRLA_CAPTURE_Pos) 392 #define TCC_FCTRLA_CAPTURE_LOCMAX (TCC_FCTRLA_CAPTURE_LOCMAX_Val << TCC_FCTRLA_CAPTURE_Pos) 393 #define TCC_FCTRLA_CAPTURE_DERIV0 (TCC_FCTRLA_CAPTURE_DERIV0_Val << TCC_FCTRLA_CAPTURE_Pos) 394 #define TCC_FCTRLA_CAPTURE_CAPTMARK (TCC_FCTRLA_CAPTURE_CAPTMARK_Val << TCC_FCTRLA_CAPTURE_Pos) 395 #define TCC_FCTRLA_BLANKPRESC_Pos 15 /**< \brief (TCC_FCTRLA) Fault A Blanking Prescaler */ 396 #define TCC_FCTRLA_BLANKPRESC (_U_(0x1) << TCC_FCTRLA_BLANKPRESC_Pos) 397 #define TCC_FCTRLA_BLANKVAL_Pos 16 /**< \brief (TCC_FCTRLA) Fault A Blanking Time */ 398 #define TCC_FCTRLA_BLANKVAL_Msk (_U_(0xFF) << TCC_FCTRLA_BLANKVAL_Pos) 399 #define TCC_FCTRLA_BLANKVAL(value) (TCC_FCTRLA_BLANKVAL_Msk & ((value) << TCC_FCTRLA_BLANKVAL_Pos)) 400 #define TCC_FCTRLA_FILTERVAL_Pos 24 /**< \brief (TCC_FCTRLA) Fault A Filter Value */ 401 #define TCC_FCTRLA_FILTERVAL_Msk (_U_(0xF) << TCC_FCTRLA_FILTERVAL_Pos) 402 #define TCC_FCTRLA_FILTERVAL(value) (TCC_FCTRLA_FILTERVAL_Msk & ((value) << TCC_FCTRLA_FILTERVAL_Pos)) 403 #define TCC_FCTRLA_MASK _U_(0x0FFFFFFB) /**< \brief (TCC_FCTRLA) MASK Register */ 404 405 /* -------- TCC_FCTRLB : (TCC Offset: 0x10) (R/W 32) Recoverable Fault B Configuration -------- */ 406 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 407 typedef union { 408 struct { 409 uint32_t SRC:2; /*!< bit: 0.. 1 Fault B Source */ 410 uint32_t :1; /*!< bit: 2 Reserved */ 411 uint32_t KEEP:1; /*!< bit: 3 Fault B Keeper */ 412 uint32_t QUAL:1; /*!< bit: 4 Fault B Qualification */ 413 uint32_t BLANK:2; /*!< bit: 5.. 6 Fault B Blanking Mode */ 414 uint32_t RESTART:1; /*!< bit: 7 Fault B Restart */ 415 uint32_t HALT:2; /*!< bit: 8.. 9 Fault B Halt Mode */ 416 uint32_t CHSEL:2; /*!< bit: 10..11 Fault B Capture Channel */ 417 uint32_t CAPTURE:3; /*!< bit: 12..14 Fault B Capture Action */ 418 uint32_t BLANKPRESC:1; /*!< bit: 15 Fault B Blanking Prescaler */ 419 uint32_t BLANKVAL:8; /*!< bit: 16..23 Fault B Blanking Time */ 420 uint32_t FILTERVAL:4; /*!< bit: 24..27 Fault B Filter Value */ 421 uint32_t :4; /*!< bit: 28..31 Reserved */ 422 } bit; /*!< Structure used for bit access */ 423 uint32_t reg; /*!< Type used for register access */ 424 } TCC_FCTRLB_Type; 425 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 426 427 #define TCC_FCTRLB_OFFSET 0x10 /**< \brief (TCC_FCTRLB offset) Recoverable Fault B Configuration */ 428 #define TCC_FCTRLB_RESETVALUE _U_(0x00000000) /**< \brief (TCC_FCTRLB reset_value) Recoverable Fault B Configuration */ 429 430 #define TCC_FCTRLB_SRC_Pos 0 /**< \brief (TCC_FCTRLB) Fault B Source */ 431 #define TCC_FCTRLB_SRC_Msk (_U_(0x3) << TCC_FCTRLB_SRC_Pos) 432 #define TCC_FCTRLB_SRC(value) (TCC_FCTRLB_SRC_Msk & ((value) << TCC_FCTRLB_SRC_Pos)) 433 #define TCC_FCTRLB_SRC_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLB) Fault input disabled */ 434 #define TCC_FCTRLB_SRC_ENABLE_Val _U_(0x1) /**< \brief (TCC_FCTRLB) MCEx (x=0,1) event input */ 435 #define TCC_FCTRLB_SRC_INVERT_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Inverted MCEx (x=0,1) event input */ 436 #define TCC_FCTRLB_SRC_ALTFAULT_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Alternate fault (A or B) state at the end of the previous period */ 437 #define TCC_FCTRLB_SRC_DISABLE (TCC_FCTRLB_SRC_DISABLE_Val << TCC_FCTRLB_SRC_Pos) 438 #define TCC_FCTRLB_SRC_ENABLE (TCC_FCTRLB_SRC_ENABLE_Val << TCC_FCTRLB_SRC_Pos) 439 #define TCC_FCTRLB_SRC_INVERT (TCC_FCTRLB_SRC_INVERT_Val << TCC_FCTRLB_SRC_Pos) 440 #define TCC_FCTRLB_SRC_ALTFAULT (TCC_FCTRLB_SRC_ALTFAULT_Val << TCC_FCTRLB_SRC_Pos) 441 #define TCC_FCTRLB_KEEP_Pos 3 /**< \brief (TCC_FCTRLB) Fault B Keeper */ 442 #define TCC_FCTRLB_KEEP (_U_(0x1) << TCC_FCTRLB_KEEP_Pos) 443 #define TCC_FCTRLB_QUAL_Pos 4 /**< \brief (TCC_FCTRLB) Fault B Qualification */ 444 #define TCC_FCTRLB_QUAL (_U_(0x1) << TCC_FCTRLB_QUAL_Pos) 445 #define TCC_FCTRLB_BLANK_Pos 5 /**< \brief (TCC_FCTRLB) Fault B Blanking Mode */ 446 #define TCC_FCTRLB_BLANK_Msk (_U_(0x3) << TCC_FCTRLB_BLANK_Pos) 447 #define TCC_FCTRLB_BLANK(value) (TCC_FCTRLB_BLANK_Msk & ((value) << TCC_FCTRLB_BLANK_Pos)) 448 #define TCC_FCTRLB_BLANK_START_Val _U_(0x0) /**< \brief (TCC_FCTRLB) Blanking applied from start of the ramp */ 449 #define TCC_FCTRLB_BLANK_RISE_Val _U_(0x1) /**< \brief (TCC_FCTRLB) Blanking applied from rising edge of the output waveform */ 450 #define TCC_FCTRLB_BLANK_FALL_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Blanking applied from falling edge of the output waveform */ 451 #define TCC_FCTRLB_BLANK_BOTH_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Blanking applied from each toggle of the output waveform */ 452 #define TCC_FCTRLB_BLANK_START (TCC_FCTRLB_BLANK_START_Val << TCC_FCTRLB_BLANK_Pos) 453 #define TCC_FCTRLB_BLANK_RISE (TCC_FCTRLB_BLANK_RISE_Val << TCC_FCTRLB_BLANK_Pos) 454 #define TCC_FCTRLB_BLANK_FALL (TCC_FCTRLB_BLANK_FALL_Val << TCC_FCTRLB_BLANK_Pos) 455 #define TCC_FCTRLB_BLANK_BOTH (TCC_FCTRLB_BLANK_BOTH_Val << TCC_FCTRLB_BLANK_Pos) 456 #define TCC_FCTRLB_RESTART_Pos 7 /**< \brief (TCC_FCTRLB) Fault B Restart */ 457 #define TCC_FCTRLB_RESTART (_U_(0x1) << TCC_FCTRLB_RESTART_Pos) 458 #define TCC_FCTRLB_HALT_Pos 8 /**< \brief (TCC_FCTRLB) Fault B Halt Mode */ 459 #define TCC_FCTRLB_HALT_Msk (_U_(0x3) << TCC_FCTRLB_HALT_Pos) 460 #define TCC_FCTRLB_HALT(value) (TCC_FCTRLB_HALT_Msk & ((value) << TCC_FCTRLB_HALT_Pos)) 461 #define TCC_FCTRLB_HALT_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLB) Halt action disabled */ 462 #define TCC_FCTRLB_HALT_HW_Val _U_(0x1) /**< \brief (TCC_FCTRLB) Hardware halt action */ 463 #define TCC_FCTRLB_HALT_SW_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Software halt action */ 464 #define TCC_FCTRLB_HALT_NR_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Non-recoverable fault */ 465 #define TCC_FCTRLB_HALT_DISABLE (TCC_FCTRLB_HALT_DISABLE_Val << TCC_FCTRLB_HALT_Pos) 466 #define TCC_FCTRLB_HALT_HW (TCC_FCTRLB_HALT_HW_Val << TCC_FCTRLB_HALT_Pos) 467 #define TCC_FCTRLB_HALT_SW (TCC_FCTRLB_HALT_SW_Val << TCC_FCTRLB_HALT_Pos) 468 #define TCC_FCTRLB_HALT_NR (TCC_FCTRLB_HALT_NR_Val << TCC_FCTRLB_HALT_Pos) 469 #define TCC_FCTRLB_CHSEL_Pos 10 /**< \brief (TCC_FCTRLB) Fault B Capture Channel */ 470 #define TCC_FCTRLB_CHSEL_Msk (_U_(0x3) << TCC_FCTRLB_CHSEL_Pos) 471 #define TCC_FCTRLB_CHSEL(value) (TCC_FCTRLB_CHSEL_Msk & ((value) << TCC_FCTRLB_CHSEL_Pos)) 472 #define TCC_FCTRLB_CHSEL_CC0_Val _U_(0x0) /**< \brief (TCC_FCTRLB) Capture value stored in channel 0 */ 473 #define TCC_FCTRLB_CHSEL_CC1_Val _U_(0x1) /**< \brief (TCC_FCTRLB) Capture value stored in channel 1 */ 474 #define TCC_FCTRLB_CHSEL_CC2_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Capture value stored in channel 2 */ 475 #define TCC_FCTRLB_CHSEL_CC3_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Capture value stored in channel 3 */ 476 #define TCC_FCTRLB_CHSEL_CC0 (TCC_FCTRLB_CHSEL_CC0_Val << TCC_FCTRLB_CHSEL_Pos) 477 #define TCC_FCTRLB_CHSEL_CC1 (TCC_FCTRLB_CHSEL_CC1_Val << TCC_FCTRLB_CHSEL_Pos) 478 #define TCC_FCTRLB_CHSEL_CC2 (TCC_FCTRLB_CHSEL_CC2_Val << TCC_FCTRLB_CHSEL_Pos) 479 #define TCC_FCTRLB_CHSEL_CC3 (TCC_FCTRLB_CHSEL_CC3_Val << TCC_FCTRLB_CHSEL_Pos) 480 #define TCC_FCTRLB_CAPTURE_Pos 12 /**< \brief (TCC_FCTRLB) Fault B Capture Action */ 481 #define TCC_FCTRLB_CAPTURE_Msk (_U_(0x7) << TCC_FCTRLB_CAPTURE_Pos) 482 #define TCC_FCTRLB_CAPTURE(value) (TCC_FCTRLB_CAPTURE_Msk & ((value) << TCC_FCTRLB_CAPTURE_Pos)) 483 #define TCC_FCTRLB_CAPTURE_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLB) No capture */ 484 #define TCC_FCTRLB_CAPTURE_CAPT_Val _U_(0x1) /**< \brief (TCC_FCTRLB) Capture on fault */ 485 #define TCC_FCTRLB_CAPTURE_CAPTMIN_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Minimum capture */ 486 #define TCC_FCTRLB_CAPTURE_CAPTMAX_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Maximum capture */ 487 #define TCC_FCTRLB_CAPTURE_LOCMIN_Val _U_(0x4) /**< \brief (TCC_FCTRLB) Minimum local detection */ 488 #define TCC_FCTRLB_CAPTURE_LOCMAX_Val _U_(0x5) /**< \brief (TCC_FCTRLB) Maximum local detection */ 489 #define TCC_FCTRLB_CAPTURE_DERIV0_Val _U_(0x6) /**< \brief (TCC_FCTRLB) Minimum and maximum local detection */ 490 #define TCC_FCTRLB_CAPTURE_CAPTMARK_Val _U_(0x7) /**< \brief (TCC_FCTRLB) Capture with ramp index as MSB value */ 491 #define TCC_FCTRLB_CAPTURE_DISABLE (TCC_FCTRLB_CAPTURE_DISABLE_Val << TCC_FCTRLB_CAPTURE_Pos) 492 #define TCC_FCTRLB_CAPTURE_CAPT (TCC_FCTRLB_CAPTURE_CAPT_Val << TCC_FCTRLB_CAPTURE_Pos) 493 #define TCC_FCTRLB_CAPTURE_CAPTMIN (TCC_FCTRLB_CAPTURE_CAPTMIN_Val << TCC_FCTRLB_CAPTURE_Pos) 494 #define TCC_FCTRLB_CAPTURE_CAPTMAX (TCC_FCTRLB_CAPTURE_CAPTMAX_Val << TCC_FCTRLB_CAPTURE_Pos) 495 #define TCC_FCTRLB_CAPTURE_LOCMIN (TCC_FCTRLB_CAPTURE_LOCMIN_Val << TCC_FCTRLB_CAPTURE_Pos) 496 #define TCC_FCTRLB_CAPTURE_LOCMAX (TCC_FCTRLB_CAPTURE_LOCMAX_Val << TCC_FCTRLB_CAPTURE_Pos) 497 #define TCC_FCTRLB_CAPTURE_DERIV0 (TCC_FCTRLB_CAPTURE_DERIV0_Val << TCC_FCTRLB_CAPTURE_Pos) 498 #define TCC_FCTRLB_CAPTURE_CAPTMARK (TCC_FCTRLB_CAPTURE_CAPTMARK_Val << TCC_FCTRLB_CAPTURE_Pos) 499 #define TCC_FCTRLB_BLANKPRESC_Pos 15 /**< \brief (TCC_FCTRLB) Fault B Blanking Prescaler */ 500 #define TCC_FCTRLB_BLANKPRESC (_U_(0x1) << TCC_FCTRLB_BLANKPRESC_Pos) 501 #define TCC_FCTRLB_BLANKVAL_Pos 16 /**< \brief (TCC_FCTRLB) Fault B Blanking Time */ 502 #define TCC_FCTRLB_BLANKVAL_Msk (_U_(0xFF) << TCC_FCTRLB_BLANKVAL_Pos) 503 #define TCC_FCTRLB_BLANKVAL(value) (TCC_FCTRLB_BLANKVAL_Msk & ((value) << TCC_FCTRLB_BLANKVAL_Pos)) 504 #define TCC_FCTRLB_FILTERVAL_Pos 24 /**< \brief (TCC_FCTRLB) Fault B Filter Value */ 505 #define TCC_FCTRLB_FILTERVAL_Msk (_U_(0xF) << TCC_FCTRLB_FILTERVAL_Pos) 506 #define TCC_FCTRLB_FILTERVAL(value) (TCC_FCTRLB_FILTERVAL_Msk & ((value) << TCC_FCTRLB_FILTERVAL_Pos)) 507 #define TCC_FCTRLB_MASK _U_(0x0FFFFFFB) /**< \brief (TCC_FCTRLB) MASK Register */ 508 509 /* -------- TCC_WEXCTRL : (TCC Offset: 0x14) (R/W 32) Waveform Extension Configuration -------- */ 510 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 511 typedef union { 512 struct { 513 uint32_t OTMX:2; /*!< bit: 0.. 1 Output Matrix */ 514 uint32_t :6; /*!< bit: 2.. 7 Reserved */ 515 uint32_t DTIEN0:1; /*!< bit: 8 Dead-time Insertion Generator 0 Enable */ 516 uint32_t DTIEN1:1; /*!< bit: 9 Dead-time Insertion Generator 1 Enable */ 517 uint32_t DTIEN2:1; /*!< bit: 10 Dead-time Insertion Generator 2 Enable */ 518 uint32_t DTIEN3:1; /*!< bit: 11 Dead-time Insertion Generator 3 Enable */ 519 uint32_t :4; /*!< bit: 12..15 Reserved */ 520 uint32_t DTLS:8; /*!< bit: 16..23 Dead-time Low Side Outputs Value */ 521 uint32_t DTHS:8; /*!< bit: 24..31 Dead-time High Side Outputs Value */ 522 } bit; /*!< Structure used for bit access */ 523 struct { 524 uint32_t :8; /*!< bit: 0.. 7 Reserved */ 525 uint32_t DTIEN:4; /*!< bit: 8..11 Dead-time Insertion Generator x Enable */ 526 uint32_t :20; /*!< bit: 12..31 Reserved */ 527 } vec; /*!< Structure used for vec access */ 528 uint32_t reg; /*!< Type used for register access */ 529 } TCC_WEXCTRL_Type; 530 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 531 532 #define TCC_WEXCTRL_OFFSET 0x14 /**< \brief (TCC_WEXCTRL offset) Waveform Extension Configuration */ 533 #define TCC_WEXCTRL_RESETVALUE _U_(0x00000000) /**< \brief (TCC_WEXCTRL reset_value) Waveform Extension Configuration */ 534 535 #define TCC_WEXCTRL_OTMX_Pos 0 /**< \brief (TCC_WEXCTRL) Output Matrix */ 536 #define TCC_WEXCTRL_OTMX_Msk (_U_(0x3) << TCC_WEXCTRL_OTMX_Pos) 537 #define TCC_WEXCTRL_OTMX(value) (TCC_WEXCTRL_OTMX_Msk & ((value) << TCC_WEXCTRL_OTMX_Pos)) 538 #define TCC_WEXCTRL_DTIEN0_Pos 8 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator 0 Enable */ 539 #define TCC_WEXCTRL_DTIEN0 (_U_(1) << TCC_WEXCTRL_DTIEN0_Pos) 540 #define TCC_WEXCTRL_DTIEN1_Pos 9 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator 1 Enable */ 541 #define TCC_WEXCTRL_DTIEN1 (_U_(1) << TCC_WEXCTRL_DTIEN1_Pos) 542 #define TCC_WEXCTRL_DTIEN2_Pos 10 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator 2 Enable */ 543 #define TCC_WEXCTRL_DTIEN2 (_U_(1) << TCC_WEXCTRL_DTIEN2_Pos) 544 #define TCC_WEXCTRL_DTIEN3_Pos 11 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator 3 Enable */ 545 #define TCC_WEXCTRL_DTIEN3 (_U_(1) << TCC_WEXCTRL_DTIEN3_Pos) 546 #define TCC_WEXCTRL_DTIEN_Pos 8 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator x Enable */ 547 #define TCC_WEXCTRL_DTIEN_Msk (_U_(0xF) << TCC_WEXCTRL_DTIEN_Pos) 548 #define TCC_WEXCTRL_DTIEN(value) (TCC_WEXCTRL_DTIEN_Msk & ((value) << TCC_WEXCTRL_DTIEN_Pos)) 549 #define TCC_WEXCTRL_DTLS_Pos 16 /**< \brief (TCC_WEXCTRL) Dead-time Low Side Outputs Value */ 550 #define TCC_WEXCTRL_DTLS_Msk (_U_(0xFF) << TCC_WEXCTRL_DTLS_Pos) 551 #define TCC_WEXCTRL_DTLS(value) (TCC_WEXCTRL_DTLS_Msk & ((value) << TCC_WEXCTRL_DTLS_Pos)) 552 #define TCC_WEXCTRL_DTHS_Pos 24 /**< \brief (TCC_WEXCTRL) Dead-time High Side Outputs Value */ 553 #define TCC_WEXCTRL_DTHS_Msk (_U_(0xFF) << TCC_WEXCTRL_DTHS_Pos) 554 #define TCC_WEXCTRL_DTHS(value) (TCC_WEXCTRL_DTHS_Msk & ((value) << TCC_WEXCTRL_DTHS_Pos)) 555 #define TCC_WEXCTRL_MASK _U_(0xFFFF0F03) /**< \brief (TCC_WEXCTRL) MASK Register */ 556 557 /* -------- TCC_DRVCTRL : (TCC Offset: 0x18) (R/W 32) Driver Control -------- */ 558 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 559 typedef union { 560 struct { 561 uint32_t NRE0:1; /*!< bit: 0 Non-Recoverable State 0 Output Enable */ 562 uint32_t NRE1:1; /*!< bit: 1 Non-Recoverable State 1 Output Enable */ 563 uint32_t NRE2:1; /*!< bit: 2 Non-Recoverable State 2 Output Enable */ 564 uint32_t NRE3:1; /*!< bit: 3 Non-Recoverable State 3 Output Enable */ 565 uint32_t NRE4:1; /*!< bit: 4 Non-Recoverable State 4 Output Enable */ 566 uint32_t NRE5:1; /*!< bit: 5 Non-Recoverable State 5 Output Enable */ 567 uint32_t NRE6:1; /*!< bit: 6 Non-Recoverable State 6 Output Enable */ 568 uint32_t NRE7:1; /*!< bit: 7 Non-Recoverable State 7 Output Enable */ 569 uint32_t NRV0:1; /*!< bit: 8 Non-Recoverable State 0 Output Value */ 570 uint32_t NRV1:1; /*!< bit: 9 Non-Recoverable State 1 Output Value */ 571 uint32_t NRV2:1; /*!< bit: 10 Non-Recoverable State 2 Output Value */ 572 uint32_t NRV3:1; /*!< bit: 11 Non-Recoverable State 3 Output Value */ 573 uint32_t NRV4:1; /*!< bit: 12 Non-Recoverable State 4 Output Value */ 574 uint32_t NRV5:1; /*!< bit: 13 Non-Recoverable State 5 Output Value */ 575 uint32_t NRV6:1; /*!< bit: 14 Non-Recoverable State 6 Output Value */ 576 uint32_t NRV7:1; /*!< bit: 15 Non-Recoverable State 7 Output Value */ 577 uint32_t INVEN0:1; /*!< bit: 16 Output Waveform 0 Inversion */ 578 uint32_t INVEN1:1; /*!< bit: 17 Output Waveform 1 Inversion */ 579 uint32_t INVEN2:1; /*!< bit: 18 Output Waveform 2 Inversion */ 580 uint32_t INVEN3:1; /*!< bit: 19 Output Waveform 3 Inversion */ 581 uint32_t INVEN4:1; /*!< bit: 20 Output Waveform 4 Inversion */ 582 uint32_t INVEN5:1; /*!< bit: 21 Output Waveform 5 Inversion */ 583 uint32_t INVEN6:1; /*!< bit: 22 Output Waveform 6 Inversion */ 584 uint32_t INVEN7:1; /*!< bit: 23 Output Waveform 7 Inversion */ 585 uint32_t FILTERVAL0:4; /*!< bit: 24..27 Non-Recoverable Fault Input 0 Filter Value */ 586 uint32_t FILTERVAL1:4; /*!< bit: 28..31 Non-Recoverable Fault Input 1 Filter Value */ 587 } bit; /*!< Structure used for bit access */ 588 struct { 589 uint32_t NRE:8; /*!< bit: 0.. 7 Non-Recoverable State x Output Enable */ 590 uint32_t NRV:8; /*!< bit: 8..15 Non-Recoverable State x Output Value */ 591 uint32_t INVEN:8; /*!< bit: 16..23 Output Waveform x Inversion */ 592 uint32_t :8; /*!< bit: 24..31 Reserved */ 593 } vec; /*!< Structure used for vec access */ 594 uint32_t reg; /*!< Type used for register access */ 595 } TCC_DRVCTRL_Type; 596 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 597 598 #define TCC_DRVCTRL_OFFSET 0x18 /**< \brief (TCC_DRVCTRL offset) Driver Control */ 599 #define TCC_DRVCTRL_RESETVALUE _U_(0x00000000) /**< \brief (TCC_DRVCTRL reset_value) Driver Control */ 600 601 #define TCC_DRVCTRL_NRE0_Pos 0 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 0 Output Enable */ 602 #define TCC_DRVCTRL_NRE0 (_U_(1) << TCC_DRVCTRL_NRE0_Pos) 603 #define TCC_DRVCTRL_NRE1_Pos 1 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 1 Output Enable */ 604 #define TCC_DRVCTRL_NRE1 (_U_(1) << TCC_DRVCTRL_NRE1_Pos) 605 #define TCC_DRVCTRL_NRE2_Pos 2 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 2 Output Enable */ 606 #define TCC_DRVCTRL_NRE2 (_U_(1) << TCC_DRVCTRL_NRE2_Pos) 607 #define TCC_DRVCTRL_NRE3_Pos 3 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 3 Output Enable */ 608 #define TCC_DRVCTRL_NRE3 (_U_(1) << TCC_DRVCTRL_NRE3_Pos) 609 #define TCC_DRVCTRL_NRE4_Pos 4 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 4 Output Enable */ 610 #define TCC_DRVCTRL_NRE4 (_U_(1) << TCC_DRVCTRL_NRE4_Pos) 611 #define TCC_DRVCTRL_NRE5_Pos 5 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 5 Output Enable */ 612 #define TCC_DRVCTRL_NRE5 (_U_(1) << TCC_DRVCTRL_NRE5_Pos) 613 #define TCC_DRVCTRL_NRE6_Pos 6 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 6 Output Enable */ 614 #define TCC_DRVCTRL_NRE6 (_U_(1) << TCC_DRVCTRL_NRE6_Pos) 615 #define TCC_DRVCTRL_NRE7_Pos 7 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 7 Output Enable */ 616 #define TCC_DRVCTRL_NRE7 (_U_(1) << TCC_DRVCTRL_NRE7_Pos) 617 #define TCC_DRVCTRL_NRE_Pos 0 /**< \brief (TCC_DRVCTRL) Non-Recoverable State x Output Enable */ 618 #define TCC_DRVCTRL_NRE_Msk (_U_(0xFF) << TCC_DRVCTRL_NRE_Pos) 619 #define TCC_DRVCTRL_NRE(value) (TCC_DRVCTRL_NRE_Msk & ((value) << TCC_DRVCTRL_NRE_Pos)) 620 #define TCC_DRVCTRL_NRV0_Pos 8 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 0 Output Value */ 621 #define TCC_DRVCTRL_NRV0 (_U_(1) << TCC_DRVCTRL_NRV0_Pos) 622 #define TCC_DRVCTRL_NRV1_Pos 9 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 1 Output Value */ 623 #define TCC_DRVCTRL_NRV1 (_U_(1) << TCC_DRVCTRL_NRV1_Pos) 624 #define TCC_DRVCTRL_NRV2_Pos 10 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 2 Output Value */ 625 #define TCC_DRVCTRL_NRV2 (_U_(1) << TCC_DRVCTRL_NRV2_Pos) 626 #define TCC_DRVCTRL_NRV3_Pos 11 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 3 Output Value */ 627 #define TCC_DRVCTRL_NRV3 (_U_(1) << TCC_DRVCTRL_NRV3_Pos) 628 #define TCC_DRVCTRL_NRV4_Pos 12 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 4 Output Value */ 629 #define TCC_DRVCTRL_NRV4 (_U_(1) << TCC_DRVCTRL_NRV4_Pos) 630 #define TCC_DRVCTRL_NRV5_Pos 13 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 5 Output Value */ 631 #define TCC_DRVCTRL_NRV5 (_U_(1) << TCC_DRVCTRL_NRV5_Pos) 632 #define TCC_DRVCTRL_NRV6_Pos 14 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 6 Output Value */ 633 #define TCC_DRVCTRL_NRV6 (_U_(1) << TCC_DRVCTRL_NRV6_Pos) 634 #define TCC_DRVCTRL_NRV7_Pos 15 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 7 Output Value */ 635 #define TCC_DRVCTRL_NRV7 (_U_(1) << TCC_DRVCTRL_NRV7_Pos) 636 #define TCC_DRVCTRL_NRV_Pos 8 /**< \brief (TCC_DRVCTRL) Non-Recoverable State x Output Value */ 637 #define TCC_DRVCTRL_NRV_Msk (_U_(0xFF) << TCC_DRVCTRL_NRV_Pos) 638 #define TCC_DRVCTRL_NRV(value) (TCC_DRVCTRL_NRV_Msk & ((value) << TCC_DRVCTRL_NRV_Pos)) 639 #define TCC_DRVCTRL_INVEN0_Pos 16 /**< \brief (TCC_DRVCTRL) Output Waveform 0 Inversion */ 640 #define TCC_DRVCTRL_INVEN0 (_U_(1) << TCC_DRVCTRL_INVEN0_Pos) 641 #define TCC_DRVCTRL_INVEN1_Pos 17 /**< \brief (TCC_DRVCTRL) Output Waveform 1 Inversion */ 642 #define TCC_DRVCTRL_INVEN1 (_U_(1) << TCC_DRVCTRL_INVEN1_Pos) 643 #define TCC_DRVCTRL_INVEN2_Pos 18 /**< \brief (TCC_DRVCTRL) Output Waveform 2 Inversion */ 644 #define TCC_DRVCTRL_INVEN2 (_U_(1) << TCC_DRVCTRL_INVEN2_Pos) 645 #define TCC_DRVCTRL_INVEN3_Pos 19 /**< \brief (TCC_DRVCTRL) Output Waveform 3 Inversion */ 646 #define TCC_DRVCTRL_INVEN3 (_U_(1) << TCC_DRVCTRL_INVEN3_Pos) 647 #define TCC_DRVCTRL_INVEN4_Pos 20 /**< \brief (TCC_DRVCTRL) Output Waveform 4 Inversion */ 648 #define TCC_DRVCTRL_INVEN4 (_U_(1) << TCC_DRVCTRL_INVEN4_Pos) 649 #define TCC_DRVCTRL_INVEN5_Pos 21 /**< \brief (TCC_DRVCTRL) Output Waveform 5 Inversion */ 650 #define TCC_DRVCTRL_INVEN5 (_U_(1) << TCC_DRVCTRL_INVEN5_Pos) 651 #define TCC_DRVCTRL_INVEN6_Pos 22 /**< \brief (TCC_DRVCTRL) Output Waveform 6 Inversion */ 652 #define TCC_DRVCTRL_INVEN6 (_U_(1) << TCC_DRVCTRL_INVEN6_Pos) 653 #define TCC_DRVCTRL_INVEN7_Pos 23 /**< \brief (TCC_DRVCTRL) Output Waveform 7 Inversion */ 654 #define TCC_DRVCTRL_INVEN7 (_U_(1) << TCC_DRVCTRL_INVEN7_Pos) 655 #define TCC_DRVCTRL_INVEN_Pos 16 /**< \brief (TCC_DRVCTRL) Output Waveform x Inversion */ 656 #define TCC_DRVCTRL_INVEN_Msk (_U_(0xFF) << TCC_DRVCTRL_INVEN_Pos) 657 #define TCC_DRVCTRL_INVEN(value) (TCC_DRVCTRL_INVEN_Msk & ((value) << TCC_DRVCTRL_INVEN_Pos)) 658 #define TCC_DRVCTRL_FILTERVAL0_Pos 24 /**< \brief (TCC_DRVCTRL) Non-Recoverable Fault Input 0 Filter Value */ 659 #define TCC_DRVCTRL_FILTERVAL0_Msk (_U_(0xF) << TCC_DRVCTRL_FILTERVAL0_Pos) 660 #define TCC_DRVCTRL_FILTERVAL0(value) (TCC_DRVCTRL_FILTERVAL0_Msk & ((value) << TCC_DRVCTRL_FILTERVAL0_Pos)) 661 #define TCC_DRVCTRL_FILTERVAL1_Pos 28 /**< \brief (TCC_DRVCTRL) Non-Recoverable Fault Input 1 Filter Value */ 662 #define TCC_DRVCTRL_FILTERVAL1_Msk (_U_(0xF) << TCC_DRVCTRL_FILTERVAL1_Pos) 663 #define TCC_DRVCTRL_FILTERVAL1(value) (TCC_DRVCTRL_FILTERVAL1_Msk & ((value) << TCC_DRVCTRL_FILTERVAL1_Pos)) 664 #define TCC_DRVCTRL_MASK _U_(0xFFFFFFFF) /**< \brief (TCC_DRVCTRL) MASK Register */ 665 666 /* -------- TCC_DBGCTRL : (TCC Offset: 0x1E) (R/W 8) Debug Control -------- */ 667 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 668 typedef union { 669 struct { 670 uint8_t DBGRUN:1; /*!< bit: 0 Debug Running Mode */ 671 uint8_t :1; /*!< bit: 1 Reserved */ 672 uint8_t FDDBD:1; /*!< bit: 2 Fault Detection on Debug Break Detection */ 673 uint8_t :5; /*!< bit: 3.. 7 Reserved */ 674 } bit; /*!< Structure used for bit access */ 675 uint8_t reg; /*!< Type used for register access */ 676 } TCC_DBGCTRL_Type; 677 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 678 679 #define TCC_DBGCTRL_OFFSET 0x1E /**< \brief (TCC_DBGCTRL offset) Debug Control */ 680 #define TCC_DBGCTRL_RESETVALUE _U_(0x00) /**< \brief (TCC_DBGCTRL reset_value) Debug Control */ 681 682 #define TCC_DBGCTRL_DBGRUN_Pos 0 /**< \brief (TCC_DBGCTRL) Debug Running Mode */ 683 #define TCC_DBGCTRL_DBGRUN (_U_(0x1) << TCC_DBGCTRL_DBGRUN_Pos) 684 #define TCC_DBGCTRL_FDDBD_Pos 2 /**< \brief (TCC_DBGCTRL) Fault Detection on Debug Break Detection */ 685 #define TCC_DBGCTRL_FDDBD (_U_(0x1) << TCC_DBGCTRL_FDDBD_Pos) 686 #define TCC_DBGCTRL_MASK _U_(0x05) /**< \brief (TCC_DBGCTRL) MASK Register */ 687 688 /* -------- TCC_EVCTRL : (TCC Offset: 0x20) (R/W 32) Event Control -------- */ 689 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 690 typedef union { 691 struct { 692 uint32_t EVACT0:3; /*!< bit: 0.. 2 Timer/counter Input Event0 Action */ 693 uint32_t EVACT1:3; /*!< bit: 3.. 5 Timer/counter Input Event1 Action */ 694 uint32_t CNTSEL:2; /*!< bit: 6.. 7 Timer/counter Output Event Mode */ 695 uint32_t OVFEO:1; /*!< bit: 8 Overflow/Underflow Output Event Enable */ 696 uint32_t TRGEO:1; /*!< bit: 9 Retrigger Output Event Enable */ 697 uint32_t CNTEO:1; /*!< bit: 10 Timer/counter Output Event Enable */ 698 uint32_t :1; /*!< bit: 11 Reserved */ 699 uint32_t TCINV0:1; /*!< bit: 12 Inverted Event 0 Input Enable */ 700 uint32_t TCINV1:1; /*!< bit: 13 Inverted Event 1 Input Enable */ 701 uint32_t TCEI0:1; /*!< bit: 14 Timer/counter Event 0 Input Enable */ 702 uint32_t TCEI1:1; /*!< bit: 15 Timer/counter Event 1 Input Enable */ 703 uint32_t MCEI0:1; /*!< bit: 16 Match or Capture Channel 0 Event Input Enable */ 704 uint32_t MCEI1:1; /*!< bit: 17 Match or Capture Channel 1 Event Input Enable */ 705 uint32_t MCEI2:1; /*!< bit: 18 Match or Capture Channel 2 Event Input Enable */ 706 uint32_t MCEI3:1; /*!< bit: 19 Match or Capture Channel 3 Event Input Enable */ 707 uint32_t :4; /*!< bit: 20..23 Reserved */ 708 uint32_t MCEO0:1; /*!< bit: 24 Match or Capture Channel 0 Event Output Enable */ 709 uint32_t MCEO1:1; /*!< bit: 25 Match or Capture Channel 1 Event Output Enable */ 710 uint32_t MCEO2:1; /*!< bit: 26 Match or Capture Channel 2 Event Output Enable */ 711 uint32_t MCEO3:1; /*!< bit: 27 Match or Capture Channel 3 Event Output Enable */ 712 uint32_t :4; /*!< bit: 28..31 Reserved */ 713 } bit; /*!< Structure used for bit access */ 714 struct { 715 uint32_t :12; /*!< bit: 0..11 Reserved */ 716 uint32_t TCINV:2; /*!< bit: 12..13 Inverted Event x Input Enable */ 717 uint32_t TCEI:2; /*!< bit: 14..15 Timer/counter Event x Input Enable */ 718 uint32_t MCEI:4; /*!< bit: 16..19 Match or Capture Channel x Event Input Enable */ 719 uint32_t :4; /*!< bit: 20..23 Reserved */ 720 uint32_t MCEO:4; /*!< bit: 24..27 Match or Capture Channel x Event Output Enable */ 721 uint32_t :4; /*!< bit: 28..31 Reserved */ 722 } vec; /*!< Structure used for vec access */ 723 uint32_t reg; /*!< Type used for register access */ 724 } TCC_EVCTRL_Type; 725 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 726 727 #define TCC_EVCTRL_OFFSET 0x20 /**< \brief (TCC_EVCTRL offset) Event Control */ 728 #define TCC_EVCTRL_RESETVALUE _U_(0x00000000) /**< \brief (TCC_EVCTRL reset_value) Event Control */ 729 730 #define TCC_EVCTRL_EVACT0_Pos 0 /**< \brief (TCC_EVCTRL) Timer/counter Input Event0 Action */ 731 #define TCC_EVCTRL_EVACT0_Msk (_U_(0x7) << TCC_EVCTRL_EVACT0_Pos) 732 #define TCC_EVCTRL_EVACT0(value) (TCC_EVCTRL_EVACT0_Msk & ((value) << TCC_EVCTRL_EVACT0_Pos)) 733 #define TCC_EVCTRL_EVACT0_OFF_Val _U_(0x0) /**< \brief (TCC_EVCTRL) Event action disabled */ 734 #define TCC_EVCTRL_EVACT0_RETRIGGER_Val _U_(0x1) /**< \brief (TCC_EVCTRL) Start, restart or re-trigger counter on event */ 735 #define TCC_EVCTRL_EVACT0_COUNTEV_Val _U_(0x2) /**< \brief (TCC_EVCTRL) Count on event */ 736 #define TCC_EVCTRL_EVACT0_START_Val _U_(0x3) /**< \brief (TCC_EVCTRL) Start counter on event */ 737 #define TCC_EVCTRL_EVACT0_INC_Val _U_(0x4) /**< \brief (TCC_EVCTRL) Increment counter on event */ 738 #define TCC_EVCTRL_EVACT0_COUNT_Val _U_(0x5) /**< \brief (TCC_EVCTRL) Count on active state of asynchronous event */ 739 #define TCC_EVCTRL_EVACT0_STAMP_Val _U_(0x6) /**< \brief (TCC_EVCTRL) Stamp capture */ 740 #define TCC_EVCTRL_EVACT0_FAULT_Val _U_(0x7) /**< \brief (TCC_EVCTRL) Non-recoverable fault */ 741 #define TCC_EVCTRL_EVACT0_OFF (TCC_EVCTRL_EVACT0_OFF_Val << TCC_EVCTRL_EVACT0_Pos) 742 #define TCC_EVCTRL_EVACT0_RETRIGGER (TCC_EVCTRL_EVACT0_RETRIGGER_Val << TCC_EVCTRL_EVACT0_Pos) 743 #define TCC_EVCTRL_EVACT0_COUNTEV (TCC_EVCTRL_EVACT0_COUNTEV_Val << TCC_EVCTRL_EVACT0_Pos) 744 #define TCC_EVCTRL_EVACT0_START (TCC_EVCTRL_EVACT0_START_Val << TCC_EVCTRL_EVACT0_Pos) 745 #define TCC_EVCTRL_EVACT0_INC (TCC_EVCTRL_EVACT0_INC_Val << TCC_EVCTRL_EVACT0_Pos) 746 #define TCC_EVCTRL_EVACT0_COUNT (TCC_EVCTRL_EVACT0_COUNT_Val << TCC_EVCTRL_EVACT0_Pos) 747 #define TCC_EVCTRL_EVACT0_STAMP (TCC_EVCTRL_EVACT0_STAMP_Val << TCC_EVCTRL_EVACT0_Pos) 748 #define TCC_EVCTRL_EVACT0_FAULT (TCC_EVCTRL_EVACT0_FAULT_Val << TCC_EVCTRL_EVACT0_Pos) 749 #define TCC_EVCTRL_EVACT1_Pos 3 /**< \brief (TCC_EVCTRL) Timer/counter Input Event1 Action */ 750 #define TCC_EVCTRL_EVACT1_Msk (_U_(0x7) << TCC_EVCTRL_EVACT1_Pos) 751 #define TCC_EVCTRL_EVACT1(value) (TCC_EVCTRL_EVACT1_Msk & ((value) << TCC_EVCTRL_EVACT1_Pos)) 752 #define TCC_EVCTRL_EVACT1_OFF_Val _U_(0x0) /**< \brief (TCC_EVCTRL) Event action disabled */ 753 #define TCC_EVCTRL_EVACT1_RETRIGGER_Val _U_(0x1) /**< \brief (TCC_EVCTRL) Re-trigger counter on event */ 754 #define TCC_EVCTRL_EVACT1_DIR_Val _U_(0x2) /**< \brief (TCC_EVCTRL) Direction control */ 755 #define TCC_EVCTRL_EVACT1_STOP_Val _U_(0x3) /**< \brief (TCC_EVCTRL) Stop counter on event */ 756 #define TCC_EVCTRL_EVACT1_DEC_Val _U_(0x4) /**< \brief (TCC_EVCTRL) Decrement counter on event */ 757 #define TCC_EVCTRL_EVACT1_PPW_Val _U_(0x5) /**< \brief (TCC_EVCTRL) Period capture value in CC0 register, pulse width capture value in CC1 register */ 758 #define TCC_EVCTRL_EVACT1_PWP_Val _U_(0x6) /**< \brief (TCC_EVCTRL) Period capture value in CC1 register, pulse width capture value in CC0 register */ 759 #define TCC_EVCTRL_EVACT1_FAULT_Val _U_(0x7) /**< \brief (TCC_EVCTRL) Non-recoverable fault */ 760 #define TCC_EVCTRL_EVACT1_OFF (TCC_EVCTRL_EVACT1_OFF_Val << TCC_EVCTRL_EVACT1_Pos) 761 #define TCC_EVCTRL_EVACT1_RETRIGGER (TCC_EVCTRL_EVACT1_RETRIGGER_Val << TCC_EVCTRL_EVACT1_Pos) 762 #define TCC_EVCTRL_EVACT1_DIR (TCC_EVCTRL_EVACT1_DIR_Val << TCC_EVCTRL_EVACT1_Pos) 763 #define TCC_EVCTRL_EVACT1_STOP (TCC_EVCTRL_EVACT1_STOP_Val << TCC_EVCTRL_EVACT1_Pos) 764 #define TCC_EVCTRL_EVACT1_DEC (TCC_EVCTRL_EVACT1_DEC_Val << TCC_EVCTRL_EVACT1_Pos) 765 #define TCC_EVCTRL_EVACT1_PPW (TCC_EVCTRL_EVACT1_PPW_Val << TCC_EVCTRL_EVACT1_Pos) 766 #define TCC_EVCTRL_EVACT1_PWP (TCC_EVCTRL_EVACT1_PWP_Val << TCC_EVCTRL_EVACT1_Pos) 767 #define TCC_EVCTRL_EVACT1_FAULT (TCC_EVCTRL_EVACT1_FAULT_Val << TCC_EVCTRL_EVACT1_Pos) 768 #define TCC_EVCTRL_CNTSEL_Pos 6 /**< \brief (TCC_EVCTRL) Timer/counter Output Event Mode */ 769 #define TCC_EVCTRL_CNTSEL_Msk (_U_(0x3) << TCC_EVCTRL_CNTSEL_Pos) 770 #define TCC_EVCTRL_CNTSEL(value) (TCC_EVCTRL_CNTSEL_Msk & ((value) << TCC_EVCTRL_CNTSEL_Pos)) 771 #define TCC_EVCTRL_CNTSEL_START_Val _U_(0x0) /**< \brief (TCC_EVCTRL) An interrupt/event is generated when a new counter cycle starts */ 772 #define TCC_EVCTRL_CNTSEL_END_Val _U_(0x1) /**< \brief (TCC_EVCTRL) An interrupt/event is generated when a counter cycle ends */ 773 #define TCC_EVCTRL_CNTSEL_BETWEEN_Val _U_(0x2) /**< \brief (TCC_EVCTRL) An interrupt/event is generated when a counter cycle ends, except for the first and last cycles */ 774 #define TCC_EVCTRL_CNTSEL_BOUNDARY_Val _U_(0x3) /**< \brief (TCC_EVCTRL) An interrupt/event is generated when a new counter cycle starts or a counter cycle ends */ 775 #define TCC_EVCTRL_CNTSEL_START (TCC_EVCTRL_CNTSEL_START_Val << TCC_EVCTRL_CNTSEL_Pos) 776 #define TCC_EVCTRL_CNTSEL_END (TCC_EVCTRL_CNTSEL_END_Val << TCC_EVCTRL_CNTSEL_Pos) 777 #define TCC_EVCTRL_CNTSEL_BETWEEN (TCC_EVCTRL_CNTSEL_BETWEEN_Val << TCC_EVCTRL_CNTSEL_Pos) 778 #define TCC_EVCTRL_CNTSEL_BOUNDARY (TCC_EVCTRL_CNTSEL_BOUNDARY_Val << TCC_EVCTRL_CNTSEL_Pos) 779 #define TCC_EVCTRL_OVFEO_Pos 8 /**< \brief (TCC_EVCTRL) Overflow/Underflow Output Event Enable */ 780 #define TCC_EVCTRL_OVFEO (_U_(0x1) << TCC_EVCTRL_OVFEO_Pos) 781 #define TCC_EVCTRL_TRGEO_Pos 9 /**< \brief (TCC_EVCTRL) Retrigger Output Event Enable */ 782 #define TCC_EVCTRL_TRGEO (_U_(0x1) << TCC_EVCTRL_TRGEO_Pos) 783 #define TCC_EVCTRL_CNTEO_Pos 10 /**< \brief (TCC_EVCTRL) Timer/counter Output Event Enable */ 784 #define TCC_EVCTRL_CNTEO (_U_(0x1) << TCC_EVCTRL_CNTEO_Pos) 785 #define TCC_EVCTRL_TCINV0_Pos 12 /**< \brief (TCC_EVCTRL) Inverted Event 0 Input Enable */ 786 #define TCC_EVCTRL_TCINV0 (_U_(1) << TCC_EVCTRL_TCINV0_Pos) 787 #define TCC_EVCTRL_TCINV1_Pos 13 /**< \brief (TCC_EVCTRL) Inverted Event 1 Input Enable */ 788 #define TCC_EVCTRL_TCINV1 (_U_(1) << TCC_EVCTRL_TCINV1_Pos) 789 #define TCC_EVCTRL_TCINV_Pos 12 /**< \brief (TCC_EVCTRL) Inverted Event x Input Enable */ 790 #define TCC_EVCTRL_TCINV_Msk (_U_(0x3) << TCC_EVCTRL_TCINV_Pos) 791 #define TCC_EVCTRL_TCINV(value) (TCC_EVCTRL_TCINV_Msk & ((value) << TCC_EVCTRL_TCINV_Pos)) 792 #define TCC_EVCTRL_TCEI0_Pos 14 /**< \brief (TCC_EVCTRL) Timer/counter Event 0 Input Enable */ 793 #define TCC_EVCTRL_TCEI0 (_U_(1) << TCC_EVCTRL_TCEI0_Pos) 794 #define TCC_EVCTRL_TCEI1_Pos 15 /**< \brief (TCC_EVCTRL) Timer/counter Event 1 Input Enable */ 795 #define TCC_EVCTRL_TCEI1 (_U_(1) << TCC_EVCTRL_TCEI1_Pos) 796 #define TCC_EVCTRL_TCEI_Pos 14 /**< \brief (TCC_EVCTRL) Timer/counter Event x Input Enable */ 797 #define TCC_EVCTRL_TCEI_Msk (_U_(0x3) << TCC_EVCTRL_TCEI_Pos) 798 #define TCC_EVCTRL_TCEI(value) (TCC_EVCTRL_TCEI_Msk & ((value) << TCC_EVCTRL_TCEI_Pos)) 799 #define TCC_EVCTRL_MCEI0_Pos 16 /**< \brief (TCC_EVCTRL) Match or Capture Channel 0 Event Input Enable */ 800 #define TCC_EVCTRL_MCEI0 (_U_(1) << TCC_EVCTRL_MCEI0_Pos) 801 #define TCC_EVCTRL_MCEI1_Pos 17 /**< \brief (TCC_EVCTRL) Match or Capture Channel 1 Event Input Enable */ 802 #define TCC_EVCTRL_MCEI1 (_U_(1) << TCC_EVCTRL_MCEI1_Pos) 803 #define TCC_EVCTRL_MCEI2_Pos 18 /**< \brief (TCC_EVCTRL) Match or Capture Channel 2 Event Input Enable */ 804 #define TCC_EVCTRL_MCEI2 (_U_(1) << TCC_EVCTRL_MCEI2_Pos) 805 #define TCC_EVCTRL_MCEI3_Pos 19 /**< \brief (TCC_EVCTRL) Match or Capture Channel 3 Event Input Enable */ 806 #define TCC_EVCTRL_MCEI3 (_U_(1) << TCC_EVCTRL_MCEI3_Pos) 807 #define TCC_EVCTRL_MCEI_Pos 16 /**< \brief (TCC_EVCTRL) Match or Capture Channel x Event Input Enable */ 808 #define TCC_EVCTRL_MCEI_Msk (_U_(0xF) << TCC_EVCTRL_MCEI_Pos) 809 #define TCC_EVCTRL_MCEI(value) (TCC_EVCTRL_MCEI_Msk & ((value) << TCC_EVCTRL_MCEI_Pos)) 810 #define TCC_EVCTRL_MCEO0_Pos 24 /**< \brief (TCC_EVCTRL) Match or Capture Channel 0 Event Output Enable */ 811 #define TCC_EVCTRL_MCEO0 (_U_(1) << TCC_EVCTRL_MCEO0_Pos) 812 #define TCC_EVCTRL_MCEO1_Pos 25 /**< \brief (TCC_EVCTRL) Match or Capture Channel 1 Event Output Enable */ 813 #define TCC_EVCTRL_MCEO1 (_U_(1) << TCC_EVCTRL_MCEO1_Pos) 814 #define TCC_EVCTRL_MCEO2_Pos 26 /**< \brief (TCC_EVCTRL) Match or Capture Channel 2 Event Output Enable */ 815 #define TCC_EVCTRL_MCEO2 (_U_(1) << TCC_EVCTRL_MCEO2_Pos) 816 #define TCC_EVCTRL_MCEO3_Pos 27 /**< \brief (TCC_EVCTRL) Match or Capture Channel 3 Event Output Enable */ 817 #define TCC_EVCTRL_MCEO3 (_U_(1) << TCC_EVCTRL_MCEO3_Pos) 818 #define TCC_EVCTRL_MCEO_Pos 24 /**< \brief (TCC_EVCTRL) Match or Capture Channel x Event Output Enable */ 819 #define TCC_EVCTRL_MCEO_Msk (_U_(0xF) << TCC_EVCTRL_MCEO_Pos) 820 #define TCC_EVCTRL_MCEO(value) (TCC_EVCTRL_MCEO_Msk & ((value) << TCC_EVCTRL_MCEO_Pos)) 821 #define TCC_EVCTRL_MASK _U_(0x0F0FF7FF) /**< \brief (TCC_EVCTRL) MASK Register */ 822 823 /* -------- TCC_INTENCLR : (TCC Offset: 0x24) (R/W 32) Interrupt Enable Clear -------- */ 824 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 825 typedef union { 826 struct { 827 uint32_t OVF:1; /*!< bit: 0 Overflow Interrupt Enable */ 828 uint32_t TRG:1; /*!< bit: 1 Retrigger Interrupt Enable */ 829 uint32_t CNT:1; /*!< bit: 2 Counter Interrupt Enable */ 830 uint32_t ERR:1; /*!< bit: 3 Error Interrupt Enable */ 831 uint32_t :6; /*!< bit: 4.. 9 Reserved */ 832 uint32_t UFS:1; /*!< bit: 10 Non-Recoverable Update Fault Interrupt Enable */ 833 uint32_t DFS:1; /*!< bit: 11 Non-Recoverable Debug Fault Interrupt Enable */ 834 uint32_t FAULTA:1; /*!< bit: 12 Recoverable Fault A Interrupt Enable */ 835 uint32_t FAULTB:1; /*!< bit: 13 Recoverable Fault B Interrupt Enable */ 836 uint32_t FAULT0:1; /*!< bit: 14 Non-Recoverable Fault 0 Interrupt Enable */ 837 uint32_t FAULT1:1; /*!< bit: 15 Non-Recoverable Fault 1 Interrupt Enable */ 838 uint32_t MC0:1; /*!< bit: 16 Match or Capture Channel 0 Interrupt Enable */ 839 uint32_t MC1:1; /*!< bit: 17 Match or Capture Channel 1 Interrupt Enable */ 840 uint32_t MC2:1; /*!< bit: 18 Match or Capture Channel 2 Interrupt Enable */ 841 uint32_t MC3:1; /*!< bit: 19 Match or Capture Channel 3 Interrupt Enable */ 842 uint32_t :12; /*!< bit: 20..31 Reserved */ 843 } bit; /*!< Structure used for bit access */ 844 struct { 845 uint32_t :16; /*!< bit: 0..15 Reserved */ 846 uint32_t MC:4; /*!< bit: 16..19 Match or Capture Channel x Interrupt Enable */ 847 uint32_t :12; /*!< bit: 20..31 Reserved */ 848 } vec; /*!< Structure used for vec access */ 849 uint32_t reg; /*!< Type used for register access */ 850 } TCC_INTENCLR_Type; 851 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 852 853 #define TCC_INTENCLR_OFFSET 0x24 /**< \brief (TCC_INTENCLR offset) Interrupt Enable Clear */ 854 #define TCC_INTENCLR_RESETVALUE _U_(0x00000000) /**< \brief (TCC_INTENCLR reset_value) Interrupt Enable Clear */ 855 856 #define TCC_INTENCLR_OVF_Pos 0 /**< \brief (TCC_INTENCLR) Overflow Interrupt Enable */ 857 #define TCC_INTENCLR_OVF (_U_(0x1) << TCC_INTENCLR_OVF_Pos) 858 #define TCC_INTENCLR_TRG_Pos 1 /**< \brief (TCC_INTENCLR) Retrigger Interrupt Enable */ 859 #define TCC_INTENCLR_TRG (_U_(0x1) << TCC_INTENCLR_TRG_Pos) 860 #define TCC_INTENCLR_CNT_Pos 2 /**< \brief (TCC_INTENCLR) Counter Interrupt Enable */ 861 #define TCC_INTENCLR_CNT (_U_(0x1) << TCC_INTENCLR_CNT_Pos) 862 #define TCC_INTENCLR_ERR_Pos 3 /**< \brief (TCC_INTENCLR) Error Interrupt Enable */ 863 #define TCC_INTENCLR_ERR (_U_(0x1) << TCC_INTENCLR_ERR_Pos) 864 #define TCC_INTENCLR_UFS_Pos 10 /**< \brief (TCC_INTENCLR) Non-Recoverable Update Fault Interrupt Enable */ 865 #define TCC_INTENCLR_UFS (_U_(0x1) << TCC_INTENCLR_UFS_Pos) 866 #define TCC_INTENCLR_DFS_Pos 11 /**< \brief (TCC_INTENCLR) Non-Recoverable Debug Fault Interrupt Enable */ 867 #define TCC_INTENCLR_DFS (_U_(0x1) << TCC_INTENCLR_DFS_Pos) 868 #define TCC_INTENCLR_FAULTA_Pos 12 /**< \brief (TCC_INTENCLR) Recoverable Fault A Interrupt Enable */ 869 #define TCC_INTENCLR_FAULTA (_U_(0x1) << TCC_INTENCLR_FAULTA_Pos) 870 #define TCC_INTENCLR_FAULTB_Pos 13 /**< \brief (TCC_INTENCLR) Recoverable Fault B Interrupt Enable */ 871 #define TCC_INTENCLR_FAULTB (_U_(0x1) << TCC_INTENCLR_FAULTB_Pos) 872 #define TCC_INTENCLR_FAULT0_Pos 14 /**< \brief (TCC_INTENCLR) Non-Recoverable Fault 0 Interrupt Enable */ 873 #define TCC_INTENCLR_FAULT0 (_U_(0x1) << TCC_INTENCLR_FAULT0_Pos) 874 #define TCC_INTENCLR_FAULT1_Pos 15 /**< \brief (TCC_INTENCLR) Non-Recoverable Fault 1 Interrupt Enable */ 875 #define TCC_INTENCLR_FAULT1 (_U_(0x1) << TCC_INTENCLR_FAULT1_Pos) 876 #define TCC_INTENCLR_MC0_Pos 16 /**< \brief (TCC_INTENCLR) Match or Capture Channel 0 Interrupt Enable */ 877 #define TCC_INTENCLR_MC0 (_U_(1) << TCC_INTENCLR_MC0_Pos) 878 #define TCC_INTENCLR_MC1_Pos 17 /**< \brief (TCC_INTENCLR) Match or Capture Channel 1 Interrupt Enable */ 879 #define TCC_INTENCLR_MC1 (_U_(1) << TCC_INTENCLR_MC1_Pos) 880 #define TCC_INTENCLR_MC2_Pos 18 /**< \brief (TCC_INTENCLR) Match or Capture Channel 2 Interrupt Enable */ 881 #define TCC_INTENCLR_MC2 (_U_(1) << TCC_INTENCLR_MC2_Pos) 882 #define TCC_INTENCLR_MC3_Pos 19 /**< \brief (TCC_INTENCLR) Match or Capture Channel 3 Interrupt Enable */ 883 #define TCC_INTENCLR_MC3 (_U_(1) << TCC_INTENCLR_MC3_Pos) 884 #define TCC_INTENCLR_MC_Pos 16 /**< \brief (TCC_INTENCLR) Match or Capture Channel x Interrupt Enable */ 885 #define TCC_INTENCLR_MC_Msk (_U_(0xF) << TCC_INTENCLR_MC_Pos) 886 #define TCC_INTENCLR_MC(value) (TCC_INTENCLR_MC_Msk & ((value) << TCC_INTENCLR_MC_Pos)) 887 #define TCC_INTENCLR_MASK _U_(0x000FFC0F) /**< \brief (TCC_INTENCLR) MASK Register */ 888 889 /* -------- TCC_INTENSET : (TCC Offset: 0x28) (R/W 32) Interrupt Enable Set -------- */ 890 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 891 typedef union { 892 struct { 893 uint32_t OVF:1; /*!< bit: 0 Overflow Interrupt Enable */ 894 uint32_t TRG:1; /*!< bit: 1 Retrigger Interrupt Enable */ 895 uint32_t CNT:1; /*!< bit: 2 Counter Interrupt Enable */ 896 uint32_t ERR:1; /*!< bit: 3 Error Interrupt Enable */ 897 uint32_t :6; /*!< bit: 4.. 9 Reserved */ 898 uint32_t UFS:1; /*!< bit: 10 Non-Recoverable Update Fault Interrupt Enable */ 899 uint32_t DFS:1; /*!< bit: 11 Non-Recoverable Debug Fault Interrupt Enable */ 900 uint32_t FAULTA:1; /*!< bit: 12 Recoverable Fault A Interrupt Enable */ 901 uint32_t FAULTB:1; /*!< bit: 13 Recoverable Fault B Interrupt Enable */ 902 uint32_t FAULT0:1; /*!< bit: 14 Non-Recoverable Fault 0 Interrupt Enable */ 903 uint32_t FAULT1:1; /*!< bit: 15 Non-Recoverable Fault 1 Interrupt Enable */ 904 uint32_t MC0:1; /*!< bit: 16 Match or Capture Channel 0 Interrupt Enable */ 905 uint32_t MC1:1; /*!< bit: 17 Match or Capture Channel 1 Interrupt Enable */ 906 uint32_t MC2:1; /*!< bit: 18 Match or Capture Channel 2 Interrupt Enable */ 907 uint32_t MC3:1; /*!< bit: 19 Match or Capture Channel 3 Interrupt Enable */ 908 uint32_t :12; /*!< bit: 20..31 Reserved */ 909 } bit; /*!< Structure used for bit access */ 910 struct { 911 uint32_t :16; /*!< bit: 0..15 Reserved */ 912 uint32_t MC:4; /*!< bit: 16..19 Match or Capture Channel x Interrupt Enable */ 913 uint32_t :12; /*!< bit: 20..31 Reserved */ 914 } vec; /*!< Structure used for vec access */ 915 uint32_t reg; /*!< Type used for register access */ 916 } TCC_INTENSET_Type; 917 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 918 919 #define TCC_INTENSET_OFFSET 0x28 /**< \brief (TCC_INTENSET offset) Interrupt Enable Set */ 920 #define TCC_INTENSET_RESETVALUE _U_(0x00000000) /**< \brief (TCC_INTENSET reset_value) Interrupt Enable Set */ 921 922 #define TCC_INTENSET_OVF_Pos 0 /**< \brief (TCC_INTENSET) Overflow Interrupt Enable */ 923 #define TCC_INTENSET_OVF (_U_(0x1) << TCC_INTENSET_OVF_Pos) 924 #define TCC_INTENSET_TRG_Pos 1 /**< \brief (TCC_INTENSET) Retrigger Interrupt Enable */ 925 #define TCC_INTENSET_TRG (_U_(0x1) << TCC_INTENSET_TRG_Pos) 926 #define TCC_INTENSET_CNT_Pos 2 /**< \brief (TCC_INTENSET) Counter Interrupt Enable */ 927 #define TCC_INTENSET_CNT (_U_(0x1) << TCC_INTENSET_CNT_Pos) 928 #define TCC_INTENSET_ERR_Pos 3 /**< \brief (TCC_INTENSET) Error Interrupt Enable */ 929 #define TCC_INTENSET_ERR (_U_(0x1) << TCC_INTENSET_ERR_Pos) 930 #define TCC_INTENSET_UFS_Pos 10 /**< \brief (TCC_INTENSET) Non-Recoverable Update Fault Interrupt Enable */ 931 #define TCC_INTENSET_UFS (_U_(0x1) << TCC_INTENSET_UFS_Pos) 932 #define TCC_INTENSET_DFS_Pos 11 /**< \brief (TCC_INTENSET) Non-Recoverable Debug Fault Interrupt Enable */ 933 #define TCC_INTENSET_DFS (_U_(0x1) << TCC_INTENSET_DFS_Pos) 934 #define TCC_INTENSET_FAULTA_Pos 12 /**< \brief (TCC_INTENSET) Recoverable Fault A Interrupt Enable */ 935 #define TCC_INTENSET_FAULTA (_U_(0x1) << TCC_INTENSET_FAULTA_Pos) 936 #define TCC_INTENSET_FAULTB_Pos 13 /**< \brief (TCC_INTENSET) Recoverable Fault B Interrupt Enable */ 937 #define TCC_INTENSET_FAULTB (_U_(0x1) << TCC_INTENSET_FAULTB_Pos) 938 #define TCC_INTENSET_FAULT0_Pos 14 /**< \brief (TCC_INTENSET) Non-Recoverable Fault 0 Interrupt Enable */ 939 #define TCC_INTENSET_FAULT0 (_U_(0x1) << TCC_INTENSET_FAULT0_Pos) 940 #define TCC_INTENSET_FAULT1_Pos 15 /**< \brief (TCC_INTENSET) Non-Recoverable Fault 1 Interrupt Enable */ 941 #define TCC_INTENSET_FAULT1 (_U_(0x1) << TCC_INTENSET_FAULT1_Pos) 942 #define TCC_INTENSET_MC0_Pos 16 /**< \brief (TCC_INTENSET) Match or Capture Channel 0 Interrupt Enable */ 943 #define TCC_INTENSET_MC0 (_U_(1) << TCC_INTENSET_MC0_Pos) 944 #define TCC_INTENSET_MC1_Pos 17 /**< \brief (TCC_INTENSET) Match or Capture Channel 1 Interrupt Enable */ 945 #define TCC_INTENSET_MC1 (_U_(1) << TCC_INTENSET_MC1_Pos) 946 #define TCC_INTENSET_MC2_Pos 18 /**< \brief (TCC_INTENSET) Match or Capture Channel 2 Interrupt Enable */ 947 #define TCC_INTENSET_MC2 (_U_(1) << TCC_INTENSET_MC2_Pos) 948 #define TCC_INTENSET_MC3_Pos 19 /**< \brief (TCC_INTENSET) Match or Capture Channel 3 Interrupt Enable */ 949 #define TCC_INTENSET_MC3 (_U_(1) << TCC_INTENSET_MC3_Pos) 950 #define TCC_INTENSET_MC_Pos 16 /**< \brief (TCC_INTENSET) Match or Capture Channel x Interrupt Enable */ 951 #define TCC_INTENSET_MC_Msk (_U_(0xF) << TCC_INTENSET_MC_Pos) 952 #define TCC_INTENSET_MC(value) (TCC_INTENSET_MC_Msk & ((value) << TCC_INTENSET_MC_Pos)) 953 #define TCC_INTENSET_MASK _U_(0x000FFC0F) /**< \brief (TCC_INTENSET) MASK Register */ 954 955 /* -------- TCC_INTFLAG : (TCC Offset: 0x2C) (R/W 32) Interrupt Flag Status and Clear -------- */ 956 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 957 typedef union { // __I to avoid read-modify-write on write-to-clear register 958 struct { 959 __I uint32_t OVF:1; /*!< bit: 0 Overflow */ 960 __I uint32_t TRG:1; /*!< bit: 1 Retrigger */ 961 __I uint32_t CNT:1; /*!< bit: 2 Counter */ 962 __I uint32_t ERR:1; /*!< bit: 3 Error */ 963 __I uint32_t :6; /*!< bit: 4.. 9 Reserved */ 964 __I uint32_t UFS:1; /*!< bit: 10 Non-Recoverable Update Fault */ 965 __I uint32_t DFS:1; /*!< bit: 11 Non-Recoverable Debug Fault */ 966 __I uint32_t FAULTA:1; /*!< bit: 12 Recoverable Fault A */ 967 __I uint32_t FAULTB:1; /*!< bit: 13 Recoverable Fault B */ 968 __I uint32_t FAULT0:1; /*!< bit: 14 Non-Recoverable Fault 0 */ 969 __I uint32_t FAULT1:1; /*!< bit: 15 Non-Recoverable Fault 1 */ 970 __I uint32_t MC0:1; /*!< bit: 16 Match or Capture 0 */ 971 __I uint32_t MC1:1; /*!< bit: 17 Match or Capture 1 */ 972 __I uint32_t MC2:1; /*!< bit: 18 Match or Capture 2 */ 973 __I uint32_t MC3:1; /*!< bit: 19 Match or Capture 3 */ 974 __I uint32_t :12; /*!< bit: 20..31 Reserved */ 975 } bit; /*!< Structure used for bit access */ 976 struct { 977 __I uint32_t :16; /*!< bit: 0..15 Reserved */ 978 __I uint32_t MC:4; /*!< bit: 16..19 Match or Capture x */ 979 __I uint32_t :12; /*!< bit: 20..31 Reserved */ 980 } vec; /*!< Structure used for vec access */ 981 uint32_t reg; /*!< Type used for register access */ 982 } TCC_INTFLAG_Type; 983 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 984 985 #define TCC_INTFLAG_OFFSET 0x2C /**< \brief (TCC_INTFLAG offset) Interrupt Flag Status and Clear */ 986 #define TCC_INTFLAG_RESETVALUE _U_(0x00000000) /**< \brief (TCC_INTFLAG reset_value) Interrupt Flag Status and Clear */ 987 988 #define TCC_INTFLAG_OVF_Pos 0 /**< \brief (TCC_INTFLAG) Overflow */ 989 #define TCC_INTFLAG_OVF (_U_(0x1) << TCC_INTFLAG_OVF_Pos) 990 #define TCC_INTFLAG_TRG_Pos 1 /**< \brief (TCC_INTFLAG) Retrigger */ 991 #define TCC_INTFLAG_TRG (_U_(0x1) << TCC_INTFLAG_TRG_Pos) 992 #define TCC_INTFLAG_CNT_Pos 2 /**< \brief (TCC_INTFLAG) Counter */ 993 #define TCC_INTFLAG_CNT (_U_(0x1) << TCC_INTFLAG_CNT_Pos) 994 #define TCC_INTFLAG_ERR_Pos 3 /**< \brief (TCC_INTFLAG) Error */ 995 #define TCC_INTFLAG_ERR (_U_(0x1) << TCC_INTFLAG_ERR_Pos) 996 #define TCC_INTFLAG_UFS_Pos 10 /**< \brief (TCC_INTFLAG) Non-Recoverable Update Fault */ 997 #define TCC_INTFLAG_UFS (_U_(0x1) << TCC_INTFLAG_UFS_Pos) 998 #define TCC_INTFLAG_DFS_Pos 11 /**< \brief (TCC_INTFLAG) Non-Recoverable Debug Fault */ 999 #define TCC_INTFLAG_DFS (_U_(0x1) << TCC_INTFLAG_DFS_Pos) 1000 #define TCC_INTFLAG_FAULTA_Pos 12 /**< \brief (TCC_INTFLAG) Recoverable Fault A */ 1001 #define TCC_INTFLAG_FAULTA (_U_(0x1) << TCC_INTFLAG_FAULTA_Pos) 1002 #define TCC_INTFLAG_FAULTB_Pos 13 /**< \brief (TCC_INTFLAG) Recoverable Fault B */ 1003 #define TCC_INTFLAG_FAULTB (_U_(0x1) << TCC_INTFLAG_FAULTB_Pos) 1004 #define TCC_INTFLAG_FAULT0_Pos 14 /**< \brief (TCC_INTFLAG) Non-Recoverable Fault 0 */ 1005 #define TCC_INTFLAG_FAULT0 (_U_(0x1) << TCC_INTFLAG_FAULT0_Pos) 1006 #define TCC_INTFLAG_FAULT1_Pos 15 /**< \brief (TCC_INTFLAG) Non-Recoverable Fault 1 */ 1007 #define TCC_INTFLAG_FAULT1 (_U_(0x1) << TCC_INTFLAG_FAULT1_Pos) 1008 #define TCC_INTFLAG_MC0_Pos 16 /**< \brief (TCC_INTFLAG) Match or Capture 0 */ 1009 #define TCC_INTFLAG_MC0 (_U_(1) << TCC_INTFLAG_MC0_Pos) 1010 #define TCC_INTFLAG_MC1_Pos 17 /**< \brief (TCC_INTFLAG) Match or Capture 1 */ 1011 #define TCC_INTFLAG_MC1 (_U_(1) << TCC_INTFLAG_MC1_Pos) 1012 #define TCC_INTFLAG_MC2_Pos 18 /**< \brief (TCC_INTFLAG) Match or Capture 2 */ 1013 #define TCC_INTFLAG_MC2 (_U_(1) << TCC_INTFLAG_MC2_Pos) 1014 #define TCC_INTFLAG_MC3_Pos 19 /**< \brief (TCC_INTFLAG) Match or Capture 3 */ 1015 #define TCC_INTFLAG_MC3 (_U_(1) << TCC_INTFLAG_MC3_Pos) 1016 #define TCC_INTFLAG_MC_Pos 16 /**< \brief (TCC_INTFLAG) Match or Capture x */ 1017 #define TCC_INTFLAG_MC_Msk (_U_(0xF) << TCC_INTFLAG_MC_Pos) 1018 #define TCC_INTFLAG_MC(value) (TCC_INTFLAG_MC_Msk & ((value) << TCC_INTFLAG_MC_Pos)) 1019 #define TCC_INTFLAG_MASK _U_(0x000FFC0F) /**< \brief (TCC_INTFLAG) MASK Register */ 1020 1021 /* -------- TCC_STATUS : (TCC Offset: 0x30) (R/W 32) Status -------- */ 1022 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1023 typedef union { 1024 struct { 1025 uint32_t STOP:1; /*!< bit: 0 Stop */ 1026 uint32_t IDX:1; /*!< bit: 1 Ramp */ 1027 uint32_t UFS:1; /*!< bit: 2 Non-recoverable Update Fault State */ 1028 uint32_t DFS:1; /*!< bit: 3 Non-Recoverable Debug Fault State */ 1029 uint32_t SLAVE:1; /*!< bit: 4 Slave */ 1030 uint32_t PATTBUFV:1; /*!< bit: 5 Pattern Buffer Valid */ 1031 uint32_t :1; /*!< bit: 6 Reserved */ 1032 uint32_t PERBUFV:1; /*!< bit: 7 Period Buffer Valid */ 1033 uint32_t FAULTAIN:1; /*!< bit: 8 Recoverable Fault A Input */ 1034 uint32_t FAULTBIN:1; /*!< bit: 9 Recoverable Fault B Input */ 1035 uint32_t FAULT0IN:1; /*!< bit: 10 Non-Recoverable Fault0 Input */ 1036 uint32_t FAULT1IN:1; /*!< bit: 11 Non-Recoverable Fault1 Input */ 1037 uint32_t FAULTA:1; /*!< bit: 12 Recoverable Fault A State */ 1038 uint32_t FAULTB:1; /*!< bit: 13 Recoverable Fault B State */ 1039 uint32_t FAULT0:1; /*!< bit: 14 Non-Recoverable Fault 0 State */ 1040 uint32_t FAULT1:1; /*!< bit: 15 Non-Recoverable Fault 1 State */ 1041 uint32_t CCBUFV0:1; /*!< bit: 16 Compare Channel 0 Buffer Valid */ 1042 uint32_t CCBUFV1:1; /*!< bit: 17 Compare Channel 1 Buffer Valid */ 1043 uint32_t CCBUFV2:1; /*!< bit: 18 Compare Channel 2 Buffer Valid */ 1044 uint32_t CCBUFV3:1; /*!< bit: 19 Compare Channel 3 Buffer Valid */ 1045 uint32_t :4; /*!< bit: 20..23 Reserved */ 1046 uint32_t CMP0:1; /*!< bit: 24 Compare Channel 0 Value */ 1047 uint32_t CMP1:1; /*!< bit: 25 Compare Channel 1 Value */ 1048 uint32_t CMP2:1; /*!< bit: 26 Compare Channel 2 Value */ 1049 uint32_t CMP3:1; /*!< bit: 27 Compare Channel 3 Value */ 1050 uint32_t :4; /*!< bit: 28..31 Reserved */ 1051 } bit; /*!< Structure used for bit access */ 1052 struct { 1053 uint32_t :16; /*!< bit: 0..15 Reserved */ 1054 uint32_t CCBUFV:4; /*!< bit: 16..19 Compare Channel x Buffer Valid */ 1055 uint32_t :4; /*!< bit: 20..23 Reserved */ 1056 uint32_t CMP:4; /*!< bit: 24..27 Compare Channel x Value */ 1057 uint32_t :4; /*!< bit: 28..31 Reserved */ 1058 } vec; /*!< Structure used for vec access */ 1059 uint32_t reg; /*!< Type used for register access */ 1060 } TCC_STATUS_Type; 1061 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1062 1063 #define TCC_STATUS_OFFSET 0x30 /**< \brief (TCC_STATUS offset) Status */ 1064 #define TCC_STATUS_RESETVALUE _U_(0x00000001) /**< \brief (TCC_STATUS reset_value) Status */ 1065 1066 #define TCC_STATUS_STOP_Pos 0 /**< \brief (TCC_STATUS) Stop */ 1067 #define TCC_STATUS_STOP (_U_(0x1) << TCC_STATUS_STOP_Pos) 1068 #define TCC_STATUS_IDX_Pos 1 /**< \brief (TCC_STATUS) Ramp */ 1069 #define TCC_STATUS_IDX (_U_(0x1) << TCC_STATUS_IDX_Pos) 1070 #define TCC_STATUS_UFS_Pos 2 /**< \brief (TCC_STATUS) Non-recoverable Update Fault State */ 1071 #define TCC_STATUS_UFS (_U_(0x1) << TCC_STATUS_UFS_Pos) 1072 #define TCC_STATUS_DFS_Pos 3 /**< \brief (TCC_STATUS) Non-Recoverable Debug Fault State */ 1073 #define TCC_STATUS_DFS (_U_(0x1) << TCC_STATUS_DFS_Pos) 1074 #define TCC_STATUS_SLAVE_Pos 4 /**< \brief (TCC_STATUS) Slave */ 1075 #define TCC_STATUS_SLAVE (_U_(0x1) << TCC_STATUS_SLAVE_Pos) 1076 #define TCC_STATUS_PATTBUFV_Pos 5 /**< \brief (TCC_STATUS) Pattern Buffer Valid */ 1077 #define TCC_STATUS_PATTBUFV (_U_(0x1) << TCC_STATUS_PATTBUFV_Pos) 1078 #define TCC_STATUS_PERBUFV_Pos 7 /**< \brief (TCC_STATUS) Period Buffer Valid */ 1079 #define TCC_STATUS_PERBUFV (_U_(0x1) << TCC_STATUS_PERBUFV_Pos) 1080 #define TCC_STATUS_FAULTAIN_Pos 8 /**< \brief (TCC_STATUS) Recoverable Fault A Input */ 1081 #define TCC_STATUS_FAULTAIN (_U_(0x1) << TCC_STATUS_FAULTAIN_Pos) 1082 #define TCC_STATUS_FAULTBIN_Pos 9 /**< \brief (TCC_STATUS) Recoverable Fault B Input */ 1083 #define TCC_STATUS_FAULTBIN (_U_(0x1) << TCC_STATUS_FAULTBIN_Pos) 1084 #define TCC_STATUS_FAULT0IN_Pos 10 /**< \brief (TCC_STATUS) Non-Recoverable Fault0 Input */ 1085 #define TCC_STATUS_FAULT0IN (_U_(0x1) << TCC_STATUS_FAULT0IN_Pos) 1086 #define TCC_STATUS_FAULT1IN_Pos 11 /**< \brief (TCC_STATUS) Non-Recoverable Fault1 Input */ 1087 #define TCC_STATUS_FAULT1IN (_U_(0x1) << TCC_STATUS_FAULT1IN_Pos) 1088 #define TCC_STATUS_FAULTA_Pos 12 /**< \brief (TCC_STATUS) Recoverable Fault A State */ 1089 #define TCC_STATUS_FAULTA (_U_(0x1) << TCC_STATUS_FAULTA_Pos) 1090 #define TCC_STATUS_FAULTB_Pos 13 /**< \brief (TCC_STATUS) Recoverable Fault B State */ 1091 #define TCC_STATUS_FAULTB (_U_(0x1) << TCC_STATUS_FAULTB_Pos) 1092 #define TCC_STATUS_FAULT0_Pos 14 /**< \brief (TCC_STATUS) Non-Recoverable Fault 0 State */ 1093 #define TCC_STATUS_FAULT0 (_U_(0x1) << TCC_STATUS_FAULT0_Pos) 1094 #define TCC_STATUS_FAULT1_Pos 15 /**< \brief (TCC_STATUS) Non-Recoverable Fault 1 State */ 1095 #define TCC_STATUS_FAULT1 (_U_(0x1) << TCC_STATUS_FAULT1_Pos) 1096 #define TCC_STATUS_CCBUFV0_Pos 16 /**< \brief (TCC_STATUS) Compare Channel 0 Buffer Valid */ 1097 #define TCC_STATUS_CCBUFV0 (_U_(1) << TCC_STATUS_CCBUFV0_Pos) 1098 #define TCC_STATUS_CCBUFV1_Pos 17 /**< \brief (TCC_STATUS) Compare Channel 1 Buffer Valid */ 1099 #define TCC_STATUS_CCBUFV1 (_U_(1) << TCC_STATUS_CCBUFV1_Pos) 1100 #define TCC_STATUS_CCBUFV2_Pos 18 /**< \brief (TCC_STATUS) Compare Channel 2 Buffer Valid */ 1101 #define TCC_STATUS_CCBUFV2 (_U_(1) << TCC_STATUS_CCBUFV2_Pos) 1102 #define TCC_STATUS_CCBUFV3_Pos 19 /**< \brief (TCC_STATUS) Compare Channel 3 Buffer Valid */ 1103 #define TCC_STATUS_CCBUFV3 (_U_(1) << TCC_STATUS_CCBUFV3_Pos) 1104 #define TCC_STATUS_CCBUFV_Pos 16 /**< \brief (TCC_STATUS) Compare Channel x Buffer Valid */ 1105 #define TCC_STATUS_CCBUFV_Msk (_U_(0xF) << TCC_STATUS_CCBUFV_Pos) 1106 #define TCC_STATUS_CCBUFV(value) (TCC_STATUS_CCBUFV_Msk & ((value) << TCC_STATUS_CCBUFV_Pos)) 1107 #define TCC_STATUS_CMP0_Pos 24 /**< \brief (TCC_STATUS) Compare Channel 0 Value */ 1108 #define TCC_STATUS_CMP0 (_U_(1) << TCC_STATUS_CMP0_Pos) 1109 #define TCC_STATUS_CMP1_Pos 25 /**< \brief (TCC_STATUS) Compare Channel 1 Value */ 1110 #define TCC_STATUS_CMP1 (_U_(1) << TCC_STATUS_CMP1_Pos) 1111 #define TCC_STATUS_CMP2_Pos 26 /**< \brief (TCC_STATUS) Compare Channel 2 Value */ 1112 #define TCC_STATUS_CMP2 (_U_(1) << TCC_STATUS_CMP2_Pos) 1113 #define TCC_STATUS_CMP3_Pos 27 /**< \brief (TCC_STATUS) Compare Channel 3 Value */ 1114 #define TCC_STATUS_CMP3 (_U_(1) << TCC_STATUS_CMP3_Pos) 1115 #define TCC_STATUS_CMP_Pos 24 /**< \brief (TCC_STATUS) Compare Channel x Value */ 1116 #define TCC_STATUS_CMP_Msk (_U_(0xF) << TCC_STATUS_CMP_Pos) 1117 #define TCC_STATUS_CMP(value) (TCC_STATUS_CMP_Msk & ((value) << TCC_STATUS_CMP_Pos)) 1118 #define TCC_STATUS_MASK _U_(0x0F0FFFBF) /**< \brief (TCC_STATUS) MASK Register */ 1119 1120 /* -------- TCC_COUNT : (TCC Offset: 0x34) (R/W 32) Count -------- */ 1121 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1122 typedef union { 1123 struct { // DITH4 mode 1124 uint32_t :4; /*!< bit: 0.. 3 Reserved */ 1125 uint32_t COUNT:20; /*!< bit: 4..23 Counter Value */ 1126 uint32_t :8; /*!< bit: 24..31 Reserved */ 1127 } DITH4; /*!< Structure used for DITH4 */ 1128 struct { // DITH5 mode 1129 uint32_t :5; /*!< bit: 0.. 4 Reserved */ 1130 uint32_t COUNT:19; /*!< bit: 5..23 Counter Value */ 1131 uint32_t :8; /*!< bit: 24..31 Reserved */ 1132 } DITH5; /*!< Structure used for DITH5 */ 1133 struct { // DITH6 mode 1134 uint32_t :6; /*!< bit: 0.. 5 Reserved */ 1135 uint32_t COUNT:18; /*!< bit: 6..23 Counter Value */ 1136 uint32_t :8; /*!< bit: 24..31 Reserved */ 1137 } DITH6; /*!< Structure used for DITH6 */ 1138 struct { 1139 uint32_t COUNT:24; /*!< bit: 0..23 Counter Value */ 1140 uint32_t :8; /*!< bit: 24..31 Reserved */ 1141 } bit; /*!< Structure used for bit access */ 1142 uint32_t reg; /*!< Type used for register access */ 1143 } TCC_COUNT_Type; 1144 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1145 1146 #define TCC_COUNT_OFFSET 0x34 /**< \brief (TCC_COUNT offset) Count */ 1147 #define TCC_COUNT_RESETVALUE _U_(0x00000000) /**< \brief (TCC_COUNT reset_value) Count */ 1148 1149 // DITH4 mode 1150 #define TCC_COUNT_DITH4_COUNT_Pos 4 /**< \brief (TCC_COUNT_DITH4) Counter Value */ 1151 #define TCC_COUNT_DITH4_COUNT_Msk (_U_(0xFFFFF) << TCC_COUNT_DITH4_COUNT_Pos) 1152 #define TCC_COUNT_DITH4_COUNT(value) (TCC_COUNT_DITH4_COUNT_Msk & ((value) << TCC_COUNT_DITH4_COUNT_Pos)) 1153 #define TCC_COUNT_DITH4_MASK _U_(0x00FFFFF0) /**< \brief (TCC_COUNT_DITH4) MASK Register */ 1154 1155 // DITH5 mode 1156 #define TCC_COUNT_DITH5_COUNT_Pos 5 /**< \brief (TCC_COUNT_DITH5) Counter Value */ 1157 #define TCC_COUNT_DITH5_COUNT_Msk (_U_(0x7FFFF) << TCC_COUNT_DITH5_COUNT_Pos) 1158 #define TCC_COUNT_DITH5_COUNT(value) (TCC_COUNT_DITH5_COUNT_Msk & ((value) << TCC_COUNT_DITH5_COUNT_Pos)) 1159 #define TCC_COUNT_DITH5_MASK _U_(0x00FFFFE0) /**< \brief (TCC_COUNT_DITH5) MASK Register */ 1160 1161 // DITH6 mode 1162 #define TCC_COUNT_DITH6_COUNT_Pos 6 /**< \brief (TCC_COUNT_DITH6) Counter Value */ 1163 #define TCC_COUNT_DITH6_COUNT_Msk (_U_(0x3FFFF) << TCC_COUNT_DITH6_COUNT_Pos) 1164 #define TCC_COUNT_DITH6_COUNT(value) (TCC_COUNT_DITH6_COUNT_Msk & ((value) << TCC_COUNT_DITH6_COUNT_Pos)) 1165 #define TCC_COUNT_DITH6_MASK _U_(0x00FFFFC0) /**< \brief (TCC_COUNT_DITH6) MASK Register */ 1166 1167 #define TCC_COUNT_COUNT_Pos 0 /**< \brief (TCC_COUNT) Counter Value */ 1168 #define TCC_COUNT_COUNT_Msk (_U_(0xFFFFFF) << TCC_COUNT_COUNT_Pos) 1169 #define TCC_COUNT_COUNT(value) (TCC_COUNT_COUNT_Msk & ((value) << TCC_COUNT_COUNT_Pos)) 1170 #define TCC_COUNT_MASK _U_(0x00FFFFFF) /**< \brief (TCC_COUNT) MASK Register */ 1171 1172 /* -------- TCC_PATT : (TCC Offset: 0x38) (R/W 16) Pattern -------- */ 1173 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1174 typedef union { 1175 struct { 1176 uint16_t PGE0:1; /*!< bit: 0 Pattern Generator 0 Output Enable */ 1177 uint16_t PGE1:1; /*!< bit: 1 Pattern Generator 1 Output Enable */ 1178 uint16_t PGE2:1; /*!< bit: 2 Pattern Generator 2 Output Enable */ 1179 uint16_t PGE3:1; /*!< bit: 3 Pattern Generator 3 Output Enable */ 1180 uint16_t PGE4:1; /*!< bit: 4 Pattern Generator 4 Output Enable */ 1181 uint16_t PGE5:1; /*!< bit: 5 Pattern Generator 5 Output Enable */ 1182 uint16_t PGE6:1; /*!< bit: 6 Pattern Generator 6 Output Enable */ 1183 uint16_t PGE7:1; /*!< bit: 7 Pattern Generator 7 Output Enable */ 1184 uint16_t PGV0:1; /*!< bit: 8 Pattern Generator 0 Output Value */ 1185 uint16_t PGV1:1; /*!< bit: 9 Pattern Generator 1 Output Value */ 1186 uint16_t PGV2:1; /*!< bit: 10 Pattern Generator 2 Output Value */ 1187 uint16_t PGV3:1; /*!< bit: 11 Pattern Generator 3 Output Value */ 1188 uint16_t PGV4:1; /*!< bit: 12 Pattern Generator 4 Output Value */ 1189 uint16_t PGV5:1; /*!< bit: 13 Pattern Generator 5 Output Value */ 1190 uint16_t PGV6:1; /*!< bit: 14 Pattern Generator 6 Output Value */ 1191 uint16_t PGV7:1; /*!< bit: 15 Pattern Generator 7 Output Value */ 1192 } bit; /*!< Structure used for bit access */ 1193 struct { 1194 uint16_t PGE:8; /*!< bit: 0.. 7 Pattern Generator x Output Enable */ 1195 uint16_t PGV:8; /*!< bit: 8..15 Pattern Generator x Output Value */ 1196 } vec; /*!< Structure used for vec access */ 1197 uint16_t reg; /*!< Type used for register access */ 1198 } TCC_PATT_Type; 1199 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1200 1201 #define TCC_PATT_OFFSET 0x38 /**< \brief (TCC_PATT offset) Pattern */ 1202 #define TCC_PATT_RESETVALUE _U_(0x0000) /**< \brief (TCC_PATT reset_value) Pattern */ 1203 1204 #define TCC_PATT_PGE0_Pos 0 /**< \brief (TCC_PATT) Pattern Generator 0 Output Enable */ 1205 #define TCC_PATT_PGE0 (_U_(1) << TCC_PATT_PGE0_Pos) 1206 #define TCC_PATT_PGE1_Pos 1 /**< \brief (TCC_PATT) Pattern Generator 1 Output Enable */ 1207 #define TCC_PATT_PGE1 (_U_(1) << TCC_PATT_PGE1_Pos) 1208 #define TCC_PATT_PGE2_Pos 2 /**< \brief (TCC_PATT) Pattern Generator 2 Output Enable */ 1209 #define TCC_PATT_PGE2 (_U_(1) << TCC_PATT_PGE2_Pos) 1210 #define TCC_PATT_PGE3_Pos 3 /**< \brief (TCC_PATT) Pattern Generator 3 Output Enable */ 1211 #define TCC_PATT_PGE3 (_U_(1) << TCC_PATT_PGE3_Pos) 1212 #define TCC_PATT_PGE4_Pos 4 /**< \brief (TCC_PATT) Pattern Generator 4 Output Enable */ 1213 #define TCC_PATT_PGE4 (_U_(1) << TCC_PATT_PGE4_Pos) 1214 #define TCC_PATT_PGE5_Pos 5 /**< \brief (TCC_PATT) Pattern Generator 5 Output Enable */ 1215 #define TCC_PATT_PGE5 (_U_(1) << TCC_PATT_PGE5_Pos) 1216 #define TCC_PATT_PGE6_Pos 6 /**< \brief (TCC_PATT) Pattern Generator 6 Output Enable */ 1217 #define TCC_PATT_PGE6 (_U_(1) << TCC_PATT_PGE6_Pos) 1218 #define TCC_PATT_PGE7_Pos 7 /**< \brief (TCC_PATT) Pattern Generator 7 Output Enable */ 1219 #define TCC_PATT_PGE7 (_U_(1) << TCC_PATT_PGE7_Pos) 1220 #define TCC_PATT_PGE_Pos 0 /**< \brief (TCC_PATT) Pattern Generator x Output Enable */ 1221 #define TCC_PATT_PGE_Msk (_U_(0xFF) << TCC_PATT_PGE_Pos) 1222 #define TCC_PATT_PGE(value) (TCC_PATT_PGE_Msk & ((value) << TCC_PATT_PGE_Pos)) 1223 #define TCC_PATT_PGV0_Pos 8 /**< \brief (TCC_PATT) Pattern Generator 0 Output Value */ 1224 #define TCC_PATT_PGV0 (_U_(1) << TCC_PATT_PGV0_Pos) 1225 #define TCC_PATT_PGV1_Pos 9 /**< \brief (TCC_PATT) Pattern Generator 1 Output Value */ 1226 #define TCC_PATT_PGV1 (_U_(1) << TCC_PATT_PGV1_Pos) 1227 #define TCC_PATT_PGV2_Pos 10 /**< \brief (TCC_PATT) Pattern Generator 2 Output Value */ 1228 #define TCC_PATT_PGV2 (_U_(1) << TCC_PATT_PGV2_Pos) 1229 #define TCC_PATT_PGV3_Pos 11 /**< \brief (TCC_PATT) Pattern Generator 3 Output Value */ 1230 #define TCC_PATT_PGV3 (_U_(1) << TCC_PATT_PGV3_Pos) 1231 #define TCC_PATT_PGV4_Pos 12 /**< \brief (TCC_PATT) Pattern Generator 4 Output Value */ 1232 #define TCC_PATT_PGV4 (_U_(1) << TCC_PATT_PGV4_Pos) 1233 #define TCC_PATT_PGV5_Pos 13 /**< \brief (TCC_PATT) Pattern Generator 5 Output Value */ 1234 #define TCC_PATT_PGV5 (_U_(1) << TCC_PATT_PGV5_Pos) 1235 #define TCC_PATT_PGV6_Pos 14 /**< \brief (TCC_PATT) Pattern Generator 6 Output Value */ 1236 #define TCC_PATT_PGV6 (_U_(1) << TCC_PATT_PGV6_Pos) 1237 #define TCC_PATT_PGV7_Pos 15 /**< \brief (TCC_PATT) Pattern Generator 7 Output Value */ 1238 #define TCC_PATT_PGV7 (_U_(1) << TCC_PATT_PGV7_Pos) 1239 #define TCC_PATT_PGV_Pos 8 /**< \brief (TCC_PATT) Pattern Generator x Output Value */ 1240 #define TCC_PATT_PGV_Msk (_U_(0xFF) << TCC_PATT_PGV_Pos) 1241 #define TCC_PATT_PGV(value) (TCC_PATT_PGV_Msk & ((value) << TCC_PATT_PGV_Pos)) 1242 #define TCC_PATT_MASK _U_(0xFFFF) /**< \brief (TCC_PATT) MASK Register */ 1243 1244 /* -------- TCC_WAVE : (TCC Offset: 0x3C) (R/W 32) Waveform Control -------- */ 1245 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1246 typedef union { 1247 struct { 1248 uint32_t WAVEGEN:3; /*!< bit: 0.. 2 Waveform Generation */ 1249 uint32_t :1; /*!< bit: 3 Reserved */ 1250 uint32_t RAMP:2; /*!< bit: 4.. 5 Ramp Mode */ 1251 uint32_t :1; /*!< bit: 6 Reserved */ 1252 uint32_t CIPEREN:1; /*!< bit: 7 Circular period Enable */ 1253 uint32_t CICCEN0:1; /*!< bit: 8 Circular Channel 0 Enable */ 1254 uint32_t CICCEN1:1; /*!< bit: 9 Circular Channel 1 Enable */ 1255 uint32_t CICCEN2:1; /*!< bit: 10 Circular Channel 2 Enable */ 1256 uint32_t CICCEN3:1; /*!< bit: 11 Circular Channel 3 Enable */ 1257 uint32_t :4; /*!< bit: 12..15 Reserved */ 1258 uint32_t POL0:1; /*!< bit: 16 Channel 0 Polarity */ 1259 uint32_t POL1:1; /*!< bit: 17 Channel 1 Polarity */ 1260 uint32_t POL2:1; /*!< bit: 18 Channel 2 Polarity */ 1261 uint32_t POL3:1; /*!< bit: 19 Channel 3 Polarity */ 1262 uint32_t :4; /*!< bit: 20..23 Reserved */ 1263 uint32_t SWAP0:1; /*!< bit: 24 Swap DTI Output Pair 0 */ 1264 uint32_t SWAP1:1; /*!< bit: 25 Swap DTI Output Pair 1 */ 1265 uint32_t SWAP2:1; /*!< bit: 26 Swap DTI Output Pair 2 */ 1266 uint32_t SWAP3:1; /*!< bit: 27 Swap DTI Output Pair 3 */ 1267 uint32_t :4; /*!< bit: 28..31 Reserved */ 1268 } bit; /*!< Structure used for bit access */ 1269 struct { 1270 uint32_t :8; /*!< bit: 0.. 7 Reserved */ 1271 uint32_t CICCEN:4; /*!< bit: 8..11 Circular Channel x Enable */ 1272 uint32_t :4; /*!< bit: 12..15 Reserved */ 1273 uint32_t POL:4; /*!< bit: 16..19 Channel x Polarity */ 1274 uint32_t :4; /*!< bit: 20..23 Reserved */ 1275 uint32_t SWAP:4; /*!< bit: 24..27 Swap DTI Output Pair x */ 1276 uint32_t :4; /*!< bit: 28..31 Reserved */ 1277 } vec; /*!< Structure used for vec access */ 1278 uint32_t reg; /*!< Type used for register access */ 1279 } TCC_WAVE_Type; 1280 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1281 1282 #define TCC_WAVE_OFFSET 0x3C /**< \brief (TCC_WAVE offset) Waveform Control */ 1283 #define TCC_WAVE_RESETVALUE _U_(0x00000000) /**< \brief (TCC_WAVE reset_value) Waveform Control */ 1284 1285 #define TCC_WAVE_WAVEGEN_Pos 0 /**< \brief (TCC_WAVE) Waveform Generation */ 1286 #define TCC_WAVE_WAVEGEN_Msk (_U_(0x7) << TCC_WAVE_WAVEGEN_Pos) 1287 #define TCC_WAVE_WAVEGEN(value) (TCC_WAVE_WAVEGEN_Msk & ((value) << TCC_WAVE_WAVEGEN_Pos)) 1288 #define TCC_WAVE_WAVEGEN_NFRQ_Val _U_(0x0) /**< \brief (TCC_WAVE) Normal frequency */ 1289 #define TCC_WAVE_WAVEGEN_MFRQ_Val _U_(0x1) /**< \brief (TCC_WAVE) Match frequency */ 1290 #define TCC_WAVE_WAVEGEN_NPWM_Val _U_(0x2) /**< \brief (TCC_WAVE) Normal PWM */ 1291 #define TCC_WAVE_WAVEGEN_DSCRITICAL_Val _U_(0x4) /**< \brief (TCC_WAVE) Dual-slope critical */ 1292 #define TCC_WAVE_WAVEGEN_DSBOTTOM_Val _U_(0x5) /**< \brief (TCC_WAVE) Dual-slope with interrupt/event condition when COUNT reaches ZERO */ 1293 #define TCC_WAVE_WAVEGEN_DSBOTH_Val _U_(0x6) /**< \brief (TCC_WAVE) Dual-slope with interrupt/event condition when COUNT reaches ZERO or TOP */ 1294 #define TCC_WAVE_WAVEGEN_DSTOP_Val _U_(0x7) /**< \brief (TCC_WAVE) Dual-slope with interrupt/event condition when COUNT reaches TOP */ 1295 #define TCC_WAVE_WAVEGEN_NFRQ (TCC_WAVE_WAVEGEN_NFRQ_Val << TCC_WAVE_WAVEGEN_Pos) 1296 #define TCC_WAVE_WAVEGEN_MFRQ (TCC_WAVE_WAVEGEN_MFRQ_Val << TCC_WAVE_WAVEGEN_Pos) 1297 #define TCC_WAVE_WAVEGEN_NPWM (TCC_WAVE_WAVEGEN_NPWM_Val << TCC_WAVE_WAVEGEN_Pos) 1298 #define TCC_WAVE_WAVEGEN_DSCRITICAL (TCC_WAVE_WAVEGEN_DSCRITICAL_Val << TCC_WAVE_WAVEGEN_Pos) 1299 #define TCC_WAVE_WAVEGEN_DSBOTTOM (TCC_WAVE_WAVEGEN_DSBOTTOM_Val << TCC_WAVE_WAVEGEN_Pos) 1300 #define TCC_WAVE_WAVEGEN_DSBOTH (TCC_WAVE_WAVEGEN_DSBOTH_Val << TCC_WAVE_WAVEGEN_Pos) 1301 #define TCC_WAVE_WAVEGEN_DSTOP (TCC_WAVE_WAVEGEN_DSTOP_Val << TCC_WAVE_WAVEGEN_Pos) 1302 #define TCC_WAVE_RAMP_Pos 4 /**< \brief (TCC_WAVE) Ramp Mode */ 1303 #define TCC_WAVE_RAMP_Msk (_U_(0x3) << TCC_WAVE_RAMP_Pos) 1304 #define TCC_WAVE_RAMP(value) (TCC_WAVE_RAMP_Msk & ((value) << TCC_WAVE_RAMP_Pos)) 1305 #define TCC_WAVE_RAMP_RAMP1_Val _U_(0x0) /**< \brief (TCC_WAVE) RAMP1 operation */ 1306 #define TCC_WAVE_RAMP_RAMP2A_Val _U_(0x1) /**< \brief (TCC_WAVE) Alternative RAMP2 operation */ 1307 #define TCC_WAVE_RAMP_RAMP2_Val _U_(0x2) /**< \brief (TCC_WAVE) RAMP2 operation */ 1308 #define TCC_WAVE_RAMP_RAMP2C_Val _U_(0x3) /**< \brief (TCC_WAVE) Critical RAMP2 operation */ 1309 #define TCC_WAVE_RAMP_RAMP1 (TCC_WAVE_RAMP_RAMP1_Val << TCC_WAVE_RAMP_Pos) 1310 #define TCC_WAVE_RAMP_RAMP2A (TCC_WAVE_RAMP_RAMP2A_Val << TCC_WAVE_RAMP_Pos) 1311 #define TCC_WAVE_RAMP_RAMP2 (TCC_WAVE_RAMP_RAMP2_Val << TCC_WAVE_RAMP_Pos) 1312 #define TCC_WAVE_RAMP_RAMP2C (TCC_WAVE_RAMP_RAMP2C_Val << TCC_WAVE_RAMP_Pos) 1313 #define TCC_WAVE_CIPEREN_Pos 7 /**< \brief (TCC_WAVE) Circular period Enable */ 1314 #define TCC_WAVE_CIPEREN (_U_(0x1) << TCC_WAVE_CIPEREN_Pos) 1315 #define TCC_WAVE_CICCEN0_Pos 8 /**< \brief (TCC_WAVE) Circular Channel 0 Enable */ 1316 #define TCC_WAVE_CICCEN0 (_U_(1) << TCC_WAVE_CICCEN0_Pos) 1317 #define TCC_WAVE_CICCEN1_Pos 9 /**< \brief (TCC_WAVE) Circular Channel 1 Enable */ 1318 #define TCC_WAVE_CICCEN1 (_U_(1) << TCC_WAVE_CICCEN1_Pos) 1319 #define TCC_WAVE_CICCEN2_Pos 10 /**< \brief (TCC_WAVE) Circular Channel 2 Enable */ 1320 #define TCC_WAVE_CICCEN2 (_U_(1) << TCC_WAVE_CICCEN2_Pos) 1321 #define TCC_WAVE_CICCEN3_Pos 11 /**< \brief (TCC_WAVE) Circular Channel 3 Enable */ 1322 #define TCC_WAVE_CICCEN3 (_U_(1) << TCC_WAVE_CICCEN3_Pos) 1323 #define TCC_WAVE_CICCEN_Pos 8 /**< \brief (TCC_WAVE) Circular Channel x Enable */ 1324 #define TCC_WAVE_CICCEN_Msk (_U_(0xF) << TCC_WAVE_CICCEN_Pos) 1325 #define TCC_WAVE_CICCEN(value) (TCC_WAVE_CICCEN_Msk & ((value) << TCC_WAVE_CICCEN_Pos)) 1326 #define TCC_WAVE_POL0_Pos 16 /**< \brief (TCC_WAVE) Channel 0 Polarity */ 1327 #define TCC_WAVE_POL0 (_U_(1) << TCC_WAVE_POL0_Pos) 1328 #define TCC_WAVE_POL1_Pos 17 /**< \brief (TCC_WAVE) Channel 1 Polarity */ 1329 #define TCC_WAVE_POL1 (_U_(1) << TCC_WAVE_POL1_Pos) 1330 #define TCC_WAVE_POL2_Pos 18 /**< \brief (TCC_WAVE) Channel 2 Polarity */ 1331 #define TCC_WAVE_POL2 (_U_(1) << TCC_WAVE_POL2_Pos) 1332 #define TCC_WAVE_POL3_Pos 19 /**< \brief (TCC_WAVE) Channel 3 Polarity */ 1333 #define TCC_WAVE_POL3 (_U_(1) << TCC_WAVE_POL3_Pos) 1334 #define TCC_WAVE_POL_Pos 16 /**< \brief (TCC_WAVE) Channel x Polarity */ 1335 #define TCC_WAVE_POL_Msk (_U_(0xF) << TCC_WAVE_POL_Pos) 1336 #define TCC_WAVE_POL(value) (TCC_WAVE_POL_Msk & ((value) << TCC_WAVE_POL_Pos)) 1337 #define TCC_WAVE_SWAP0_Pos 24 /**< \brief (TCC_WAVE) Swap DTI Output Pair 0 */ 1338 #define TCC_WAVE_SWAP0 (_U_(1) << TCC_WAVE_SWAP0_Pos) 1339 #define TCC_WAVE_SWAP1_Pos 25 /**< \brief (TCC_WAVE) Swap DTI Output Pair 1 */ 1340 #define TCC_WAVE_SWAP1 (_U_(1) << TCC_WAVE_SWAP1_Pos) 1341 #define TCC_WAVE_SWAP2_Pos 26 /**< \brief (TCC_WAVE) Swap DTI Output Pair 2 */ 1342 #define TCC_WAVE_SWAP2 (_U_(1) << TCC_WAVE_SWAP2_Pos) 1343 #define TCC_WAVE_SWAP3_Pos 27 /**< \brief (TCC_WAVE) Swap DTI Output Pair 3 */ 1344 #define TCC_WAVE_SWAP3 (_U_(1) << TCC_WAVE_SWAP3_Pos) 1345 #define TCC_WAVE_SWAP_Pos 24 /**< \brief (TCC_WAVE) Swap DTI Output Pair x */ 1346 #define TCC_WAVE_SWAP_Msk (_U_(0xF) << TCC_WAVE_SWAP_Pos) 1347 #define TCC_WAVE_SWAP(value) (TCC_WAVE_SWAP_Msk & ((value) << TCC_WAVE_SWAP_Pos)) 1348 #define TCC_WAVE_MASK _U_(0x0F0F0FB7) /**< \brief (TCC_WAVE) MASK Register */ 1349 1350 /* -------- TCC_PER : (TCC Offset: 0x40) (R/W 32) Period -------- */ 1351 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1352 typedef union { 1353 struct { // DITH4 mode 1354 uint32_t DITHER:4; /*!< bit: 0.. 3 Dithering Cycle Number */ 1355 uint32_t PER:20; /*!< bit: 4..23 Period Value */ 1356 uint32_t :8; /*!< bit: 24..31 Reserved */ 1357 } DITH4; /*!< Structure used for DITH4 */ 1358 struct { // DITH5 mode 1359 uint32_t DITHER:5; /*!< bit: 0.. 4 Dithering Cycle Number */ 1360 uint32_t PER:19; /*!< bit: 5..23 Period Value */ 1361 uint32_t :8; /*!< bit: 24..31 Reserved */ 1362 } DITH5; /*!< Structure used for DITH5 */ 1363 struct { // DITH6 mode 1364 uint32_t DITHER:6; /*!< bit: 0.. 5 Dithering Cycle Number */ 1365 uint32_t PER:18; /*!< bit: 6..23 Period Value */ 1366 uint32_t :8; /*!< bit: 24..31 Reserved */ 1367 } DITH6; /*!< Structure used for DITH6 */ 1368 struct { 1369 uint32_t PER:24; /*!< bit: 0..23 Period Value */ 1370 uint32_t :8; /*!< bit: 24..31 Reserved */ 1371 } bit; /*!< Structure used for bit access */ 1372 uint32_t reg; /*!< Type used for register access */ 1373 } TCC_PER_Type; 1374 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1375 1376 #define TCC_PER_OFFSET 0x40 /**< \brief (TCC_PER offset) Period */ 1377 #define TCC_PER_RESETVALUE _U_(0xFFFFFFFF) /**< \brief (TCC_PER reset_value) Period */ 1378 1379 // DITH4 mode 1380 #define TCC_PER_DITH4_DITHER_Pos 0 /**< \brief (TCC_PER_DITH4) Dithering Cycle Number */ 1381 #define TCC_PER_DITH4_DITHER_Msk (_U_(0xF) << TCC_PER_DITH4_DITHER_Pos) 1382 #define TCC_PER_DITH4_DITHER(value) (TCC_PER_DITH4_DITHER_Msk & ((value) << TCC_PER_DITH4_DITHER_Pos)) 1383 #define TCC_PER_DITH4_PER_Pos 4 /**< \brief (TCC_PER_DITH4) Period Value */ 1384 #define TCC_PER_DITH4_PER_Msk (_U_(0xFFFFF) << TCC_PER_DITH4_PER_Pos) 1385 #define TCC_PER_DITH4_PER(value) (TCC_PER_DITH4_PER_Msk & ((value) << TCC_PER_DITH4_PER_Pos)) 1386 #define TCC_PER_DITH4_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PER_DITH4) MASK Register */ 1387 1388 // DITH5 mode 1389 #define TCC_PER_DITH5_DITHER_Pos 0 /**< \brief (TCC_PER_DITH5) Dithering Cycle Number */ 1390 #define TCC_PER_DITH5_DITHER_Msk (_U_(0x1F) << TCC_PER_DITH5_DITHER_Pos) 1391 #define TCC_PER_DITH5_DITHER(value) (TCC_PER_DITH5_DITHER_Msk & ((value) << TCC_PER_DITH5_DITHER_Pos)) 1392 #define TCC_PER_DITH5_PER_Pos 5 /**< \brief (TCC_PER_DITH5) Period Value */ 1393 #define TCC_PER_DITH5_PER_Msk (_U_(0x7FFFF) << TCC_PER_DITH5_PER_Pos) 1394 #define TCC_PER_DITH5_PER(value) (TCC_PER_DITH5_PER_Msk & ((value) << TCC_PER_DITH5_PER_Pos)) 1395 #define TCC_PER_DITH5_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PER_DITH5) MASK Register */ 1396 1397 // DITH6 mode 1398 #define TCC_PER_DITH6_DITHER_Pos 0 /**< \brief (TCC_PER_DITH6) Dithering Cycle Number */ 1399 #define TCC_PER_DITH6_DITHER_Msk (_U_(0x3F) << TCC_PER_DITH6_DITHER_Pos) 1400 #define TCC_PER_DITH6_DITHER(value) (TCC_PER_DITH6_DITHER_Msk & ((value) << TCC_PER_DITH6_DITHER_Pos)) 1401 #define TCC_PER_DITH6_PER_Pos 6 /**< \brief (TCC_PER_DITH6) Period Value */ 1402 #define TCC_PER_DITH6_PER_Msk (_U_(0x3FFFF) << TCC_PER_DITH6_PER_Pos) 1403 #define TCC_PER_DITH6_PER(value) (TCC_PER_DITH6_PER_Msk & ((value) << TCC_PER_DITH6_PER_Pos)) 1404 #define TCC_PER_DITH6_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PER_DITH6) MASK Register */ 1405 1406 #define TCC_PER_PER_Pos 0 /**< \brief (TCC_PER) Period Value */ 1407 #define TCC_PER_PER_Msk (_U_(0xFFFFFF) << TCC_PER_PER_Pos) 1408 #define TCC_PER_PER(value) (TCC_PER_PER_Msk & ((value) << TCC_PER_PER_Pos)) 1409 #define TCC_PER_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PER) MASK Register */ 1410 1411 /* -------- TCC_CC : (TCC Offset: 0x44) (R/W 32) Compare and Capture -------- */ 1412 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1413 typedef union { 1414 struct { // DITH4 mode 1415 uint32_t DITHER:4; /*!< bit: 0.. 3 Dithering Cycle Number */ 1416 uint32_t CC:20; /*!< bit: 4..23 Channel Compare/Capture Value */ 1417 uint32_t :8; /*!< bit: 24..31 Reserved */ 1418 } DITH4; /*!< Structure used for DITH4 */ 1419 struct { // DITH5 mode 1420 uint32_t DITHER:5; /*!< bit: 0.. 4 Dithering Cycle Number */ 1421 uint32_t CC:19; /*!< bit: 5..23 Channel Compare/Capture Value */ 1422 uint32_t :8; /*!< bit: 24..31 Reserved */ 1423 } DITH5; /*!< Structure used for DITH5 */ 1424 struct { // DITH6 mode 1425 uint32_t DITHER:6; /*!< bit: 0.. 5 Dithering Cycle Number */ 1426 uint32_t CC:18; /*!< bit: 6..23 Channel Compare/Capture Value */ 1427 uint32_t :8; /*!< bit: 24..31 Reserved */ 1428 } DITH6; /*!< Structure used for DITH6 */ 1429 struct { 1430 uint32_t CC:24; /*!< bit: 0..23 Channel Compare/Capture Value */ 1431 uint32_t :8; /*!< bit: 24..31 Reserved */ 1432 } bit; /*!< Structure used for bit access */ 1433 uint32_t reg; /*!< Type used for register access */ 1434 } TCC_CC_Type; 1435 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1436 1437 #define TCC_CC_OFFSET 0x44 /**< \brief (TCC_CC offset) Compare and Capture */ 1438 #define TCC_CC_RESETVALUE _U_(0x00000000) /**< \brief (TCC_CC reset_value) Compare and Capture */ 1439 1440 // DITH4 mode 1441 #define TCC_CC_DITH4_DITHER_Pos 0 /**< \brief (TCC_CC_DITH4) Dithering Cycle Number */ 1442 #define TCC_CC_DITH4_DITHER_Msk (_U_(0xF) << TCC_CC_DITH4_DITHER_Pos) 1443 #define TCC_CC_DITH4_DITHER(value) (TCC_CC_DITH4_DITHER_Msk & ((value) << TCC_CC_DITH4_DITHER_Pos)) 1444 #define TCC_CC_DITH4_CC_Pos 4 /**< \brief (TCC_CC_DITH4) Channel Compare/Capture Value */ 1445 #define TCC_CC_DITH4_CC_Msk (_U_(0xFFFFF) << TCC_CC_DITH4_CC_Pos) 1446 #define TCC_CC_DITH4_CC(value) (TCC_CC_DITH4_CC_Msk & ((value) << TCC_CC_DITH4_CC_Pos)) 1447 #define TCC_CC_DITH4_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CC_DITH4) MASK Register */ 1448 1449 // DITH5 mode 1450 #define TCC_CC_DITH5_DITHER_Pos 0 /**< \brief (TCC_CC_DITH5) Dithering Cycle Number */ 1451 #define TCC_CC_DITH5_DITHER_Msk (_U_(0x1F) << TCC_CC_DITH5_DITHER_Pos) 1452 #define TCC_CC_DITH5_DITHER(value) (TCC_CC_DITH5_DITHER_Msk & ((value) << TCC_CC_DITH5_DITHER_Pos)) 1453 #define TCC_CC_DITH5_CC_Pos 5 /**< \brief (TCC_CC_DITH5) Channel Compare/Capture Value */ 1454 #define TCC_CC_DITH5_CC_Msk (_U_(0x7FFFF) << TCC_CC_DITH5_CC_Pos) 1455 #define TCC_CC_DITH5_CC(value) (TCC_CC_DITH5_CC_Msk & ((value) << TCC_CC_DITH5_CC_Pos)) 1456 #define TCC_CC_DITH5_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CC_DITH5) MASK Register */ 1457 1458 // DITH6 mode 1459 #define TCC_CC_DITH6_DITHER_Pos 0 /**< \brief (TCC_CC_DITH6) Dithering Cycle Number */ 1460 #define TCC_CC_DITH6_DITHER_Msk (_U_(0x3F) << TCC_CC_DITH6_DITHER_Pos) 1461 #define TCC_CC_DITH6_DITHER(value) (TCC_CC_DITH6_DITHER_Msk & ((value) << TCC_CC_DITH6_DITHER_Pos)) 1462 #define TCC_CC_DITH6_CC_Pos 6 /**< \brief (TCC_CC_DITH6) Channel Compare/Capture Value */ 1463 #define TCC_CC_DITH6_CC_Msk (_U_(0x3FFFF) << TCC_CC_DITH6_CC_Pos) 1464 #define TCC_CC_DITH6_CC(value) (TCC_CC_DITH6_CC_Msk & ((value) << TCC_CC_DITH6_CC_Pos)) 1465 #define TCC_CC_DITH6_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CC_DITH6) MASK Register */ 1466 1467 #define TCC_CC_CC_Pos 0 /**< \brief (TCC_CC) Channel Compare/Capture Value */ 1468 #define TCC_CC_CC_Msk (_U_(0xFFFFFF) << TCC_CC_CC_Pos) 1469 #define TCC_CC_CC(value) (TCC_CC_CC_Msk & ((value) << TCC_CC_CC_Pos)) 1470 #define TCC_CC_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CC) MASK Register */ 1471 1472 /* -------- TCC_PATTBUF : (TCC Offset: 0x64) (R/W 16) Pattern Buffer -------- */ 1473 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1474 typedef union { 1475 struct { 1476 uint16_t PGEB0:1; /*!< bit: 0 Pattern Generator 0 Output Enable Buffer */ 1477 uint16_t PGEB1:1; /*!< bit: 1 Pattern Generator 1 Output Enable Buffer */ 1478 uint16_t PGEB2:1; /*!< bit: 2 Pattern Generator 2 Output Enable Buffer */ 1479 uint16_t PGEB3:1; /*!< bit: 3 Pattern Generator 3 Output Enable Buffer */ 1480 uint16_t PGEB4:1; /*!< bit: 4 Pattern Generator 4 Output Enable Buffer */ 1481 uint16_t PGEB5:1; /*!< bit: 5 Pattern Generator 5 Output Enable Buffer */ 1482 uint16_t PGEB6:1; /*!< bit: 6 Pattern Generator 6 Output Enable Buffer */ 1483 uint16_t PGEB7:1; /*!< bit: 7 Pattern Generator 7 Output Enable Buffer */ 1484 uint16_t PGVB0:1; /*!< bit: 8 Pattern Generator 0 Output Enable */ 1485 uint16_t PGVB1:1; /*!< bit: 9 Pattern Generator 1 Output Enable */ 1486 uint16_t PGVB2:1; /*!< bit: 10 Pattern Generator 2 Output Enable */ 1487 uint16_t PGVB3:1; /*!< bit: 11 Pattern Generator 3 Output Enable */ 1488 uint16_t PGVB4:1; /*!< bit: 12 Pattern Generator 4 Output Enable */ 1489 uint16_t PGVB5:1; /*!< bit: 13 Pattern Generator 5 Output Enable */ 1490 uint16_t PGVB6:1; /*!< bit: 14 Pattern Generator 6 Output Enable */ 1491 uint16_t PGVB7:1; /*!< bit: 15 Pattern Generator 7 Output Enable */ 1492 } bit; /*!< Structure used for bit access */ 1493 struct { 1494 uint16_t PGEB:8; /*!< bit: 0.. 7 Pattern Generator x Output Enable Buffer */ 1495 uint16_t PGVB:8; /*!< bit: 8..15 Pattern Generator x Output Enable */ 1496 } vec; /*!< Structure used for vec access */ 1497 uint16_t reg; /*!< Type used for register access */ 1498 } TCC_PATTBUF_Type; 1499 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1500 1501 #define TCC_PATTBUF_OFFSET 0x64 /**< \brief (TCC_PATTBUF offset) Pattern Buffer */ 1502 #define TCC_PATTBUF_RESETVALUE _U_(0x0000) /**< \brief (TCC_PATTBUF reset_value) Pattern Buffer */ 1503 1504 #define TCC_PATTBUF_PGEB0_Pos 0 /**< \brief (TCC_PATTBUF) Pattern Generator 0 Output Enable Buffer */ 1505 #define TCC_PATTBUF_PGEB0 (_U_(1) << TCC_PATTBUF_PGEB0_Pos) 1506 #define TCC_PATTBUF_PGEB1_Pos 1 /**< \brief (TCC_PATTBUF) Pattern Generator 1 Output Enable Buffer */ 1507 #define TCC_PATTBUF_PGEB1 (_U_(1) << TCC_PATTBUF_PGEB1_Pos) 1508 #define TCC_PATTBUF_PGEB2_Pos 2 /**< \brief (TCC_PATTBUF) Pattern Generator 2 Output Enable Buffer */ 1509 #define TCC_PATTBUF_PGEB2 (_U_(1) << TCC_PATTBUF_PGEB2_Pos) 1510 #define TCC_PATTBUF_PGEB3_Pos 3 /**< \brief (TCC_PATTBUF) Pattern Generator 3 Output Enable Buffer */ 1511 #define TCC_PATTBUF_PGEB3 (_U_(1) << TCC_PATTBUF_PGEB3_Pos) 1512 #define TCC_PATTBUF_PGEB4_Pos 4 /**< \brief (TCC_PATTBUF) Pattern Generator 4 Output Enable Buffer */ 1513 #define TCC_PATTBUF_PGEB4 (_U_(1) << TCC_PATTBUF_PGEB4_Pos) 1514 #define TCC_PATTBUF_PGEB5_Pos 5 /**< \brief (TCC_PATTBUF) Pattern Generator 5 Output Enable Buffer */ 1515 #define TCC_PATTBUF_PGEB5 (_U_(1) << TCC_PATTBUF_PGEB5_Pos) 1516 #define TCC_PATTBUF_PGEB6_Pos 6 /**< \brief (TCC_PATTBUF) Pattern Generator 6 Output Enable Buffer */ 1517 #define TCC_PATTBUF_PGEB6 (_U_(1) << TCC_PATTBUF_PGEB6_Pos) 1518 #define TCC_PATTBUF_PGEB7_Pos 7 /**< \brief (TCC_PATTBUF) Pattern Generator 7 Output Enable Buffer */ 1519 #define TCC_PATTBUF_PGEB7 (_U_(1) << TCC_PATTBUF_PGEB7_Pos) 1520 #define TCC_PATTBUF_PGEB_Pos 0 /**< \brief (TCC_PATTBUF) Pattern Generator x Output Enable Buffer */ 1521 #define TCC_PATTBUF_PGEB_Msk (_U_(0xFF) << TCC_PATTBUF_PGEB_Pos) 1522 #define TCC_PATTBUF_PGEB(value) (TCC_PATTBUF_PGEB_Msk & ((value) << TCC_PATTBUF_PGEB_Pos)) 1523 #define TCC_PATTBUF_PGVB0_Pos 8 /**< \brief (TCC_PATTBUF) Pattern Generator 0 Output Enable */ 1524 #define TCC_PATTBUF_PGVB0 (_U_(1) << TCC_PATTBUF_PGVB0_Pos) 1525 #define TCC_PATTBUF_PGVB1_Pos 9 /**< \brief (TCC_PATTBUF) Pattern Generator 1 Output Enable */ 1526 #define TCC_PATTBUF_PGVB1 (_U_(1) << TCC_PATTBUF_PGVB1_Pos) 1527 #define TCC_PATTBUF_PGVB2_Pos 10 /**< \brief (TCC_PATTBUF) Pattern Generator 2 Output Enable */ 1528 #define TCC_PATTBUF_PGVB2 (_U_(1) << TCC_PATTBUF_PGVB2_Pos) 1529 #define TCC_PATTBUF_PGVB3_Pos 11 /**< \brief (TCC_PATTBUF) Pattern Generator 3 Output Enable */ 1530 #define TCC_PATTBUF_PGVB3 (_U_(1) << TCC_PATTBUF_PGVB3_Pos) 1531 #define TCC_PATTBUF_PGVB4_Pos 12 /**< \brief (TCC_PATTBUF) Pattern Generator 4 Output Enable */ 1532 #define TCC_PATTBUF_PGVB4 (_U_(1) << TCC_PATTBUF_PGVB4_Pos) 1533 #define TCC_PATTBUF_PGVB5_Pos 13 /**< \brief (TCC_PATTBUF) Pattern Generator 5 Output Enable */ 1534 #define TCC_PATTBUF_PGVB5 (_U_(1) << TCC_PATTBUF_PGVB5_Pos) 1535 #define TCC_PATTBUF_PGVB6_Pos 14 /**< \brief (TCC_PATTBUF) Pattern Generator 6 Output Enable */ 1536 #define TCC_PATTBUF_PGVB6 (_U_(1) << TCC_PATTBUF_PGVB6_Pos) 1537 #define TCC_PATTBUF_PGVB7_Pos 15 /**< \brief (TCC_PATTBUF) Pattern Generator 7 Output Enable */ 1538 #define TCC_PATTBUF_PGVB7 (_U_(1) << TCC_PATTBUF_PGVB7_Pos) 1539 #define TCC_PATTBUF_PGVB_Pos 8 /**< \brief (TCC_PATTBUF) Pattern Generator x Output Enable */ 1540 #define TCC_PATTBUF_PGVB_Msk (_U_(0xFF) << TCC_PATTBUF_PGVB_Pos) 1541 #define TCC_PATTBUF_PGVB(value) (TCC_PATTBUF_PGVB_Msk & ((value) << TCC_PATTBUF_PGVB_Pos)) 1542 #define TCC_PATTBUF_MASK _U_(0xFFFF) /**< \brief (TCC_PATTBUF) MASK Register */ 1543 1544 /* -------- TCC_PERBUF : (TCC Offset: 0x6C) (R/W 32) Period Buffer -------- */ 1545 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1546 typedef union { 1547 struct { // DITH4 mode 1548 uint32_t DITHERBUF:4; /*!< bit: 0.. 3 Dithering Buffer Cycle Number */ 1549 uint32_t PERBUF:20; /*!< bit: 4..23 Period Buffer Value */ 1550 uint32_t :8; /*!< bit: 24..31 Reserved */ 1551 } DITH4; /*!< Structure used for DITH4 */ 1552 struct { // DITH5 mode 1553 uint32_t DITHERBUF:5; /*!< bit: 0.. 4 Dithering Buffer Cycle Number */ 1554 uint32_t PERBUF:19; /*!< bit: 5..23 Period Buffer Value */ 1555 uint32_t :8; /*!< bit: 24..31 Reserved */ 1556 } DITH5; /*!< Structure used for DITH5 */ 1557 struct { // DITH6 mode 1558 uint32_t DITHERBUF:6; /*!< bit: 0.. 5 Dithering Buffer Cycle Number */ 1559 uint32_t PERBUF:18; /*!< bit: 6..23 Period Buffer Value */ 1560 uint32_t :8; /*!< bit: 24..31 Reserved */ 1561 } DITH6; /*!< Structure used for DITH6 */ 1562 struct { 1563 uint32_t PERBUF:24; /*!< bit: 0..23 Period Buffer Value */ 1564 uint32_t :8; /*!< bit: 24..31 Reserved */ 1565 } bit; /*!< Structure used for bit access */ 1566 uint32_t reg; /*!< Type used for register access */ 1567 } TCC_PERBUF_Type; 1568 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1569 1570 #define TCC_PERBUF_OFFSET 0x6C /**< \brief (TCC_PERBUF offset) Period Buffer */ 1571 #define TCC_PERBUF_RESETVALUE _U_(0xFFFFFFFF) /**< \brief (TCC_PERBUF reset_value) Period Buffer */ 1572 1573 // DITH4 mode 1574 #define TCC_PERBUF_DITH4_DITHERBUF_Pos 0 /**< \brief (TCC_PERBUF_DITH4) Dithering Buffer Cycle Number */ 1575 #define TCC_PERBUF_DITH4_DITHERBUF_Msk (_U_(0xF) << TCC_PERBUF_DITH4_DITHERBUF_Pos) 1576 #define TCC_PERBUF_DITH4_DITHERBUF(value) (TCC_PERBUF_DITH4_DITHERBUF_Msk & ((value) << TCC_PERBUF_DITH4_DITHERBUF_Pos)) 1577 #define TCC_PERBUF_DITH4_PERBUF_Pos 4 /**< \brief (TCC_PERBUF_DITH4) Period Buffer Value */ 1578 #define TCC_PERBUF_DITH4_PERBUF_Msk (_U_(0xFFFFF) << TCC_PERBUF_DITH4_PERBUF_Pos) 1579 #define TCC_PERBUF_DITH4_PERBUF(value) (TCC_PERBUF_DITH4_PERBUF_Msk & ((value) << TCC_PERBUF_DITH4_PERBUF_Pos)) 1580 #define TCC_PERBUF_DITH4_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PERBUF_DITH4) MASK Register */ 1581 1582 // DITH5 mode 1583 #define TCC_PERBUF_DITH5_DITHERBUF_Pos 0 /**< \brief (TCC_PERBUF_DITH5) Dithering Buffer Cycle Number */ 1584 #define TCC_PERBUF_DITH5_DITHERBUF_Msk (_U_(0x1F) << TCC_PERBUF_DITH5_DITHERBUF_Pos) 1585 #define TCC_PERBUF_DITH5_DITHERBUF(value) (TCC_PERBUF_DITH5_DITHERBUF_Msk & ((value) << TCC_PERBUF_DITH5_DITHERBUF_Pos)) 1586 #define TCC_PERBUF_DITH5_PERBUF_Pos 5 /**< \brief (TCC_PERBUF_DITH5) Period Buffer Value */ 1587 #define TCC_PERBUF_DITH5_PERBUF_Msk (_U_(0x7FFFF) << TCC_PERBUF_DITH5_PERBUF_Pos) 1588 #define TCC_PERBUF_DITH5_PERBUF(value) (TCC_PERBUF_DITH5_PERBUF_Msk & ((value) << TCC_PERBUF_DITH5_PERBUF_Pos)) 1589 #define TCC_PERBUF_DITH5_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PERBUF_DITH5) MASK Register */ 1590 1591 // DITH6 mode 1592 #define TCC_PERBUF_DITH6_DITHERBUF_Pos 0 /**< \brief (TCC_PERBUF_DITH6) Dithering Buffer Cycle Number */ 1593 #define TCC_PERBUF_DITH6_DITHERBUF_Msk (_U_(0x3F) << TCC_PERBUF_DITH6_DITHERBUF_Pos) 1594 #define TCC_PERBUF_DITH6_DITHERBUF(value) (TCC_PERBUF_DITH6_DITHERBUF_Msk & ((value) << TCC_PERBUF_DITH6_DITHERBUF_Pos)) 1595 #define TCC_PERBUF_DITH6_PERBUF_Pos 6 /**< \brief (TCC_PERBUF_DITH6) Period Buffer Value */ 1596 #define TCC_PERBUF_DITH6_PERBUF_Msk (_U_(0x3FFFF) << TCC_PERBUF_DITH6_PERBUF_Pos) 1597 #define TCC_PERBUF_DITH6_PERBUF(value) (TCC_PERBUF_DITH6_PERBUF_Msk & ((value) << TCC_PERBUF_DITH6_PERBUF_Pos)) 1598 #define TCC_PERBUF_DITH6_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PERBUF_DITH6) MASK Register */ 1599 1600 #define TCC_PERBUF_PERBUF_Pos 0 /**< \brief (TCC_PERBUF) Period Buffer Value */ 1601 #define TCC_PERBUF_PERBUF_Msk (_U_(0xFFFFFF) << TCC_PERBUF_PERBUF_Pos) 1602 #define TCC_PERBUF_PERBUF(value) (TCC_PERBUF_PERBUF_Msk & ((value) << TCC_PERBUF_PERBUF_Pos)) 1603 #define TCC_PERBUF_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PERBUF) MASK Register */ 1604 1605 /* -------- TCC_CCBUF : (TCC Offset: 0x70) (R/W 32) Compare and Capture Buffer -------- */ 1606 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1607 typedef union { 1608 struct { // DITH4 mode 1609 uint32_t CCBUF:4; /*!< bit: 0.. 3 Channel Compare/Capture Buffer Value */ 1610 uint32_t DITHERBUF:20; /*!< bit: 4..23 Dithering Buffer Cycle Number */ 1611 uint32_t :8; /*!< bit: 24..31 Reserved */ 1612 } DITH4; /*!< Structure used for DITH4 */ 1613 struct { // DITH5 mode 1614 uint32_t DITHERBUF:5; /*!< bit: 0.. 4 Dithering Buffer Cycle Number */ 1615 uint32_t CCBUF:19; /*!< bit: 5..23 Channel Compare/Capture Buffer Value */ 1616 uint32_t :8; /*!< bit: 24..31 Reserved */ 1617 } DITH5; /*!< Structure used for DITH5 */ 1618 struct { // DITH6 mode 1619 uint32_t DITHERBUF:6; /*!< bit: 0.. 5 Dithering Buffer Cycle Number */ 1620 uint32_t CCBUF:18; /*!< bit: 6..23 Channel Compare/Capture Buffer Value */ 1621 uint32_t :8; /*!< bit: 24..31 Reserved */ 1622 } DITH6; /*!< Structure used for DITH6 */ 1623 struct { 1624 uint32_t CCBUF:24; /*!< bit: 0..23 Channel Compare/Capture Buffer Value */ 1625 uint32_t :8; /*!< bit: 24..31 Reserved */ 1626 } bit; /*!< Structure used for bit access */ 1627 uint32_t reg; /*!< Type used for register access */ 1628 } TCC_CCBUF_Type; 1629 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1630 1631 #define TCC_CCBUF_OFFSET 0x70 /**< \brief (TCC_CCBUF offset) Compare and Capture Buffer */ 1632 #define TCC_CCBUF_RESETVALUE _U_(0x00000000) /**< \brief (TCC_CCBUF reset_value) Compare and Capture Buffer */ 1633 1634 // DITH4 mode 1635 #define TCC_CCBUF_DITH4_CCBUF_Pos 0 /**< \brief (TCC_CCBUF_DITH4) Channel Compare/Capture Buffer Value */ 1636 #define TCC_CCBUF_DITH4_CCBUF_Msk (_U_(0xF) << TCC_CCBUF_DITH4_CCBUF_Pos) 1637 #define TCC_CCBUF_DITH4_CCBUF(value) (TCC_CCBUF_DITH4_CCBUF_Msk & ((value) << TCC_CCBUF_DITH4_CCBUF_Pos)) 1638 #define TCC_CCBUF_DITH4_DITHERBUF_Pos 4 /**< \brief (TCC_CCBUF_DITH4) Dithering Buffer Cycle Number */ 1639 #define TCC_CCBUF_DITH4_DITHERBUF_Msk (_U_(0xFFFFF) << TCC_CCBUF_DITH4_DITHERBUF_Pos) 1640 #define TCC_CCBUF_DITH4_DITHERBUF(value) (TCC_CCBUF_DITH4_DITHERBUF_Msk & ((value) << TCC_CCBUF_DITH4_DITHERBUF_Pos)) 1641 #define TCC_CCBUF_DITH4_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CCBUF_DITH4) MASK Register */ 1642 1643 // DITH5 mode 1644 #define TCC_CCBUF_DITH5_DITHERBUF_Pos 0 /**< \brief (TCC_CCBUF_DITH5) Dithering Buffer Cycle Number */ 1645 #define TCC_CCBUF_DITH5_DITHERBUF_Msk (_U_(0x1F) << TCC_CCBUF_DITH5_DITHERBUF_Pos) 1646 #define TCC_CCBUF_DITH5_DITHERBUF(value) (TCC_CCBUF_DITH5_DITHERBUF_Msk & ((value) << TCC_CCBUF_DITH5_DITHERBUF_Pos)) 1647 #define TCC_CCBUF_DITH5_CCBUF_Pos 5 /**< \brief (TCC_CCBUF_DITH5) Channel Compare/Capture Buffer Value */ 1648 #define TCC_CCBUF_DITH5_CCBUF_Msk (_U_(0x7FFFF) << TCC_CCBUF_DITH5_CCBUF_Pos) 1649 #define TCC_CCBUF_DITH5_CCBUF(value) (TCC_CCBUF_DITH5_CCBUF_Msk & ((value) << TCC_CCBUF_DITH5_CCBUF_Pos)) 1650 #define TCC_CCBUF_DITH5_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CCBUF_DITH5) MASK Register */ 1651 1652 // DITH6 mode 1653 #define TCC_CCBUF_DITH6_DITHERBUF_Pos 0 /**< \brief (TCC_CCBUF_DITH6) Dithering Buffer Cycle Number */ 1654 #define TCC_CCBUF_DITH6_DITHERBUF_Msk (_U_(0x3F) << TCC_CCBUF_DITH6_DITHERBUF_Pos) 1655 #define TCC_CCBUF_DITH6_DITHERBUF(value) (TCC_CCBUF_DITH6_DITHERBUF_Msk & ((value) << TCC_CCBUF_DITH6_DITHERBUF_Pos)) 1656 #define TCC_CCBUF_DITH6_CCBUF_Pos 6 /**< \brief (TCC_CCBUF_DITH6) Channel Compare/Capture Buffer Value */ 1657 #define TCC_CCBUF_DITH6_CCBUF_Msk (_U_(0x3FFFF) << TCC_CCBUF_DITH6_CCBUF_Pos) 1658 #define TCC_CCBUF_DITH6_CCBUF(value) (TCC_CCBUF_DITH6_CCBUF_Msk & ((value) << TCC_CCBUF_DITH6_CCBUF_Pos)) 1659 #define TCC_CCBUF_DITH6_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CCBUF_DITH6) MASK Register */ 1660 1661 #define TCC_CCBUF_CCBUF_Pos 0 /**< \brief (TCC_CCBUF) Channel Compare/Capture Buffer Value */ 1662 #define TCC_CCBUF_CCBUF_Msk (_U_(0xFFFFFF) << TCC_CCBUF_CCBUF_Pos) 1663 #define TCC_CCBUF_CCBUF(value) (TCC_CCBUF_CCBUF_Msk & ((value) << TCC_CCBUF_CCBUF_Pos)) 1664 #define TCC_CCBUF_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CCBUF) MASK Register */ 1665 1666 /** \brief TCC hardware registers */ 1667 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 1668 typedef struct { 1669 __IO TCC_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 32) Control A */ 1670 __IO TCC_CTRLBCLR_Type CTRLBCLR; /**< \brief Offset: 0x04 (R/W 8) Control B Clear */ 1671 __IO TCC_CTRLBSET_Type CTRLBSET; /**< \brief Offset: 0x05 (R/W 8) Control B Set */ 1672 RoReg8 Reserved1[0x2]; 1673 __I TCC_SYNCBUSY_Type SYNCBUSY; /**< \brief Offset: 0x08 (R/ 32) Synchronization Busy */ 1674 __IO TCC_FCTRLA_Type FCTRLA; /**< \brief Offset: 0x0C (R/W 32) Recoverable Fault A Configuration */ 1675 __IO TCC_FCTRLB_Type FCTRLB; /**< \brief Offset: 0x10 (R/W 32) Recoverable Fault B Configuration */ 1676 __IO TCC_WEXCTRL_Type WEXCTRL; /**< \brief Offset: 0x14 (R/W 32) Waveform Extension Configuration */ 1677 __IO TCC_DRVCTRL_Type DRVCTRL; /**< \brief Offset: 0x18 (R/W 32) Driver Control */ 1678 RoReg8 Reserved2[0x2]; 1679 __IO TCC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x1E (R/W 8) Debug Control */ 1680 RoReg8 Reserved3[0x1]; 1681 __IO TCC_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x20 (R/W 32) Event Control */ 1682 __IO TCC_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x24 (R/W 32) Interrupt Enable Clear */ 1683 __IO TCC_INTENSET_Type INTENSET; /**< \brief Offset: 0x28 (R/W 32) Interrupt Enable Set */ 1684 __IO TCC_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x2C (R/W 32) Interrupt Flag Status and Clear */ 1685 __IO TCC_STATUS_Type STATUS; /**< \brief Offset: 0x30 (R/W 32) Status */ 1686 __IO TCC_COUNT_Type COUNT; /**< \brief Offset: 0x34 (R/W 32) Count */ 1687 __IO TCC_PATT_Type PATT; /**< \brief Offset: 0x38 (R/W 16) Pattern */ 1688 RoReg8 Reserved4[0x2]; 1689 __IO TCC_WAVE_Type WAVE; /**< \brief Offset: 0x3C (R/W 32) Waveform Control */ 1690 __IO TCC_PER_Type PER; /**< \brief Offset: 0x40 (R/W 32) Period */ 1691 __IO TCC_CC_Type CC[4]; /**< \brief Offset: 0x44 (R/W 32) Compare and Capture */ 1692 RoReg8 Reserved5[0x10]; 1693 __IO TCC_PATTBUF_Type PATTBUF; /**< \brief Offset: 0x64 (R/W 16) Pattern Buffer */ 1694 RoReg8 Reserved6[0x6]; 1695 __IO TCC_PERBUF_Type PERBUF; /**< \brief Offset: 0x6C (R/W 32) Period Buffer */ 1696 __IO TCC_CCBUF_Type CCBUF[4]; /**< \brief Offset: 0x70 (R/W 32) Compare and Capture Buffer */ 1697 } Tcc; 1698 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 1699 1700 /*@}*/ 1701 1702 #endif /* _SAML21_TCC_COMPONENT_ */ 1703