#define DMA_IT_FEIF6 ((uint32_t)0xA0010000) #define DMA_IT_DMEIF6 ((uint32_t)0x20041000) #define DMA_IT_TEIF6 ((uint32_t)0x20082000) #define DMA_IT_HTIF6 ((uint32_t)0x20104000) #define DMA_IT_TCIF6 ((uint32_t)0x20208000) #define DMA_IT_FEIF7 ((uint32_t)0xA0400000...
{ if (DMA_GetITStatus(DMA2_Stream6, DMA_IT_TCIF6) != RESET) //判断为接收中断 { DMA_ClearITPendingBit(DMA2_Stream6, DMA_IT_TCIF6); GPIO_ResetBits(GPIOG, GPIO_Pin_6); //点亮LED,起到中断指示作用 } } 调试结果如下:
#define COMM_TX_DMA_FLAG_TCIF DMA_FLAG_TCIF6 #define COMM_TX_DMA_IRQn DMA1_Stream6_IRQn #define COMM_TX_DMA_Priority 8 //优先级 #define COMM_TX_DMA_IRQHandler DMA1_Stream6_IRQHandler //中断函数接口(见stm32f4xx_it.c) #define COMM_TX_DMA_IT_TCIF DMA_IT_TCIF6 DMA配置: /*** ...
voidDMA2_Stream0_IRQHandler(void){if(DMA_GetITStatus(DMA2_Stream0, DMA_IT_TCIF0)) { DMA_ClearITPendingBit(DMA2_Stream0, DMA_IT_TCIF0); transfers++;if(transfers >=100){ GPIO_ToggleBits(GPIOD, GPIO_Pin_12); transfers =0; } }if(DMA_GetITStatus(DMA2_Stream0, DMA_IT_HTIF0)) { ...
DMA_ClearITPendingBit(DMA1_Stream6, DMA_IT_TCIF6); } } DMA发送函数:(初始化时不使能DMA,当数据准备好之后,根据待发送的数据长度,设定DMA发送的长度,同时使能DMA,启动一次发送,当每次DMA发送完成后,在传输完成中断中,关闭DMA,等待下一次数据准备好,循环以上过程)/* start once usart2 dma send (for ANO)...
DMA_ClearITPendingBit(DMA2_Stream1, DMA_IT_TCIF1);} } void init_usart(void){ NVIC_InitTypeDef ...
void DMA2_Stream6_IRQHandler(void) { if (DMA_GetITStatus(DMA2_Stream6, DMA_IT_TCIF6) != RESET) //判断为接收中断 { DMA_ClearITPendingBit(DMA2_Stream6, DMA_IT_TCIF6); GPIO_ResetBits(GPIOG, GPIO_Pin_6); //点亮LED,起到中断指示作用 } } 调试结果如下:...
DMA_ITConfig(DMA1_Stream6, DMA_IT_TC, ENABLE);// 开启DMA通道传输完成中断 USART_DMACmd(USART2...
if (DMA_GetITStatus(DMA2_Stream6, DMA_IT_TCIF6) != RESET) //判断为接收中断 { DMA_ClearITPendingBit(DMA2_Stream6, DMA_IT_TCIF6); GPIO_ResetBits(GPIOG, GPIO_Pin_6); //点亮LED,起到中断指示作用 } } 调试结果如下: 分享有些DMA的资料 ...