annotate OtherSources/stm32f4xx_hal_msp_hw1.c @ 250:822416168585 bm-2

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