Mercurial > public > ostc4
annotate Discovery/Src/ostc.c @ 878:6b06143cbfea Evo_2_23
brightness settings and proper power down for new screen
author | heinrichsweikamp |
---|---|
date | Sun, 25 Aug 2024 18:55:43 +0200 |
parents | bc6c90e20d9e |
children | fe955104901c |
rev | line source |
---|---|
38 | 1 /////////////////////////////////////////////////////////////////////////////// |
2 /// -*- coding: UTF-8 -*- | |
3 /// | |
4 /// \file Discovery/Src/ostc.c | |
5 /// \brief Hardware specific configuration | |
6 /// \author Heinrichs Weikamp gmbh | |
7 /// \date 05-Dec-2014 | |
8 /// | |
9 /// \details | |
10 /// | |
11 /// $Id$ | |
12 /////////////////////////////////////////////////////////////////////////////// | |
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
14 /// | |
15 /// This program is free software: you can redistribute it and/or modify | |
16 /// it under the terms of the GNU General Public License as published by | |
17 /// the Free Software Foundation, either version 3 of the License, or | |
18 /// (at your option) any later version. | |
19 /// | |
20 /// This program is distributed in the hope that it will be useful, | |
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 /// GNU General Public License for more details. | |
24 /// | |
25 /// You should have received a copy of the GNU General Public License | |
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
27 ////////////////////////////////////////////////////////////////////////////// | |
28 | |
29 /* Includes ------------------------------------------------------------------*/ | |
30 #include "ostc.h" | |
31 #include "stm32f4xx_hal.h" | |
32 | |
33 #ifndef BOOTLOADER_STANDALONE | |
34 #include "tCCR.h" | |
35 #endif | |
36 | |
37 /* Exported variables --------------------------------------------------------*/ | |
38 SPI_HandleTypeDef hspiDisplay; | |
39 SPI_HandleTypeDef cpu2DmaSpi; | |
40 | |
41 | |
42 UART_HandleTypeDef UartHandle; | |
300
5ca177d2df5d
cleanup: remove commented/unused code, make static
Jan Mulder <jlmulder@xs4all.nl>
parents:
140
diff
changeset
|
43 #ifdef USART_PIEZO |
38 | 44 UART_HandleTypeDef UartPiezoTxHandle; |
300
5ca177d2df5d
cleanup: remove commented/unused code, make static
Jan Mulder <jlmulder@xs4all.nl>
parents:
140
diff
changeset
|
45 #endif |
38 | 46 UART_HandleTypeDef UartIR_HUD_Handle; |
47 | |
48 __IO ITStatus UartReady = RESET; | |
870 | 49 __IO ITStatus UartReadyHUD = RESET; |
38 | 50 |
51 /* Private types -------------------------------------------------------------*/ | |
52 | |
53 /* Private variables ---------------------------------------------------------*/ | |
54 | |
55 /* Private variables with external access via get_xxx() function -------------*/ | |
56 | |
57 /* Private function prototypes -----------------------------------------------*/ | |
58 | |
59 /* Exported functions --------------------------------------------------------*/ | |
60 | |
61 /** SPI init function | |
62 * called from HAL | |
63 */ | |
64 void MX_SPI_Init(void) | |
65 { | |
66 hspiDisplay.Instance = SPI5; | |
67 hspiDisplay.Init.Mode = SPI_MODE_MASTER; | |
68 hspiDisplay.Init.Direction = SPI_DIRECTION_2LINES; | |
69 hspiDisplay.Init.DataSize = SPI_DATASIZE_8BIT; | |
70 hspiDisplay.Init.CLKPolarity = SPI_POLARITY_LOW; | |
71 hspiDisplay.Init.CLKPhase = SPI_PHASE_1EDGE; | |
72 hspiDisplay.Init.NSS = SPI_NSS_SOFT; | |
73 hspiDisplay.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32;//SPI_BAUDRATEPRESCALER_4;//SPI_BAUDRATEPRESCALER_256; | |
74 hspiDisplay.Init.FirstBit = SPI_FIRSTBIT_MSB; | |
75 hspiDisplay.Init.TIMode = SPI_TIMODE_DISABLED; | |
76 hspiDisplay.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED; | |
77 HAL_SPI_Init(&hspiDisplay); | |
78 | |
79 cpu2DmaSpi.Instance = SPI1; | |
80 cpu2DmaSpi.Init.Mode = SPI_MODE_MASTER; | |
81 cpu2DmaSpi.Init.Direction = SPI_DIRECTION_2LINES; | |
82 cpu2DmaSpi.Init.DataSize = SPI_DATASIZE_8BIT; | |
83 cpu2DmaSpi.Init.CLKPolarity = SPI_POLARITY_LOW; | |
84 cpu2DmaSpi.Init.CLKPhase = SPI_PHASE_1EDGE; | |
85 cpu2DmaSpi.Init.NSS = SPI_NSS_SOFT;//SPI_NSS_HARD_OUTPUT;//SPI_NSS_SOFT; | |
140
f6c52eb0e25d
Increase prescalar => frame takes about 4ms.
Ideenmodellierer
parents:
104
diff
changeset
|
86 cpu2DmaSpi.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_128; |
38 | 87 cpu2DmaSpi.Init.FirstBit = SPI_FIRSTBIT_MSB; |
88 cpu2DmaSpi.Init.TIMode = SPI_TIMODE_DISABLED; | |
89 cpu2DmaSpi.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED; | |
90 cpu2DmaSpi.Init.CRCPolynomial = 7; | |
91 | |
92 HAL_SPI_Init(&cpu2DmaSpi); | |
93 } | |
94 | |
870 | 95 |
96 void MX_GPIO_Backlight_max_static_only_Init(void) | |
97 { | |
98 GPIO_InitTypeDef GPIO_InitStruct; | |
99 TIM_BACKLIGHT_GPIO_ENABLE(); | |
100 | |
101 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
102 GPIO_InitStruct.Pull = GPIO_NOPULL;//GPIO_PULLUP; /* should be normally high */ | |
103 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; | |
104 | |
105 GPIO_InitStruct.Pin = TIM_BACKLIGHT_PIN; | |
106 HAL_GPIO_Init(TIM_BACKLIGHT_GPIO_PORT, &GPIO_InitStruct); | |
107 | |
108 HAL_GPIO_WritePin(TIM_BACKLIGHT_GPIO_PORT,TIM_BACKLIGHT_PIN,GPIO_PIN_SET); | |
109 } | |
110 | |
111 | |
112 void MX_GPIO_One_Button_only_Init(void) | |
113 { | |
114 GPIO_InitTypeDef GPIO_InitStruct; | |
115 BUTTON_NEXT_GPIO_ENABLE(); | |
116 | |
117 GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
118 GPIO_InitStruct.Pull = GPIO_NOPULL;//GPIO_PULLUP; /* should be normally high */ | |
119 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; | |
120 | |
121 GPIO_InitStruct.Pin = BUTTON_NEXT_PIN; | |
122 HAL_GPIO_Init(BUTTON_NEXT_GPIO_PORT, &GPIO_InitStruct); | |
123 } | |
124 | |
125 | |
126 GPIO_PinState MX_GPIO_Read_The_One_Button(void) | |
127 { | |
128 return HAL_GPIO_ReadPin(BUTTON_NEXT_GPIO_PORT, BUTTON_NEXT_PIN); | |
129 } | |
130 | |
38 | 131 void MX_GPIO_Init(void) |
132 { | |
133 GPIO_InitTypeDef GPIO_InitStruct; | |
134 | |
135 DISPLAY_CSB_GPIO_ENABLE(); | |
136 DISPLAY_RESETB_GPIO_ENABLE(); | |
137 EXTFLASH_CSB_GPIO_ENABLE(); | |
138 SMALLCPU_CSB_GPIO_ENABLE(); | |
139 OSCILLOSCOPE_GPIO_ENABLE(); | |
140 OSCILLOSCOPE2_GPIO_ENABLE(); | |
141 | |
142 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
143 GPIO_InitStruct.Pull = GPIO_PULLUP; | |
144 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; | |
145 | |
146 GPIO_InitStruct.Pin = DISPLAY_CSB_PIN; | |
147 HAL_GPIO_Init(DISPLAY_CSB_GPIO_PORT, &GPIO_InitStruct); | |
148 | |
149 GPIO_InitStruct.Pin = DISPLAY_RESETB_PIN; | |
150 HAL_GPIO_Init(DISPLAY_RESETB_GPIO_PORT, &GPIO_InitStruct); | |
151 | |
152 GPIO_InitStruct.Pin = EXTFLASH_CSB_PIN; | |
153 HAL_GPIO_Init(EXTFLASH_CSB_GPIO_PORT, &GPIO_InitStruct); | |
154 | |
155 GPIO_InitStruct.Pin = OSCILLOSCOPE_PIN; | |
156 HAL_GPIO_Init(OSCILLOSCOPE_GPIO_PORT, &GPIO_InitStruct); | |
157 | |
158 GPIO_InitStruct.Pin = OSCILLOSCOPE2_PIN; | |
159 HAL_GPIO_Init(OSCILLOSCOPE2_GPIO_PORT, &GPIO_InitStruct); | |
160 | |
161 #ifdef DISPLAY_BACKLIGHT_PIN | |
162 DISPLAY_BACKLIGHT_GPIO_ENABLE(); | |
163 GPIO_InitStruct.Pin = DISPLAY_BACKLIGHT_PIN; | |
164 HAL_GPIO_Init(DISPLAY_BACKLIGHT_GPIO_PORT, &GPIO_InitStruct); | |
165 HAL_GPIO_WritePin(DISPLAY_BACKLIGHT_GPIO_PORT,DISPLAY_BACKLIGHT_PIN,GPIO_PIN_SET); | |
166 #endif | |
167 | |
168 #ifdef SMALLCPU_CSB_PIN | |
169 SMALLCPU_CSB_GPIO_ENABLE(); | |
170 GPIO_InitStruct.Pin = SMALLCPU_CSB_PIN; | |
171 HAL_GPIO_Init(SMALLCPU_CSB_GPIO_PORT, &GPIO_InitStruct); | |
172 HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_SET); | |
173 #endif | |
174 | |
175 #ifdef SMALLCPU_BOOT0_PIN | |
176 GPIO_InitStruct.Pull = GPIO_NOPULL; | |
177 SMALLCPU_BOOT0_GPIO_ENABLE(); | |
178 GPIO_InitStruct.Pin = SMALLCPU_BOOT0_PIN; | |
179 HAL_GPIO_Init(SMALLCPU_BOOT0_GPIO_PORT, &GPIO_InitStruct); | |
180 HAL_GPIO_WritePin(SMALLCPU_BOOT0_GPIO_PORT,SMALLCPU_BOOT0_PIN,GPIO_PIN_RESET); | |
181 GPIO_InitStruct.Pull = GPIO_PULLUP; | |
182 #endif | |
183 | |
184 #ifdef IR_HUD_ENABLE_PIN | |
185 IR_HUD_ENABLE_GPIO_ENABLE(); | |
186 GPIO_InitStruct.Pin = IR_HUD_ENABLE_PIN; | |
187 GPIO_InitStruct.Pull = GPIO_NOPULL; | |
188 HAL_GPIO_Init(IR_HUD_ENABLE_GPIO_PORT, &GPIO_InitStruct); | |
189 HAL_GPIO_WritePin(IR_HUD_ENABLE_GPIO_PORT,IR_HUD_ENABLE_PIN,GPIO_PIN_SET); | |
190 GPIO_InitStruct.Pull = GPIO_PULLUP; | |
191 #endif | |
192 | |
193 #ifdef BLE_NENABLE_PIN | |
194 BLE_NENABLE_GPIO_ENABLE(); | |
195 MX_Bluetooth_PowerOff(); | |
196 #endif | |
197 | |
198 #ifdef TESTPIN | |
199 GPIO_InitStruct.Pull = GPIO_PULLUP; | |
200 TEST_GPIO_ENABLE(); | |
201 GPIO_InitStruct.Pin = TEST_PIN; | |
202 HAL_GPIO_Init(TEST_GPIO_PORT, &GPIO_InitStruct); | |
203 HAL_GPIO_WritePin(TEST_GPIO_PORT,TEST_PIN,GPIO_PIN_SET); | |
204 GPIO_InitStruct.Pull = GPIO_PULLUP; | |
205 #endif | |
206 } | |
207 | |
208 | |
209 void MX_TestPin_High(void) | |
210 { | |
211 #ifdef TESTPIN | |
212 HAL_GPIO_WritePin(TEST_GPIO_PORT,TEST_PIN,GPIO_PIN_SET); | |
213 #endif | |
214 } | |
215 | |
216 | |
217 void MX_TestPin_Low(void) | |
218 { | |
219 #ifdef TESTPIN | |
220 HAL_GPIO_WritePin(TEST_GPIO_PORT,TEST_PIN,GPIO_PIN_RESET); | |
221 #endif | |
222 } | |
223 | |
224 void MX_Bluetooth_PowerOn(void) | |
225 { | |
226 GPIO_InitTypeDef GPIO_InitStruct; | |
227 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
228 GPIO_InitStruct.Pull = GPIO_NOPULL; | |
229 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; | |
230 GPIO_InitStruct.Pin = BLE_NENABLE_PIN; | |
231 HAL_GPIO_Init(BLE_NENABLE_GPIO_PORT, &GPIO_InitStruct); | |
232 HAL_GPIO_WritePin(BLE_NENABLE_GPIO_PORT,BLE_NENABLE_PIN,GPIO_PIN_RESET); | |
233 } | |
234 | |
235 | |
236 void MX_Bluetooth_PowerOff(void) | |
237 { | |
238 GPIO_InitTypeDef GPIO_InitStruct; | |
239 GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
240 GPIO_InitStruct.Pin = BLE_NENABLE_PIN; | |
241 GPIO_InitStruct.Pull = GPIO_NOPULL; | |
242 HAL_GPIO_Init(BLE_NENABLE_GPIO_PORT, &GPIO_InitStruct); | |
243 } | |
244 | |
245 | |
246 void MX_SmallCPU_Reset_To_Boot(void) | |
247 { | |
248 #ifdef SMALLCPU_NRESET_PIN | |
249 GPIO_InitTypeDef GPIO_InitStruct; | |
250 | |
251 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
252 GPIO_InitStruct.Pull = GPIO_NOPULL; | |
253 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; | |
254 | |
255 SMALLCPU_NRESET_GPIO_ENABLE(); | |
256 GPIO_InitStruct.Pin = SMALLCPU_NRESET_PIN; | |
257 HAL_GPIO_Init(SMALLCPU_NRESET_GPIO_PORT, &GPIO_InitStruct); | |
258 HAL_GPIO_WritePin(SMALLCPU_NRESET_GPIO_PORT,SMALLCPU_NRESET_PIN,GPIO_PIN_RESET); | |
259 HAL_GPIO_WritePin(SMALLCPU_BOOT0_GPIO_PORT,SMALLCPU_BOOT0_PIN,GPIO_PIN_SET); | |
260 HAL_Delay(2); | |
261 GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
262 HAL_GPIO_Init(SMALLCPU_NRESET_GPIO_PORT, &GPIO_InitStruct); | |
263 HAL_Delay(100); | |
264 HAL_GPIO_WritePin(SMALLCPU_BOOT0_GPIO_PORT,SMALLCPU_BOOT0_PIN,GPIO_PIN_RESET); | |
265 #endif | |
266 } | |
267 | |
870 | 268 |
269 void MX_SmallCPU_NO_Reset_Helper(void) | |
270 { | |
271 #ifdef SMALLCPU_NRESET_PIN | |
272 GPIO_InitTypeDef GPIO_InitStruct; | |
273 | |
274 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
275 GPIO_InitStruct.Pull = GPIO_NOPULL; | |
276 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; | |
277 | |
278 SMALLCPU_NRESET_GPIO_ENABLE(); | |
279 HAL_GPIO_Init(SMALLCPU_NRESET_GPIO_PORT, &GPIO_InitStruct); | |
280 HAL_GPIO_WritePin(SMALLCPU_NRESET_GPIO_PORT,SMALLCPU_NRESET_PIN,GPIO_PIN_SET); | |
281 // HAL_Delay(100); | |
282 // GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
283 // HAL_GPIO_Init(SMALLCPU_NRESET_GPIO_PORT, &GPIO_InitStruct); | |
284 #endif | |
285 } | |
286 | |
287 | |
38 | 288 void MX_SmallCPU_Reset_To_Standard(void) |
289 { | |
290 #ifdef SMALLCPU_NRESET_PIN | |
291 GPIO_InitTypeDef GPIO_InitStruct; | |
292 | |
293 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
294 GPIO_InitStruct.Pull = GPIO_NOPULL; | |
295 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; | |
296 | |
297 SMALLCPU_NRESET_GPIO_ENABLE(); | |
298 GPIO_InitStruct.Pin = SMALLCPU_NRESET_PIN; | |
299 HAL_GPIO_Init(SMALLCPU_NRESET_GPIO_PORT, &GPIO_InitStruct); | |
300 HAL_GPIO_WritePin(SMALLCPU_NRESET_GPIO_PORT,SMALLCPU_NRESET_PIN,GPIO_PIN_RESET); | |
301 HAL_GPIO_WritePin(SMALLCPU_BOOT0_GPIO_PORT,SMALLCPU_BOOT0_PIN,GPIO_PIN_RESET); | |
302 HAL_Delay(2); | |
303 GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
304 HAL_GPIO_Init(SMALLCPU_NRESET_GPIO_PORT, &GPIO_InitStruct); | |
305 #endif | |
306 } | |
307 | |
870 | 308 |
309 uint8_t MX_UART_ButtonAdjust(uint8_t *array) | |
310 { | |
311 #ifdef USART_PIEZO | |
312 uint8_t answer[4]; | |
313 HAL_UART_Transmit(&UartPiezoTxHandle,array,4,1000); | |
314 HAL_UART_Receive(&UartPiezoTxHandle,answer,4,2000); | |
315 if( (answer[0] == array[0]) | |
316 &&(answer[1] == array[1]) | |
317 &&(answer[2] == array[2]) | |
318 &&(answer[3] == array[3])) | |
319 return 1; | |
320 #endif | |
321 return 0; | |
322 } | |
323 | |
324 | |
38 | 325 void MX_UART_Init(void) |
326 { | |
327 /*##-1- Configure the UART peripheral ######################################*/ | |
328 /* Put the USART peripheral in the Asynchronous mode (UART Mode) */ | |
329 /* UART1 configured as follow: | |
330 - Word Length = 8 Bits | |
331 - Stop Bit = One Stop bit | |
332 - Parity = None | |
333 - BaudRate = 9600 baud | |
334 - Hardware flow control disabled (RTS and CTS signals) */ | |
335 | |
336 #ifdef USARTx_CTS_PIN | |
337 UartHandle.Init.HwFlowCtl = UART_HWCONTROL_RTS_CTS; | |
338 #else | |
339 UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE; | |
340 #endif | |
341 UartHandle.Instance = USARTx; | |
342 UartHandle.Init.BaudRate = 115200; | |
343 UartHandle.Init.WordLength = UART_WORDLENGTH_8B; | |
344 UartHandle.Init.StopBits = UART_STOPBITS_1; | |
345 UartHandle.Init.Parity = UART_PARITY_NONE; | |
346 UartHandle.Init.Mode = UART_MODE_TX_RX; | |
347 HAL_UART_Init(&UartHandle); | |
348 | |
349 #ifdef USART_PIEZO | |
350 UartPiezoTxHandle.Instance = USART_PIEZO; | |
351 UartPiezoTxHandle.Init.BaudRate = 1200; | |
352 UartPiezoTxHandle.Init.WordLength = UART_WORDLENGTH_8B; | |
353 UartPiezoTxHandle.Init.StopBits = UART_STOPBITS_1; | |
354 UartPiezoTxHandle.Init.Parity = UART_PARITY_NONE; | |
355 UartPiezoTxHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE; | |
356 UartPiezoTxHandle.Init.Mode = UART_MODE_TX_RX; | |
357 | |
358 HAL_UART_Init(&UartPiezoTxHandle); | |
359 #endif | |
360 | |
361 #ifdef USART_IR_HUD | |
362 UartIR_HUD_Handle.Instance = USART_IR_HUD; | |
363 UartIR_HUD_Handle.Init.BaudRate = 2400; | |
364 UartIR_HUD_Handle.Init.WordLength = UART_WORDLENGTH_8B; | |
365 UartIR_HUD_Handle.Init.StopBits = UART_STOPBITS_1; | |
366 UartIR_HUD_Handle.Init.Parity = UART_PARITY_NONE; | |
367 UartIR_HUD_Handle.Init.HwFlowCtl = UART_HWCONTROL_NONE; | |
368 UartIR_HUD_Handle.Init.Mode = UART_MODE_TX_RX; | |
369 | |
370 HAL_UART_Init(&UartIR_HUD_Handle); | |
371 #endif | |
372 } | |
373 | |
374 void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) | |
375 { | |
376 if(huart == &UartHandle) | |
377 UartReady = SET; | |
378 } | |
379 | |
321
37ee61f93124
Moved indication variable for received HUD data to tCCR file.
ideenmodellierer
parents:
300
diff
changeset
|
380 |
38 | 381 void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) |
382 { | |
383 if(huart == &UartHandle) | |
384 UartReady = SET; | |
385 else | |
386 if(huart == &UartIR_HUD_Handle) | |
387 { | |
870 | 388 #ifndef BOOTLOADER_STANDALONE |
321
37ee61f93124
Moved indication variable for received HUD data to tCCR file.
ideenmodellierer
parents:
300
diff
changeset
|
389 tCCR_SetRXIndication(); |
870 | 390 #endif |
391 UartReadyHUD = SET; | |
38 | 392 } |
393 } | |
394 | |
395 void MX_tell_reset_logik_alles_ok(void) | |
396 { | |
397 #ifdef RESET_LOGIC_ALLES_OK_PIN | |
398 GPIO_InitTypeDef GPIO_InitStruct; | |
399 | |
400 RESET_LOGIC_ALLES_OK_GPIO_ENABLE(); | |
401 | |
402 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; | |
403 GPIO_InitStruct.Pull = GPIO_NOPULL; | |
404 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; | |
405 GPIO_InitStruct.Pin = RESET_LOGIC_ALLES_OK_PIN; | |
406 HAL_GPIO_Init(RESET_LOGIC_ALLES_OK_GPIO_PORT, &GPIO_InitStruct); | |
407 | |
408 HAL_GPIO_WritePin(RESET_LOGIC_ALLES_OK_GPIO_PORT,RESET_LOGIC_ALLES_OK_PIN,GPIO_PIN_RESET); | |
409 HAL_Delay(1); | |
410 HAL_GPIO_WritePin(RESET_LOGIC_ALLES_OK_GPIO_PORT,RESET_LOGIC_ALLES_OK_PIN,GPIO_PIN_SET); | |
411 | |
412 GPIO_InitStruct.Mode = GPIO_MODE_INPUT; | |
413 HAL_GPIO_Init(RESET_LOGIC_ALLES_OK_GPIO_PORT, &GPIO_InitStruct); | |
414 #endif | |
415 } | |
416 | |
417 | |
418 #ifndef BOOTLOADER_STANDALONE | |
419 void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart) | |
420 { | |
421 if(huart == &UartIR_HUD_Handle) | |
422 tCCR_restart(); | |
423 } | |
424 #endif |