1 /* ---------------------------------------------------------------------------- */
2 /*                  Atmel Microcontroller Software Support                      */
3 /*                       SAM Software Package License                           */
4 /* ---------------------------------------------------------------------------- */
5 /* Copyright (c) %copyright_year%, Atmel Corporation                                        */
6 /*                                                                              */
7 /* All rights reserved.                                                         */
8 /*                                                                              */
9 /* Redistribution and use in source and binary forms, with or without           */
10 /* modification, are permitted provided that the following condition is met:    */
11 /*                                                                              */
12 /* - Redistributions of source code must retain the above copyright notice,     */
13 /* this list of conditions and the disclaimer below.                            */
14 /*                                                                              */
15 /* Atmel's name may not be used to endorse or promote products derived from     */
16 /* this software without specific prior written permission.                     */
17 /*                                                                              */
18 /* DISCLAIMER:  THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR   */
19 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE   */
21 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,      */
22 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,  */
24 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    */
25 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING         */
26 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                           */
28 /* ---------------------------------------------------------------------------- */
29 
30 #ifndef _SAM4E_TC_COMPONENT_
31 #define _SAM4E_TC_COMPONENT_
32 
33 /* ============================================================================= */
34 /**  SOFTWARE API DEFINITION FOR Timer Counter */
35 /* ============================================================================= */
36 /** \addtogroup SAM4E_TC Timer Counter */
37 /*@{*/
38 
39 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
40 /** \brief TcChannel hardware registers */
41 typedef struct {
42   RwReg      TC_CCR;        /**< \brief (TcChannel Offset: 0x0) Channel Control Register */
43   RwReg      TC_CMR;        /**< \brief (TcChannel Offset: 0x4) Channel Mode Register */
44   RwReg      TC_SMMR;       /**< \brief (TcChannel Offset: 0x8) Stepper Motor Mode Register */
45   RwReg      TC_RAB;        /**< \brief (TcChannel Offset: 0xC) Register AB */
46   RwReg      TC_CV;         /**< \brief (TcChannel Offset: 0x10) Counter Value */
47   RwReg      TC_RA;         /**< \brief (TcChannel Offset: 0x14) Register A */
48   RwReg      TC_RB;         /**< \brief (TcChannel Offset: 0x18) Register B */
49   RwReg      TC_RC;         /**< \brief (TcChannel Offset: 0x1C) Register C */
50   RwReg      TC_SR;         /**< \brief (TcChannel Offset: 0x20) Status Register */
51   RwReg      TC_IER;        /**< \brief (TcChannel Offset: 0x24) Interrupt Enable Register */
52   RwReg      TC_IDR;        /**< \brief (TcChannel Offset: 0x28) Interrupt Disable Register */
53   RwReg      TC_IMR;        /**< \brief (TcChannel Offset: 0x2C) Interrupt Mask Register */
54   RwReg      TC_EMR;        /**< \brief (TcChannel Offset: 0x30) Extended Mode Register */
55   RoReg      Reserved1[3];
56 } TcChannel;
57 /** \brief TcPdc hardware registers */
58 typedef struct {
59   RwReg      TC_RPR;        /**< \brief (TcPdc Offset: 0x0) Receive Pointer Register */
60   RwReg      TC_RCR;        /**< \brief (TcPdc Offset: 0x4) Receive Counter Register */
61   RoReg      Reserved2[2];
62   RwReg      TC_RNPR;       /**< \brief (TcPdc Offset: 0x10) Receive Next Pointer Register */
63   RwReg      TC_RNCR;       /**< \brief (TcPdc Offset: 0x14) Receive Next Counter Register */
64   RoReg      Reserved3[2];
65   RwReg      TC_PTCR;       /**< \brief (TcPdc Offset: 0x20) Transfer Control Register */
66   RwReg      TC_PTSR;       /**< \brief (TcPdc Offset: 0x24) Transfer Status Register */
67   RoReg      Reserved4[6];
68 } TcPdc;
69 /** \brief Tc hardware registers */
70 #define TCCHANNEL_NUMBER 3
71 #define TCPDC_NUMBER 3
72 typedef struct {
73   TcChannel  TcChannel[TCCHANNEL_NUMBER]; /**< \brief (Tc Offset: 0x0) channel = 0 .. 2 */
74   WoReg      TC_BCR;        /**< \brief (Tc Offset: 0xC0) Block Control Register */
75   RwReg      TC_BMR;        /**< \brief (Tc Offset: 0xC4) Block Mode Register */
76   WoReg      TC_QIER;       /**< \brief (Tc Offset: 0xC8) QDEC Interrupt Enable Register */
77   WoReg      TC_QIDR;       /**< \brief (Tc Offset: 0xCC) QDEC Interrupt Disable Register */
78   RoReg      TC_QIMR;       /**< \brief (Tc Offset: 0xD0) QDEC Interrupt Mask Register */
79   RoReg      TC_QISR;       /**< \brief (Tc Offset: 0xD4) QDEC Interrupt Status Register */
80   RwReg      TC_FMR;        /**< \brief (Tc Offset: 0xD8) Fault Mode Register */
81   RoReg      Reserved1[2];
82   RwReg      TC_WPMR;       /**< \brief (Tc Offset: 0xE4) Write Protect Mode Register */
83   RoReg      Reserved2[6];
84   TcPdc      TC_PDC[TCPDC_NUMBER]; /**< \brief (Tc Offset: 0x100) pdc = 0 .. 2 */
85 } Tc;
86 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
87 /* -------- TC_CCR : (TC Offset: N/A) Channel Control Register -------- */
88 #define TC_CCR_CLKEN (0x1u << 0) /**< \brief (TC_CCR) Counter Clock Enable Command */
89 #define TC_CCR_CLKDIS (0x1u << 1) /**< \brief (TC_CCR) Counter Clock Disable Command */
90 #define TC_CCR_SWTRG (0x1u << 2) /**< \brief (TC_CCR) Software Trigger Command */
91 /* -------- TC_CMR : (TC Offset: N/A) Channel Mode Register -------- */
92 #define TC_CMR_TCCLKS_Pos 0
93 #define TC_CMR_TCCLKS_Msk (0x7u << TC_CMR_TCCLKS_Pos) /**< \brief (TC_CMR) Clock Selection */
94 #define TC_CMR_TCCLKS(value) ((TC_CMR_TCCLKS_Msk & ((value) << TC_CMR_TCCLKS_Pos)))
95 #define   TC_CMR_TCCLKS_TIMER_CLOCK1 (0x0u << 0) /**< \brief (TC_CMR) Clock selected: TCLK1 */
96 #define   TC_CMR_TCCLKS_TIMER_CLOCK2 (0x1u << 0) /**< \brief (TC_CMR) Clock selected: TCLK2 */
97 #define   TC_CMR_TCCLKS_TIMER_CLOCK3 (0x2u << 0) /**< \brief (TC_CMR) Clock selected: TCLK3 */
98 #define   TC_CMR_TCCLKS_TIMER_CLOCK4 (0x3u << 0) /**< \brief (TC_CMR) Clock selected: TCLK4 */
99 #define   TC_CMR_TCCLKS_TIMER_CLOCK5 (0x4u << 0) /**< \brief (TC_CMR) Clock selected: TCLK5 */
100 #define   TC_CMR_TCCLKS_XC0 (0x5u << 0) /**< \brief (TC_CMR) Clock selected: XC0 */
101 #define   TC_CMR_TCCLKS_XC1 (0x6u << 0) /**< \brief (TC_CMR) Clock selected: XC1 */
102 #define   TC_CMR_TCCLKS_XC2 (0x7u << 0) /**< \brief (TC_CMR) Clock selected: XC2 */
103 #define TC_CMR_CLKI (0x1u << 3) /**< \brief (TC_CMR) Clock Invert */
104 #define TC_CMR_BURST_Pos 4
105 #define TC_CMR_BURST_Msk (0x3u << TC_CMR_BURST_Pos) /**< \brief (TC_CMR) Burst Signal Selection */
106 #define   TC_CMR_BURST_NONE (0x0u << 4) /**< \brief (TC_CMR) The clock is not gated by an external signal. */
107 #define   TC_CMR_BURST_XC0 (0x1u << 4) /**< \brief (TC_CMR) XC0 is ANDed with the selected clock. */
108 #define   TC_CMR_BURST_XC1 (0x2u << 4) /**< \brief (TC_CMR) XC1 is ANDed with the selected clock. */
109 #define   TC_CMR_BURST_XC2 (0x3u << 4) /**< \brief (TC_CMR) XC2 is ANDed with the selected clock. */
110 #define TC_CMR_LDBSTOP (0x1u << 6) /**< \brief (TC_CMR) Counter Clock Stopped with RB Loading */
111 #define TC_CMR_LDBDIS (0x1u << 7) /**< \brief (TC_CMR) Counter Clock Disable with RB Loading */
112 #define TC_CMR_ETRGEDG_Pos 8
113 #define TC_CMR_ETRGEDG_Msk (0x3u << TC_CMR_ETRGEDG_Pos) /**< \brief (TC_CMR) External Trigger Edge Selection */
114 #define   TC_CMR_ETRGEDG_NONE (0x0u << 8) /**< \brief (TC_CMR) The clock is not gated by an external signal. */
115 #define   TC_CMR_ETRGEDG_RISING (0x1u << 8) /**< \brief (TC_CMR) Rising edge */
116 #define   TC_CMR_ETRGEDG_FALLING (0x2u << 8) /**< \brief (TC_CMR) Falling edge */
117 #define   TC_CMR_ETRGEDG_EDGE (0x3u << 8) /**< \brief (TC_CMR) Each edge */
118 #define TC_CMR_ABETRG (0x1u << 10) /**< \brief (TC_CMR) TIOA or TIOB External Trigger Selection */
119 #define TC_CMR_CPCTRG (0x1u << 14) /**< \brief (TC_CMR) RC Compare Trigger Enable */
120 #define TC_CMR_WAVE (0x1u << 15) /**< \brief (TC_CMR) Waveform Mode */
121 #define TC_CMR_LDRA_Pos 16
122 #define TC_CMR_LDRA_Msk (0x3u << TC_CMR_LDRA_Pos) /**< \brief (TC_CMR) RA Loading Edge Selection */
123 #define   TC_CMR_LDRA_NONE (0x0u << 16) /**< \brief (TC_CMR) None */
124 #define   TC_CMR_LDRA_RISING (0x1u << 16) /**< \brief (TC_CMR) Rising edge of TIOA */
125 #define   TC_CMR_LDRA_FALLING (0x2u << 16) /**< \brief (TC_CMR) Falling edge of TIOA */
126 #define   TC_CMR_LDRA_EDGE (0x3u << 16) /**< \brief (TC_CMR) Each edge of TIOA */
127 #define TC_CMR_LDRB_Pos 18
128 #define TC_CMR_LDRB_Msk (0x3u << TC_CMR_LDRB_Pos) /**< \brief (TC_CMR) RB Loading Edge Selection */
129 #define   TC_CMR_LDRB_NONE (0x0u << 18) /**< \brief (TC_CMR) None */
130 #define   TC_CMR_LDRB_RISING (0x1u << 18) /**< \brief (TC_CMR) Rising edge of TIOA */
131 #define   TC_CMR_LDRB_FALLING (0x2u << 18) /**< \brief (TC_CMR) Falling edge of TIOA */
132 #define   TC_CMR_LDRB_EDGE (0x3u << 18) /**< \brief (TC_CMR) Each edge of TIOA */
133 #define TC_CMR_SBSMPLR_Pos 20
134 #define TC_CMR_SBSMPLR_Msk (0x7u << TC_CMR_SBSMPLR_Pos) /**< \brief (TC_CMR) Loading Edge Subsampling Ratio */
135 #define   TC_CMR_SBSMPLR_ONE (0x0u << 20) /**< \brief (TC_CMR) Load a Capture Register each selected edge */
136 #define   TC_CMR_SBSMPLR_HALF (0x1u << 20) /**< \brief (TC_CMR) Load a Capture Register every 2 selected edges */
137 #define   TC_CMR_SBSMPLR_FOURTH (0x2u << 20) /**< \brief (TC_CMR) Load a Capture Register every 4 selected edges */
138 #define   TC_CMR_SBSMPLR_EIGHTH (0x3u << 20) /**< \brief (TC_CMR) Load a Capture Register every 8 selected edges */
139 #define   TC_CMR_SBSMPLR_SIXTEENTH (0x4u << 20) /**< \brief (TC_CMR) Load a Capture Register every 16 selected edges */
140 #define TC_CMR_CPCSTOP (0x1u << 6) /**< \brief (TC_CMR) Counter Clock Stopped with RC Compare */
141 #define TC_CMR_CPCDIS (0x1u << 7) /**< \brief (TC_CMR) Counter Clock Disable with RC Compare */
142 #define TC_CMR_EEVTEDG_Pos 8
143 #define TC_CMR_EEVTEDG_Msk (0x3u << TC_CMR_EEVTEDG_Pos) /**< \brief (TC_CMR) External Event Edge Selection */
144 #define   TC_CMR_EEVTEDG_NONE (0x0u << 8) /**< \brief (TC_CMR) None */
145 #define   TC_CMR_EEVTEDG_RISING (0x1u << 8) /**< \brief (TC_CMR) Rising edge */
146 #define   TC_CMR_EEVTEDG_FALLING (0x2u << 8) /**< \brief (TC_CMR) Falling edge */
147 #define   TC_CMR_EEVTEDG_EDGE (0x3u << 8) /**< \brief (TC_CMR) Each edge */
148 #define TC_CMR_EEVT_Pos 10
149 #define TC_CMR_EEVT_Msk (0x3u << TC_CMR_EEVT_Pos) /**< \brief (TC_CMR) External Event Selection */
150 #define   TC_CMR_EEVT_TIOB (0x0u << 10) /**< \brief (TC_CMR) TIOB */
151 #define   TC_CMR_EEVT_XC0 (0x1u << 10) /**< \brief (TC_CMR) XC0 */
152 #define   TC_CMR_EEVT_XC1 (0x2u << 10) /**< \brief (TC_CMR) XC1 */
153 #define   TC_CMR_EEVT_XC2 (0x3u << 10) /**< \brief (TC_CMR) XC2 */
154 #define TC_CMR_ENETRG (0x1u << 12) /**< \brief (TC_CMR) External Event Trigger Enable */
155 #define TC_CMR_WAVSEL_Pos 13
156 #define TC_CMR_WAVSEL_Msk (0x3u << TC_CMR_WAVSEL_Pos) /**< \brief (TC_CMR) Waveform Selection */
157 #define   TC_CMR_WAVSEL_UP (0x0u << 13) /**< \brief (TC_CMR) UP mode without automatic trigger on RC Compare */
158 #define   TC_CMR_WAVSEL_UPDOWN (0x1u << 13) /**< \brief (TC_CMR) UPDOWN mode without automatic trigger on RC Compare */
159 #define   TC_CMR_WAVSEL_UP_RC (0x2u << 13) /**< \brief (TC_CMR) UP mode with automatic trigger on RC Compare */
160 #define   TC_CMR_WAVSEL_UPDOWN_RC (0x3u << 13) /**< \brief (TC_CMR) UPDOWN mode with automatic trigger on RC Compare */
161 #define TC_CMR_ACPA_Pos 16
162 #define TC_CMR_ACPA_Msk (0x3u << TC_CMR_ACPA_Pos) /**< \brief (TC_CMR) RA Compare Effect on TIOA */
163 #define   TC_CMR_ACPA_NONE (0x0u << 16) /**< \brief (TC_CMR) None */
164 #define   TC_CMR_ACPA_SET (0x1u << 16) /**< \brief (TC_CMR) Set */
165 #define   TC_CMR_ACPA_CLEAR (0x2u << 16) /**< \brief (TC_CMR) Clear */
166 #define   TC_CMR_ACPA_TOGGLE (0x3u << 16) /**< \brief (TC_CMR) Toggle */
167 #define TC_CMR_ACPC_Pos 18
168 #define TC_CMR_ACPC_Msk (0x3u << TC_CMR_ACPC_Pos) /**< \brief (TC_CMR) RC Compare Effect on TIOA */
169 #define   TC_CMR_ACPC_NONE (0x0u << 18) /**< \brief (TC_CMR) None */
170 #define   TC_CMR_ACPC_SET (0x1u << 18) /**< \brief (TC_CMR) Set */
171 #define   TC_CMR_ACPC_CLEAR (0x2u << 18) /**< \brief (TC_CMR) Clear */
172 #define   TC_CMR_ACPC_TOGGLE (0x3u << 18) /**< \brief (TC_CMR) Toggle */
173 #define TC_CMR_AEEVT_Pos 20
174 #define TC_CMR_AEEVT_Msk (0x3u << TC_CMR_AEEVT_Pos) /**< \brief (TC_CMR) External Event Effect on TIOA */
175 #define   TC_CMR_AEEVT_NONE (0x0u << 20) /**< \brief (TC_CMR) None */
176 #define   TC_CMR_AEEVT_SET (0x1u << 20) /**< \brief (TC_CMR) Set */
177 #define   TC_CMR_AEEVT_CLEAR (0x2u << 20) /**< \brief (TC_CMR) Clear */
178 #define   TC_CMR_AEEVT_TOGGLE (0x3u << 20) /**< \brief (TC_CMR) Toggle */
179 #define TC_CMR_ASWTRG_Pos 22
180 #define TC_CMR_ASWTRG_Msk (0x3u << TC_CMR_ASWTRG_Pos) /**< \brief (TC_CMR) Software Trigger Effect on TIOA */
181 #define   TC_CMR_ASWTRG_NONE (0x0u << 22) /**< \brief (TC_CMR) None */
182 #define   TC_CMR_ASWTRG_SET (0x1u << 22) /**< \brief (TC_CMR) Set */
183 #define   TC_CMR_ASWTRG_CLEAR (0x2u << 22) /**< \brief (TC_CMR) Clear */
184 #define   TC_CMR_ASWTRG_TOGGLE (0x3u << 22) /**< \brief (TC_CMR) Toggle */
185 #define TC_CMR_BCPB_Pos 24
186 #define TC_CMR_BCPB_Msk (0x3u << TC_CMR_BCPB_Pos) /**< \brief (TC_CMR) RB Compare Effect on TIOB */
187 #define   TC_CMR_BCPB_NONE (0x0u << 24) /**< \brief (TC_CMR) None */
188 #define   TC_CMR_BCPB_SET (0x1u << 24) /**< \brief (TC_CMR) Set */
189 #define   TC_CMR_BCPB_CLEAR (0x2u << 24) /**< \brief (TC_CMR) Clear */
190 #define   TC_CMR_BCPB_TOGGLE (0x3u << 24) /**< \brief (TC_CMR) Toggle */
191 #define TC_CMR_BCPC_Pos 26
192 #define TC_CMR_BCPC_Msk (0x3u << TC_CMR_BCPC_Pos) /**< \brief (TC_CMR) RC Compare Effect on TIOB */
193 #define   TC_CMR_BCPC_NONE (0x0u << 26) /**< \brief (TC_CMR) None */
194 #define   TC_CMR_BCPC_SET (0x1u << 26) /**< \brief (TC_CMR) Set */
195 #define   TC_CMR_BCPC_CLEAR (0x2u << 26) /**< \brief (TC_CMR) Clear */
196 #define   TC_CMR_BCPC_TOGGLE (0x3u << 26) /**< \brief (TC_CMR) Toggle */
197 #define TC_CMR_BEEVT_Pos 28
198 #define TC_CMR_BEEVT_Msk (0x3u << TC_CMR_BEEVT_Pos) /**< \brief (TC_CMR) External Event Effect on TIOB */
199 #define   TC_CMR_BEEVT_NONE (0x0u << 28) /**< \brief (TC_CMR) None */
200 #define   TC_CMR_BEEVT_SET (0x1u << 28) /**< \brief (TC_CMR) Set */
201 #define   TC_CMR_BEEVT_CLEAR (0x2u << 28) /**< \brief (TC_CMR) Clear */
202 #define   TC_CMR_BEEVT_TOGGLE (0x3u << 28) /**< \brief (TC_CMR) Toggle */
203 #define TC_CMR_BSWTRG_Pos 30
204 #define TC_CMR_BSWTRG_Msk (0x3u << TC_CMR_BSWTRG_Pos) /**< \brief (TC_CMR) Software Trigger Effect on TIOB */
205 #define   TC_CMR_BSWTRG_NONE (0x0u << 30) /**< \brief (TC_CMR) None */
206 #define   TC_CMR_BSWTRG_SET (0x1u << 30) /**< \brief (TC_CMR) Set */
207 #define   TC_CMR_BSWTRG_CLEAR (0x2u << 30) /**< \brief (TC_CMR) Clear */
208 #define   TC_CMR_BSWTRG_TOGGLE (0x3u << 30) /**< \brief (TC_CMR) Toggle */
209 
210 /* CAPTURE mode */
211 #define TC_CMR_CAPTURE_LDBSTOP_Pos          6                                              /**< (TC_CMR) Counter Clock Stopped with RB Loading Position */
212 #define TC_CMR_CAPTURE_LDBSTOP_Msk          (0x1u << TC_CMR_CAPTURE_LDBSTOP_Pos)       /**< (TC_CMR) Counter Clock Stopped with RB Loading Mask */
213 #define TC_CMR_CAPTURE_LDBSTOP              TC_CMR_CAPTURE_LDBSTOP_Msk                     /**< \deprecated Old style mask definition for 1 bit bitfield. Use TC_CMR_CAPTURE_LDBSTOP_Msk instead */
214 #define TC_CMR_CAPTURE_LDBDIS_Pos           7                                              /**< (TC_CMR) Counter Clock Disable with RB Loading Position */
215 #define TC_CMR_CAPTURE_LDBDIS_Msk           (0x1u << TC_CMR_CAPTURE_LDBDIS_Pos)        /**< (TC_CMR) Counter Clock Disable with RB Loading Mask */
216 #define TC_CMR_CAPTURE_LDBDIS               TC_CMR_CAPTURE_LDBDIS_Msk                      /**< \deprecated Old style mask definition for 1 bit bitfield. Use TC_CMR_CAPTURE_LDBDIS_Msk instead */
217 #define TC_CMR_CAPTURE_ETRGEDG_Pos          8                                              /**< (TC_CMR) External Trigger Edge Selection Position */
218 #define TC_CMR_CAPTURE_ETRGEDG_Msk          (0x3u << TC_CMR_CAPTURE_ETRGEDG_Pos)       /**< (TC_CMR) External Trigger Edge Selection Mask */
219 #define TC_CMR_CAPTURE_ETRGEDG(value)       (TC_CMR_CAPTURE_ETRGEDG_Msk & ((value) << TC_CMR_CAPTURE_ETRGEDG_Pos))
220 #define   TC_CMR_CAPTURE_ETRGEDG_NONE_Val   0x0u                                       /**< (TC_CMR) CAPTURE The clock is not gated by an external signal.  */
221 #define   TC_CMR_CAPTURE_ETRGEDG_RISING_Val 0x1u                                       /**< (TC_CMR) CAPTURE Rising edge  */
222 #define   TC_CMR_CAPTURE_ETRGEDG_FALLING_Val 0x2u                                       /**< (TC_CMR) CAPTURE Falling edge  */
223 #define   TC_CMR_CAPTURE_ETRGEDG_EDGE_Val   0x3u                                       /**< (TC_CMR) CAPTURE Each edge  */
224 #define TC_CMR_CAPTURE_ETRGEDG_NONE         (TC_CMR_CAPTURE_ETRGEDG_NONE_Val << TC_CMR_CAPTURE_ETRGEDG_Pos)  /**< (TC_CMR) The clock is not gated by an external signal. Position  */
225 #define TC_CMR_CAPTURE_ETRGEDG_RISING       (TC_CMR_CAPTURE_ETRGEDG_RISING_Val << TC_CMR_CAPTURE_ETRGEDG_Pos)  /**< (TC_CMR) Rising edge Position  */
226 #define TC_CMR_CAPTURE_ETRGEDG_FALLING      (TC_CMR_CAPTURE_ETRGEDG_FALLING_Val << TC_CMR_CAPTURE_ETRGEDG_Pos)  /**< (TC_CMR) Falling edge Position  */
227 #define TC_CMR_CAPTURE_ETRGEDG_EDGE         (TC_CMR_CAPTURE_ETRGEDG_EDGE_Val << TC_CMR_CAPTURE_ETRGEDG_Pos)  /**< (TC_CMR) Each edge Position  */
228 #define TC_CMR_CAPTURE_ABETRG_Pos           10                                             /**< (TC_CMR) TIOAx or TIOBx External Trigger Selection Position */
229 #define TC_CMR_CAPTURE_ABETRG_Msk           (0x1u << TC_CMR_CAPTURE_ABETRG_Pos)        /**< (TC_CMR) TIOAx or TIOBx External Trigger Selection Mask */
230 #define TC_CMR_CAPTURE_ABETRG               TC_CMR_CAPTURE_ABETRG_Msk                      /**< \deprecated Old style mask definition for 1 bit bitfield. Use TC_CMR_CAPTURE_ABETRG_Msk instead */
231 #define TC_CMR_CAPTURE_CPCTRG_Pos           14                                             /**< (TC_CMR) RC Compare Trigger Enable Position */
232 #define TC_CMR_CAPTURE_CPCTRG_Msk           (0x1u << TC_CMR_CAPTURE_CPCTRG_Pos)        /**< (TC_CMR) RC Compare Trigger Enable Mask */
233 #define TC_CMR_CAPTURE_CPCTRG               TC_CMR_CAPTURE_CPCTRG_Msk                      /**< \deprecated Old style mask definition for 1 bit bitfield. Use TC_CMR_CAPTURE_CPCTRG_Msk instead */
234 #define TC_CMR_CAPTURE_LDRA_Pos             16                                             /**< (TC_CMR) RA Loading Edge Selection Position */
235 #define TC_CMR_CAPTURE_LDRA_Msk             (0x3u << TC_CMR_CAPTURE_LDRA_Pos)          /**< (TC_CMR) RA Loading Edge Selection Mask */
236 #define TC_CMR_CAPTURE_LDRA(value)          (TC_CMR_CAPTURE_LDRA_Msk & ((value) << TC_CMR_CAPTURE_LDRA_Pos))
237 #define   TC_CMR_CAPTURE_LDRA_NONE_Val      0x0u                                       /**< (TC_CMR) CAPTURE None  */
238 #define   TC_CMR_CAPTURE_LDRA_RISING_Val    0x1u                                       /**< (TC_CMR) CAPTURE Rising edge of TIOAx  */
239 #define   TC_CMR_CAPTURE_LDRA_FALLING_Val   0x2u                                       /**< (TC_CMR) CAPTURE Falling edge of TIOAx  */
240 #define   TC_CMR_CAPTURE_LDRA_EDGE_Val      0x3u                                       /**< (TC_CMR) CAPTURE Each edge of TIOAx  */
241 #define TC_CMR_CAPTURE_LDRA_NONE            (TC_CMR_CAPTURE_LDRA_NONE_Val << TC_CMR_CAPTURE_LDRA_Pos)  /**< (TC_CMR) None Position  */
242 #define TC_CMR_CAPTURE_LDRA_RISING          (TC_CMR_CAPTURE_LDRA_RISING_Val << TC_CMR_CAPTURE_LDRA_Pos)  /**< (TC_CMR) Rising edge of TIOAx Position  */
243 #define TC_CMR_CAPTURE_LDRA_FALLING         (TC_CMR_CAPTURE_LDRA_FALLING_Val << TC_CMR_CAPTURE_LDRA_Pos)  /**< (TC_CMR) Falling edge of TIOAx Position  */
244 #define TC_CMR_CAPTURE_LDRA_EDGE            (TC_CMR_CAPTURE_LDRA_EDGE_Val << TC_CMR_CAPTURE_LDRA_Pos)  /**< (TC_CMR) Each edge of TIOAx Position  */
245 #define TC_CMR_CAPTURE_LDRB_Pos             18                                             /**< (TC_CMR) RB Loading Edge Selection Position */
246 #define TC_CMR_CAPTURE_LDRB_Msk             (0x3u << TC_CMR_CAPTURE_LDRB_Pos)          /**< (TC_CMR) RB Loading Edge Selection Mask */
247 #define TC_CMR_CAPTURE_LDRB(value)          (TC_CMR_CAPTURE_LDRB_Msk & ((value) << TC_CMR_CAPTURE_LDRB_Pos))
248 #define   TC_CMR_CAPTURE_LDRB_NONE_Val      0x0u                                       /**< (TC_CMR) CAPTURE None  */
249 #define   TC_CMR_CAPTURE_LDRB_RISING_Val    0x1u                                       /**< (TC_CMR) CAPTURE Rising edge of TIOAx  */
250 #define   TC_CMR_CAPTURE_LDRB_FALLING_Val   0x2u                                       /**< (TC_CMR) CAPTURE Falling edge of TIOAx  */
251 #define   TC_CMR_CAPTURE_LDRB_EDGE_Val      0x3u                                       /**< (TC_CMR) CAPTURE Each edge of TIOAx  */
252 #define TC_CMR_CAPTURE_LDRB_NONE            (TC_CMR_CAPTURE_LDRB_NONE_Val << TC_CMR_CAPTURE_LDRB_Pos)  /**< (TC_CMR) None Position  */
253 #define TC_CMR_CAPTURE_LDRB_RISING          (TC_CMR_CAPTURE_LDRB_RISING_Val << TC_CMR_CAPTURE_LDRB_Pos)  /**< (TC_CMR) Rising edge of TIOAx Position  */
254 #define TC_CMR_CAPTURE_LDRB_FALLING         (TC_CMR_CAPTURE_LDRB_FALLING_Val << TC_CMR_CAPTURE_LDRB_Pos)  /**< (TC_CMR) Falling edge of TIOAx Position  */
255 #define TC_CMR_CAPTURE_LDRB_EDGE            (TC_CMR_CAPTURE_LDRB_EDGE_Val << TC_CMR_CAPTURE_LDRB_Pos)  /**< (TC_CMR) Each edge of TIOAx Position  */
256 #define TC_CMR_CAPTURE_SBSMPLR_Pos          20                                             /**< (TC_CMR) Loading Edge Subsampling Ratio Position */
257 #define TC_CMR_CAPTURE_SBSMPLR_Msk          (0x7u << TC_CMR_CAPTURE_SBSMPLR_Pos)       /**< (TC_CMR) Loading Edge Subsampling Ratio Mask */
258 #define TC_CMR_CAPTURE_SBSMPLR(value)       (TC_CMR_CAPTURE_SBSMPLR_Msk & ((value) << TC_CMR_CAPTURE_SBSMPLR_Pos))
259 #define   TC_CMR_CAPTURE_SBSMPLR_ONE_Val    0x0u                                       /**< (TC_CMR) CAPTURE Load a Capture Register each selected edge  */
260 #define   TC_CMR_CAPTURE_SBSMPLR_HALF_Val   0x1u                                       /**< (TC_CMR) CAPTURE Load a Capture Register every 2 selected edges  */
261 #define   TC_CMR_CAPTURE_SBSMPLR_FOURTH_Val 0x2u                                       /**< (TC_CMR) CAPTURE Load a Capture Register every 4 selected edges  */
262 #define   TC_CMR_CAPTURE_SBSMPLR_EIGHTH_Val 0x3u                                       /**< (TC_CMR) CAPTURE Load a Capture Register every 8 selected edges  */
263 #define   TC_CMR_CAPTURE_SBSMPLR_SIXTEENTH_Val 0x4u                                       /**< (TC_CMR) CAPTURE Load a Capture Register every 16 selected edges  */
264 #define TC_CMR_CAPTURE_SBSMPLR_ONE          (TC_CMR_CAPTURE_SBSMPLR_ONE_Val << TC_CMR_CAPTURE_SBSMPLR_Pos)  /**< (TC_CMR) Load a Capture Register each selected edge Position  */
265 #define TC_CMR_CAPTURE_SBSMPLR_HALF         (TC_CMR_CAPTURE_SBSMPLR_HALF_Val << TC_CMR_CAPTURE_SBSMPLR_Pos)  /**< (TC_CMR) Load a Capture Register every 2 selected edges Position  */
266 #define TC_CMR_CAPTURE_SBSMPLR_FOURTH       (TC_CMR_CAPTURE_SBSMPLR_FOURTH_Val << TC_CMR_CAPTURE_SBSMPLR_Pos)  /**< (TC_CMR) Load a Capture Register every 4 selected edges Position  */
267 #define TC_CMR_CAPTURE_SBSMPLR_EIGHTH       (TC_CMR_CAPTURE_SBSMPLR_EIGHTH_Val << TC_CMR_CAPTURE_SBSMPLR_Pos)  /**< (TC_CMR) Load a Capture Register every 8 selected edges Position  */
268 #define TC_CMR_CAPTURE_SBSMPLR_SIXTEENTH    (TC_CMR_CAPTURE_SBSMPLR_SIXTEENTH_Val << TC_CMR_CAPTURE_SBSMPLR_Pos)  /**< (TC_CMR) Load a Capture Register every 16 selected edges Position  */
269 #define TC_CMR_CAPTURE_MASK                 0x7F47C0u                                  /**< \deprecated (TC_CMR_CAPTURE) Register MASK  (Use TC_CMR_CAPTURE_Msk instead)  */
270 #define TC_CMR_CAPTURE_Msk                  0x7F47C0u                                  /**< (TC_CMR_CAPTURE) Register Mask  */
271 
272 /* WAVEFORM mode */
273 #define TC_CMR_WAVEFORM_CPCSTOP_Pos         6                                              /**< (TC_CMR) Counter Clock Stopped with RC Compare Position */
274 #define TC_CMR_WAVEFORM_CPCSTOP_Msk         (0x1u << TC_CMR_WAVEFORM_CPCSTOP_Pos)      /**< (TC_CMR) Counter Clock Stopped with RC Compare Mask */
275 #define TC_CMR_WAVEFORM_CPCSTOP             TC_CMR_WAVEFORM_CPCSTOP_Msk                    /**< \deprecated Old style mask definition for 1 bit bitfield. Use TC_CMR_WAVEFORM_CPCSTOP_Msk instead */
276 #define TC_CMR_WAVEFORM_CPCDIS_Pos          7                                              /**< (TC_CMR) Counter Clock Disable with RC Loading Position */
277 #define TC_CMR_WAVEFORM_CPCDIS_Msk          (0x1u << TC_CMR_WAVEFORM_CPCDIS_Pos)       /**< (TC_CMR) Counter Clock Disable with RC Loading Mask */
278 #define TC_CMR_WAVEFORM_CPCDIS              TC_CMR_WAVEFORM_CPCDIS_Msk                     /**< \deprecated Old style mask definition for 1 bit bitfield. Use TC_CMR_WAVEFORM_CPCDIS_Msk instead */
279 #define TC_CMR_WAVEFORM_EEVTEDG_Pos         8                                              /**< (TC_CMR) External Event Edge Selection Position */
280 #define TC_CMR_WAVEFORM_EEVTEDG_Msk         (0x3u << TC_CMR_WAVEFORM_EEVTEDG_Pos)      /**< (TC_CMR) External Event Edge Selection Mask */
281 #define TC_CMR_WAVEFORM_EEVTEDG(value)      (TC_CMR_WAVEFORM_EEVTEDG_Msk & ((value) << TC_CMR_WAVEFORM_EEVTEDG_Pos))
282 #define   TC_CMR_WAVEFORM_EEVTEDG_NONE_Val  0x0u                                       /**< (TC_CMR) WAVEFORM None  */
283 #define   TC_CMR_WAVEFORM_EEVTEDG_RISING_Val 0x1u                                       /**< (TC_CMR) WAVEFORM Rising edge  */
284 #define   TC_CMR_WAVEFORM_EEVTEDG_FALLING_Val 0x2u                                       /**< (TC_CMR) WAVEFORM Falling edge  */
285 #define   TC_CMR_WAVEFORM_EEVTEDG_EDGE_Val  0x3u                                       /**< (TC_CMR) WAVEFORM Each edges  */
286 #define TC_CMR_WAVEFORM_EEVTEDG_NONE        (TC_CMR_WAVEFORM_EEVTEDG_NONE_Val << TC_CMR_WAVEFORM_EEVTEDG_Pos)  /**< (TC_CMR) None Position  */
287 #define TC_CMR_WAVEFORM_EEVTEDG_RISING      (TC_CMR_WAVEFORM_EEVTEDG_RISING_Val << TC_CMR_WAVEFORM_EEVTEDG_Pos)  /**< (TC_CMR) Rising edge Position  */
288 #define TC_CMR_WAVEFORM_EEVTEDG_FALLING     (TC_CMR_WAVEFORM_EEVTEDG_FALLING_Val << TC_CMR_WAVEFORM_EEVTEDG_Pos)  /**< (TC_CMR) Falling edge Position  */
289 #define TC_CMR_WAVEFORM_EEVTEDG_EDGE        (TC_CMR_WAVEFORM_EEVTEDG_EDGE_Val << TC_CMR_WAVEFORM_EEVTEDG_Pos)  /**< (TC_CMR) Each edges Position  */
290 #define TC_CMR_WAVEFORM_EEVT_Pos            10                                             /**< (TC_CMR) External Event Selection Position */
291 #define TC_CMR_WAVEFORM_EEVT_Msk            (0x3u << TC_CMR_WAVEFORM_EEVT_Pos)         /**< (TC_CMR) External Event Selection Mask */
292 #define TC_CMR_WAVEFORM_EEVT(value)         (TC_CMR_WAVEFORM_EEVT_Msk & ((value) << TC_CMR_WAVEFORM_EEVT_Pos))
293 #define   TC_CMR_WAVEFORM_EEVT_TIOB_Val     0x0u                                       /**< (TC_CMR) WAVEFORM TIOB  */
294 #define   TC_CMR_WAVEFORM_EEVT_XC0_Val      0x1u                                       /**< (TC_CMR) WAVEFORM XC0  */
295 #define   TC_CMR_WAVEFORM_EEVT_XC1_Val      0x2u                                       /**< (TC_CMR) WAVEFORM XC1  */
296 #define   TC_CMR_WAVEFORM_EEVT_XC2_Val      0x3u                                       /**< (TC_CMR) WAVEFORM XC2  */
297 #define TC_CMR_WAVEFORM_EEVT_TIOB           (TC_CMR_WAVEFORM_EEVT_TIOB_Val << TC_CMR_WAVEFORM_EEVT_Pos)  /**< (TC_CMR) TIOB Position  */
298 #define TC_CMR_WAVEFORM_EEVT_XC0            (TC_CMR_WAVEFORM_EEVT_XC0_Val << TC_CMR_WAVEFORM_EEVT_Pos)  /**< (TC_CMR) XC0 Position  */
299 #define TC_CMR_WAVEFORM_EEVT_XC1            (TC_CMR_WAVEFORM_EEVT_XC1_Val << TC_CMR_WAVEFORM_EEVT_Pos)  /**< (TC_CMR) XC1 Position  */
300 #define TC_CMR_WAVEFORM_EEVT_XC2            (TC_CMR_WAVEFORM_EEVT_XC2_Val << TC_CMR_WAVEFORM_EEVT_Pos)  /**< (TC_CMR) XC2 Position  */
301 #define TC_CMR_WAVEFORM_ENETRG_Pos          12                                             /**< (TC_CMR) External Event Trigger Enable Position */
302 #define TC_CMR_WAVEFORM_ENETRG_Msk          (0x1u << TC_CMR_WAVEFORM_ENETRG_Pos)       /**< (TC_CMR) External Event Trigger Enable Mask */
303 #define TC_CMR_WAVEFORM_ENETRG              TC_CMR_WAVEFORM_ENETRG_Msk                     /**< \deprecated Old style mask definition for 1 bit bitfield. Use TC_CMR_WAVEFORM_ENETRG_Msk instead */
304 #define TC_CMR_WAVEFORM_WAVSEL_Pos          13                                             /**< (TC_CMR) Waveform Selection Position */
305 #define TC_CMR_WAVEFORM_WAVSEL_Msk          (0x3u << TC_CMR_WAVEFORM_WAVSEL_Pos)       /**< (TC_CMR) Waveform Selection Mask */
306 #define TC_CMR_WAVEFORM_WAVSEL(value)       (TC_CMR_WAVEFORM_WAVSEL_Msk & ((value) << TC_CMR_WAVEFORM_WAVSEL_Pos))
307 #define   TC_CMR_WAVEFORM_WAVSEL_UP_Val     0x0u                                       /**< (TC_CMR) WAVEFORM UP mode without automatic trigger on RC Compare  */
308 #define   TC_CMR_WAVEFORM_WAVSEL_UPDOWN_Val 0x1u                                       /**< (TC_CMR) WAVEFORM UPDOWN mode without automatic trigger on RC Compare  */
309 #define   TC_CMR_WAVEFORM_WAVSEL_UP_RC_Val  0x2u                                       /**< (TC_CMR) WAVEFORM UP mode with automatic trigger on RC Compare  */
310 #define   TC_CMR_WAVEFORM_WAVSEL_UPDOWN_RC_Val 0x3u                                       /**< (TC_CMR) WAVEFORM UPDOWN mode with automatic trigger on RC Compare  */
311 #define TC_CMR_WAVEFORM_WAVSEL_UP           (TC_CMR_WAVEFORM_WAVSEL_UP_Val << TC_CMR_WAVEFORM_WAVSEL_Pos)  /**< (TC_CMR) UP mode without automatic trigger on RC Compare Position  */
312 #define TC_CMR_WAVEFORM_WAVSEL_UPDOWN       (TC_CMR_WAVEFORM_WAVSEL_UPDOWN_Val << TC_CMR_WAVEFORM_WAVSEL_Pos)  /**< (TC_CMR) UPDOWN mode without automatic trigger on RC Compare Position  */
313 #define TC_CMR_WAVEFORM_WAVSEL_UP_RC        (TC_CMR_WAVEFORM_WAVSEL_UP_RC_Val << TC_CMR_WAVEFORM_WAVSEL_Pos)  /**< (TC_CMR) UP mode with automatic trigger on RC Compare Position  */
314 #define TC_CMR_WAVEFORM_WAVSEL_UPDOWN_RC    (TC_CMR_WAVEFORM_WAVSEL_UPDOWN_RC_Val << TC_CMR_WAVEFORM_WAVSEL_Pos)  /**< (TC_CMR) UPDOWN mode with automatic trigger on RC Compare Position  */
315 #define TC_CMR_WAVEFORM_ACPA_Pos            16                                             /**< (TC_CMR) RA Compare Effect on TIOAx Position */
316 #define TC_CMR_WAVEFORM_ACPA_Msk            (0x3u << TC_CMR_WAVEFORM_ACPA_Pos)         /**< (TC_CMR) RA Compare Effect on TIOAx Mask */
317 #define TC_CMR_WAVEFORM_ACPA(value)         (TC_CMR_WAVEFORM_ACPA_Msk & ((value) << TC_CMR_WAVEFORM_ACPA_Pos))
318 #define   TC_CMR_WAVEFORM_ACPA_NONE_Val     0x0u                                       /**< (TC_CMR) WAVEFORM NONE  */
319 #define   TC_CMR_WAVEFORM_ACPA_SET_Val      0x1u                                       /**< (TC_CMR) WAVEFORM SET  */
320 #define   TC_CMR_WAVEFORM_ACPA_CLEAR_Val    0x2u                                       /**< (TC_CMR) WAVEFORM CLEAR  */
321 #define   TC_CMR_WAVEFORM_ACPA_TOGGLE_Val   0x3u                                       /**< (TC_CMR) WAVEFORM TOGGLE  */
322 #define TC_CMR_WAVEFORM_ACPA_NONE           (TC_CMR_WAVEFORM_ACPA_NONE_Val << TC_CMR_WAVEFORM_ACPA_Pos)  /**< (TC_CMR) NONE Position  */
323 #define TC_CMR_WAVEFORM_ACPA_SET            (TC_CMR_WAVEFORM_ACPA_SET_Val << TC_CMR_WAVEFORM_ACPA_Pos)  /**< (TC_CMR) SET Position  */
324 #define TC_CMR_WAVEFORM_ACPA_CLEAR          (TC_CMR_WAVEFORM_ACPA_CLEAR_Val << TC_CMR_WAVEFORM_ACPA_Pos)  /**< (TC_CMR) CLEAR Position  */
325 #define TC_CMR_WAVEFORM_ACPA_TOGGLE         (TC_CMR_WAVEFORM_ACPA_TOGGLE_Val << TC_CMR_WAVEFORM_ACPA_Pos)  /**< (TC_CMR) TOGGLE Position  */
326 #define TC_CMR_WAVEFORM_ACPC_Pos            18                                             /**< (TC_CMR) RC Compare Effect on TIOAx Position */
327 #define TC_CMR_WAVEFORM_ACPC_Msk            (0x3u << TC_CMR_WAVEFORM_ACPC_Pos)         /**< (TC_CMR) RC Compare Effect on TIOAx Mask */
328 #define TC_CMR_WAVEFORM_ACPC(value)         (TC_CMR_WAVEFORM_ACPC_Msk & ((value) << TC_CMR_WAVEFORM_ACPC_Pos))
329 #define   TC_CMR_WAVEFORM_ACPC_NONE_Val     0x0u                                       /**< (TC_CMR) WAVEFORM NONE  */
330 #define   TC_CMR_WAVEFORM_ACPC_SET_Val      0x1u                                       /**< (TC_CMR) WAVEFORM SET  */
331 #define   TC_CMR_WAVEFORM_ACPC_CLEAR_Val    0x2u                                       /**< (TC_CMR) WAVEFORM CLEAR  */
332 #define   TC_CMR_WAVEFORM_ACPC_TOGGLE_Val   0x3u                                       /**< (TC_CMR) WAVEFORM TOGGLE  */
333 #define TC_CMR_WAVEFORM_ACPC_NONE           (TC_CMR_WAVEFORM_ACPC_NONE_Val << TC_CMR_WAVEFORM_ACPC_Pos)  /**< (TC_CMR) NONE Position  */
334 #define TC_CMR_WAVEFORM_ACPC_SET            (TC_CMR_WAVEFORM_ACPC_SET_Val << TC_CMR_WAVEFORM_ACPC_Pos)  /**< (TC_CMR) SET Position  */
335 #define TC_CMR_WAVEFORM_ACPC_CLEAR          (TC_CMR_WAVEFORM_ACPC_CLEAR_Val << TC_CMR_WAVEFORM_ACPC_Pos)  /**< (TC_CMR) CLEAR Position  */
336 #define TC_CMR_WAVEFORM_ACPC_TOGGLE         (TC_CMR_WAVEFORM_ACPC_TOGGLE_Val << TC_CMR_WAVEFORM_ACPC_Pos)  /**< (TC_CMR) TOGGLE Position  */
337 #define TC_CMR_WAVEFORM_AEEVT_Pos           20                                             /**< (TC_CMR) External Event Effect on TIOAx Position */
338 #define TC_CMR_WAVEFORM_AEEVT_Msk           (0x3u << TC_CMR_WAVEFORM_AEEVT_Pos)        /**< (TC_CMR) External Event Effect on TIOAx Mask */
339 #define TC_CMR_WAVEFORM_AEEVT(value)        (TC_CMR_WAVEFORM_AEEVT_Msk & ((value) << TC_CMR_WAVEFORM_AEEVT_Pos))
340 #define   TC_CMR_WAVEFORM_AEEVT_NONE_Val    0x0u                                       /**< (TC_CMR) WAVEFORM NONE  */
341 #define   TC_CMR_WAVEFORM_AEEVT_SET_Val     0x1u                                       /**< (TC_CMR) WAVEFORM SET  */
342 #define   TC_CMR_WAVEFORM_AEEVT_CLEAR_Val   0x2u                                       /**< (TC_CMR) WAVEFORM CLEAR  */
343 #define   TC_CMR_WAVEFORM_AEEVT_TOGGLE_Val  0x3u                                       /**< (TC_CMR) WAVEFORM TOGGLE  */
344 #define TC_CMR_WAVEFORM_AEEVT_NONE          (TC_CMR_WAVEFORM_AEEVT_NONE_Val << TC_CMR_WAVEFORM_AEEVT_Pos)  /**< (TC_CMR) NONE Position  */
345 #define TC_CMR_WAVEFORM_AEEVT_SET           (TC_CMR_WAVEFORM_AEEVT_SET_Val << TC_CMR_WAVEFORM_AEEVT_Pos)  /**< (TC_CMR) SET Position  */
346 #define TC_CMR_WAVEFORM_AEEVT_CLEAR         (TC_CMR_WAVEFORM_AEEVT_CLEAR_Val << TC_CMR_WAVEFORM_AEEVT_Pos)  /**< (TC_CMR) CLEAR Position  */
347 #define TC_CMR_WAVEFORM_AEEVT_TOGGLE        (TC_CMR_WAVEFORM_AEEVT_TOGGLE_Val << TC_CMR_WAVEFORM_AEEVT_Pos)  /**< (TC_CMR) TOGGLE Position  */
348 #define TC_CMR_WAVEFORM_ASWTRG_Pos          22                                             /**< (TC_CMR) Software Trigger Effect on TIOAx Position */
349 #define TC_CMR_WAVEFORM_ASWTRG_Msk          (0x3u << TC_CMR_WAVEFORM_ASWTRG_Pos)       /**< (TC_CMR) Software Trigger Effect on TIOAx Mask */
350 #define TC_CMR_WAVEFORM_ASWTRG(value)       (TC_CMR_WAVEFORM_ASWTRG_Msk & ((value) << TC_CMR_WAVEFORM_ASWTRG_Pos))
351 #define   TC_CMR_WAVEFORM_ASWTRG_NONE_Val   0x0u                                       /**< (TC_CMR) WAVEFORM NONE  */
352 #define   TC_CMR_WAVEFORM_ASWTRG_SET_Val    0x1u                                       /**< (TC_CMR) WAVEFORM SET  */
353 #define   TC_CMR_WAVEFORM_ASWTRG_CLEAR_Val  0x2u                                       /**< (TC_CMR) WAVEFORM CLEAR  */
354 #define   TC_CMR_WAVEFORM_ASWTRG_TOGGLE_Val 0x3u                                       /**< (TC_CMR) WAVEFORM TOGGLE  */
355 #define TC_CMR_WAVEFORM_ASWTRG_NONE         (TC_CMR_WAVEFORM_ASWTRG_NONE_Val << TC_CMR_WAVEFORM_ASWTRG_Pos)  /**< (TC_CMR) NONE Position  */
356 #define TC_CMR_WAVEFORM_ASWTRG_SET          (TC_CMR_WAVEFORM_ASWTRG_SET_Val << TC_CMR_WAVEFORM_ASWTRG_Pos)  /**< (TC_CMR) SET Position  */
357 #define TC_CMR_WAVEFORM_ASWTRG_CLEAR        (TC_CMR_WAVEFORM_ASWTRG_CLEAR_Val << TC_CMR_WAVEFORM_ASWTRG_Pos)  /**< (TC_CMR) CLEAR Position  */
358 #define TC_CMR_WAVEFORM_ASWTRG_TOGGLE       (TC_CMR_WAVEFORM_ASWTRG_TOGGLE_Val << TC_CMR_WAVEFORM_ASWTRG_Pos)  /**< (TC_CMR) TOGGLE Position  */
359 #define TC_CMR_WAVEFORM_BCPB_Pos            24                                             /**< (TC_CMR) RB Compare Effect on TIOBx Position */
360 #define TC_CMR_WAVEFORM_BCPB_Msk            (0x3u << TC_CMR_WAVEFORM_BCPB_Pos)         /**< (TC_CMR) RB Compare Effect on TIOBx Mask */
361 #define TC_CMR_WAVEFORM_BCPB(value)         (TC_CMR_WAVEFORM_BCPB_Msk & ((value) << TC_CMR_WAVEFORM_BCPB_Pos))
362 #define   TC_CMR_WAVEFORM_BCPB_NONE_Val     0x0u                                       /**< (TC_CMR) WAVEFORM NONE  */
363 #define   TC_CMR_WAVEFORM_BCPB_SET_Val      0x1u                                       /**< (TC_CMR) WAVEFORM SET  */
364 #define   TC_CMR_WAVEFORM_BCPB_CLEAR_Val    0x2u                                       /**< (TC_CMR) WAVEFORM CLEAR  */
365 #define   TC_CMR_WAVEFORM_BCPB_TOGGLE_Val   0x3u                                       /**< (TC_CMR) WAVEFORM TOGGLE  */
366 #define TC_CMR_WAVEFORM_BCPB_NONE           (TC_CMR_WAVEFORM_BCPB_NONE_Val << TC_CMR_WAVEFORM_BCPB_Pos)  /**< (TC_CMR) NONE Position  */
367 #define TC_CMR_WAVEFORM_BCPB_SET            (TC_CMR_WAVEFORM_BCPB_SET_Val << TC_CMR_WAVEFORM_BCPB_Pos)  /**< (TC_CMR) SET Position  */
368 #define TC_CMR_WAVEFORM_BCPB_CLEAR          (TC_CMR_WAVEFORM_BCPB_CLEAR_Val << TC_CMR_WAVEFORM_BCPB_Pos)  /**< (TC_CMR) CLEAR Position  */
369 #define TC_CMR_WAVEFORM_BCPB_TOGGLE         (TC_CMR_WAVEFORM_BCPB_TOGGLE_Val << TC_CMR_WAVEFORM_BCPB_Pos)  /**< (TC_CMR) TOGGLE Position  */
370 #define TC_CMR_WAVEFORM_BCPC_Pos            26                                             /**< (TC_CMR) RC Compare Effect on TIOBx Position */
371 #define TC_CMR_WAVEFORM_BCPC_Msk            (0x3u << TC_CMR_WAVEFORM_BCPC_Pos)         /**< (TC_CMR) RC Compare Effect on TIOBx Mask */
372 #define TC_CMR_WAVEFORM_BCPC(value)         (TC_CMR_WAVEFORM_BCPC_Msk & ((value) << TC_CMR_WAVEFORM_BCPC_Pos))
373 #define   TC_CMR_WAVEFORM_BCPC_NONE_Val     0x0u                                       /**< (TC_CMR) WAVEFORM NONE  */
374 #define   TC_CMR_WAVEFORM_BCPC_SET_Val      0x1u                                       /**< (TC_CMR) WAVEFORM SET  */
375 #define   TC_CMR_WAVEFORM_BCPC_CLEAR_Val    0x2u                                       /**< (TC_CMR) WAVEFORM CLEAR  */
376 #define   TC_CMR_WAVEFORM_BCPC_TOGGLE_Val   0x3u                                       /**< (TC_CMR) WAVEFORM TOGGLE  */
377 #define TC_CMR_WAVEFORM_BCPC_NONE           (TC_CMR_WAVEFORM_BCPC_NONE_Val << TC_CMR_WAVEFORM_BCPC_Pos)  /**< (TC_CMR) NONE Position  */
378 #define TC_CMR_WAVEFORM_BCPC_SET            (TC_CMR_WAVEFORM_BCPC_SET_Val << TC_CMR_WAVEFORM_BCPC_Pos)  /**< (TC_CMR) SET Position  */
379 #define TC_CMR_WAVEFORM_BCPC_CLEAR          (TC_CMR_WAVEFORM_BCPC_CLEAR_Val << TC_CMR_WAVEFORM_BCPC_Pos)  /**< (TC_CMR) CLEAR Position  */
380 #define TC_CMR_WAVEFORM_BCPC_TOGGLE         (TC_CMR_WAVEFORM_BCPC_TOGGLE_Val << TC_CMR_WAVEFORM_BCPC_Pos)  /**< (TC_CMR) TOGGLE Position  */
381 #define TC_CMR_WAVEFORM_BEEVT_Pos           28                                             /**< (TC_CMR) External Event Effect on TIOBx Position */
382 #define TC_CMR_WAVEFORM_BEEVT_Msk           (0x3u << TC_CMR_WAVEFORM_BEEVT_Pos)        /**< (TC_CMR) External Event Effect on TIOBx Mask */
383 #define TC_CMR_WAVEFORM_BEEVT(value)        (TC_CMR_WAVEFORM_BEEVT_Msk & ((value) << TC_CMR_WAVEFORM_BEEVT_Pos))
384 #define   TC_CMR_WAVEFORM_BEEVT_NONE_Val    0x0u                                       /**< (TC_CMR) WAVEFORM NONE  */
385 #define   TC_CMR_WAVEFORM_BEEVT_SET_Val     0x1u                                       /**< (TC_CMR) WAVEFORM SET  */
386 #define   TC_CMR_WAVEFORM_BEEVT_CLEAR_Val   0x2u                                       /**< (TC_CMR) WAVEFORM CLEAR  */
387 #define   TC_CMR_WAVEFORM_BEEVT_TOGGLE_Val  0x3u                                       /**< (TC_CMR) WAVEFORM TOGGLE  */
388 #define TC_CMR_WAVEFORM_BEEVT_NONE          (TC_CMR_WAVEFORM_BEEVT_NONE_Val << TC_CMR_WAVEFORM_BEEVT_Pos)  /**< (TC_CMR) NONE Position  */
389 #define TC_CMR_WAVEFORM_BEEVT_SET           (TC_CMR_WAVEFORM_BEEVT_SET_Val << TC_CMR_WAVEFORM_BEEVT_Pos)  /**< (TC_CMR) SET Position  */
390 #define TC_CMR_WAVEFORM_BEEVT_CLEAR         (TC_CMR_WAVEFORM_BEEVT_CLEAR_Val << TC_CMR_WAVEFORM_BEEVT_Pos)  /**< (TC_CMR) CLEAR Position  */
391 #define TC_CMR_WAVEFORM_BEEVT_TOGGLE        (TC_CMR_WAVEFORM_BEEVT_TOGGLE_Val << TC_CMR_WAVEFORM_BEEVT_Pos)  /**< (TC_CMR) TOGGLE Position  */
392 #define TC_CMR_WAVEFORM_BSWTRG_Pos          30                                             /**< (TC_CMR) Software Trigger Effect on TIOBx Position */
393 #define TC_CMR_WAVEFORM_BSWTRG_Msk          (0x3u << TC_CMR_WAVEFORM_BSWTRG_Pos)       /**< (TC_CMR) Software Trigger Effect on TIOBx Mask */
394 #define TC_CMR_WAVEFORM_BSWTRG(value)       (TC_CMR_WAVEFORM_BSWTRG_Msk & ((value) << TC_CMR_WAVEFORM_BSWTRG_Pos))
395 #define   TC_CMR_WAVEFORM_BSWTRG_NONE_Val   0x0u                                       /**< (TC_CMR) WAVEFORM NONE  */
396 #define   TC_CMR_WAVEFORM_BSWTRG_SET_Val    0x1u                                       /**< (TC_CMR) WAVEFORM SET  */
397 #define   TC_CMR_WAVEFORM_BSWTRG_CLEAR_Val  0x2u                                       /**< (TC_CMR) WAVEFORM CLEAR  */
398 #define   TC_CMR_WAVEFORM_BSWTRG_TOGGLE_Val 0x3u                                       /**< (TC_CMR) WAVEFORM TOGGLE  */
399 #define TC_CMR_WAVEFORM_BSWTRG_NONE         (TC_CMR_WAVEFORM_BSWTRG_NONE_Val << TC_CMR_WAVEFORM_BSWTRG_Pos)  /**< (TC_CMR) NONE Position  */
400 #define TC_CMR_WAVEFORM_BSWTRG_SET          (TC_CMR_WAVEFORM_BSWTRG_SET_Val << TC_CMR_WAVEFORM_BSWTRG_Pos)  /**< (TC_CMR) SET Position  */
401 #define TC_CMR_WAVEFORM_BSWTRG_CLEAR        (TC_CMR_WAVEFORM_BSWTRG_CLEAR_Val << TC_CMR_WAVEFORM_BSWTRG_Pos)  /**< (TC_CMR) CLEAR Position  */
402 #define TC_CMR_WAVEFORM_BSWTRG_TOGGLE       (TC_CMR_WAVEFORM_BSWTRG_TOGGLE_Val << TC_CMR_WAVEFORM_BSWTRG_Pos)  /**< (TC_CMR) TOGGLE Position  */
403 #define TC_CMR_WAVEFORM_MASK                0xFFFF7FC0u                                /**< \deprecated (TC_CMR_WAVEFORM) Register MASK  (Use TC_CMR_WAVEFORM_Msk instead)  */
404 #define TC_CMR_WAVEFORM_Msk                 0xFFFF7FC0u                                /**< (TC_CMR_WAVEFORM) Register Mask  */
405 
406 /* -------- TC_SMMR : (TC Offset: N/A) Stepper Motor Mode Register -------- */
407 #define TC_SMMR_GCEN (0x1u << 0) /**< \brief (TC_SMMR) Gray Count Enable */
408 #define TC_SMMR_DOWN (0x1u << 1) /**< \brief (TC_SMMR) DOWN Count */
409 /* -------- TC_RAB : (TC Offset: N/A) Register AB -------- */
410 #define TC_RAB_RAB_Pos 0
411 #define TC_RAB_RAB_Msk (0xffffffffu << TC_RAB_RAB_Pos) /**< \brief (TC_RAB) Register A or Register B */
412 /* -------- TC_CV : (TC Offset: N/A) Counter Value -------- */
413 #define TC_CV_CV_Pos 0
414 #define TC_CV_CV_Msk (0xffffffffu << TC_CV_CV_Pos) /**< \brief (TC_CV) Counter Value */
415 /* -------- TC_RA : (TC Offset: N/A) Register A -------- */
416 #define TC_RA_RA_Pos 0
417 #define TC_RA_RA_Msk (0xffffffffu << TC_RA_RA_Pos) /**< \brief (TC_RA) Register A */
418 #define TC_RA_RA(value) ((TC_RA_RA_Msk & ((value) << TC_RA_RA_Pos)))
419 /* -------- TC_RB : (TC Offset: N/A) Register B -------- */
420 #define TC_RB_RB_Pos 0
421 #define TC_RB_RB_Msk (0xffffffffu << TC_RB_RB_Pos) /**< \brief (TC_RB) Register B */
422 #define TC_RB_RB(value) ((TC_RB_RB_Msk & ((value) << TC_RB_RB_Pos)))
423 /* -------- TC_RC : (TC Offset: N/A) Register C -------- */
424 #define TC_RC_RC_Pos 0
425 #define TC_RC_RC_Msk (0xffffffffu << TC_RC_RC_Pos) /**< \brief (TC_RC) Register C */
426 #define TC_RC_RC(value) ((TC_RC_RC_Msk & ((value) << TC_RC_RC_Pos)))
427 /* -------- TC_SR : (TC Offset: N/A) Status Register -------- */
428 #define TC_SR_COVFS (0x1u << 0) /**< \brief (TC_SR) Counter Overflow Status */
429 #define TC_SR_LOVRS (0x1u << 1) /**< \brief (TC_SR) Load Overrun Status */
430 #define TC_SR_CPAS (0x1u << 2) /**< \brief (TC_SR) RA Compare Status */
431 #define TC_SR_CPBS (0x1u << 3) /**< \brief (TC_SR) RB Compare Status */
432 #define TC_SR_CPCS (0x1u << 4) /**< \brief (TC_SR) RC Compare Status */
433 #define TC_SR_LDRAS (0x1u << 5) /**< \brief (TC_SR) RA Loading Status */
434 #define TC_SR_LDRBS (0x1u << 6) /**< \brief (TC_SR) RB Loading Status */
435 #define TC_SR_ETRGS (0x1u << 7) /**< \brief (TC_SR) External Trigger Status */
436 #define TC_SR_ENDRX (0x1u << 8) /**< \brief (TC_SR) End of Receiver Transfer */
437 #define TC_SR_RXBUFF (0x1u << 9) /**< \brief (TC_SR) Reception Buffer Full */
438 #define TC_SR_CLKSTA (0x1u << 16) /**< \brief (TC_SR) Clock Enabling Status */
439 #define TC_SR_MTIOA (0x1u << 17) /**< \brief (TC_SR) TIOA Mirror */
440 #define TC_SR_MTIOB (0x1u << 18) /**< \brief (TC_SR) TIOB Mirror */
441 /* -------- TC_IER : (TC Offset: N/A) Interrupt Enable Register -------- */
442 #define TC_IER_COVFS (0x1u << 0) /**< \brief (TC_IER) Counter Overflow */
443 #define TC_IER_LOVRS (0x1u << 1) /**< \brief (TC_IER) Load Overrun */
444 #define TC_IER_CPAS (0x1u << 2) /**< \brief (TC_IER) RA Compare */
445 #define TC_IER_CPBS (0x1u << 3) /**< \brief (TC_IER) RB Compare */
446 #define TC_IER_CPCS (0x1u << 4) /**< \brief (TC_IER) RC Compare */
447 #define TC_IER_LDRAS (0x1u << 5) /**< \brief (TC_IER) RA Loading */
448 #define TC_IER_LDRBS (0x1u << 6) /**< \brief (TC_IER) RB Loading */
449 #define TC_IER_ETRGS (0x1u << 7) /**< \brief (TC_IER) External Trigger */
450 #define TC_IER_ENDRX (0x1u << 8) /**< \brief (TC_IER) End of Receiver Transfer */
451 #define TC_IER_RXBUFF (0x1u << 9) /**< \brief (TC_IER) Reception Buffer Full */
452 /* -------- TC_IDR : (TC Offset: N/A) Interrupt Disable Register -------- */
453 #define TC_IDR_COVFS (0x1u << 0) /**< \brief (TC_IDR) Counter Overflow */
454 #define TC_IDR_LOVRS (0x1u << 1) /**< \brief (TC_IDR) Load Overrun */
455 #define TC_IDR_CPAS (0x1u << 2) /**< \brief (TC_IDR) RA Compare */
456 #define TC_IDR_CPBS (0x1u << 3) /**< \brief (TC_IDR) RB Compare */
457 #define TC_IDR_CPCS (0x1u << 4) /**< \brief (TC_IDR) RC Compare */
458 #define TC_IDR_LDRAS (0x1u << 5) /**< \brief (TC_IDR) RA Loading */
459 #define TC_IDR_LDRBS (0x1u << 6) /**< \brief (TC_IDR) RB Loading */
460 #define TC_IDR_ETRGS (0x1u << 7) /**< \brief (TC_IDR) External Trigger */
461 #define TC_IDR_ENDRX (0x1u << 8) /**< \brief (TC_IDR) End of Receiver Transfer */
462 #define TC_IDR_RXBUFF (0x1u << 9) /**< \brief (TC_IDR) Reception Buffer Full */
463 /* -------- TC_IMR : (TC Offset: N/A) Interrupt Mask Register -------- */
464 #define TC_IMR_COVFS (0x1u << 0) /**< \brief (TC_IMR) Counter Overflow */
465 #define TC_IMR_LOVRS (0x1u << 1) /**< \brief (TC_IMR) Load Overrun */
466 #define TC_IMR_CPAS (0x1u << 2) /**< \brief (TC_IMR) RA Compare */
467 #define TC_IMR_CPBS (0x1u << 3) /**< \brief (TC_IMR) RB Compare */
468 #define TC_IMR_CPCS (0x1u << 4) /**< \brief (TC_IMR) RC Compare */
469 #define TC_IMR_LDRAS (0x1u << 5) /**< \brief (TC_IMR) RA Loading */
470 #define TC_IMR_LDRBS (0x1u << 6) /**< \brief (TC_IMR) RB Loading */
471 #define TC_IMR_ETRGS (0x1u << 7) /**< \brief (TC_IMR) External Trigger */
472 #define TC_IMR_ENDRX (0x1u << 8) /**< \brief (TC_IMR) End of Receiver Transfer */
473 #define TC_IMR_RXBUFF (0x1u << 9) /**< \brief (TC_IMR) Reception Buffer Full */
474 /* -------- TC_EMR : (TC Offset: N/A) Extended Mode Register -------- */
475 #define TC_EMR_TRIGSRCA_Pos 0
476 #define TC_EMR_TRIGSRCA_Msk (0x3u << TC_EMR_TRIGSRCA_Pos) /**< \brief (TC_EMR) TRIGger SouRCe for input A */
477 #define   TC_EMR_TRIGSRCA_EXTERNAL_TIOAx (0x0u << 0) /**< \brief (TC_EMR) the trigger/capture input A is driven by external pin TIOAx */
478 #define   TC_EMR_TRIGSRCA_PWMx (0x1u << 0) /**< \brief (TC_EMR) the trigger/capture input A is driven internally by PWMx */
479 #define TC_EMR_TRIGSRCB_Pos 4
480 #define TC_EMR_TRIGSRCB_Msk (0x3u << TC_EMR_TRIGSRCB_Pos) /**< \brief (TC_EMR) TRIGger SouRCe for input B */
481 #define   TC_EMR_TRIGSRCB_EXTERNAL_TIOBx (0x0u << 4) /**< \brief (TC_EMR) the trigger/capture input B is driven by external pin TIOBx */
482 #define   TC_EMR_TRIGSRCB_PWMx (0x1u << 4) /**< \brief (TC_EMR) the trigger/capture input B is driven internally by PWMx */
483 #define TC_EMR_NODIVCLK (0x1u << 8) /**< \brief (TC_EMR) NO DIVided CLocK */
484 /* -------- TC_BCR : (TC Offset: 0xC0) Block Control Register -------- */
485 #define TC_BCR_SYNC (0x1u << 0) /**< \brief (TC_BCR) Synchro Command */
486 /* -------- TC_BMR : (TC Offset: 0xC4) Block Mode Register -------- */
487 #define TC_BMR_TC0XC0S_Pos 0
488 #define TC_BMR_TC0XC0S_Msk (0x3u << TC_BMR_TC0XC0S_Pos) /**< \brief (TC_BMR) External Clock Signal 0 Selection */
489 #define   TC_BMR_TC0XC0S_TCLK0 (0x0u << 0) /**< \brief (TC_BMR) Signal connected to XC0: TCLK0 */
490 #define   TC_BMR_TC0XC0S_TIOA1 (0x2u << 0) /**< \brief (TC_BMR) Signal connected to XC0: TIOA1 */
491 #define   TC_BMR_TC0XC0S_TIOA2 (0x3u << 0) /**< \brief (TC_BMR) Signal connected to XC0: TIOA2 */
492 #define TC_BMR_TC1XC1S_Pos 2
493 #define TC_BMR_TC1XC1S_Msk (0x3u << TC_BMR_TC1XC1S_Pos) /**< \brief (TC_BMR) External Clock Signal 1 Selection */
494 #define   TC_BMR_TC1XC1S_TCLK1 (0x0u << 2) /**< \brief (TC_BMR) Signal connected to XC1: TCLK1 */
495 #define   TC_BMR_TC1XC1S_TIOA0 (0x2u << 2) /**< \brief (TC_BMR) Signal connected to XC1: TIOA0 */
496 #define   TC_BMR_TC1XC1S_TIOA2 (0x3u << 2) /**< \brief (TC_BMR) Signal connected to XC1: TIOA2 */
497 #define TC_BMR_TC2XC2S_Pos 4
498 #define TC_BMR_TC2XC2S_Msk (0x3u << TC_BMR_TC2XC2S_Pos) /**< \brief (TC_BMR) External Clock Signal 2 Selection */
499 #define   TC_BMR_TC2XC2S_TCLK2 (0x0u << 4) /**< \brief (TC_BMR) Signal connected to XC2: TCLK2 */
500 #define   TC_BMR_TC2XC2S_TIOA1 (0x2u << 4) /**< \brief (TC_BMR) Signal connected to XC2: TIOA1 */
501 #define   TC_BMR_TC2XC2S_TIOA2 (0x3u << 4) /**< \brief (TC_BMR) Signal connected to XC2: TIOA2 */
502 #define TC_BMR_QDEN (0x1u << 8) /**< \brief (TC_BMR) Quadrature Decoder ENabled */
503 #define TC_BMR_POSEN (0x1u << 9) /**< \brief (TC_BMR) POSition ENabled */
504 #define TC_BMR_SPEEDEN (0x1u << 10) /**< \brief (TC_BMR) SPEED ENabled */
505 #define TC_BMR_QDTRANS (0x1u << 11) /**< \brief (TC_BMR) Quadrature Decoding TRANSparent */
506 #define TC_BMR_EDGPHA (0x1u << 12) /**< \brief (TC_BMR) EDGe on PHA count mode */
507 #define TC_BMR_INVA (0x1u << 13) /**< \brief (TC_BMR) INVerted phA */
508 #define TC_BMR_INVB (0x1u << 14) /**< \brief (TC_BMR) INVerted phB */
509 #define TC_BMR_INVIDX (0x1u << 15) /**< \brief (TC_BMR) INVerted InDeX */
510 #define TC_BMR_SWAP (0x1u << 16) /**< \brief (TC_BMR) SWAP PHA and PHB */
511 #define TC_BMR_IDXPHB (0x1u << 17) /**< \brief (TC_BMR) InDeX pin is PHB pin */
512 #define TC_BMR_FILTER (0x1u << 19) /**< \brief (TC_BMR)  */
513 #define TC_BMR_MAXFILT_Pos 20
514 #define TC_BMR_MAXFILT_Msk (0x3fu << TC_BMR_MAXFILT_Pos) /**< \brief (TC_BMR) MAXimum FILTer */
515 #define TC_BMR_MAXFILT(value) ((TC_BMR_MAXFILT_Msk & ((value) << TC_BMR_MAXFILT_Pos)))
516 /* -------- TC_QIER : (TC Offset: 0xC8) QDEC Interrupt Enable Register -------- */
517 #define TC_QIER_IDX (0x1u << 0) /**< \brief (TC_QIER) InDeX */
518 #define TC_QIER_DIRCHG (0x1u << 1) /**< \brief (TC_QIER) DIRection CHanGe */
519 #define TC_QIER_QERR (0x1u << 2) /**< \brief (TC_QIER) Quadrature ERRor */
520 /* -------- TC_QIDR : (TC Offset: 0xCC) QDEC Interrupt Disable Register -------- */
521 #define TC_QIDR_IDX (0x1u << 0) /**< \brief (TC_QIDR) InDeX */
522 #define TC_QIDR_DIRCHG (0x1u << 1) /**< \brief (TC_QIDR) DIRection CHanGe */
523 #define TC_QIDR_QERR (0x1u << 2) /**< \brief (TC_QIDR) Quadrature ERRor */
524 /* -------- TC_QIMR : (TC Offset: 0xD0) QDEC Interrupt Mask Register -------- */
525 #define TC_QIMR_IDX (0x1u << 0) /**< \brief (TC_QIMR) InDeX */
526 #define TC_QIMR_DIRCHG (0x1u << 1) /**< \brief (TC_QIMR) DIRection CHanGe */
527 #define TC_QIMR_QERR (0x1u << 2) /**< \brief (TC_QIMR) Quadrature ERRor */
528 /* -------- TC_QISR : (TC Offset: 0xD4) QDEC Interrupt Status Register -------- */
529 #define TC_QISR_IDX (0x1u << 0) /**< \brief (TC_QISR) InDeX */
530 #define TC_QISR_DIRCHG (0x1u << 1) /**< \brief (TC_QISR) DIRection CHanGe */
531 #define TC_QISR_QERR (0x1u << 2) /**< \brief (TC_QISR) Quadrature ERRor */
532 #define TC_QISR_DIR (0x1u << 8) /**< \brief (TC_QISR) DIRection */
533 /* -------- TC_FMR : (TC Offset: 0xD8) Fault Mode Register -------- */
534 #define TC_FMR_ENCF0 (0x1u << 0) /**< \brief (TC_FMR) ENable Compare Fault Channel 0 */
535 #define TC_FMR_ENCF1 (0x1u << 1) /**< \brief (TC_FMR) ENable Compare Fault Channel 1 */
536 /* -------- TC_WPMR : (TC Offset: 0xE4) Write Protect Mode Register -------- */
537 #define TC_WPMR_WPEN (0x1u << 0) /**< \brief (TC_WPMR) Write Protect Enable */
538 #define TC_WPMR_WPKEY_Pos 8
539 #define TC_WPMR_WPKEY_Msk (0xffffffu << TC_WPMR_WPKEY_Pos) /**< \brief (TC_WPMR) Write Protect KEY */
540 #define TC_WPMR_WPKEY(value) ((TC_WPMR_WPKEY_Msk & ((value) << TC_WPMR_WPKEY_Pos)))
541 /* -------- TC_RPR : (TC Offset: N/A) Receive Pointer Register -------- */
542 #define TC_RPR_RXPTR_Pos 0
543 #define TC_RPR_RXPTR_Msk (0xffffffffu << TC_RPR_RXPTR_Pos) /**< \brief (TC_RPR) Receive Pointer Register */
544 #define TC_RPR_RXPTR(value) ((TC_RPR_RXPTR_Msk & ((value) << TC_RPR_RXPTR_Pos)))
545 /* -------- TC_RCR : (TC Offset: N/A) Receive Counter Register -------- */
546 #define TC_RCR_RXCTR_Pos 0
547 #define TC_RCR_RXCTR_Msk (0xffffu << TC_RCR_RXCTR_Pos) /**< \brief (TC_RCR) Receive Counter Register */
548 #define TC_RCR_RXCTR(value) ((TC_RCR_RXCTR_Msk & ((value) << TC_RCR_RXCTR_Pos)))
549 /* -------- TC_RNPR : (TC Offset: N/A) Receive Next Pointer Register -------- */
550 #define TC_RNPR_RXNPTR_Pos 0
551 #define TC_RNPR_RXNPTR_Msk (0xffffffffu << TC_RNPR_RXNPTR_Pos) /**< \brief (TC_RNPR) Receive Next Pointer */
552 #define TC_RNPR_RXNPTR(value) ((TC_RNPR_RXNPTR_Msk & ((value) << TC_RNPR_RXNPTR_Pos)))
553 /* -------- TC_RNCR : (TC Offset: N/A) Receive Next Counter Register -------- */
554 #define TC_RNCR_RXNCTR_Pos 0
555 #define TC_RNCR_RXNCTR_Msk (0xffffu << TC_RNCR_RXNCTR_Pos) /**< \brief (TC_RNCR) Receive Next Counter */
556 #define TC_RNCR_RXNCTR(value) ((TC_RNCR_RXNCTR_Msk & ((value) << TC_RNCR_RXNCTR_Pos)))
557 /* -------- TC_PTCR : (TC Offset: N/A) Transfer Control Register -------- */
558 #define TC_PTCR_RXTEN (0x1u << 0) /**< \brief (TC_PTCR) Receiver Transfer Enable */
559 #define TC_PTCR_RXTDIS (0x1u << 1) /**< \brief (TC_PTCR) Receiver Transfer Disable */
560 #define TC_PTCR_TXTEN (0x1u << 8) /**< \brief (TC_PTCR) Transmitter Transfer Enable */
561 #define TC_PTCR_TXTDIS (0x1u << 9) /**< \brief (TC_PTCR) Transmitter Transfer Disable */
562 /* -------- TC_PTSR : (TC Offset: N/A) Transfer Status Register -------- */
563 #define TC_PTSR_RXTEN (0x1u << 0) /**< \brief (TC_PTSR) Receiver Transfer Enable */
564 #define TC_PTSR_TXTEN (0x1u << 8) /**< \brief (TC_PTSR) Transmitter Transfer Enable */
565 
566 /*@}*/
567 
568 
569 #endif /* _SAM4E_TC_COMPONENT_ */
570