annotate Discovery/Src/stm32f4xx_hal_msp_hw2.c @ 739:4a6bffaa38b3

Enable start dive in Big font display: The diver had to manually switch to the big font view in dive mode. By selecting the big font view as default view in the custom menu the BF view will now be shown from the start of the dive. In order to have a qucker access to the settings menu, the settings menu has been added to the quick menu selection. The settings menu will then also be left to the BF view.
author Ideenmodellierer
date Thu, 02 Feb 2023 17:26:54 +0100
parents 879709909dd6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /// \file Discovery/Src/stm32f4xx_hal_msp_hw2.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief This file provides code for the MSP Initialization and de-Initialization codes.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /// \author Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /// \date 2018
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// \details
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 /// \par Copyright (c) 2014 STMicroelectronics
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 /// Redistribution and use in source and binary forms, with or without modification,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 /// are permitted provided that the following conditions are met:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 /// 1. Redistributions of source code must retain the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 /// this list of conditions and the following disclaimer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 /// 2. Redistributions in binary form must reproduce the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 /// this list of conditions and the following disclaimer in the documentation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 /// and/or other materials provided with the distribution.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 /// 3. Neither the name of STMicroelectronics nor the names of its contributors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 /// may be used to endorse or promote products derived from this software
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 /// without specific prior written permission.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 /// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 /// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 /// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 /// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 /// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 /// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 /// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 /// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 /// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 #include "stm32f4xx_hal.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 #include "ostc.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 DMA_HandleTypeDef hdma_spi1_tx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 DMA_HandleTypeDef hdma_spi1_rx;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 * Initializes the Global MSP.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 void HAL_MspInit(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 /* USER CODE BEGIN MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 /* USER CODE END MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 /* System interrupt init*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 /** SysTick_IRQn interrupt configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 HAL_NVIC_SetPriority(SysTick_IRQn, 1, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 /* USER CODE BEGIN MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 /* always set priority right */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 /* USER CODE END MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 void HAL_DMA2D_MspInit(DMA2D_HandleTypeDef* hdma2d)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 if(hdma2d->Instance==DMA2D)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 /* USER CODE BEGIN DMA2D_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 /* USER CODE END DMA2D_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 /* Peripheral clock enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 __DMA2D_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 /* USER CODE BEGIN DMA2D_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 HAL_NVIC_SetPriority(DMA2D_IRQn, 1, 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 HAL_NVIC_EnableIRQ(DMA2D_IRQn);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 /* USER CODE END DMA2D_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 void HAL_DMA2D_MspDeInit(DMA2D_HandleTypeDef* hdma2d)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 if(hdma2d->Instance==DMA2D)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 /* USER CODE BEGIN DMA2D_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 /* USER CODE END DMA2D_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 __DMA2D_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 /* USER CODE BEGIN DMA2D_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 __DMA2D_RELEASE_RESET();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 /* USER CODE END DMA2D_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 GPIO_InitTypeDef GPIO_InitStruct;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 if(hltdc->Instance==LTDC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 /* USER CODE BEGIN LTDC_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 __GPIOE_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 __GPIOF_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 __GPIOG_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 __GPIOH_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 __GPIOI_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 /* USER CODE END LTDC_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 /* Peripheral clock enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 __LTDC_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 /**LTDC GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 PE4 ------> LTDC_B0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 PE5 ------> LTDC_G0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 PE6 ------> LTDC_G1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 PI9 ------> LTDC_VSYNC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 PI10 ------> LTDC_HSYNC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 PF10 ------> LTDC_DE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 PH2 ------> LTDC_R0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 PH3 ------> LTDC_R1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 PH8 ------> LTDC_R2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 PH9 ------> LTDC_R3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 PH10 ------> LTDC_R4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 PH11 ------> LTDC_R5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 PH12 ------> LTDC_R6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 PG6 ------> LTDC_R7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 PG7 ------> LTDC_CLK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 PH13 ------> LTDC_G2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 PH14 ------> LTDC_G3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 PH15 ------> LTDC_G4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 PI0 ------> LTDC_G5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 PI1 ------> LTDC_G6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 PI2 ------> LTDC_G7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 PG10 ------> LTDC_B2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 PG11 ------> LTDC_B3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 PG12 ------> LTDC_B1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 PI4 ------> LTDC_B4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 PI5 ------> LTDC_B5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 PI6 ------> LTDC_B6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 PI7 ------> LTDC_B7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 GPIO_InitStruct.Pull = GPIO_NOPULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_0|GPIO_PIN_1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 |GPIO_PIN_2|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 |GPIO_PIN_7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 GPIO_InitStruct.Pull = GPIO_NOPULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 GPIO_InitStruct.Pin = GPIO_PIN_10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 GPIO_InitStruct.Pull = GPIO_NOPULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_8|GPIO_PIN_9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 |GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 |GPIO_PIN_14|GPIO_PIN_15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 GPIO_InitStruct.Pull = GPIO_NOPULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_10|GPIO_PIN_11
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 |GPIO_PIN_12;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 GPIO_InitStruct.Pull = GPIO_NOPULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 /* USER CODE BEGIN LTDC_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 /* USER CODE END LTDC_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 if(hltdc->Instance==LTDC)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 /* USER CODE BEGIN LTDC_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 /* USER CODE END LTDC_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 __LTDC_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 /**LTDC GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 PE4 ------> LTDC_B0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 PE5 ------> LTDC_G0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 PE6 ------> LTDC_G1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 PI9 ------> LTDC_VSYNC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 PI10 ------> LTDC_HSYNC
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 PF10 ------> LTDC_DE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 PH2 ------> LTDC_R0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 PH3 ------> LTDC_R1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 PH8 ------> LTDC_R2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 PH9 ------> LTDC_R3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 PH10 ------> LTDC_R4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 PH11 ------> LTDC_R5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 PH12 ------> LTDC_R6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 PG6 ------> LTDC_R7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 PG7 ------> LTDC_CLK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 PH13 ------> LTDC_G2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 PH14 ------> LTDC_G3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 PH15 ------> LTDC_G4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 PI0 ------> LTDC_G5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 PI1 ------> LTDC_G6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 PI2 ------> LTDC_G7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 PG10 ------> LTDC_B2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 PG11 ------> LTDC_B3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 PG12 ------> LTDC_B1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 PI4 ------> LTDC_B4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 PI5 ------> LTDC_B5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 PI6 ------> LTDC_B6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 PI7 ------> LTDC_B7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 HAL_GPIO_DeInit(GPIOE, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 HAL_GPIO_DeInit(GPIOI, GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_0|GPIO_PIN_1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 |GPIO_PIN_2|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 |GPIO_PIN_7);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 HAL_GPIO_DeInit(GPIOF, GPIO_PIN_10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 HAL_GPIO_DeInit(GPIOH, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_8|GPIO_PIN_9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 |GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 |GPIO_PIN_14|GPIO_PIN_15);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 HAL_GPIO_DeInit(GPIOG, GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_10|GPIO_PIN_11
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 |GPIO_PIN_12);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 /* USER CODE BEGIN LTDC_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 __LTDC_RELEASE_RESET();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 /* USER CODE END LTDC_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 GPIO_InitTypeDef GPIO_InitStruct;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 if(hspi->Instance==SPI1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 /* USER CODE BEGIN SPI1_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 __GPIOA_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 __GPIOB_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 __DMA2_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 /* USER CODE END SPI1_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 /* Peripheral clock enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 __SPI1_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 /**SPI1 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 alt: PA4 ------> SPI1_NSS, jetzt soft
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 PA5 ------> SPI1_SCK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 alt: PA6 ------> SPI1_MISO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 neu: PB4 ------> SPI1_MISO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 PA7 ------> SPI1_MOSI
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 // GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 GPIO_InitStruct.Pull = GPIO_NOPULL;
125
626191e1fed1 Change GPIO speed for SPI communication as recommended by STM32 Errata
Ideenmodellierer
parents: 124
diff changeset
301 GPIO_InitStruct.Speed = GPIO_SPEED_FAST; /* Decision is based on errata which recommends FAST for GPIO at 90Mhz */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 GPIO_InitStruct.Pin = GPIO_PIN_4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 /* Peripheral DMA init*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 hdma_spi1_tx.Instance = DMA2_Stream3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 hdma_spi1_tx.Init.Channel = DMA_CHANNEL_3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 hdma_spi1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 hdma_spi1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 hdma_spi1_tx.Init.MemInc = DMA_MINC_ENABLE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 hdma_spi1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 hdma_spi1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 hdma_spi1_tx.Init.Mode = DMA_NORMAL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 hdma_spi1_tx.Init.Priority = DMA_PRIORITY_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 hdma_spi1_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 hdma_spi1_tx.Init.MemBurst = DMA_MBURST_INC4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 hdma_spi1_tx.Init.PeriphBurst = DMA_PBURST_INC4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 HAL_DMA_Init(&hdma_spi1_tx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 __HAL_LINKDMA(hspi,hdmatx,hdma_spi1_tx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 hdma_spi1_rx.Instance = DMA2_Stream0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 hdma_spi1_rx.Init.Channel = DMA_CHANNEL_3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 hdma_spi1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 hdma_spi1_rx.Init.PeriphInc = DMA_PINC_DISABLE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 hdma_spi1_rx.Init.MemInc = DMA_MINC_ENABLE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 hdma_spi1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 hdma_spi1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 hdma_spi1_rx.Init.Mode = DMA_NORMAL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 hdma_spi1_rx.Init.Priority = DMA_PRIORITY_HIGH;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 hdma_spi1_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 hdma_spi1_rx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 hdma_spi1_rx.Init.MemBurst = DMA_MBURST_INC4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 hdma_spi1_rx.Init.PeriphBurst = DMA_PBURST_INC4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 HAL_DMA_Init(&hdma_spi1_rx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 __HAL_LINKDMA(hspi, hdmarx, hdma_spi1_rx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 /*##-4- Configure the NVIC for DMA #########################################*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 /* NVIC configuration for DMA transfer complete interrupt (SPI1_TX) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 HAL_NVIC_SetPriority(DMA2_Stream3_IRQn, 0, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 HAL_NVIC_EnableIRQ(DMA2_Stream3_IRQn);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 /* NVIC configuration for DMA transfer complete interrupt (SPI1_RX) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 HAL_NVIC_SetPriority(DMA2_Stream0_IRQn, 0, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 HAL_NVIC_EnableIRQ(DMA2_Stream0_IRQn);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 else if(hspi->Instance==SPI2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 /* USER CODE BEGIN SPI2_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 __GPIOB_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 /* USER CODE END SPI2_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 /* Peripheral clock enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 __SPI2_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 /**SPI2 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 PB13 ------> SPI2_SCK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 PB14 ------> SPI2_MISO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 PB15 ------> SPI2_MOSI
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 GPIO_InitStruct.Pull = GPIO_NOPULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 /* USER CODE BEGIN SPI2_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 /* USER CODE END SPI2_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 else if(hspi->Instance==SPI5)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 /* USER CODE BEGIN SPI5_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 __GPIOF_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 /* USER CODE END SPI5_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 /* Peripheral clock enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 __SPI5_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 /**SPI5 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 PF7 ------> SPI5_SCK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 PF8 ------> SPI5_MISO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 PF9 ------> SPI5_MOSI
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 GPIO_InitStruct.Pull = GPIO_NOPULL;
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 125
diff changeset
396 GPIO_InitStruct.Speed = GPIO_SPEED_FAST; /* Decision is based on errata which recommends FAST for GPIO at 90Mhz */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 GPIO_InitStruct.Alternate = GPIO_AF5_SPI5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 /* USER CODE BEGIN SPI5_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 /* USER CODE END SPI5_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 if(hspi->Instance==SPI1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 /* USER CODE BEGIN SPI1_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 __SPI1_FORCE_RESET();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 __SPI1_RELEASE_RESET();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 /* USER CODE END SPI1_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 __SPI1_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 /**SPI1 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 PA4 ------> SPI1_NSS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 PA5 ------> SPI1_SCK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 PA6 ------> SPI1_MISO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 PA7 ------> SPI1_MOSI
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 HAL_GPIO_DeInit(GPIOA, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 /* Peripheral DMA DeInit*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 HAL_DMA_DeInit(hspi->hdmatx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 HAL_DMA_DeInit(hspi->hdmarx);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 /* USER CODE BEGIN SPI1_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 /* USER CODE END SPI1_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 else if(hspi->Instance==SPI2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 /* USER CODE BEGIN SPI2_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 /* USER CODE END SPI2_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 __SPI2_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 /**SPI2 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 PB13 ------> SPI2_SCK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 PB14 ------> SPI2_MISO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 PB15 ------> SPI2_MOSI
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 /* USER CODE BEGIN SPI2_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 /* USER CODE END SPI2_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 else if(hspi->Instance==SPI5)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 /* USER CODE BEGIN SPI5_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 __SPI5_FORCE_RESET();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 __SPI5_RELEASE_RESET();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 /* USER CODE END SPI5_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 __SPI5_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 /**SPI5 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 PF7 ------> SPI5_SCK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 PF8 ------> SPI5_MISO
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 PF9 ------> SPI5_MOSI
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 HAL_GPIO_DeInit(GPIOF, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 /* USER CODE BEGIN SPI5_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 /* USER CODE END SPI5_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* htim_pwm)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 GPIO_InitTypeDef GPIO_InitStruct;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 if(htim_pwm->Instance==TIM_BACKLIGHT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 TIM_BACKLIGHT_GPIO_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 TIM_BACKLIGHT_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 GPIO_InitStruct.Pin = TIM_BACKLIGHT_PIN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 GPIO_InitStruct.Pull = GPIO_NOPULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 GPIO_InitStruct.Alternate = GPIO_AF2_TIM3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 HAL_GPIO_Init(TIM_BACKLIGHT_GPIO_PORT, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 if(htim_base->Instance==TIMx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 TIMx_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 HAL_NVIC_SetPriority(TIMx_IRQn, 2, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 HAL_NVIC_EnableIRQ(TIMx_IRQn);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 }
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 125
diff changeset
505 #ifdef DEMOMODE
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 if(htim_base->Instance==TIM7)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 __TIM7_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 HAL_NVIC_SetPriority(TIM7_IRQn, 2, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 HAL_NVIC_EnableIRQ(TIM7_IRQn);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 }
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 125
diff changeset
513 #endif
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef* htim_pwm)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 if(htim_pwm->Instance==TIM2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 /* USER CODE BEGIN TIM2_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 /* USER CODE END TIM2_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 __TIM2_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 /**TIM2 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 PA15 ------> TIM2_CH1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 HAL_GPIO_DeInit(GPIOA, GPIO_PIN_15);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 /* USER CODE BEGIN TIM2_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 /* USER CODE END TIM2_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 if(htim_base->Instance==TIM3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 /* USER CODE BEGIN TIM3_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 /* USER CODE END TIM3_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 __TIM3_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 /**TIM3 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 PC7 ------> TIM3_CH2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 HAL_GPIO_DeInit(GPIOC, GPIO_PIN_7);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 /* USER CODE BEGIN TIM3_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 /* USER CODE END TIM3_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 void HAL_UART_MspInit(UART_HandleTypeDef* huart)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 GPIO_InitTypeDef GPIO_InitStruct;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 if(huart->Instance==USART1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 /* USER CODE BEGIN USART1_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 __GPIOA_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 /* USER CODE END USART1_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 /* Peripheral clock enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 __USART1_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 /**USART1 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 PA9 ------> USART1_TX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 PA10 ------> USART1_RX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 PA11 ------> USART1_CTS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 PA12 ------> USART1_RTS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 GPIO_InitStruct.Pull = GPIO_PULLUP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 GPIO_InitStruct.Speed = GPIO_SPEED_FAST;//GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587
393
879709909dd6 Configurate FlowCntrl Pins as noPull
ideenmodellierer
parents: 130
diff changeset
588 #ifdef USARTx_CTS_PIN /* config control flow pins */
879709909dd6 Configurate FlowCntrl Pins as noPull
ideenmodellierer
parents: 130
diff changeset
589 GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12;
879709909dd6 Configurate FlowCntrl Pins as noPull
ideenmodellierer
parents: 130
diff changeset
590 GPIO_InitStruct.Pull = GPIO_NOPULL;
879709909dd6 Configurate FlowCntrl Pins as noPull
ideenmodellierer
parents: 130
diff changeset
591 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
879709909dd6 Configurate FlowCntrl Pins as noPull
ideenmodellierer
parents: 130
diff changeset
592 #endif
879709909dd6 Configurate FlowCntrl Pins as noPull
ideenmodellierer
parents: 130
diff changeset
593
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 HAL_NVIC_SetPriority(USART1_IRQn, 0, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 HAL_NVIC_EnableIRQ(USART1_IRQn);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 #ifdef USART_IR_HUD
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 else if(huart->Instance==USART_IR_HUD) /* USART2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 USART_IR_HUD_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 USART_IR_HUD_TX_GPIO_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 USART_IR_HUD_RX_GPIO_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 /**USART2 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 PD5 ------> USART2_TX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 PD6 ------> USART2_RX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 GPIO_InitStruct.Pin = USART_IR_HUD_TX_PIN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 GPIO_InitStruct.Pull = GPIO_PULLUP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 GPIO_InitStruct.Alternate = USART_IR_HUD_TX_AF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 HAL_GPIO_Init(USART_IR_HUD_TX_GPIO_PORT, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 GPIO_InitStruct.Pin = USART_IR_HUD_RX_PIN;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 GPIO_InitStruct.Pull = GPIO_PULLUP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 GPIO_InitStruct.Alternate = USART_IR_HUD_RX_AF;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 HAL_GPIO_Init(USART_IR_HUD_RX_GPIO_PORT, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 HAL_NVIC_SetPriority(USART_IR_HUD_IRQn, 0, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 HAL_NVIC_EnableIRQ(USART_IR_HUD_IRQn);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 else if(huart->Instance==USART3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 /* USER CODE BEGIN USART3_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 /* USER CODE END USART3_MspInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 /* Peripheral clock enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 __USART3_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 /**USART3 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 PC10 ------> USART3_TX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 PC11 ------> USART3_RX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 GPIO_InitStruct.Pull = GPIO_PULLUP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 /* USER CODE BEGIN USART3_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 /* USER CODE END USART3_MspInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 if(huart->Instance==USART1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 /* USER CODE BEGIN USART1_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 /* USER CODE END USART1_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 HAL_NVIC_DisableIRQ(USART1_IRQn);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 __USART1_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 /**USART1 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 PA9 ------> USART1_TX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 PA10 ------> USART1_RX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 #ifdef USARTx_CTS_PIN
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 #else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 /* USER CODE BEGIN USART1_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 /* USER CODE END USART1_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 else if(huart->Instance==USART2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 /* USER CODE BEGIN USART2_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 /* USER CODE END USART2_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 __USART2_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 /**USART2 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 PD5 ------> USART2_TX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 PD6 ------> USART2_RX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 HAL_GPIO_DeInit(GPIOD, GPIO_PIN_5|GPIO_PIN_6);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 /* USER CODE BEGIN USART2_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 /* USER CODE END USART2_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 else if(huart->Instance==USART3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 /* USER CODE BEGIN USART3_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 /* USER CODE END USART3_MspDeInit 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 /* Peripheral clock disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 __USART3_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 /**USART3 GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 PC10 ------> USART3_TX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 PC11 ------> USART3_RX
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 HAL_GPIO_DeInit(GPIOC, GPIO_PIN_10|GPIO_PIN_11);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 /* USER CODE BEGIN USART3_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 /* USER CODE END USART3_MspDeInit 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 static int FMC_Initialized = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 static void HAL_FMC_MspInit(void){
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 GPIO_InitTypeDef GPIO_InitStruct;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 if (FMC_Initialized) {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 FMC_Initialized = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 /* Peripheral clock enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 __GPIOC_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 __GPIOD_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 __GPIOE_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 __GPIOF_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 __GPIOG_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 __GPIOH_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 __FMC_CLK_ENABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 /** FMC GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 PF0 ------> FMC_A0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 PF1 ------> FMC_A1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 PF2 ------> FMC_A2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 PF3 ------> FMC_A3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 PF4 ------> FMC_A4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 PF5 ------> FMC_A5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 PC0 ------> FMC_SDNWE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 PF11 ------> FMC_SDNRAS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 PF12 ------> FMC_A6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 PF13 ------> FMC_A7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 PF14 ------> FMC_A8
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 PF15 ------> FMC_A9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 PG0 ------> FMC_A10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 PG1 ------> FMC_A11
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 PE7 ------> FMC_D4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 PE8 ------> FMC_D5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 PE9 ------> FMC_D6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 PE10 ------> FMC_D7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 PE11 ------> FMC_D8
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 PE12 ------> FMC_D9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 PE13 ------> FMC_D10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 PE14 ------> FMC_D11
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 PE15 ------> FMC_D12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 PH6 ------> FMC_SDNE1 neu
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 PH7 ------> FMC_SDCKE1 neu
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 PD8 ------> FMC_D13
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 PD9 ------> FMC_D14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 PD10 ------> FMC_D15
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 PD14 ------> FMC_D0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 PD15 ------> FMC_D1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 PG2 ------> FMC_A12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 PG4 ------> FMC_BA0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 PG5 ------> FMC_BA1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 PG8 ------> FMC_SDCLK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 PD0 ------> FMC_D2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 PD1 ------> FMC_D3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 PG15 ------> FMC_SDNCAS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 PE0 ------> FMC_NBL0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 PE1 ------> FMC_NBL1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 GPIO_InitStruct.Pull = GPIO_NOPULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 GPIO_InitStruct.Alternate = GPIO_AF12_FMC;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 GPIO_InitStruct.Pin = GPIO_PIN_0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_11|GPIO_PIN_12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 |GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 |GPIO_PIN_5|GPIO_PIN_8|GPIO_PIN_15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 void HAL_SDRAM_MspInit(SDRAM_HandleTypeDef* hsdram){
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 HAL_FMC_MspInit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 static int FMC_DeInitialized = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 static void HAL_FMC_MspDeInit(void){
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 if (FMC_DeInitialized) {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821 FMC_DeInitialized = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 /* Peripheral clock enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 __FMC_CLK_DISABLE();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 /** FMC GPIO Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 PF0 ------> FMC_A0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 PF1 ------> FMC_A1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828 PF2 ------> FMC_A2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829 PF3 ------> FMC_A3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 PF4 ------> FMC_A4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 PF5 ------> FMC_A5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 PC0 ------> FMC_SDNWE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833 PF11 ------> FMC_SDNRAS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 PF12 ------> FMC_A6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 PF13 ------> FMC_A7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 PF14 ------> FMC_A8
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 PF15 ------> FMC_A9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 PG0 ------> FMC_A10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 PG1 ------> FMC_A11
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 PE7 ------> FMC_D4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841 PE8 ------> FMC_D5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 PE9 ------> FMC_D6
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 PE10 ------> FMC_D7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 PE11 ------> FMC_D8
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845 PE12 ------> FMC_D9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 PE13 ------> FMC_D10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 PE14 ------> FMC_D11
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 PE15 ------> FMC_D12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 PH6 ------> FMC_SDNE1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850 PH7 ------> FMC_SDCKE1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 PD8 ------> FMC_D13
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 PD9 ------> FMC_D14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853 PD10 ------> FMC_D15
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 PD14 ------> FMC_D0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 PD15 ------> FMC_D1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 PG2 ------> FMC_A12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 PG4 ------> FMC_BA0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 PG5 ------> FMC_BA1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 PG8 ------> FMC_SDCLK
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 PD0 ------> FMC_D2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 PD1 ------> FMC_D3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 PG15 ------> FMC_SDNCAS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 PE0 ------> FMC_NBL0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 PE1 ------> FMC_NBL1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 HAL_GPIO_DeInit(GPIOF, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_11|GPIO_PIN_12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 |GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870 HAL_GPIO_DeInit(GPIOC, GPIO_PIN_0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 HAL_GPIO_DeInit(GPIOG, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_4
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 |GPIO_PIN_5|GPIO_PIN_8|GPIO_PIN_15);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875 HAL_GPIO_DeInit(GPIOE, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879 HAL_GPIO_DeInit(GPIOH, GPIO_PIN_6|GPIO_PIN_7);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886 void HAL_SDRAM_MspDeInit(SDRAM_HandleTypeDef* hsdram){
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887 HAL_FMC_MspDeInit();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888 }