新手上路
- 积分
- 49
- 金钱
- 49
- 注册时间
- 2023-4-4
- 在线时间
- 11 小时
|

楼主 |
发表于 2024-3-11 15:01:45
|
显示全部楼层
主函数主要是这样写的:
dma_usart_tx_config(DMA2_Stream7 ,4,(uint32_t)write_chip_data, (uint32_t)g_test_buffer);
USART1->CR3 = 1 << 7; /* 串口DMA使能发送器,1:使能DMA模式,0:禁止DMA模式;*/
dma_enable(DMA2_Stream7,7680); /* 开始一次DMA传输! */
while(1)
{
for(int j=0;j<20;j++)
{
RCC->AHB1ENR |= 1 << 2;
};//凑时间
if (DMA2->HISR & (1 << 27)) /* 等待DMA2_Steam7传输完成 */
{
DMA2->HIFCR |= 1 << 27; /* 清除DMA2_Steam7传输完成标志 */
FR_TOGGLE();
num=0;
}
LP(1);
LP(0);
num++;
}
}
|
|