GD32F1x0 DMA

[复制链接]
994|3
 楼主| MDK冲了周周 发表于 2020-8-28 16:10 | 显示全部楼层 |阅读模式
求问GD32F1x0的DMA怎么配置,怎么用DMA发送数据
zeshoufx 发表于 2020-8-28 16:34 | 显示全部楼层
有例程的,,参考一下
chenjun89 发表于 2020-9-4 23:08 来自手机 | 显示全部楼层
楼主是想用DMA操作什么外设啊?
清溪 发表于 2020-11-27 21:38 | 显示全部楼层
GD32F1x0 DMA (ram to ram)具体配置步骤如下:
(1) 使能DMA时钟:rcu_periph_clock_enable(RCU_DMA);
(2) 初始化DMA通道:
    dma_init_struct.direction = DMA_PERIPHERA_TO_MEMORY;
    dma_init_struct.memory_addr = (uint32_t)destination_address1;
    dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE;
    dma_init_struct.memory_width = DMA_MEMORY_WIDTH_8BIT;
    dma_init_struct.number = DATANUM;
    dma_init_struct.periph_addr = (uint32_t)source_address;
    dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_ENABLE;
    dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_8BIT;
    dma_init_struct.priority = DMA_PRIORITY_ULTRA_HIGH;
    dma_init(DMA_CH1,dma_init_struct);
(3) 配置DMA的模式
    dma_circulation_disable(DMA_CH1);
    dma_memory_to_memory_enable(DMA_CH1);
(4) DMA 通道使能
    dma_channel_enable(DMA_CH1);
固件库dma.c文件中,有很详细的DMA各项参数的初始化说明,如图。
271715fc100cf1111c.png

        
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

2

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部