dma.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file dma.c
  5. * @brief This file provides code for the configuration
  6. * of all the requested memory to memory DMA transfers.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2024 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Includes ------------------------------------------------------------------*/
  21. #include "dma.h"
  22. /* USER CODE BEGIN 0 */
  23. /* USER CODE END 0 */
  24. /*----------------------------------------------------------------------------*/
  25. /* Configure DMA */
  26. /*----------------------------------------------------------------------------*/
  27. /* USER CODE BEGIN 1 */
  28. /* USER CODE END 1 */
  29. /**
  30. * Enable DMA controller clock
  31. */
  32. void MX_DMA_Init(void)
  33. {
  34. /* DMA controller clock enable */
  35. __HAL_RCC_DMA1_CLK_ENABLE();
  36. __HAL_RCC_DMA2_CLK_ENABLE();
  37. /* DMA interrupt init */
  38. /* DMA1_Channel3_IRQn interrupt configuration */
  39. HAL_NVIC_SetPriority(DMA1_Channel3_IRQn, 5, 0);
  40. HAL_NVIC_EnableIRQ(DMA1_Channel3_IRQn);
  41. /* DMA2_Channel3_IRQn interrupt configuration */
  42. HAL_NVIC_SetPriority(DMA2_Channel3_IRQn, 5, 0);
  43. HAL_NVIC_EnableIRQ(DMA2_Channel3_IRQn);
  44. }
  45. /* USER CODE BEGIN 2 */
  46. /* USER CODE END 2 */