Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef _ARCH_ARM_AT91_ADC_H_
00043 #define _ARCH_ARM_AT91_ADC_H_
00044
00066
00069 #define ADC_CR_OFF 0x00000000
00070 #define ADC_CR (ADC_BASE + ADC_CR_OFF)
00071 #define ADC_SWRST 0x00000001
00072 #define ADC_START 0x00000002
00074
00075
00077 #define ADC_MR_OFF 0x00000004
00078 #define ADC_MR (ADC_BASE + ADC_MR_OFF)
00079 #define ADC_TRGEN 0x00000001
00080 #define ADC_TRGSEL 0x0000000E
00081 #define ADC_TRGSEL_TIOA0 0x00000000
00082 #define ADC_TRGSEL_TIOA1 0x00000002
00083 #define ADC_TRGSEL_TIOA2 0x00000004
00084 #define ADC_TRGSEL_EXT 0x0000000C
00085 #define ADC_LOWRES 0x00000010
00086 #define ADC_SLEEP 0x00000020
00087 #define ADC_PRESCAL 0x00003F00
00088 #define ADC_PRESCAL_LSB 8
00089 #define ADC_STARTUP 0x001F0000
00090 #define ADC_STARTUP_LSB 16
00091 #define ADC_SHTIM 0x0F000000
00092 #define ADC_SHTIM_LSB 24
00094
00095
00097 #define ADC_CHER_OFF 0x00000010
00098 #define ADC_CHER (ADC_BASE + ADC_CHER_OFF)
00100 #define ADC_CH(x) ((unsigned long)BV(x))
00101 #define ADC_CH0 0x00000001
00102 #define ADC_CH1 0x00000002
00103 #define ADC_CH2 0x00000004
00104 #define ADC_CH3 0x00000008
00105 #define ADC_CH4 0x00000010
00106 #define ADC_CH5 0x00000020
00107 #define ADC_CH6 0x00000040
00108 #define ADC_CH7 0x00000080
00110
00111
00113 #define ADC_CHDR_OFF 0x00000014
00114 #define ADC_CHDR (ADC_BASE + ADC_CHDR_OFF)
00116
00117
00119 #define ADC_CHSR_OFF 0x00000018
00120 #define ADC_CHSR (ADC_BASE + ADC_CHSR_OFF)
00122
00123
00125 #define ADC_SR_OFF 0x0000001C
00126 #define ADC_SR (ADC_BASE + ADC_SR_OFF)
00128 #define ADC_EOC(x)((unsigned long)BV(x))
00130 #define ADC_EOC0 0x00000001
00131 #define ADC_EOC1 0x00000002
00132 #define ADC_EOC2 0x00000004
00133 #define ADC_EOC3 0x00000008
00134 #define ADC_EOC4 0x00000010
00135 #define ADC_EOC5 0x00000020
00136 #define ADC_EOC6 0x00000040
00137 #define ADC_EOC7 0x00000080
00139 #define ADC_OVRE(x)((unsigned long)BV(x+8))
00140 #define ADC_OVRE0 0x00000100
00141 #define ADC_OVRE1 0x00000200
00142 #define ADC_OVRE2 0x00000400
00143 #define ADC_OVRE3 0x00000800
00144 #define ADC_OVRE4 0x00001000
00145 #define ADC_OVRE5 0x00002000
00146 #define ADC_OVRE6 0x00004000
00147 #define ADC_OVRE7 0x00008000
00149 #define ADC_DRDY 0x00010000
00150 #define ADC_GOVRE 0x00020000
00151 #define ADC_ENDRX 0x00040000
00152 #define ADC_RXBUF 0x00080000
00154
00155
00157 #define ADC_LCDR_OFF 0x00000020
00158 #define ADC_LCDR (ADC_BASE + ADC_LCDR_OFF)
00160 #define ADC_LCDR_MASK 0x000003FF
00162
00163
00165 #define ADC_IER_OFF 0x00000024
00166 #define ADC_IER (ADC_BASE + ADC_IER_OFF)
00168
00169
00171 #define ADC_IDR_OFF 0x00000028
00172 #define ADC_IDR (ADC_BASE + ADC_IDR_OFF)
00174
00175
00177 #define ADC_IMR_OFF 0x0000002C
00178 #define ADC_IMR (ADC_BASE + ADC_IMR_OFF)
00180
00181
00183 #define ADC_CDR_OFF 0x00000030
00184 #define ADC_CDR(x) (ADC_BASE + ADC_CDR_OFF + ((x) << 2))
00186 #define ADC_CDR_MASK 0x000003FF
00188
00189 #if defined(ADC_HAS_PDC)
00190
00193 #define ADC_RPR (ADC_BASE + PERIPH_RPR_OFF)
00195
00196
00198 #define ADC_RCR (ADC_BASE + PERIPH_RCR_OFF)
00200
00201
00203 #define ADC_TPR (ADC_BASE + PERIPH_TPR_OFF)
00205
00206
00208 #define ADC_TCR (ADC_BASE + PERIPH_TCR_OFF)
00210
00211
00213 #define ADC_RNPR (ADC_BASE + PERIPH_RNPR_OFF)
00215
00216
00218 #define ADC_RNCR (ADC_BASE + PERIPH_RNCR_OFF)
00220
00221
00223 #define ADC_TNPR (ADC_BASE + PERIPH_TNPR_OFF)
00225
00226
00228 #define ADC_TNCR (ADC_BASE + PERIPH_TNCR_OFF)
00230
00231
00233 #define ADC_PTCR (ADC_BASE + PERIPH_PTCR_OFF)
00235
00236
00238 #define ADC_PTSR (ADC_BASE + PERIPH_PTSR_OFF)
00240
00241 #endif
00242
00243
00244 #endif