void ADC0_Init(void)
{
// Ctt = (unsigned int)&ADC0->RSQ2;
RCC->APB2RSTR|=1<<9; //复位AD时钟
RCC->APB2RSTR&=~(1<<9); //复位结束
RCC->APB2ENR |=1<<9; //开始AD时钟
RCC->CFG0 |= 0X02<<14; //ADC分频
ADC0->CTL0 = 0;
ADC0->CTL1 = 0;
ADC0->CTL0 |= 0<<8;
//
ADC0->CTL1 &=~(1<<1);
ADC0->CTL1 &=~(1<<11);
ADC0->SAMPT1 = (0X05<<0) | (0X05<<3)| (0X05<<6)| (0X05<<9);
//ADC0->OVSAMPCTL =0;
ADC0->RSQ0 &=~(0XFF<<20);
ADC0->RSQ0 |=0<<20;
// ADC0->RSQ1 &=~(7<<(3*5));
// ADC0->RSQ1 |=7<<(3*5);
ADC0->CTL1 |=1<<0;
} |