文件
Function_Define_ML51.h 内定义了每个通道的使能方式,或者输入选择,好像前面几个就错了吧?
/*****************************************************************************************
* For ADC setting
*****************************************************************************************/
/*---- ADC input setting , disable digital function & enable ADC -------*/
#define ADC_INPUT_CHANNEL0 SFRS=0;ADCCON0&=0xF0;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT1
#define ENABLE_ADC_AIN0 SFRS=0;ADCCON0&=0xF0;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT1
#define ADC_INPUT_CHANNEL1 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x01;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT2
#define ENABLE_ADC_AIN1 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x01;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT2
#define ADC_INPUT_CHANNEL2 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x02;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT2
#define ENABLE_ADC_AIN2 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x02;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT2
#define ADC_INPUT_CHANNEL3 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x03;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT3
#define ENABLE_ADC_AIN3 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x03;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT3
#define ADC_INPUT_CHANNEL4 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x04;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT4
#define ENABLE_ADC_AIN4 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x04;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT4
#define ADC_INPUT_CHANNEL5 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x05;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT5
#define ENABLE_ADC_AIN5 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x05;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT5
#define ADC_INPUT_CHANNEL6 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x06;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT6
#define ENABLE_ADC_AIN6 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x06;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT6
#define ADC_INPUT_CHANNEL7 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x07;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT7
#define ENABLE_ADC_AIN7 SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x07;ADCCON1|=SET_BIT0;SFRS=1;AINDIDS|=SET_BIT7
#define ADC_INPUT_VBG SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x08;ADCCON1|=SET_BIT0
#define ENABLE_ADC_BANDGAP SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x08;ADCCON1|=SET_BIT0
#define ADC_INPUT_VTEMP SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x09;ADCCON1|=SET_BIT0
#define ADC_INPUT_VLDO SFRS=0;ADCCON0&=0xF0;ADCCON0|=0x0A;ADCCON1|=SET_BIT0
|