1 |
581 |
jeremybenn |
//*****************************************************************************
|
2 |
|
|
//
|
3 |
|
|
// hw_adc.h - Macros used when accessing the ADC hardware.
|
4 |
|
|
//
|
5 |
|
|
// Copyright (c) 2005,2006 Luminary Micro, Inc. All rights reserved.
|
6 |
|
|
//
|
7 |
|
|
// Software License Agreement
|
8 |
|
|
//
|
9 |
|
|
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
|
10 |
|
|
// exclusively on LMI's Stellaris Family of microcontroller products.
|
11 |
|
|
//
|
12 |
|
|
// The software is owned by LMI and/or its suppliers, and is protected under
|
13 |
|
|
// applicable copyright laws. All rights are reserved. Any use in violation
|
14 |
|
|
// of the foregoing restrictions may subject the user to criminal sanctions
|
15 |
|
|
// under applicable laws, as well as to civil liability for the breach of the
|
16 |
|
|
// terms and conditions of this license.
|
17 |
|
|
//
|
18 |
|
|
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
19 |
|
|
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
20 |
|
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
21 |
|
|
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
22 |
|
|
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
23 |
|
|
//
|
24 |
|
|
// This is part of revision 816 of the Stellaris Driver Library.
|
25 |
|
|
//
|
26 |
|
|
//*****************************************************************************
|
27 |
|
|
|
28 |
|
|
#ifndef __HW_ADC_H__
|
29 |
|
|
#define __HW_ADC_H__
|
30 |
|
|
|
31 |
|
|
//*****************************************************************************
|
32 |
|
|
//
|
33 |
|
|
// The following define the offsets of the ADC registers.
|
34 |
|
|
//
|
35 |
|
|
//*****************************************************************************
|
36 |
|
|
#define ADC_O_ACTSS 0x00000000 // Active sample register
|
37 |
|
|
#define ADC_O_RIS 0x00000004 // Raw interrupt status register
|
38 |
|
|
#define ADC_O_IM 0x00000008 // Interrupt mask register
|
39 |
|
|
#define ADC_O_ISC 0x0000000C // Interrupt status/clear register
|
40 |
|
|
#define ADC_O_OSTAT 0x00000010 // Overflow status register
|
41 |
|
|
#define ADC_O_EMUX 0x00000014 // Event multiplexer select reg.
|
42 |
|
|
#define ADC_O_USTAT 0x00000018 // Underflow status register
|
43 |
|
|
#define ADC_O_SSPRI 0x00000020 // Channel priority register
|
44 |
|
|
#define ADC_O_PSSI 0x00000028 // Processor sample initiate reg.
|
45 |
|
|
#define ADC_O_SSMUX0 0x00000040 // Multiplexer select 0 register
|
46 |
|
|
#define ADC_O_SSCTL0 0x00000044 // Sample sequence control 0 reg.
|
47 |
|
|
#define ADC_O_SSFIFO0 0x00000048 // Result FIFO 0 register
|
48 |
|
|
#define ADC_O_SSFSTAT0 0x0000004C // FIFO 0 status register
|
49 |
|
|
#define ADC_O_SSMUX1 0x00000060 // Multiplexer select 1 register
|
50 |
|
|
#define ADC_O_SSCTL1 0x00000064 // Sample sequence control 1 reg.
|
51 |
|
|
#define ADC_O_SSFIFO1 0x00000068 // Result FIFO 1 register
|
52 |
|
|
#define ADC_O_SSFSTAT1 0x0000006C // FIFO 1 status register
|
53 |
|
|
#define ADC_O_SSMUX2 0x00000080 // Multiplexer select 2 register
|
54 |
|
|
#define ADC_O_SSCTL2 0x00000084 // Sample sequence control 2 reg.
|
55 |
|
|
#define ADC_O_SSFIFO2 0x00000088 // Result FIFO 2 register
|
56 |
|
|
#define ADC_O_SSFSTAT2 0x0000008C // FIFO 2 status register
|
57 |
|
|
#define ADC_O_SSMUX3 0x000000A0 // Multiplexer select 3 register
|
58 |
|
|
#define ADC_O_SSCTL3 0x000000A4 // Sample sequence control 3 reg.
|
59 |
|
|
#define ADC_O_SSFIFO3 0x000000A8 // Result FIFO 3 register
|
60 |
|
|
#define ADC_O_SSFSTAT3 0x000000AC // FIFO 3 status register
|
61 |
|
|
#define ADC_O_TMLB 0x00000100 // Test mode loopback register
|
62 |
|
|
|
63 |
|
|
//*****************************************************************************
|
64 |
|
|
//
|
65 |
|
|
// The following define the offsets of the ADC sequence registers.
|
66 |
|
|
//
|
67 |
|
|
//*****************************************************************************
|
68 |
|
|
#define ADC_O_SEQ 0x00000040 // Offset to the first sequence
|
69 |
|
|
#define ADC_O_SEQ_STEP 0x00000020 // Increment to the next sequence
|
70 |
|
|
#define ADC_O_X_SSMUX 0x00000000 // Multiplexer select register
|
71 |
|
|
#define ADC_O_X_SSCTL 0x00000004 // Sample sequence control register
|
72 |
|
|
#define ADC_O_X_SSFIFO 0x00000008 // Result FIFO register
|
73 |
|
|
#define ADC_O_X_SSFSTAT 0x0000000C // FIFO status register
|
74 |
|
|
|
75 |
|
|
//*****************************************************************************
|
76 |
|
|
//
|
77 |
|
|
// The following define the bit fields in the ADC_ACTSS register.
|
78 |
|
|
//
|
79 |
|
|
//*****************************************************************************
|
80 |
|
|
#define ADC_ACTSS_ASEN3 0x00000008 // Sample sequence 3 enable
|
81 |
|
|
#define ADC_ACTSS_ASEN2 0x00000004 // Sample sequence 2 enable
|
82 |
|
|
#define ADC_ACTSS_ASEN1 0x00000002 // Sample sequence 1 enable
|
83 |
|
|
#define ADC_ACTSS_ASEN0 0x00000001 // Sample sequence 0 enable
|
84 |
|
|
|
85 |
|
|
//*****************************************************************************
|
86 |
|
|
//
|
87 |
|
|
// The following define the bit fields in the ADC_RIS register.
|
88 |
|
|
//
|
89 |
|
|
//*****************************************************************************
|
90 |
|
|
#define ADC_RIS_INR3 0x00000008 // Sample sequence 3 interrupt
|
91 |
|
|
#define ADC_RIS_INR2 0x00000004 // Sample sequence 2 interrupt
|
92 |
|
|
#define ADC_RIS_INR1 0x00000002 // Sample sequence 1 interrupt
|
93 |
|
|
#define ADC_RIS_INR0 0x00000001 // Sample sequence 0 interrupt
|
94 |
|
|
|
95 |
|
|
//*****************************************************************************
|
96 |
|
|
//
|
97 |
|
|
// The following define the bit fields in the ADC_IM register.
|
98 |
|
|
//
|
99 |
|
|
//*****************************************************************************
|
100 |
|
|
#define ADC_IM_MASK3 0x00000008 // Sample sequence 3 mask
|
101 |
|
|
#define ADC_IM_MASK2 0x00000004 // Sample sequence 2 mask
|
102 |
|
|
#define ADC_IM_MASK1 0x00000002 // Sample sequence 1 mask
|
103 |
|
|
#define ADC_IM_MASK0 0x00000001 // Sample sequence 0 mask
|
104 |
|
|
|
105 |
|
|
//*****************************************************************************
|
106 |
|
|
//
|
107 |
|
|
// The following define the bit fields in the ADC_ISC register.
|
108 |
|
|
//
|
109 |
|
|
//*****************************************************************************
|
110 |
|
|
#define ADC_ISC_IN3 0x00000008 // Sample sequence 3 interrupt
|
111 |
|
|
#define ADC_ISC_IN2 0x00000004 // Sample sequence 2 interrupt
|
112 |
|
|
#define ADC_ISC_IN1 0x00000002 // Sample sequence 1 interrupt
|
113 |
|
|
#define ADC_ISC_IN0 0x00000001 // Sample sequence 0 interrupt
|
114 |
|
|
|
115 |
|
|
//*****************************************************************************
|
116 |
|
|
//
|
117 |
|
|
// The following define the bit fields in the ADC_OSTAT register.
|
118 |
|
|
//
|
119 |
|
|
//*****************************************************************************
|
120 |
|
|
#define ADC_OSTAT_OV3 0x00000008 // Sample sequence 3 overflow
|
121 |
|
|
#define ADC_OSTAT_OV2 0x00000004 // Sample sequence 2 overflow
|
122 |
|
|
#define ADC_OSTAT_OV1 0x00000002 // Sample sequence 1 overflow
|
123 |
|
|
#define ADC_OSTAT_OV0 0x00000001 // Sample sequence 0 overflow
|
124 |
|
|
|
125 |
|
|
//*****************************************************************************
|
126 |
|
|
//
|
127 |
|
|
// The following define the bit fields in the ADC_EMUX register.
|
128 |
|
|
//
|
129 |
|
|
//*****************************************************************************
|
130 |
|
|
#define ADC_EMUX_EM3_MASK 0x0000F000 // Event mux 3 mask
|
131 |
|
|
#define ADC_EMUX_EM3_PROCESSOR 0x00000000 // Processor event
|
132 |
|
|
#define ADC_EMUX_EM3_COMP0 0x00001000 // Analog comparator 0 event
|
133 |
|
|
#define ADC_EMUX_EM3_COMP1 0x00002000 // Analog comparator 1 event
|
134 |
|
|
#define ADC_EMUX_EM3_COMP2 0x00003000 // Analog comparator 2 event
|
135 |
|
|
#define ADC_EMUX_EM3_EXTERNAL 0x00004000 // External event
|
136 |
|
|
#define ADC_EMUX_EM3_TIMER 0x00005000 // Timer event
|
137 |
|
|
#define ADC_EMUX_EM3_PWM0 0x00006000 // PWM0 event
|
138 |
|
|
#define ADC_EMUX_EM3_PWM1 0x00007000 // PWM1 event
|
139 |
|
|
#define ADC_EMUX_EM3_PWM2 0x00008000 // PWM2 event
|
140 |
|
|
#define ADC_EMUX_EM3_ALWAYS 0x0000F000 // Always event
|
141 |
|
|
#define ADC_EMUX_EM2_MASK 0x00000F00 // Event mux 2 mask
|
142 |
|
|
#define ADC_EMUX_EM2_PROCESSOR 0x00000000 // Processor event
|
143 |
|
|
#define ADC_EMUX_EM2_COMP0 0x00000100 // Analog comparator 0 event
|
144 |
|
|
#define ADC_EMUX_EM2_COMP1 0x00000200 // Analog comparator 1 event
|
145 |
|
|
#define ADC_EMUX_EM2_COMP2 0x00000300 // Analog comparator 2 event
|
146 |
|
|
#define ADC_EMUX_EM2_EXTERNAL 0x00000400 // External event
|
147 |
|
|
#define ADC_EMUX_EM2_TIMER 0x00000500 // Timer event
|
148 |
|
|
#define ADC_EMUX_EM2_PWM0 0x00000600 // PWM0 event
|
149 |
|
|
#define ADC_EMUX_EM2_PWM1 0x00000700 // PWM1 event
|
150 |
|
|
#define ADC_EMUX_EM2_PWM2 0x00000800 // PWM2 event
|
151 |
|
|
#define ADC_EMUX_EM2_ALWAYS 0x00000F00 // Always event
|
152 |
|
|
#define ADC_EMUX_EM1_MASK 0x000000F0 // Event mux 1 mask
|
153 |
|
|
#define ADC_EMUX_EM1_PROCESSOR 0x00000000 // Processor event
|
154 |
|
|
#define ADC_EMUX_EM1_COMP0 0x00000010 // Analog comparator 0 event
|
155 |
|
|
#define ADC_EMUX_EM1_COMP1 0x00000020 // Analog comparator 1 event
|
156 |
|
|
#define ADC_EMUX_EM1_COMP2 0x00000030 // Analog comparator 2 event
|
157 |
|
|
#define ADC_EMUX_EM1_EXTERNAL 0x00000040 // External event
|
158 |
|
|
#define ADC_EMUX_EM1_TIMER 0x00000050 // Timer event
|
159 |
|
|
#define ADC_EMUX_EM1_PWM0 0x00000060 // PWM0 event
|
160 |
|
|
#define ADC_EMUX_EM1_PWM1 0x00000070 // PWM1 event
|
161 |
|
|
#define ADC_EMUX_EM1_PWM2 0x00000080 // PWM2 event
|
162 |
|
|
#define ADC_EMUX_EM1_ALWAYS 0x000000F0 // Always event
|
163 |
|
|
#define ADC_EMUX_EM0_MASK 0x0000000F // Event mux 0 mask
|
164 |
|
|
#define ADC_EMUX_EM0_PROCESSOR 0x00000000 // Processor event
|
165 |
|
|
#define ADC_EMUX_EM0_COMP0 0x00000001 // Analog comparator 0 event
|
166 |
|
|
#define ADC_EMUX_EM0_COMP1 0x00000002 // Analog comparator 1 event
|
167 |
|
|
#define ADC_EMUX_EM0_COMP2 0x00000003 // Analog comparator 2 event
|
168 |
|
|
#define ADC_EMUX_EM0_EXTERNAL 0x00000004 // External event
|
169 |
|
|
#define ADC_EMUX_EM0_TIMER 0x00000005 // Timer event
|
170 |
|
|
#define ADC_EMUX_EM0_PWM0 0x00000006 // PWM0 event
|
171 |
|
|
#define ADC_EMUX_EM0_PWM1 0x00000007 // PWM1 event
|
172 |
|
|
#define ADC_EMUX_EM0_PWM2 0x00000008 // PWM2 event
|
173 |
|
|
#define ADC_EMUX_EM0_ALWAYS 0x0000000F // Always event
|
174 |
|
|
#define ADC_EMUX_EM0_SHIFT 0 // The shift for the first event
|
175 |
|
|
#define ADC_EMUX_EM1_SHIFT 4 // The shift for the second event
|
176 |
|
|
#define ADC_EMUX_EM2_SHIFT 8 // The shift for the third event
|
177 |
|
|
#define ADC_EMUX_EM3_SHIFT 12 // The shift for the fourth event
|
178 |
|
|
|
179 |
|
|
//*****************************************************************************
|
180 |
|
|
//
|
181 |
|
|
// The following define the bit fields in the ADC_USTAT register.
|
182 |
|
|
//
|
183 |
|
|
//*****************************************************************************
|
184 |
|
|
#define ADC_USTAT_UV3 0x00000008 // Sample sequence 3 underflow
|
185 |
|
|
#define ADC_USTAT_UV2 0x00000004 // Sample sequence 2 underflow
|
186 |
|
|
#define ADC_USTAT_UV1 0x00000002 // Sample sequence 1 underflow
|
187 |
|
|
#define ADC_USTAT_UV0 0x00000001 // Sample sequence 0 underflow
|
188 |
|
|
|
189 |
|
|
//*****************************************************************************
|
190 |
|
|
//
|
191 |
|
|
// The following define the bit fields in the ADC_SSPRI register.
|
192 |
|
|
//
|
193 |
|
|
//*****************************************************************************
|
194 |
|
|
#define ADC_SSPRI_SS3_MASK 0x00003000 // Sequencer 3 priority mask
|
195 |
|
|
#define ADC_SSPRI_SS3_1ST 0x00000000 // First priority
|
196 |
|
|
#define ADC_SSPRI_SS3_2ND 0x00001000 // Second priority
|
197 |
|
|
#define ADC_SSPRI_SS3_3RD 0x00002000 // Third priority
|
198 |
|
|
#define ADC_SSPRI_SS3_4TH 0x00003000 // Fourth priority
|
199 |
|
|
#define ADC_SSPRI_SS2_MASK 0x00000300 // Sequencer 2 priority mask
|
200 |
|
|
#define ADC_SSPRI_SS2_1ST 0x00000000 // First priority
|
201 |
|
|
#define ADC_SSPRI_SS2_2ND 0x00000100 // Second priority
|
202 |
|
|
#define ADC_SSPRI_SS2_3RD 0x00000200 // Third priority
|
203 |
|
|
#define ADC_SSPRI_SS2_4TH 0x00000300 // Fourth priority
|
204 |
|
|
#define ADC_SSPRI_SS1_MASK 0x00000030 // Sequencer 1 priority mask
|
205 |
|
|
#define ADC_SSPRI_SS1_1ST 0x00000000 // First priority
|
206 |
|
|
#define ADC_SSPRI_SS1_2ND 0x00000010 // Second priority
|
207 |
|
|
#define ADC_SSPRI_SS1_3RD 0x00000020 // Third priority
|
208 |
|
|
#define ADC_SSPRI_SS1_4TH 0x00000030 // Fourth priority
|
209 |
|
|
#define ADC_SSPRI_SS0_MASK 0x00000003 // Sequencer 0 priority mask
|
210 |
|
|
#define ADC_SSPRI_SS0_1ST 0x00000000 // First priority
|
211 |
|
|
#define ADC_SSPRI_SS0_2ND 0x00000001 // Second priority
|
212 |
|
|
#define ADC_SSPRI_SS0_3RD 0x00000002 // Third priority
|
213 |
|
|
#define ADC_SSPRI_SS0_4TH 0x00000003 // Fourth priority
|
214 |
|
|
|
215 |
|
|
//*****************************************************************************
|
216 |
|
|
//
|
217 |
|
|
// The following define the bit fields in the ADC_PSSI register.
|
218 |
|
|
//
|
219 |
|
|
//*****************************************************************************
|
220 |
|
|
#define ADC_PSSI_SS3 0x00000008 // Trigger sample sequencer 3
|
221 |
|
|
#define ADC_PSSI_SS2 0x00000004 // Trigger sample sequencer 2
|
222 |
|
|
#define ADC_PSSI_SS1 0x00000002 // Trigger sample sequencer 1
|
223 |
|
|
#define ADC_PSSI_SS0 0x00000001 // Trigger sample sequencer 0
|
224 |
|
|
|
225 |
|
|
//*****************************************************************************
|
226 |
|
|
//
|
227 |
|
|
// The following define the bit fields in the ADC_SSMUX0, ADC_SSMUX1,
|
228 |
|
|
// ADC_SSMUX2, and ADC_SSMUX3 registers. Not all fields are present in all
|
229 |
|
|
// registers.
|
230 |
|
|
//
|
231 |
|
|
//*****************************************************************************
|
232 |
|
|
#define ADC_SSMUX_MUX7_MASK 0x70000000 // 8th mux select mask
|
233 |
|
|
#define ADC_SSMUX_MUX6_MASK 0x07000000 // 7th mux select mask
|
234 |
|
|
#define ADC_SSMUX_MUX5_MASK 0x00700000 // 6th mux select mask
|
235 |
|
|
#define ADC_SSMUX_MUX4_MASK 0x00070000 // 5th mux select mask
|
236 |
|
|
#define ADC_SSMUX_MUX3_MASK 0x00007000 // 4th mux select mask
|
237 |
|
|
#define ADC_SSMUX_MUX2_MASK 0x00000700 // 3rd mux select mask
|
238 |
|
|
#define ADC_SSMUX_MUX1_MASK 0x00000070 // 2nd mux select mask
|
239 |
|
|
#define ADC_SSMUX_MUX0_MASK 0x00000007 // 1st mux select mask
|
240 |
|
|
#define ADC_SSMUX_MUX7_SHIFT 28
|
241 |
|
|
#define ADC_SSMUX_MUX6_SHIFT 24
|
242 |
|
|
#define ADC_SSMUX_MUX5_SHIFT 20
|
243 |
|
|
#define ADC_SSMUX_MUX4_SHIFT 16
|
244 |
|
|
#define ADC_SSMUX_MUX3_SHIFT 12
|
245 |
|
|
#define ADC_SSMUX_MUX2_SHIFT 8
|
246 |
|
|
#define ADC_SSMUX_MUX1_SHIFT 4
|
247 |
|
|
#define ADC_SSMUX_MUX0_SHIFT 0
|
248 |
|
|
|
249 |
|
|
//*****************************************************************************
|
250 |
|
|
//
|
251 |
|
|
// The following define the bit fields in the ADC_SSCTL0, ADC_SSCTL1,
|
252 |
|
|
// ADC_SSCTL2, and ADC_SSCTL3 registers. Not all fields are present in all
|
253 |
|
|
// registers.
|
254 |
|
|
//
|
255 |
|
|
//*****************************************************************************
|
256 |
|
|
#define ADC_SSCTL_TS7 0x80000000 // 8th temperature sensor select
|
257 |
|
|
#define ADC_SSCTL_IE7 0x40000000 // 8th interrupt enable
|
258 |
|
|
#define ADC_SSCTL_END7 0x20000000 // 8th sequence end select
|
259 |
|
|
#define ADC_SSCTL_D7 0x10000000 // 8th differential select
|
260 |
|
|
#define ADC_SSCTL_TS6 0x08000000 // 7th temperature sensor select
|
261 |
|
|
#define ADC_SSCTL_IE6 0x04000000 // 7th interrupt enable
|
262 |
|
|
#define ADC_SSCTL_END6 0x02000000 // 7th sequence end select
|
263 |
|
|
#define ADC_SSCTL_D6 0x01000000 // 7th differential select
|
264 |
|
|
#define ADC_SSCTL_TS5 0x00800000 // 6th temperature sensor select
|
265 |
|
|
#define ADC_SSCTL_IE5 0x00400000 // 6th interrupt enable
|
266 |
|
|
#define ADC_SSCTL_END5 0x00200000 // 6th sequence end select
|
267 |
|
|
#define ADC_SSCTL_D5 0x00100000 // 6th differential select
|
268 |
|
|
#define ADC_SSCTL_TS4 0x00080000 // 5th temperature sensor select
|
269 |
|
|
#define ADC_SSCTL_IE4 0x00040000 // 5th interrupt enable
|
270 |
|
|
#define ADC_SSCTL_END4 0x00020000 // 5th sequence end select
|
271 |
|
|
#define ADC_SSCTL_D4 0x00010000 // 5th differential select
|
272 |
|
|
#define ADC_SSCTL_TS3 0x00008000 // 4th temperature sensor select
|
273 |
|
|
#define ADC_SSCTL_IE3 0x00004000 // 4th interrupt enable
|
274 |
|
|
#define ADC_SSCTL_END3 0x00002000 // 4th sequence end select
|
275 |
|
|
#define ADC_SSCTL_D3 0x00001000 // 4th differential select
|
276 |
|
|
#define ADC_SSCTL_TS2 0x00000800 // 3rd temperature sensor select
|
277 |
|
|
#define ADC_SSCTL_IE2 0x00000400 // 3rd interrupt enable
|
278 |
|
|
#define ADC_SSCTL_END2 0x00000200 // 3rd sequence end select
|
279 |
|
|
#define ADC_SSCTL_D2 0x00000100 // 3rd differential select
|
280 |
|
|
#define ADC_SSCTL_TS1 0x00000080 // 2nd temperature sensor select
|
281 |
|
|
#define ADC_SSCTL_IE1 0x00000040 // 2nd interrupt enable
|
282 |
|
|
#define ADC_SSCTL_END1 0x00000020 // 2nd sequence end select
|
283 |
|
|
#define ADC_SSCTL_D1 0x00000010 // 2nd differential select
|
284 |
|
|
#define ADC_SSCTL_TS0 0x00000008 // 1st temperature sensor select
|
285 |
|
|
#define ADC_SSCTL_IE0 0x00000004 // 1st interrupt enable
|
286 |
|
|
#define ADC_SSCTL_END0 0x00000002 // 1st sequence end select
|
287 |
|
|
#define ADC_SSCTL_D0 0x00000001 // 1st differential select
|
288 |
|
|
|
289 |
|
|
//*****************************************************************************
|
290 |
|
|
//
|
291 |
|
|
// The following define the bit fields in the ADC_SSFIFO0, ADC_SSFIFO1,
|
292 |
|
|
// ADC_SSFIFO2, and ADC_SSFIFO3 registers.
|
293 |
|
|
//
|
294 |
|
|
//*****************************************************************************
|
295 |
|
|
#define ADC_SSFIFO_DATA_MASK 0x000003FF // Sample data
|
296 |
|
|
#define ADC_SSFIFO_DATA_SHIFT 0
|
297 |
|
|
|
298 |
|
|
//*****************************************************************************
|
299 |
|
|
//
|
300 |
|
|
// The following define the bit fields in the ADC_SSFSTAT0, ADC_SSFSTAT1,
|
301 |
|
|
// ADC_SSFSTAT2, and ADC_SSFSTAT3 registers.
|
302 |
|
|
//
|
303 |
|
|
//*****************************************************************************
|
304 |
|
|
#define ADC_SSFSTAT_FULL 0x00001000 // FIFO is full
|
305 |
|
|
#define ADC_SSFSTAT_EMPTY 0x00000100 // FIFO is empty
|
306 |
|
|
#define ADC_SSFSTAT_HPTR 0x000000F0 // FIFO head pointer
|
307 |
|
|
#define ADC_SSFSTAT_TPTR 0x0000000F // FIFO tail pointer
|
308 |
|
|
|
309 |
|
|
//*****************************************************************************
|
310 |
|
|
//
|
311 |
|
|
// The following define the bit fields in the ADC_TMLB register.
|
312 |
|
|
//
|
313 |
|
|
//*****************************************************************************
|
314 |
|
|
#define ADC_TMLB_LB 0x00000001 // Loopback control signals
|
315 |
|
|
|
316 |
|
|
//*****************************************************************************
|
317 |
|
|
//
|
318 |
|
|
// The following define the bit fields in the loopback ADC data.
|
319 |
|
|
//
|
320 |
|
|
//*****************************************************************************
|
321 |
|
|
#define ADC_LB_CNT_MASK 0x000003C0 // Sample counter mask
|
322 |
|
|
#define ADC_LB_CONT 0x00000020 // Continuation sample
|
323 |
|
|
#define ADC_LB_DIFF 0x00000010 // Differential sample
|
324 |
|
|
#define ADC_LB_TS 0x00000008 // Temperature sensor sample
|
325 |
|
|
#define ADC_LB_MUX_MASK 0x00000007 // Input channel number mask
|
326 |
|
|
#define ADC_LB_CNT_SHIFT 6 // Sample counter shift
|
327 |
|
|
#define ADC_LB_MUX_SHIFT 0 // Input channel number shift
|
328 |
|
|
|
329 |
|
|
#endif // __HW_ADC_H__
|