hard_hdma_int.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "hard_hdma_int.h"
  2. #include "hpm_dma_drv.h"
  3. #include "board.h"
  4. volatile bool uart1_tx_dma_done = true;
  5. volatile bool uart2_tx_dma_done = true;
  6. volatile bool uart3_tx_dma_done = true;
  7. volatile bool uart4_tx_dma_done = true;
  8. volatile bool uart5_tx_dma_done = true;
  9. volatile bool uart6_tx_dma_done = true;
  10. extern struct _uart_config _u1_config;
  11. extern struct _uart_config _u4_config;
  12. extern void uart_tx_dma_isr_callback(struct _uart_config *config);
  13. /*--------------------------------------------------------------------------*/
  14. /* DMA 发送完成中断服务程序 */
  15. /*--------------------------------------------------------------------------*/
  16. SDK_DECLARE_EXT_ISR_M(IRQn_HDMA, dma_isr)
  17. void dma_isr(void)
  18. {
  19. //volatile hpm_stat_t stat_tx_chn;
  20. //stat_tx_chn = dma_check_transfer_status(SBUS_UART2_DMA_CONTROLLER, SBUS_UART2_TX_DMA_CH);
  21. //if (stat_tx_chn & DMA_CHANNEL_STATUS_TC) {
  22. // uart2_tx_dma_done = true;
  23. //}
  24. //stat_tx_chn = dma_check_transfer_status(IMU_UART3_DMA_CONTROLLER, IMU_UART3_TX_DMA_CH);
  25. //if (stat_tx_chn & DMA_CHANNEL_STATUS_TC) {
  26. // uart3_tx_dma_done = true;
  27. // uart_tx_dma_isr_callback(&_u3_config); // 串口3 DMA发送中断回调
  28. //}
  29. volatile hpm_stat_t stat_tx_chn = dma_check_transfer_status(HPM_HDMA, 0);
  30. if (stat_tx_chn & DMA_CHANNEL_STATUS_TC) {
  31. uart1_tx_dma_done = true;
  32. uart_tx_dma_isr_callback(&_u1_config);
  33. }
  34. if (stat_tx_chn & DMA_CHANNEL_STATUS_TC) {
  35. uart4_tx_dma_done = true;
  36. uart_tx_dma_isr_callback(&_u4_config);
  37. }
  38. }