同时也可以ADC1、ADC3同时使用,ADC3利用PF6-9,可复用为Channel4-7,要为扫描模式,非连续模式;代码如下:
ADC_InitStructure.ADC_NbrOfChannel = 4;
ADC_Init(ADC3, &ADC_InitStructure);
ADC_RegularChannelConfig(ADC3,ADC_Channel_4, 1, ADC_SampleTime_239Cycles5);
ADC_RegularChannelConfig(ADC3,ADC_Channel_5, 2, ADC_SampleTime_239Cycles5 );
ADC_RegularChannelConfig(ADC3,ADC_Channel_6, 3, ADC_SampleTime_239Cycles5 );
ADC_RegularChannelConfig(ADC3,ADC_Channel_7, 4, ADC_SampleTime_239Cycles5 );
ADC_DMACmd(ADC3, ENABLE);
ADC_Cmd(ADC3,ENABLE);
ADC_ResetCalibration(ADC3);
while(ADC_GetResetCalibrationStatus(ADC3));
ADC_StartCalibration(ADC3);
while(ADC_GetCalibrationStatus(ADC3));
ADC_SoftwareStartConvCmd(ADC3, ENABLE);
|