1 /* Coldfire C Header File
\r
2 * Copyright Freescale Semiconductor Inc
\r
3 * All rights reserved.
\r
5 * 2007/03/19 Revision: 0.91
\r
8 #ifndef __MCF52235_ADC_H__
\r
9 #define __MCF52235_ADC_H__
\r
12 /*********************************************************************
\r
14 * Analog-to-Digital Converter (ADC)
\r
16 *********************************************************************/
\r
18 /* Register read/write macros */
\r
19 #define MCF_ADC_CTRL1 (*(vuint16*)(&__IPSBAR[0x190000]))
\r
20 #define MCF_ADC_CTRL2 (*(vuint16*)(&__IPSBAR[0x190002]))
\r
21 #define MCF_ADC_ADZCC (*(vuint16*)(&__IPSBAR[0x190004]))
\r
22 #define MCF_ADC_ADLST1 (*(vuint16*)(&__IPSBAR[0x190006]))
\r
23 #define MCF_ADC_ADLST2 (*(vuint16*)(&__IPSBAR[0x190008]))
\r
24 #define MCF_ADC_ADSDIS (*(vuint16*)(&__IPSBAR[0x19000A]))
\r
25 #define MCF_ADC_ADSTAT (*(vuint16*)(&__IPSBAR[0x19000C]))
\r
26 #define MCF_ADC_ADLSTAT (*(vuint16*)(&__IPSBAR[0x19000E]))
\r
27 #define MCF_ADC_ADZCSTAT (*(vuint16*)(&__IPSBAR[0x190010]))
\r
28 #define MCF_ADC_ADRSLT0 (*(vuint16*)(&__IPSBAR[0x190012]))
\r
29 #define MCF_ADC_ADRSLT1 (*(vuint16*)(&__IPSBAR[0x190014]))
\r
30 #define MCF_ADC_ADRSLT2 (*(vuint16*)(&__IPSBAR[0x190016]))
\r
31 #define MCF_ADC_ADRSLT3 (*(vuint16*)(&__IPSBAR[0x190018]))
\r
32 #define MCF_ADC_ADRSLT4 (*(vuint16*)(&__IPSBAR[0x19001A]))
\r
33 #define MCF_ADC_ADRSLT5 (*(vuint16*)(&__IPSBAR[0x19001C]))
\r
34 #define MCF_ADC_ADRSLT6 (*(vuint16*)(&__IPSBAR[0x19001E]))
\r
35 #define MCF_ADC_ADRSLT7 (*(vuint16*)(&__IPSBAR[0x190020]))
\r
36 #define MCF_ADC_ADLLMT0 (*(vuint16*)(&__IPSBAR[0x190022]))
\r
37 #define MCF_ADC_ADLLMT1 (*(vuint16*)(&__IPSBAR[0x190024]))
\r
38 #define MCF_ADC_ADLLMT2 (*(vuint16*)(&__IPSBAR[0x190026]))
\r
39 #define MCF_ADC_ADLLMT3 (*(vuint16*)(&__IPSBAR[0x190028]))
\r
40 #define MCF_ADC_ADLLMT4 (*(vuint16*)(&__IPSBAR[0x19002A]))
\r
41 #define MCF_ADC_ADLLMT5 (*(vuint16*)(&__IPSBAR[0x19002C]))
\r
42 #define MCF_ADC_ADLLMT6 (*(vuint16*)(&__IPSBAR[0x19002E]))
\r
43 #define MCF_ADC_ADLLMT7 (*(vuint16*)(&__IPSBAR[0x190030]))
\r
44 #define MCF_ADC_ADHLMT0 (*(vuint16*)(&__IPSBAR[0x190032]))
\r
45 #define MCF_ADC_ADHLMT1 (*(vuint16*)(&__IPSBAR[0x190034]))
\r
46 #define MCF_ADC_ADHLMT2 (*(vuint16*)(&__IPSBAR[0x190036]))
\r
47 #define MCF_ADC_ADHLMT3 (*(vuint16*)(&__IPSBAR[0x190038]))
\r
48 #define MCF_ADC_ADHLMT4 (*(vuint16*)(&__IPSBAR[0x19003A]))
\r
49 #define MCF_ADC_ADHLMT5 (*(vuint16*)(&__IPSBAR[0x19003C]))
\r
50 #define MCF_ADC_ADHLMT6 (*(vuint16*)(&__IPSBAR[0x19003E]))
\r
51 #define MCF_ADC_ADHLMT7 (*(vuint16*)(&__IPSBAR[0x190040]))
\r
52 #define MCF_ADC_ADOFS0 (*(vuint16*)(&__IPSBAR[0x190042]))
\r
53 #define MCF_ADC_ADOFS1 (*(vuint16*)(&__IPSBAR[0x190044]))
\r
54 #define MCF_ADC_ADOFS2 (*(vuint16*)(&__IPSBAR[0x190046]))
\r
55 #define MCF_ADC_ADOFS3 (*(vuint16*)(&__IPSBAR[0x190048]))
\r
56 #define MCF_ADC_ADOFS4 (*(vuint16*)(&__IPSBAR[0x19004A]))
\r
57 #define MCF_ADC_ADOFS5 (*(vuint16*)(&__IPSBAR[0x19004C]))
\r
58 #define MCF_ADC_ADOFS6 (*(vuint16*)(&__IPSBAR[0x19004E]))
\r
59 #define MCF_ADC_ADOFS7 (*(vuint16*)(&__IPSBAR[0x190050]))
\r
60 #define MCF_ADC_POWER (*(vuint16*)(&__IPSBAR[0x190052]))
\r
61 #define MCF_ADC_CAL (*(vuint16*)(&__IPSBAR[0x190054]))
\r
62 #define MCF_ADC_ADRSLT(x) (*(vuint16*)(&__IPSBAR[0x190012 + ((x)*0x2)]))
\r
63 #define MCF_ADC_ADLLMT(x) (*(vuint16*)(&__IPSBAR[0x190022 + ((x)*0x2)]))
\r
64 #define MCF_ADC_ADHLMT(x) (*(vuint16*)(&__IPSBAR[0x190032 + ((x)*0x2)]))
\r
65 #define MCF_ADC_ADOFS(x) (*(vuint16*)(&__IPSBAR[0x190042 + ((x)*0x2)]))
\r
68 /* Bit definitions and macros for MCF_ADC_CTRL1 */
\r
69 #define MCF_ADC_CTRL1_SMODE(x) (((x)&0x7)<<0)
\r
70 #define MCF_ADC_CTRL1_CHNCFG(x) (((x)&0xF)<<0x4)
\r
71 #define MCF_ADC_CTRL1_HLMTIE (0x100)
\r
72 #define MCF_ADC_CTRL1_LLMTIE (0x200)
\r
73 #define MCF_ADC_CTRL1_ZCIE (0x400)
\r
74 #define MCF_ADC_CTRL1_EOSIE0 (0x800)
\r
75 #define MCF_ADC_CTRL1_SYNC0 (0x1000)
\r
76 #define MCF_ADC_CTRL1_START0 (0x2000)
\r
77 #define MCF_ADC_CTRL1_STOP0 (0x4000)
\r
79 /* Bit definitions and macros for MCF_ADC_CTRL2 */
\r
80 #define MCF_ADC_CTRL2_DIV(x) (((x)&0x1F)<<0)
\r
81 #define MCF_ADC_CTRL2_SIMULT (0x20)
\r
82 #define MCF_ADC_CTRL2_EOSIE1 (0x800)
\r
83 #define MCF_ADC_CTRL2_SYNC1 (0x1000)
\r
84 #define MCF_ADC_CTRL2_START1 (0x2000)
\r
85 #define MCF_ADC_CTRL2_STOP1 (0x4000)
\r
87 /* Bit definitions and macros for MCF_ADC_ADZCC */
\r
88 #define MCF_ADC_ADZCC_ZCE0(x) (((x)&0x3)<<0)
\r
89 #define MCF_ADC_ADZCC_ZCE1(x) (((x)&0x3)<<0x2)
\r
90 #define MCF_ADC_ADZCC_ZCE2(x) (((x)&0x3)<<0x4)
\r
91 #define MCF_ADC_ADZCC_ZCE3(x) (((x)&0x3)<<0x6)
\r
92 #define MCF_ADC_ADZCC_ZCE4(x) (((x)&0x3)<<0x8)
\r
93 #define MCF_ADC_ADZCC_ZCE5(x) (((x)&0x3)<<0xA)
\r
94 #define MCF_ADC_ADZCC_ZCE6(x) (((x)&0x3)<<0xC)
\r
95 #define MCF_ADC_ADZCC_ZCE7(x) (((x)&0x3)<<0xE)
\r
97 /* Bit definitions and macros for MCF_ADC_ADLST1 */
\r
98 #define MCF_ADC_ADLST1_SAMPLE0(x) (((x)&0x7)<<0)
\r
99 #define MCF_ADC_ADLST1_SAMPLE1(x) (((x)&0x7)<<0x4)
\r
100 #define MCF_ADC_ADLST1_SAMPLE2(x) (((x)&0x7)<<0x8)
\r
101 #define MCF_ADC_ADLST1_SAMPLE3(x) (((x)&0x7)<<0xC)
\r
103 /* Bit definitions and macros for MCF_ADC_ADLST2 */
\r
104 #define MCF_ADC_ADLST2_SAMPLE4(x) (((x)&0x7)<<0)
\r
105 #define MCF_ADC_ADLST2_SAMPLE5(x) (((x)&0x7)<<0x4)
\r
106 #define MCF_ADC_ADLST2_SAMPLE6(x) (((x)&0x7)<<0x8)
\r
107 #define MCF_ADC_ADLST2_SAMPLE7(x) (((x)&0x7)<<0xC)
\r
109 /* Bit definitions and macros for MCF_ADC_ADSDIS */
\r
110 #define MCF_ADC_ADSDIS_DS0 (0x1)
\r
111 #define MCF_ADC_ADSDIS_DS1 (0x2)
\r
112 #define MCF_ADC_ADSDIS_DS2 (0x4)
\r
113 #define MCF_ADC_ADSDIS_DS3 (0x8)
\r
114 #define MCF_ADC_ADSDIS_DS4 (0x10)
\r
115 #define MCF_ADC_ADSDIS_DS5 (0x20)
\r
116 #define MCF_ADC_ADSDIS_DS6 (0x40)
\r
117 #define MCF_ADC_ADSDIS_DS7 (0x80)
\r
119 /* Bit definitions and macros for MCF_ADC_ADSTAT */
\r
120 #define MCF_ADC_ADSTAT_RDY0 (0x1)
\r
121 #define MCF_ADC_ADSTAT_RDY1 (0x2)
\r
122 #define MCF_ADC_ADSTAT_RDY2 (0x4)
\r
123 #define MCF_ADC_ADSTAT_RDY3 (0x8)
\r
124 #define MCF_ADC_ADSTAT_RDY4 (0x10)
\r
125 #define MCF_ADC_ADSTAT_RDY5 (0x20)
\r
126 #define MCF_ADC_ADSTAT_RDY6 (0x40)
\r
127 #define MCF_ADC_ADSTAT_RDY7 (0x80)
\r
128 #define MCF_ADC_ADSTAT_HLMTI (0x100)
\r
129 #define MCF_ADC_ADSTAT_LLMTI (0x200)
\r
130 #define MCF_ADC_ADSTAT_ZCI (0x400)
\r
131 #define MCF_ADC_ADSTAT_EOSI0 (0x800)
\r
132 #define MCF_ADC_ADSTAT_EOSI1 (0x1000)
\r
133 #define MCF_ADC_ADSTAT_CIP1 (0x4000)
\r
134 #define MCF_ADC_ADSTAT_CIP0 (0x8000)
\r
136 /* Bit definitions and macros for MCF_ADC_ADLSTAT */
\r
137 #define MCF_ADC_ADLSTAT_LLS0 (0x1)
\r
138 #define MCF_ADC_ADLSTAT_LLS1 (0x2)
\r
139 #define MCF_ADC_ADLSTAT_LLS2 (0x4)
\r
140 #define MCF_ADC_ADLSTAT_LLS3 (0x8)
\r
141 #define MCF_ADC_ADLSTAT_LLS4 (0x10)
\r
142 #define MCF_ADC_ADLSTAT_LLS5 (0x20)
\r
143 #define MCF_ADC_ADLSTAT_LLS6 (0x40)
\r
144 #define MCF_ADC_ADLSTAT_LLS7 (0x80)
\r
145 #define MCF_ADC_ADLSTAT_HLS0 (0x100)
\r
146 #define MCF_ADC_ADLSTAT_HLS1 (0x200)
\r
147 #define MCF_ADC_ADLSTAT_HLS2 (0x400)
\r
148 #define MCF_ADC_ADLSTAT_HLS3 (0x800)
\r
149 #define MCF_ADC_ADLSTAT_HLS4 (0x1000)
\r
150 #define MCF_ADC_ADLSTAT_HLS5 (0x2000)
\r
151 #define MCF_ADC_ADLSTAT_HLS6 (0x4000)
\r
152 #define MCF_ADC_ADLSTAT_HLS7 (0x8000)
\r
154 /* Bit definitions and macros for MCF_ADC_ADZCSTAT */
\r
155 #define MCF_ADC_ADZCSTAT_ZCS0 (0x1)
\r
156 #define MCF_ADC_ADZCSTAT_ZCS1 (0x2)
\r
157 #define MCF_ADC_ADZCSTAT_ZCS2 (0x4)
\r
158 #define MCF_ADC_ADZCSTAT_ZCS3 (0x8)
\r
159 #define MCF_ADC_ADZCSTAT_ZCS4 (0x10)
\r
160 #define MCF_ADC_ADZCSTAT_ZCS5 (0x20)
\r
161 #define MCF_ADC_ADZCSTAT_ZCS6 (0x40)
\r
162 #define MCF_ADC_ADZCSTAT_ZCS7 (0x80)
\r
164 /* Bit definitions and macros for MCF_ADC_ADRSLT */
\r
165 #define MCF_ADC_ADRSLT_RSLT(x) (((x)&0xFFF)<<0x3)
\r
166 #define MCF_ADC_ADRSLT_SEXT (0x8000)
\r
168 /* Bit definitions and macros for MCF_ADC_ADLLMT */
\r
169 #define MCF_ADC_ADLLMT_LLMT(x) (((x)&0xFFF)<<0x3)
\r
171 /* Bit definitions and macros for MCF_ADC_ADHLMT */
\r
172 #define MCF_ADC_ADHLMT_HLMT(x) (((x)&0xFFF)<<0x3)
\r
174 /* Bit definitions and macros for MCF_ADC_ADOFS */
\r
175 #define MCF_ADC_ADOFS_OFFSET(x) (((x)&0xFFF)<<0x3)
\r
177 /* Bit definitions and macros for MCF_ADC_POWER */
\r
178 #define MCF_ADC_POWER_PD0 (0x1)
\r
179 #define MCF_ADC_POWER_PD1 (0x2)
\r
180 #define MCF_ADC_POWER_PD2 (0x4)
\r
181 #define MCF_ADC_POWER_APD (0x8)
\r
182 #define MCF_ADC_POWER_PUDELAY(x) (((x)&0x3F)<<0x4)
\r
183 #define MCF_ADC_POWER_PSTS0 (0x400)
\r
184 #define MCF_ADC_POWER_PSTS1 (0x800)
\r
185 #define MCF_ADC_POWER_PSTS2 (0x1000)
\r
186 #define MCF_ADC_POWER_ASB (0x8000)
\r
188 /* Bit definitions and macros for MCF_ADC_CAL */
\r
189 #define MCF_ADC_CAL_SEL_VREFL (0x4000)
\r
190 #define MCF_ADC_CAL_SEL_VREFH (0x8000)
\r
193 #endif /* __MCF52235_ADC_H__ */
\r