ADC_InitStructure.ChsNumber = 1;ADC_Init(ADC1, &ADC_InitStructure);// 配置ADC时钟分频因子 ...
*/voidADC_Config(void){/* Enable The HSI (16Mhz) */RCC_HSICmd(ENABLE);/* Enable the GPIOF or GPIOA Clock */RCC_AHBPeriphClockCmd(IDD_MEASUREMENT_GPIO_CLK, ENABLE);/* Configure PF.11 (ADC Channel11) or PA.05 (ADC Channe5) in analog mode */GPIO_InitStructure.GPIO_Pin = IDD_ME...
}if(adc_obj->channel < ADC_NUM_GPIO_CHANNELS) {// Channels 0-16 correspond to real pins. Configure the GPIO pin in// ADC mode.constpin_obj_t*pin = pin_adc1[adc_obj->channel]; GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.Pin = pin->pin_mask; GPIO_InitStructure.Mode = GPI...