/* configure the ADC sync mode */
adc_sync_mode_config(ADC_ALL_REGULAL_PARALLEL);
adc_sync_dma_config(ADC_SYNC_DMA_MODE0);
adc_sync_dma_request_after_last_enable();// notations of this func are fault
/* ADC SCAN function enable */
adc_special_function_config(ADC0,ADC_SCAN_MODE,ENABLE);
adc_special_function_config(ADC1,ADC_SCAN_MODE,ENABLE);
adc_special_function_config(ADC2,ADC_SCAN_MODE,ENABLE);
/* ADC data alignment config */
adc_data_alignment_config(ADC0,ADC_DATAALIGN_RIGHT);
adc_data_alignment_config(ADC1,ADC_DATAALIGN_RIGHT);
adc_data_alignment_config(ADC2,ADC_DATAALIGN_RIGHT);
/* ADC channel length config */
adc_channel_length_config(ADC0,ADC_REGULAR_CHANNEL,ADC_CHANNEL_LENGTH);
adc_channel_length_config(ADC1,ADC_REGULAR_CHANNEL,ADC_CHANNEL_LENGTH);
adc_channel_length_config(ADC2,ADC_REGULAR_CHANNEL,ADC_CHANNEL_LENGTH);
/* ADC regular channel config */
adc_regular_channel_config(ADC0,0,ADC_CHANNEL_8, ADC_SAMPLETIME_15);//[AI9 ]PB0(ADC01_IN8)
adc_regular_channel_config(ADC1,0,ADC_CHANNEL_10,ADC_SAMPLETIME_15);//[AI11]PC0(ADC012_IN10)
adc_regular_channel_config(ADC2,0,ADC_CHANNEL_12,ADC_SAMPLETIME_15);//[AI13]PC2(ADC012_IN12)
adc_regular_channel_config(ADC0,1,ADC_CHANNEL_9, ADC_SAMPLETIME_15);//[AI10]PB1(ADC01_IN9)
adc_regular_channel_config(ADC1,1,ADC_CHANNEL_11,ADC_SAMPLETIME_15);//[AI12]PC1(ADC012_IN11)
adc_regular_channel_config(ADC2,1,ADC_CHANNEL_5, ADC_SAMPLETIME_15);//[PTIN5]PF7(ADC2_IN5)
adc_regular_channel_config(ADC0,2,ADC_CHANNEL_0, ADC_SAMPLETIME_15);//[AI1]PA0(ADC012_IN0)
adc_regular_channel_config(ADC1,2,ADC_CHANNEL_1, ADC_SAMPLETIME_15);//[AI2]PA1(ADC012_IN1)
adc_regular_channel_config(ADC2,2,ADC_CHANNEL_9, ADC_SAMPLETIME_15);//[PTIN1]PF3(ADC2_IN9)
//sample sequence:B0/C0/C2->B1/C1/F7->PA0/PA1/PF3
/* ADC external trigger enable */
adc_external_trigger_config(ADC0,ADC_REGULAR_CHANNEL,EXTERNAL_TRIGGER_RISING);
adc_external_trigger_config(ADC1,ADC_REGULAR_CHANNEL,EXTERNAL_TRIGGER_DISABLE);
adc_external_trigger_config(ADC2,ADC_REGULAR_CHANNEL,EXTERNAL_TRIGGER_DISABLE);
adc_external_trigger_source_config(ADC0,ADC_REGULAR_CHANNEL,ADC_EXTTRIG_REGULAR_T1_CH1);
版权声明:本文为CSDN博主「rrrrrrrrrstart」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/qq_43438751/article/details/122293216