You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  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) 2023 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_DMA2_CLK_ENABLE();
  36. __HAL_RCC_DMA1_CLK_ENABLE();
  37. /* DMA interrupt init */
  38. /* DMA1_Stream3_IRQn interrupt configuration */
  39. HAL_NVIC_SetPriority(DMA1_Stream3_IRQn, 5, 0);
  40. HAL_NVIC_EnableIRQ(DMA1_Stream3_IRQn);
  41. /* DMA1_Stream4_IRQn interrupt configuration */
  42. HAL_NVIC_SetPriority(DMA1_Stream4_IRQn, 5, 0);
  43. HAL_NVIC_EnableIRQ(DMA1_Stream4_IRQn);
  44. /* DMA2_Stream0_IRQn interrupt configuration */
  45. HAL_NVIC_SetPriority(DMA2_Stream0_IRQn, 5, 0);
  46. HAL_NVIC_EnableIRQ(DMA2_Stream0_IRQn);
  47. /* DMA2_Stream2_IRQn interrupt configuration */
  48. HAL_NVIC_SetPriority(DMA2_Stream2_IRQn, 5, 0);
  49. HAL_NVIC_EnableIRQ(DMA2_Stream2_IRQn);
  50. /* DMA2_Stream3_IRQn interrupt configuration */
  51. HAL_NVIC_SetPriority(DMA2_Stream3_IRQn, 5, 0);
  52. HAL_NVIC_EnableIRQ(DMA2_Stream3_IRQn);
  53. }
  54. /* USER CODE BEGIN 2 */
  55. /* USER CODE END 2 */