Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __ADC_H
00012 #define __ADC_H
00013
00014 #define ADC_INTERRUPT_FLAG 0
00015
00016 #define ADC_OFFSET 0x10
00017 #define ADC_INDEX 4
00018
00019 #define ADC_DONE 0x80000000
00020 #define ADC_OVERRUN 0x40000000
00021 #define ADC_ADINT 0x00010000
00022
00023 #define VOLTAGE_1 2
00024 #define VOLTAGE_2 4
00025 #define CURRENT_1 3
00026 #define CURRENT_2 1
00027
00028 #define ADC_NUM 8
00029 #define ADC_CLK 1000000
00030
00031 extern void ADC0Handler( void ) __irq;
00032 extern void ADC1Handler( void ) __irq;
00033 extern unsigned int ADCInit( unsigned int ADC_Clk );
00034 extern unsigned int ADC0Read( unsigned char channelNum );
00035 extern unsigned int ADC1Read( unsigned char channelNum );
00036 extern void ADC0triggerSampling(unsigned char selectChannels);
00037 extern void ADC0getSamplingResults(unsigned char selectChannels, unsigned int * channelValues);
00038
00039
00040 extern volatile unsigned int ADC0Value[ADC_NUM], ADC1Value[ADC_NUM];
00041 extern volatile unsigned int ADC0IntDone, ADC1IntDone;
00042 extern unsigned int adcChannelValues[8];
00043
00044 #endif
00045
00046
00047