annotate OtherSources/stm32f4xx_hal_msp_hw2.c @ 6:b355f462c952

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