hard_system.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "hpm_dma_drv.h"
  2. #include "board.h"
  3. #include "hard_system.h"
  4. #include "hpm_ppor_drv.h"
  5. #include "test.h"
  6. #define U3_DMA HPM_HDMA // 关的是串口三的接收dma 这里没有空闲中断 不使用dma模式接收
  7. #define U3_DMA_CH 1
  8. void sys_reset(void)
  9. {
  10. /*Enable software reset*/
  11. ppor_reset_mask_set_source_enable(HPM_PPOR, ppor_reset_software);
  12. /* software reset*/
  13. printf("%s\n", __func__);
  14. ppor_sw_reset(HPM_PPOR, 10);
  15. }
  16. /**
  17. * @brief 禁用指定DMA通道
  18. * @note HPM6750的DMA1 Stream1对应:
  19. * - DMA控制器:DMA0(HPM6750主DMA控制器)
  20. *
  21. */
  22. void u3_dma_disable(void)
  23. {
  24. // 禁用HDMA通道 1 根据实际修改
  25. // dma_disable_channel(U3_DMA, U3_DMA_CH);
  26. }
  27. #ifdef SYSTEM_TEST
  28. /*
  29. reset demo test 20260115 pass
  30. */
  31. void system_test(void)
  32. {
  33. sys_reset();
  34. /*If a software reset occurs, clear the reset flag and print the message*/
  35. if (ppor_reset_get_flags(HPM_PPOR) & ppor_reset_software) {
  36. ppor_reset_clear_flags(HPM_PPOR, ppor_reset_software);
  37. ppor_reset_mask_clear_source_enable(HPM_PPOR, ppor_reset_software);
  38. printf("Software reset has occurred\n");
  39. while (1) {
  40. };
  41. }
  42. #endif