source: trunk/fw_g473rct/Core/Src/dma.c

Last change on this file was 23, checked in by f.jahn, 4 months ago

modbus via DMA still BETA, aber bautratenumschaltung implementiert

File size: 2.5 KB
Line 
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) 2025 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
21/* Includes ------------------------------------------------------------------*/
22#include "dma.h"
23
24/* USER CODE BEGIN 0 */
25
26/* USER CODE END 0 */
27
28/*----------------------------------------------------------------------------*/
29/* Configure DMA */
30/*----------------------------------------------------------------------------*/
31
32/* USER CODE BEGIN 1 */
33
34/* USER CODE END 1 */
35
36/**
37 * Enable DMA controller clock
38 */
39void MX_DMA_Init(void)
40{
41
42 /* DMA controller clock enable */
43 __HAL_RCC_DMAMUX1_CLK_ENABLE();
44 __HAL_RCC_DMA1_CLK_ENABLE();
45
46 /* DMA interrupt init */
47 /* DMA1_Channel1_IRQn interrupt configuration */
48 HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
49 HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
50 /* DMA1_Channel2_IRQn interrupt configuration */
51 HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
52 HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
53 /* DMA1_Channel3_IRQn interrupt configuration */
54 HAL_NVIC_SetPriority(DMA1_Channel3_IRQn, 0, 0);
55 HAL_NVIC_EnableIRQ(DMA1_Channel3_IRQn);
56 /* DMA1_Channel4_IRQn interrupt configuration */
57 HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 0, 0);
58 HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);
59 /* DMA1_Channel5_IRQn interrupt configuration */
60 HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 0, 0);
61 HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
62 /* DMA1_Channel6_IRQn interrupt configuration */
63 HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0);
64 HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn);
65 /* DMA1_Channel7_IRQn interrupt configuration */
66 HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0);
67 HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);
68
69}
70
71/* USER CODE BEGIN 2 */
72
73/* USER CODE END 2 */
74
Note: See TracBrowser for help on using the repository browser.