dma.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. ******************************************************************************
  3. * File Name : dma.c
  4. * Description : This file provides code for the configuration
  5. * of all the requested memory to memory DMA transfers.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "dma.h"
  21. /* USER CODE BEGIN 0 */
  22. /* USER CODE END 0 */
  23. /*----------------------------------------------------------------------------*/
  24. /* Configure DMA */
  25. /*----------------------------------------------------------------------------*/
  26. /* USER CODE BEGIN 1 */
  27. /* USER CODE END 1 */
  28. /**
  29. * Enable DMA controller clock
  30. */
  31. void MX_DMA_Init(void)
  32. {
  33. /* DMA controller clock enable */
  34. __HAL_RCC_DMA1_CLK_ENABLE();
  35. /* DMA interrupt init */
  36. /* DMA1_Channel2_IRQn interrupt configuration */
  37. HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
  38. HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
  39. /* DMA1_Channel3_IRQn interrupt configuration */
  40. HAL_NVIC_SetPriority(DMA1_Channel3_IRQn, 0, 0);
  41. HAL_NVIC_EnableIRQ(DMA1_Channel3_IRQn);
  42. /* DMA1_Channel6_IRQn interrupt configuration */
  43. HAL_NVIC_SetPriority(DMA1_Channel6_IRQn,0, 0);
  44. HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn);
  45. /* DMA1_Channel7_IRQn interrupt configuration */
  46. HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0);
  47. HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);
  48. }
  49. /* USER CODE BEGIN 2 */
  50. /* USER CODE END 2 */
  51. /**
  52. * @}
  53. */
  54. /**
  55. * @}
  56. */
  57. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/