ADC_InitStructure.ADC_NbrOfChannel = 3;ADC_Init(ADC1, &ADC_InitStructure);ADC_DMACmd(ADC1, ...
dma_circulation_disable(ADC->dma_parameter.dma_periph, ADC->dma_parameter.dma_channel); } dma_channel_enable(ADC->dma_parameter.dma_periph, ADC->dma_parameter.dma_channel); /* 使能DMA */ driver_adc_config(ADC,ADC_CH); /* ADC初始化 */ } 在driver_adc.h中声明了ADC DMA的结构体: C ...
dma_channel_enable(ADC->dma_parameter.dma_periph, ADC->dma_parameter.dma_channel); /* 使能DMA */ driver_adc_config(ADC,ADC_CH); /* ADC初始化 */ } 在driver_adc.h中声明了ADC DMA的结构体: C typedef struct __typdef_adc_dma_parameter { rcu_periph_enum rcu_dma; //DMA时钟 uint32_t...
.adc_channel_group = ADC_ROUTINE_CHANNEL, /* 使用规则组 */ .adc_scan_function = ENABLE, /* 开启扫描模式 */ .adc_continuous_function = ENABLE, /* 开启循环模式 */ .ch_count = 2, /* 转换长度为2 */ .adc_external_trigger_mode = EXTERNAL_TRIGGER_DISABLE, .dma_parameter = { .rcu_d...
AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 1; //Normally ADC will be tied to ePWM, or timed routine } //For this example will re-start manually } // INT7.1 interrupt void local_DINTCH1_ISR(void) // DMA Channel 1 { // To receive more interrupts from this PIE group, acknowledge this interrup...
(ADC_REGULAR_CHANNEL,ADC_EXTTRIG_REGULAR_NONE);//配置 ADC 的触发方式 此处设置为软件触发 adc_external_trigger_source_config(ADC0, ADC_ROUTINE_CHANNEL, ADC_EXTTRIG_ROUTINE_T0_CH0); adc_external_trigger_config(ADC0, ADC_ROUTINE_CHANNEL, EXTERNAL_TRIGGER_DISABLE); adc_enable(ADC0); delay_1ms...
adc_channel_length_config(adc_periph, ADC_ROUTINE_CHANNEL, 1); adc_data_alignment_config(adc_periph, ADC_DATAALIGN_RIGHT); #if defined SOC_SERIES_GD32F4xx adc_external_trigger_source_config(adc_periph, ADC_ROUTINE_CHANNEL, ADC_EXTTRIG_ROUTINE_EXTI_11); ...
The interrupt method is an efficient way to do ADC conversion in a non-blocking manner, so the CPU can resume executing the main code routine until the ADC completes the conversion and fires an interrupt signal so the CPU can switch to the ISR context and save the conversion results for fu...
(ADC_REGULAR_CHANNEL,ADC_EXTTRIG_REGULAR_NONE);//配置 ADC 的触发方式 此处设置为软件触发 adc_external_trigger_source_config(ADC0, ADC_ROUTINE_CHANNEL, ADC_EXTTRIG_ROUTINE_T0_CH0); adc_external_trigger_config(ADC0, ADC_ROUTINE_CHANNEL, EXTERNAL_TRIGGER_DISABLE); adc_enable(ADC0); delay_1ms...
The interrupt method is an efficient way to do ADC conversion in a non-blocking manner, so the CPU can resume executing the main code routine until the ADC completes the conversion and fires an interrupt signal so the CPU can switch to the ISR context and save the conversion results for fu...