-
GD32E230的ADC可靠不?
我想用TIMER14CH0触发ADC(扫描转换模式),就怎么触发不了。高手帮我看看哪错了#include"gd32e23x_adc.h"#include"gd32e23x_dma.h"#include"gd32e23x_gpio.h"#include"gd32e23x_timer.h"staticvolatileuint16_tdata[4];staticvoidrcuConfig();staticvoidadcConfig();staticvoiddmaConfig();staticvoidportConfig();staticvoidtimerConfig();voidmain(){rcuConfig();timerConfig();portConfig();dmaConfig();adcConfig();timer_enable(TIMER14);gpio_bit_set(GPIOB,GPIO_PIN_4);while(1);}voidrcuConfig(){rcu_periph_clock_enable(RCU_GPIOA);rcu_periph_clock_enable(RCU_GPIOB);rcu_periph_clock_enable(RCU_ADC);rcu_periph_clock_enable(RCU_DMA);rcu_periph_clock_enable(RCU_TIMER14);rcu_adc_clock_config(RCU_ADCCK_AHB_DIV3);}voidadcConfig(){adc_special_function_config(ADC_SCAN_MODE,ENABLE);adc_dma_mode_enable();adc_channel_length_config(ADC_REGULAR_CHANNEL,4U);adc_regular_channel_config(1U,ADC_CHANNEL_3,ADC_SAMPLETIME_1POINT5);adc_regular_channel_config(2U,ADC_CHANNEL_4,ADC_SAMPLETIME_1POINT5);adc_regular_channel_config(3U,ADC_CHANNEL_8,ADC_SAMPLETIME_1POINT5);adc_regular_channel_config(4U,ADC_CHANNEL_9,ADC_SAMPLETIME_1POINT5);adc_external_trigger_config(ADC_REGULAR_CHANNEL,ENABLE);adc_external_trigger_source_config(ADC_REGULAR_CHANNEL,ADC_EXTTRIG_REGULAR_T14_CH0);adc_enable();for(uint16_ti=0;i<1000;++i);adc_calibration_enable();}voiddmaConfig(){dma_parameter_structinitParam;initParam.periph_addr=0x4001244CU;//ADC_RDATAinitParam.periph_inc=DMA_PERIPH_INCREASE_DISABLE;initParam.memory_addr=(uint32_t)data;initParam.memory_inc=DMA_MEMORY_INCREASE_ENABLE;initParam.periph_width=DMA_PERIPHERAL_WIDTH_16BIT;initParam.memory_width=
2021-01-10 0