Robobo
component_adc.h
1 /* ----------------------------------------------------------------------------
2  * SAM Software Package License
3  * ----------------------------------------------------------------------------
4  * Copyright (c) 2012, Atmel Corporation
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following condition is met:
10  *
11  * - Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the disclaimer below.
13  *
14  * Atmel's name may not be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
20  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  * ----------------------------------------------------------------------------
28  */
29 
30 #ifndef _SAM3XA_ADC_COMPONENT_
31 #define _SAM3XA_ADC_COMPONENT_
32 
33 /* ============================================================================= */
35 /* ============================================================================= */
38 
39 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
40 
41 typedef struct {
42  WoReg ADC_CR;
43  RwReg ADC_MR;
44  RwReg ADC_SEQR1;
45  RwReg ADC_SEQR2;
46  WoReg ADC_CHER;
47  WoReg ADC_CHDR;
48  RoReg ADC_CHSR;
49  RoReg Reserved1[1];
50  RoReg ADC_LCDR;
51  WoReg ADC_IER;
52  WoReg ADC_IDR;
53  RoReg ADC_IMR;
54  RoReg ADC_ISR;
55  RoReg Reserved2[2];
56  RoReg ADC_OVER;
57  RwReg ADC_EMR;
58  RwReg ADC_CWR;
59  RwReg ADC_CGR;
60  RwReg ADC_COR;
61  RoReg ADC_CDR[16];
62  RoReg Reserved3[1];
63  RwReg ADC_ACR;
64  RoReg Reserved4[19];
65  RwReg ADC_WPMR;
66  RoReg ADC_WPSR;
67  RoReg Reserved5[5];
68  RwReg ADC_RPR;
69  RwReg ADC_RCR;
70  RoReg Reserved6[2];
71  RwReg ADC_RNPR;
72  RwReg ADC_RNCR;
73  RoReg Reserved7[2];
74  WoReg ADC_PTCR;
75  RoReg ADC_PTSR;
76 } Adc;
77 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
78 /* -------- ADC_CR : (ADC Offset: 0x00) Control Register -------- */
79 #define ADC_CR_SWRST (0x1u << 0)
80 #define ADC_CR_START (0x1u << 1)
81 /* -------- ADC_MR : (ADC Offset: 0x04) Mode Register -------- */
82 #define ADC_MR_TRGEN (0x1u << 0)
83 #define ADC_MR_TRGEN_DIS (0x0u << 0)
84 #define ADC_MR_TRGEN_EN (0x1u << 0)
85 #define ADC_MR_TRGSEL_Pos 1
86 #define ADC_MR_TRGSEL_Msk (0x7u << ADC_MR_TRGSEL_Pos)
87 #define ADC_MR_TRGSEL_ADC_TRIG0 (0x0u << 1)
88 #define ADC_MR_TRGSEL_ADC_TRIG1 (0x1u << 1)
89 #define ADC_MR_TRGSEL_ADC_TRIG2 (0x2u << 1)
90 #define ADC_MR_TRGSEL_ADC_TRIG3 (0x3u << 1)
91 #define ADC_MR_TRGSEL_ADC_TRIG4 (0x4u << 1)
92 #define ADC_MR_TRGSEL_ADC_TRIG5 (0x5u << 1)
93 #define ADC_MR_LOWRES (0x1u << 4)
94 #define ADC_MR_LOWRES_BITS_12 (0x0u << 4)
95 #define ADC_MR_LOWRES_BITS_10 (0x1u << 4)
96 #define ADC_MR_SLEEP (0x1u << 5)
97 #define ADC_MR_SLEEP_NORMAL (0x0u << 5)
98 #define ADC_MR_SLEEP_SLEEP (0x1u << 5)
99 #define ADC_MR_FWUP (0x1u << 6)
100 #define ADC_MR_FWUP_OFF (0x0u << 6)
101 #define ADC_MR_FWUP_ON (0x1u << 6)
102 #define ADC_MR_FREERUN (0x1u << 7)
103 #define ADC_MR_FREERUN_OFF (0x0u << 7)
104 #define ADC_MR_FREERUN_ON (0x1u << 7)
105 #define ADC_MR_PRESCAL_Pos 8
106 #define ADC_MR_PRESCAL_Msk (0xffu << ADC_MR_PRESCAL_Pos)
107 #define ADC_MR_PRESCAL(value) ((ADC_MR_PRESCAL_Msk & ((value) << ADC_MR_PRESCAL_Pos)))
108 #define ADC_MR_STARTUP_Pos 16
109 #define ADC_MR_STARTUP_Msk (0xfu << ADC_MR_STARTUP_Pos)
110 #define ADC_MR_STARTUP_SUT0 (0x0u << 16)
111 #define ADC_MR_STARTUP_SUT8 (0x1u << 16)
112 #define ADC_MR_STARTUP_SUT16 (0x2u << 16)
113 #define ADC_MR_STARTUP_SUT24 (0x3u << 16)
114 #define ADC_MR_STARTUP_SUT64 (0x4u << 16)
115 #define ADC_MR_STARTUP_SUT80 (0x5u << 16)
116 #define ADC_MR_STARTUP_SUT96 (0x6u << 16)
117 #define ADC_MR_STARTUP_SUT112 (0x7u << 16)
118 #define ADC_MR_STARTUP_SUT512 (0x8u << 16)
119 #define ADC_MR_STARTUP_SUT576 (0x9u << 16)
120 #define ADC_MR_STARTUP_SUT640 (0xAu << 16)
121 #define ADC_MR_STARTUP_SUT704 (0xBu << 16)
122 #define ADC_MR_STARTUP_SUT768 (0xCu << 16)
123 #define ADC_MR_STARTUP_SUT832 (0xDu << 16)
124 #define ADC_MR_STARTUP_SUT896 (0xEu << 16)
125 #define ADC_MR_STARTUP_SUT960 (0xFu << 16)
126 #define ADC_MR_SETTLING_Pos 20
127 #define ADC_MR_SETTLING_Msk (0x3u << ADC_MR_SETTLING_Pos)
128 #define ADC_MR_SETTLING_AST3 (0x0u << 20)
129 #define ADC_MR_SETTLING_AST5 (0x1u << 20)
130 #define ADC_MR_SETTLING_AST9 (0x2u << 20)
131 #define ADC_MR_SETTLING_AST17 (0x3u << 20)
132 #define ADC_MR_ANACH (0x1u << 23)
133 #define ADC_MR_ANACH_NONE (0x0u << 23)
134 #define ADC_MR_ANACH_ALLOWED (0x1u << 23)
135 #define ADC_MR_TRACKTIM_Pos 24
136 #define ADC_MR_TRACKTIM_Msk (0xfu << ADC_MR_TRACKTIM_Pos)
137 #define ADC_MR_TRACKTIM(value) ((ADC_MR_TRACKTIM_Msk & ((value) << ADC_MR_TRACKTIM_Pos)))
138 #define ADC_MR_TRANSFER_Pos 28
139 #define ADC_MR_TRANSFER_Msk (0x3u << ADC_MR_TRANSFER_Pos)
140 #define ADC_MR_TRANSFER(value) ((ADC_MR_TRANSFER_Msk & ((value) << ADC_MR_TRANSFER_Pos)))
141 #define ADC_MR_USEQ (0x1u << 31)
142 #define ADC_MR_USEQ_NUM_ORDER (0x0u << 31)
143 #define ADC_MR_USEQ_REG_ORDER (0x1u << 31)
144 /* -------- ADC_SEQR1 : (ADC Offset: 0x08) Channel Sequence Register 1 -------- */
145 #define ADC_SEQR1_USCH1_Pos 0
146 #define ADC_SEQR1_USCH1_Msk (0xfu << ADC_SEQR1_USCH1_Pos)
147 #define ADC_SEQR1_USCH1(value) ((ADC_SEQR1_USCH1_Msk & ((value) << ADC_SEQR1_USCH1_Pos)))
148 #define ADC_SEQR1_USCH2_Pos 4
149 #define ADC_SEQR1_USCH2_Msk (0xfu << ADC_SEQR1_USCH2_Pos)
150 #define ADC_SEQR1_USCH2(value) ((ADC_SEQR1_USCH2_Msk & ((value) << ADC_SEQR1_USCH2_Pos)))
151 #define ADC_SEQR1_USCH3_Pos 8
152 #define ADC_SEQR1_USCH3_Msk (0xfu << ADC_SEQR1_USCH3_Pos)
153 #define ADC_SEQR1_USCH3(value) ((ADC_SEQR1_USCH3_Msk & ((value) << ADC_SEQR1_USCH3_Pos)))
154 #define ADC_SEQR1_USCH4_Pos 12
155 #define ADC_SEQR1_USCH4_Msk (0xfu << ADC_SEQR1_USCH4_Pos)
156 #define ADC_SEQR1_USCH4(value) ((ADC_SEQR1_USCH4_Msk & ((value) << ADC_SEQR1_USCH4_Pos)))
157 #define ADC_SEQR1_USCH5_Pos 16
158 #define ADC_SEQR1_USCH5_Msk (0xfu << ADC_SEQR1_USCH5_Pos)
159 #define ADC_SEQR1_USCH5(value) ((ADC_SEQR1_USCH5_Msk & ((value) << ADC_SEQR1_USCH5_Pos)))
160 #define ADC_SEQR1_USCH6_Pos 20
161 #define ADC_SEQR1_USCH6_Msk (0xfu << ADC_SEQR1_USCH6_Pos)
162 #define ADC_SEQR1_USCH6(value) ((ADC_SEQR1_USCH6_Msk & ((value) << ADC_SEQR1_USCH6_Pos)))
163 #define ADC_SEQR1_USCH7_Pos 24
164 #define ADC_SEQR1_USCH7_Msk (0xfu << ADC_SEQR1_USCH7_Pos)
165 #define ADC_SEQR1_USCH7(value) ((ADC_SEQR1_USCH7_Msk & ((value) << ADC_SEQR1_USCH7_Pos)))
166 #define ADC_SEQR1_USCH8_Pos 28
167 #define ADC_SEQR1_USCH8_Msk (0xfu << ADC_SEQR1_USCH8_Pos)
168 #define ADC_SEQR1_USCH8(value) ((ADC_SEQR1_USCH8_Msk & ((value) << ADC_SEQR1_USCH8_Pos)))
169 /* -------- ADC_SEQR2 : (ADC Offset: 0x0C) Channel Sequence Register 2 -------- */
170 #define ADC_SEQR2_USCH9_Pos 0
171 #define ADC_SEQR2_USCH9_Msk (0xfu << ADC_SEQR2_USCH9_Pos)
172 #define ADC_SEQR2_USCH9(value) ((ADC_SEQR2_USCH9_Msk & ((value) << ADC_SEQR2_USCH9_Pos)))
173 #define ADC_SEQR2_USCH10_Pos 4
174 #define ADC_SEQR2_USCH10_Msk (0xfu << ADC_SEQR2_USCH10_Pos)
175 #define ADC_SEQR2_USCH10(value) ((ADC_SEQR2_USCH10_Msk & ((value) << ADC_SEQR2_USCH10_Pos)))
176 #define ADC_SEQR2_USCH11_Pos 8
177 #define ADC_SEQR2_USCH11_Msk (0xfu << ADC_SEQR2_USCH11_Pos)
178 #define ADC_SEQR2_USCH11(value) ((ADC_SEQR2_USCH11_Msk & ((value) << ADC_SEQR2_USCH11_Pos)))
179 #define ADC_SEQR2_USCH12_Pos 12
180 #define ADC_SEQR2_USCH12_Msk (0xfu << ADC_SEQR2_USCH12_Pos)
181 #define ADC_SEQR2_USCH12(value) ((ADC_SEQR2_USCH12_Msk & ((value) << ADC_SEQR2_USCH12_Pos)))
182 #define ADC_SEQR2_USCH13_Pos 16
183 #define ADC_SEQR2_USCH13_Msk (0xfu << ADC_SEQR2_USCH13_Pos)
184 #define ADC_SEQR2_USCH13(value) ((ADC_SEQR2_USCH13_Msk & ((value) << ADC_SEQR2_USCH13_Pos)))
185 #define ADC_SEQR2_USCH14_Pos 20
186 #define ADC_SEQR2_USCH14_Msk (0xfu << ADC_SEQR2_USCH14_Pos)
187 #define ADC_SEQR2_USCH14(value) ((ADC_SEQR2_USCH14_Msk & ((value) << ADC_SEQR2_USCH14_Pos)))
188 #define ADC_SEQR2_USCH15_Pos 24
189 #define ADC_SEQR2_USCH15_Msk (0xfu << ADC_SEQR2_USCH15_Pos)
190 #define ADC_SEQR2_USCH15(value) ((ADC_SEQR2_USCH15_Msk & ((value) << ADC_SEQR2_USCH15_Pos)))
191 #define ADC_SEQR2_USCH16_Pos 28
192 #define ADC_SEQR2_USCH16_Msk (0xfu << ADC_SEQR2_USCH16_Pos)
193 #define ADC_SEQR2_USCH16(value) ((ADC_SEQR2_USCH16_Msk & ((value) << ADC_SEQR2_USCH16_Pos)))
194 /* -------- ADC_CHER : (ADC Offset: 0x10) Channel Enable Register -------- */
195 #define ADC_CHER_CH0 (0x1u << 0)
196 #define ADC_CHER_CH1 (0x1u << 1)
197 #define ADC_CHER_CH2 (0x1u << 2)
198 #define ADC_CHER_CH3 (0x1u << 3)
199 #define ADC_CHER_CH4 (0x1u << 4)
200 #define ADC_CHER_CH5 (0x1u << 5)
201 #define ADC_CHER_CH6 (0x1u << 6)
202 #define ADC_CHER_CH7 (0x1u << 7)
203 #define ADC_CHER_CH8 (0x1u << 8)
204 #define ADC_CHER_CH9 (0x1u << 9)
205 #define ADC_CHER_CH10 (0x1u << 10)
206 #define ADC_CHER_CH11 (0x1u << 11)
207 #define ADC_CHER_CH12 (0x1u << 12)
208 #define ADC_CHER_CH13 (0x1u << 13)
209 #define ADC_CHER_CH14 (0x1u << 14)
210 #define ADC_CHER_CH15 (0x1u << 15)
211 /* -------- ADC_CHDR : (ADC Offset: 0x14) Channel Disable Register -------- */
212 #define ADC_CHDR_CH0 (0x1u << 0)
213 #define ADC_CHDR_CH1 (0x1u << 1)
214 #define ADC_CHDR_CH2 (0x1u << 2)
215 #define ADC_CHDR_CH3 (0x1u << 3)
216 #define ADC_CHDR_CH4 (0x1u << 4)
217 #define ADC_CHDR_CH5 (0x1u << 5)
218 #define ADC_CHDR_CH6 (0x1u << 6)
219 #define ADC_CHDR_CH7 (0x1u << 7)
220 #define ADC_CHDR_CH8 (0x1u << 8)
221 #define ADC_CHDR_CH9 (0x1u << 9)
222 #define ADC_CHDR_CH10 (0x1u << 10)
223 #define ADC_CHDR_CH11 (0x1u << 11)
224 #define ADC_CHDR_CH12 (0x1u << 12)
225 #define ADC_CHDR_CH13 (0x1u << 13)
226 #define ADC_CHDR_CH14 (0x1u << 14)
227 #define ADC_CHDR_CH15 (0x1u << 15)
228 /* -------- ADC_CHSR : (ADC Offset: 0x18) Channel Status Register -------- */
229 #define ADC_CHSR_CH0 (0x1u << 0)
230 #define ADC_CHSR_CH1 (0x1u << 1)
231 #define ADC_CHSR_CH2 (0x1u << 2)
232 #define ADC_CHSR_CH3 (0x1u << 3)
233 #define ADC_CHSR_CH4 (0x1u << 4)
234 #define ADC_CHSR_CH5 (0x1u << 5)
235 #define ADC_CHSR_CH6 (0x1u << 6)
236 #define ADC_CHSR_CH7 (0x1u << 7)
237 #define ADC_CHSR_CH8 (0x1u << 8)
238 #define ADC_CHSR_CH9 (0x1u << 9)
239 #define ADC_CHSR_CH10 (0x1u << 10)
240 #define ADC_CHSR_CH11 (0x1u << 11)
241 #define ADC_CHSR_CH12 (0x1u << 12)
242 #define ADC_CHSR_CH13 (0x1u << 13)
243 #define ADC_CHSR_CH14 (0x1u << 14)
244 #define ADC_CHSR_CH15 (0x1u << 15)
245 /* -------- ADC_LCDR : (ADC Offset: 0x20) Last Converted Data Register -------- */
246 #define ADC_LCDR_LDATA_Pos 0
247 #define ADC_LCDR_LDATA_Msk (0xfffu << ADC_LCDR_LDATA_Pos)
248 #define ADC_LCDR_CHNB_Pos 12
249 #define ADC_LCDR_CHNB_Msk (0xfu << ADC_LCDR_CHNB_Pos)
250 /* -------- ADC_IER : (ADC Offset: 0x24) Interrupt Enable Register -------- */
251 #define ADC_IER_EOC0 (0x1u << 0)
252 #define ADC_IER_EOC1 (0x1u << 1)
253 #define ADC_IER_EOC2 (0x1u << 2)
254 #define ADC_IER_EOC3 (0x1u << 3)
255 #define ADC_IER_EOC4 (0x1u << 4)
256 #define ADC_IER_EOC5 (0x1u << 5)
257 #define ADC_IER_EOC6 (0x1u << 6)
258 #define ADC_IER_EOC7 (0x1u << 7)
259 #define ADC_IER_EOC8 (0x1u << 8)
260 #define ADC_IER_EOC9 (0x1u << 9)
261 #define ADC_IER_EOC10 (0x1u << 10)
262 #define ADC_IER_EOC11 (0x1u << 11)
263 #define ADC_IER_EOC12 (0x1u << 12)
264 #define ADC_IER_EOC13 (0x1u << 13)
265 #define ADC_IER_EOC14 (0x1u << 14)
266 #define ADC_IER_EOC15 (0x1u << 15)
267 #define ADC_IER_DRDY (0x1u << 24)
268 #define ADC_IER_GOVRE (0x1u << 25)
269 #define ADC_IER_COMPE (0x1u << 26)
270 #define ADC_IER_ENDRX (0x1u << 27)
271 #define ADC_IER_RXBUFF (0x1u << 28)
272 /* -------- ADC_IDR : (ADC Offset: 0x28) Interrupt Disable Register -------- */
273 #define ADC_IDR_EOC0 (0x1u << 0)
274 #define ADC_IDR_EOC1 (0x1u << 1)
275 #define ADC_IDR_EOC2 (0x1u << 2)
276 #define ADC_IDR_EOC3 (0x1u << 3)
277 #define ADC_IDR_EOC4 (0x1u << 4)
278 #define ADC_IDR_EOC5 (0x1u << 5)
279 #define ADC_IDR_EOC6 (0x1u << 6)
280 #define ADC_IDR_EOC7 (0x1u << 7)
281 #define ADC_IDR_EOC8 (0x1u << 8)
282 #define ADC_IDR_EOC9 (0x1u << 9)
283 #define ADC_IDR_EOC10 (0x1u << 10)
284 #define ADC_IDR_EOC11 (0x1u << 11)
285 #define ADC_IDR_EOC12 (0x1u << 12)
286 #define ADC_IDR_EOC13 (0x1u << 13)
287 #define ADC_IDR_EOC14 (0x1u << 14)
288 #define ADC_IDR_EOC15 (0x1u << 15)
289 #define ADC_IDR_DRDY (0x1u << 24)
290 #define ADC_IDR_GOVRE (0x1u << 25)
291 #define ADC_IDR_COMPE (0x1u << 26)
292 #define ADC_IDR_ENDRX (0x1u << 27)
293 #define ADC_IDR_RXBUFF (0x1u << 28)
294 /* -------- ADC_IMR : (ADC Offset: 0x2C) Interrupt Mask Register -------- */
295 #define ADC_IMR_EOC0 (0x1u << 0)
296 #define ADC_IMR_EOC1 (0x1u << 1)
297 #define ADC_IMR_EOC2 (0x1u << 2)
298 #define ADC_IMR_EOC3 (0x1u << 3)
299 #define ADC_IMR_EOC4 (0x1u << 4)
300 #define ADC_IMR_EOC5 (0x1u << 5)
301 #define ADC_IMR_EOC6 (0x1u << 6)
302 #define ADC_IMR_EOC7 (0x1u << 7)
303 #define ADC_IMR_EOC8 (0x1u << 8)
304 #define ADC_IMR_EOC9 (0x1u << 9)
305 #define ADC_IMR_EOC10 (0x1u << 10)
306 #define ADC_IMR_EOC11 (0x1u << 11)
307 #define ADC_IMR_EOC12 (0x1u << 12)
308 #define ADC_IMR_EOC13 (0x1u << 13)
309 #define ADC_IMR_EOC14 (0x1u << 14)
310 #define ADC_IMR_EOC15 (0x1u << 15)
311 #define ADC_IMR_DRDY (0x1u << 24)
312 #define ADC_IMR_GOVRE (0x1u << 25)
313 #define ADC_IMR_COMPE (0x1u << 26)
314 #define ADC_IMR_ENDRX (0x1u << 27)
315 #define ADC_IMR_RXBUFF (0x1u << 28)
316 /* -------- ADC_ISR : (ADC Offset: 0x30) Interrupt Status Register -------- */
317 #define ADC_ISR_EOC0 (0x1u << 0)
318 #define ADC_ISR_EOC1 (0x1u << 1)
319 #define ADC_ISR_EOC2 (0x1u << 2)
320 #define ADC_ISR_EOC3 (0x1u << 3)
321 #define ADC_ISR_EOC4 (0x1u << 4)
322 #define ADC_ISR_EOC5 (0x1u << 5)
323 #define ADC_ISR_EOC6 (0x1u << 6)
324 #define ADC_ISR_EOC7 (0x1u << 7)
325 #define ADC_ISR_EOC8 (0x1u << 8)
326 #define ADC_ISR_EOC9 (0x1u << 9)
327 #define ADC_ISR_EOC10 (0x1u << 10)
328 #define ADC_ISR_EOC11 (0x1u << 11)
329 #define ADC_ISR_EOC12 (0x1u << 12)
330 #define ADC_ISR_EOC13 (0x1u << 13)
331 #define ADC_ISR_EOC14 (0x1u << 14)
332 #define ADC_ISR_EOC15 (0x1u << 15)
333 #define ADC_ISR_DRDY (0x1u << 24)
334 #define ADC_ISR_GOVRE (0x1u << 25)
335 #define ADC_ISR_COMPE (0x1u << 26)
336 #define ADC_ISR_ENDRX (0x1u << 27)
337 #define ADC_ISR_RXBUFF (0x1u << 28)
338 /* -------- ADC_OVER : (ADC Offset: 0x3C) Overrun Status Register -------- */
339 #define ADC_OVER_OVRE0 (0x1u << 0)
340 #define ADC_OVER_OVRE1 (0x1u << 1)
341 #define ADC_OVER_OVRE2 (0x1u << 2)
342 #define ADC_OVER_OVRE3 (0x1u << 3)
343 #define ADC_OVER_OVRE4 (0x1u << 4)
344 #define ADC_OVER_OVRE5 (0x1u << 5)
345 #define ADC_OVER_OVRE6 (0x1u << 6)
346 #define ADC_OVER_OVRE7 (0x1u << 7)
347 #define ADC_OVER_OVRE8 (0x1u << 8)
348 #define ADC_OVER_OVRE9 (0x1u << 9)
349 #define ADC_OVER_OVRE10 (0x1u << 10)
350 #define ADC_OVER_OVRE11 (0x1u << 11)
351 #define ADC_OVER_OVRE12 (0x1u << 12)
352 #define ADC_OVER_OVRE13 (0x1u << 13)
353 #define ADC_OVER_OVRE14 (0x1u << 14)
354 #define ADC_OVER_OVRE15 (0x1u << 15)
355 /* -------- ADC_EMR : (ADC Offset: 0x40) Extended Mode Register -------- */
356 #define ADC_EMR_CMPMODE_Pos 0
357 #define ADC_EMR_CMPMODE_Msk (0x3u << ADC_EMR_CMPMODE_Pos)
358 #define ADC_EMR_CMPMODE_LOW (0x0u << 0)
359 #define ADC_EMR_CMPMODE_HIGH (0x1u << 0)
360 #define ADC_EMR_CMPMODE_IN (0x2u << 0)
361 #define ADC_EMR_CMPMODE_OUT (0x3u << 0)
362 #define ADC_EMR_CMPSEL_Pos 4
363 #define ADC_EMR_CMPSEL_Msk (0xfu << ADC_EMR_CMPSEL_Pos)
364 #define ADC_EMR_CMPSEL(value) ((ADC_EMR_CMPSEL_Msk & ((value) << ADC_EMR_CMPSEL_Pos)))
365 #define ADC_EMR_CMPALL (0x1u << 9)
366 #define ADC_EMR_CMPFILTER_Pos 12
367 #define ADC_EMR_CMPFILTER_Msk (0x3u << ADC_EMR_CMPFILTER_Pos)
368 #define ADC_EMR_CMPFILTER(value) ((ADC_EMR_CMPFILTER_Msk & ((value) << ADC_EMR_CMPFILTER_Pos)))
369 #define ADC_EMR_TAG (0x1u << 24)
370 /* -------- ADC_CWR : (ADC Offset: 0x44) Compare Window Register -------- */
371 #define ADC_CWR_LOWTHRES_Pos 0
372 #define ADC_CWR_LOWTHRES_Msk (0xfffu << ADC_CWR_LOWTHRES_Pos)
373 #define ADC_CWR_LOWTHRES(value) ((ADC_CWR_LOWTHRES_Msk & ((value) << ADC_CWR_LOWTHRES_Pos)))
374 #define ADC_CWR_HIGHTHRES_Pos 16
375 #define ADC_CWR_HIGHTHRES_Msk (0xfffu << ADC_CWR_HIGHTHRES_Pos)
376 #define ADC_CWR_HIGHTHRES(value) ((ADC_CWR_HIGHTHRES_Msk & ((value) << ADC_CWR_HIGHTHRES_Pos)))
377 /* -------- ADC_CGR : (ADC Offset: 0x48) Channel Gain Register -------- */
378 #define ADC_CGR_GAIN0_Pos 0
379 #define ADC_CGR_GAIN0_Msk (0x3u << ADC_CGR_GAIN0_Pos)
380 #define ADC_CGR_GAIN0(value) ((ADC_CGR_GAIN0_Msk & ((value) << ADC_CGR_GAIN0_Pos)))
381 #define ADC_CGR_GAIN1_Pos 2
382 #define ADC_CGR_GAIN1_Msk (0x3u << ADC_CGR_GAIN1_Pos)
383 #define ADC_CGR_GAIN1(value) ((ADC_CGR_GAIN1_Msk & ((value) << ADC_CGR_GAIN1_Pos)))
384 #define ADC_CGR_GAIN2_Pos 4
385 #define ADC_CGR_GAIN2_Msk (0x3u << ADC_CGR_GAIN2_Pos)
386 #define ADC_CGR_GAIN2(value) ((ADC_CGR_GAIN2_Msk & ((value) << ADC_CGR_GAIN2_Pos)))
387 #define ADC_CGR_GAIN3_Pos 6
388 #define ADC_CGR_GAIN3_Msk (0x3u << ADC_CGR_GAIN3_Pos)
389 #define ADC_CGR_GAIN3(value) ((ADC_CGR_GAIN3_Msk & ((value) << ADC_CGR_GAIN3_Pos)))
390 #define ADC_CGR_GAIN4_Pos 8
391 #define ADC_CGR_GAIN4_Msk (0x3u << ADC_CGR_GAIN4_Pos)
392 #define ADC_CGR_GAIN4(value) ((ADC_CGR_GAIN4_Msk & ((value) << ADC_CGR_GAIN4_Pos)))
393 #define ADC_CGR_GAIN5_Pos 10
394 #define ADC_CGR_GAIN5_Msk (0x3u << ADC_CGR_GAIN5_Pos)
395 #define ADC_CGR_GAIN5(value) ((ADC_CGR_GAIN5_Msk & ((value) << ADC_CGR_GAIN5_Pos)))
396 #define ADC_CGR_GAIN6_Pos 12
397 #define ADC_CGR_GAIN6_Msk (0x3u << ADC_CGR_GAIN6_Pos)
398 #define ADC_CGR_GAIN6(value) ((ADC_CGR_GAIN6_Msk & ((value) << ADC_CGR_GAIN6_Pos)))
399 #define ADC_CGR_GAIN7_Pos 14
400 #define ADC_CGR_GAIN7_Msk (0x3u << ADC_CGR_GAIN7_Pos)
401 #define ADC_CGR_GAIN7(value) ((ADC_CGR_GAIN7_Msk & ((value) << ADC_CGR_GAIN7_Pos)))
402 #define ADC_CGR_GAIN8_Pos 16
403 #define ADC_CGR_GAIN8_Msk (0x3u << ADC_CGR_GAIN8_Pos)
404 #define ADC_CGR_GAIN8(value) ((ADC_CGR_GAIN8_Msk & ((value) << ADC_CGR_GAIN8_Pos)))
405 #define ADC_CGR_GAIN9_Pos 18
406 #define ADC_CGR_GAIN9_Msk (0x3u << ADC_CGR_GAIN9_Pos)
407 #define ADC_CGR_GAIN9(value) ((ADC_CGR_GAIN9_Msk & ((value) << ADC_CGR_GAIN9_Pos)))
408 #define ADC_CGR_GAIN10_Pos 20
409 #define ADC_CGR_GAIN10_Msk (0x3u << ADC_CGR_GAIN10_Pos)
410 #define ADC_CGR_GAIN10(value) ((ADC_CGR_GAIN10_Msk & ((value) << ADC_CGR_GAIN10_Pos)))
411 #define ADC_CGR_GAIN11_Pos 22
412 #define ADC_CGR_GAIN11_Msk (0x3u << ADC_CGR_GAIN11_Pos)
413 #define ADC_CGR_GAIN11(value) ((ADC_CGR_GAIN11_Msk & ((value) << ADC_CGR_GAIN11_Pos)))
414 #define ADC_CGR_GAIN12_Pos 24
415 #define ADC_CGR_GAIN12_Msk (0x3u << ADC_CGR_GAIN12_Pos)
416 #define ADC_CGR_GAIN12(value) ((ADC_CGR_GAIN12_Msk & ((value) << ADC_CGR_GAIN12_Pos)))
417 #define ADC_CGR_GAIN13_Pos 26
418 #define ADC_CGR_GAIN13_Msk (0x3u << ADC_CGR_GAIN13_Pos)
419 #define ADC_CGR_GAIN13(value) ((ADC_CGR_GAIN13_Msk & ((value) << ADC_CGR_GAIN13_Pos)))
420 #define ADC_CGR_GAIN14_Pos 28
421 #define ADC_CGR_GAIN14_Msk (0x3u << ADC_CGR_GAIN14_Pos)
422 #define ADC_CGR_GAIN14(value) ((ADC_CGR_GAIN14_Msk & ((value) << ADC_CGR_GAIN14_Pos)))
423 #define ADC_CGR_GAIN15_Pos 30
424 #define ADC_CGR_GAIN15_Msk (0x3u << ADC_CGR_GAIN15_Pos)
425 #define ADC_CGR_GAIN15(value) ((ADC_CGR_GAIN15_Msk & ((value) << ADC_CGR_GAIN15_Pos)))
426 /* -------- ADC_COR : (ADC Offset: 0x4C) Channel Offset Register -------- */
427 #define ADC_COR_OFF0 (0x1u << 0)
428 #define ADC_COR_OFF1 (0x1u << 1)
429 #define ADC_COR_OFF2 (0x1u << 2)
430 #define ADC_COR_OFF3 (0x1u << 3)
431 #define ADC_COR_OFF4 (0x1u << 4)
432 #define ADC_COR_OFF5 (0x1u << 5)
433 #define ADC_COR_OFF6 (0x1u << 6)
434 #define ADC_COR_OFF7 (0x1u << 7)
435 #define ADC_COR_OFF8 (0x1u << 8)
436 #define ADC_COR_OFF9 (0x1u << 9)
437 #define ADC_COR_OFF10 (0x1u << 10)
438 #define ADC_COR_OFF11 (0x1u << 11)
439 #define ADC_COR_OFF12 (0x1u << 12)
440 #define ADC_COR_OFF13 (0x1u << 13)
441 #define ADC_COR_OFF14 (0x1u << 14)
442 #define ADC_COR_OFF15 (0x1u << 15)
443 #define ADC_COR_DIFF0 (0x1u << 16)
444 #define ADC_COR_DIFF1 (0x1u << 17)
445 #define ADC_COR_DIFF2 (0x1u << 18)
446 #define ADC_COR_DIFF3 (0x1u << 19)
447 #define ADC_COR_DIFF4 (0x1u << 20)
448 #define ADC_COR_DIFF5 (0x1u << 21)
449 #define ADC_COR_DIFF6 (0x1u << 22)
450 #define ADC_COR_DIFF7 (0x1u << 23)
451 #define ADC_COR_DIFF8 (0x1u << 24)
452 #define ADC_COR_DIFF9 (0x1u << 25)
453 #define ADC_COR_DIFF10 (0x1u << 26)
454 #define ADC_COR_DIFF11 (0x1u << 27)
455 #define ADC_COR_DIFF12 (0x1u << 28)
456 #define ADC_COR_DIFF13 (0x1u << 29)
457 #define ADC_COR_DIFF14 (0x1u << 30)
458 #define ADC_COR_DIFF15 (0x1u << 31)
459 /* -------- ADC_CDR[16] : (ADC Offset: 0x50) Channel Data Register -------- */
460 #define ADC_CDR_DATA_Pos 0
461 #define ADC_CDR_DATA_Msk (0xfffu << ADC_CDR_DATA_Pos)
462 /* -------- ADC_ACR : (ADC Offset: 0x94) Analog Control Register -------- */
463 #define ADC_ACR_TSON (0x1u << 4)
464 #define ADC_ACR_IBCTL_Pos 8
465 #define ADC_ACR_IBCTL_Msk (0x3u << ADC_ACR_IBCTL_Pos)
466 #define ADC_ACR_IBCTL(value) ((ADC_ACR_IBCTL_Msk & ((value) << ADC_ACR_IBCTL_Pos)))
467 /* -------- ADC_WPMR : (ADC Offset: 0xE4) Write Protect Mode Register -------- */
468 #define ADC_WPMR_WPEN (0x1u << 0)
469 #define ADC_WPMR_WPKEY_Pos 8
470 #define ADC_WPMR_WPKEY_Msk (0xffffffu << ADC_WPMR_WPKEY_Pos)
471 #define ADC_WPMR_WPKEY(value) ((ADC_WPMR_WPKEY_Msk & ((value) << ADC_WPMR_WPKEY_Pos)))
472 /* -------- ADC_WPSR : (ADC Offset: 0xE8) Write Protect Status Register -------- */
473 #define ADC_WPSR_WPVS (0x1u << 0)
474 #define ADC_WPSR_WPVSRC_Pos 8
475 #define ADC_WPSR_WPVSRC_Msk (0xffffu << ADC_WPSR_WPVSRC_Pos)
476 /* -------- ADC_RPR : (ADC Offset: 0x100) Receive Pointer Register -------- */
477 #define ADC_RPR_RXPTR_Pos 0
478 #define ADC_RPR_RXPTR_Msk (0xffffffffu << ADC_RPR_RXPTR_Pos)
479 #define ADC_RPR_RXPTR(value) ((ADC_RPR_RXPTR_Msk & ((value) << ADC_RPR_RXPTR_Pos)))
480 /* -------- ADC_RCR : (ADC Offset: 0x104) Receive Counter Register -------- */
481 #define ADC_RCR_RXCTR_Pos 0
482 #define ADC_RCR_RXCTR_Msk (0xffffu << ADC_RCR_RXCTR_Pos)
483 #define ADC_RCR_RXCTR(value) ((ADC_RCR_RXCTR_Msk & ((value) << ADC_RCR_RXCTR_Pos)))
484 /* -------- ADC_RNPR : (ADC Offset: 0x110) Receive Next Pointer Register -------- */
485 #define ADC_RNPR_RXNPTR_Pos 0
486 #define ADC_RNPR_RXNPTR_Msk (0xffffffffu << ADC_RNPR_RXNPTR_Pos)
487 #define ADC_RNPR_RXNPTR(value) ((ADC_RNPR_RXNPTR_Msk & ((value) << ADC_RNPR_RXNPTR_Pos)))
488 /* -------- ADC_RNCR : (ADC Offset: 0x114) Receive Next Counter Register -------- */
489 #define ADC_RNCR_RXNCTR_Pos 0
490 #define ADC_RNCR_RXNCTR_Msk (0xffffu << ADC_RNCR_RXNCTR_Pos)
491 #define ADC_RNCR_RXNCTR(value) ((ADC_RNCR_RXNCTR_Msk & ((value) << ADC_RNCR_RXNCTR_Pos)))
492 /* -------- ADC_PTCR : (ADC Offset: 0x120) Transfer Control Register -------- */
493 #define ADC_PTCR_RXTEN (0x1u << 0)
494 #define ADC_PTCR_RXTDIS (0x1u << 1)
495 #define ADC_PTCR_TXTEN (0x1u << 8)
496 #define ADC_PTCR_TXTDIS (0x1u << 9)
497 /* -------- ADC_PTSR : (ADC Offset: 0x124) Transfer Status Register -------- */
498 #define ADC_PTSR_RXTEN (0x1u << 0)
499 #define ADC_PTSR_TXTEN (0x1u << 8)
502 
503 
504 #endif /* _SAM3XA_ADC_COMPONENT_ */
volatile uint32_t RwReg
Definition: sam3n00a.h:54
volatile uint32_t WoReg
Definition: sam3n00a.h:53
volatile const uint32_t RoReg
Definition: sam3n00a.h:49
Adc hardware registers.
Definition: component_adc.h:41