-
GD32H759 定时器触发+DMA控制任意IO做PWM和脉冲数控制
在使用GD32H759的定时器出发DMA搬数据到GPIO的BOP寄存器来控制GPIO的翻转做PWM和脉冲数的控制。DMA能进入传输完成中断,但是并没有把数据搬运到GPIO的BOP寄存器使GPIO口翻转。不知道是什么原因。有没有大神解答下的,万分感谢!代码如下:constuint32_tvPulse_Data[17]={0x00080004,0x00040008,0x00080004,0x00040008,0x00080004,0x00040008,0x00080004,0x00040008,0x00080004,0x00040008,0x00080004,0x00040008,0x00080004,0x00040008,0x00080004,0x00040008,0x0000000C};/*PD2,PD3Upluse*/voidpwm_gpio_config(void){rcu_periph_clock_enable(RCU_GPIOD);/*LED0引脚模式设置*/gpio_mode_set(GPIOD,GPIO_MODE_OUTPUT,GPIO_PUPD_PULLUP,GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3\|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_6|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11);gpio_output_options_set(GPIOD,GPIO_OTYPE_PP,GPIO_OSPEED_60MHZ,GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3\|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_6|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11);gpio_port_write(GPIOD,0x0000);}/*!\briefconfiguretheDMAperipheral\paramnone\param[out]none\retvalnone*/voidtime2_dma_config(void){/*ADC_DMA_channelconfiguration*/dma_single_data_parameter_structdma_single_data_parameter;rcu_periph_clock_enable(RCU_DMA0);nvic_priority_group_set(NVIC_PRIGROUP_PRE4_SUB0);nvic_irq_enable(DMA0_Channel2_IRQn,1,0);/*ADCDMA_channelconfiguration*/dma_deinit(DMA0,DMA_CH2);/*initializeDMAsingledatamode*/dma_single_data_parameter.request=DMA_REQUEST_TIMER2_UP;dma_single_data_parameter.periph_addr=(uint32_t)&GPIO_BOP(GPIOD);dma_single_data_parameter.periph_inc=DMA_PERIPH_INCREASE_DISABLE;dma_single_data_parameter.memory0_addr=(uint32_t)(vPulse_Da
2025-03-11 1 -
GD32E503是不是只有144PIN才有SQPI外设
GD32E503是不是只有144PIN才有SQPI外设
2023-08-23 3