文章目录一、前言二、Cloack Configuration三、ADC1 Mode and Configuration四、Configuration4.1、ADC_Setting4.1.1、Clock Prescaler(时钟预分频)4.1.2、Resolution(分辨率)4.1.3、Scan Conversion Mode(扫描模式)4.1.4、Continuous Conversion Mode(连续转换模式)4.1.5、Discontinuous Conversion Mode(不连续序列转换模式)...
/* ADC1 configuration ---*/ ADC_InitStructure.ADC_Mode = ADC_Mode_Independent; ADC_InitStructure.ADC_ScanConvMode = ENABLE; ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None; ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; AD...
大致是这样的 void ADC_Configuration(void){ ADC_InitTypeDef ADC_InitStructure;/* ADC1 configuration ---*/ ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;ADC_InitStructure.ADC_ScanConvMode = ENABLE;ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;ADC_InitStructure.ADC_ExternalTrigConv = ...
/* ADC1 regular channel16 configuration */ ADC_RegularChannelConfig(ADC1, ADC_Channel_16, 1, ADC_SampleTime_239Cycles5);//ADC1,ADC通道16,规则采样顺序值为1,采样时间为239.5周期 /* Enable the temperature sensor and vref internal channel */ ADC_TempSensorVrefintCmd(ENABLE); #endif ADC_DMACmd(...
ADC_InitTypeDef ADC_InitStructure;/*ADC1 configuration*/ADC_InitStructure.ADC_Mode= ADC_Mode_Independent;//独立ADC模式ADC_InitStructure.ADC_ScanConvMode = ENABLE ;//禁止扫描模式,扫描模式用于多通道采集ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;//开启连续转换模式,即不停地进行ADC转换ADC_InitStructur...
/**ADC1 GPIO Configuration PC2 ---> ADC1_IN3 PC3 ---> ADC1_IN4 PA2 ---> ADC1_IN7 PA3 ---> ADC1_IN8 PA4 ---> ADC1_IN9 PA5 ---> ADC1_IN10 PA6 ---> ADC1_IN11 PA7 ---> ADC1_IN12 PB0 ---> ADC1_IN15 PB1 ---> ADC1_IN16 PB2 ---> ADC1_IN17...
(ADC1,&ADC_InitStructure);/* ADC1 regular channel9 configuration *///ADC通道组,第9个通道 采样顺序1,转换时间ADC_RegularChannelConfig(ADC1,ADC_Channel_9,1,ADC_CYC_Cycles5);// ADC_RegularChannelConfig(ADC1, ADC_Channel_8, 2, ADC_SampleTime_55Cycles5);ADC_DMACmd(ADC1,ENABLE);//ADC命令,...
* 函数名 : ADC_configuration 说明 : ADC初始化,采样完成后自动DMA到缓冲区 ***...
void GPIO_Configuration(void); void NVIC_Configuration(void); /* Private functions ---*/ /*** * Function Name : main * Description : Main program * Input : None * Output : None * Return : None ***
GPIO_Configuration(); /* DMA1 channel1 configuration ---*/ DMA_DeInit(DMA1_Channel1); //复位DMA1的通道1 DMA_InitStructure.DMA_PeripheralBaseAddr = ADC1_DR_Address;//DMA对应的外设基础地址,这个地址可以在相应的DATASHEET上查 DMA_InitStructure.DMA_MemoryBaseAddr = (u32)&ADCConvertedValue; /...