问答

汇集网友智慧,解决技术难题

guozengpeng

TA的家园币:20  

  • GD32A503RDT3 ADC+DMA顺序转换问题,没有数据

    voidrcu_config(void){/*enableGPIOclock*/rcu_periph_clock_enable(RCU_GPIOB);rcu_periph_clock_enable(RCU_GPIOE);/*enableADC0clock*/rcu_periph_clock_enable(RCU_ADC0);/*enableDMA0clock*/rcu_periph_clock_enable(RCU_DMA0);}/*!\briefconfiguretheGPIOperipheral\paramnone\param[out]none\retvalnone*/voidgpio_config(void){/*configtheGPIOasanalogmode*/gpio_mode_set(GPIOB,GPIO_MODE_ANALOG,GPIO_PUPD_NONE,GPIO_PIN_1);//GPIOB1,gpio_mode_set(GPIOE,GPIO_MODE_ANALOG,GPIO_PUPD_NONE,GPIO_PIN_13);}/*!\briefconfiguretheDMAperipheral\paramnone\param[out]none\retvalnone*/voiddma_config(void){/*ADC_DMA_channelconfiguration*/dma_parameter_structdma_data_parameter;/*ADCDMA_channelconfiguration*/dma_deinit(DMA0,DMA_CH0);/*initializeDMAsingledatamode*/dma_data_parameter.periph_addr=(uint32_t)(&ADC_RDATA(ADC0));//外设基地址dma_data_parameter.periph_inc=DMA_PERIPH_INCREASE_DISABLE;//内存地址增量模式dma_data_parameter.memory_addr=(uint32_t)adc_value;//数据存放地址dma_data_parameter.memory_inc=DMA_MEMORY_INCREASE_ENABLE;//内存地址增量模式dma_data_parameter.periph_width=DMA_PERIPHERAL_WIDTH_16BIT;//dma外设宽度16位,半字dma_data_parameter.memory_width=DMA_MEMORY_WIDTH_16BIT;dma_data_parameter.direction=DMA_PERIPHERAL_TO_MEMORY;//传输模式,外设到存储(接收)dma_data_parameter.number=2;//长度dma_data_parameter.priority=DMA_PRIORITY_HIGH;//优先级高dma_init(DMA0,DMA_CH0,&dma_data_parameter);dma_circulation_enable(DMA0,DMA_CH0);/*enableDMAchannel*/dma_channel_enable(DMA0,DMA_CH0);}/*!\briefconfiguretheADCperipheral\paramnone\param[out]none\retvalnone*/voidadc_config(void){/*configADCclock*/rcu_adc_clock_config(RCU_

    顺序 2A DMA ADC GD32

    2023-08-28 25