comparison Small_CPU/Src/stm32f4xx_hal_msp_v3.c @ 662:1b995079c045 Betatest

PSCR Mode
author heinrichs weikamp
date Tue, 14 Dec 2021 15:36:10 +0100
parents abec171c2c4b
children
comparison
equal deleted inserted replaced
661:87bee7cc77b3 662:1b995079c045
227 227
228 void HAL_UART_MspInit(UART_HandleTypeDef* huart) 228 void HAL_UART_MspInit(UART_HandleTypeDef* huart)
229 { 229 {
230 230
231 GPIO_InitTypeDef GPIO_InitStruct; 231 GPIO_InitTypeDef GPIO_InitStruct;
232 if(huart->Instance==USART2) 232 if(huart->Instance==USART1)
233 { 233 {
234 __USART2_CLK_ENABLE(); 234 __GPIOA_CLK_ENABLE();
235 GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3; 235 __USART1_CLK_ENABLE();
236 GPIO_InitStruct.Pin = GPIO_PIN_9;
236 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 237 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
237 GPIO_InitStruct.Pull = GPIO_PULLUP; 238 GPIO_InitStruct.Pull = GPIO_PULLUP;
238 GPIO_InitStruct.Speed = GPIO_SPEED_LOW; 239 GPIO_InitStruct.Speed = GPIO_SPEED_FAST; //GPIO_SPEED_LOW;
239 GPIO_InitStruct.Alternate = GPIO_AF7_USART2; 240 GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
240 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 241 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
242
243 GPIO_InitStruct.Pin = GPIO_PIN_10;
244 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
241 } 245 }
242 } 246 }
243 247
244 248
245 void HAL_UART_MspDeInit(UART_HandleTypeDef* huart) 249 void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
246 { 250 {
247 if(huart->Instance==USART2) 251 if(huart->Instance==USART1)
248 { 252 {
249 __USART2_CLK_DISABLE(); 253 HAL_NVIC_DisableIRQ(USART1_IRQn);
250 HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3); 254 __USART1_CLK_DISABLE();
255 HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);
251 } 256 }
252 } 257 }
253 258
254 259
255 260