summaryrefslogtreecommitdiff
path: root/src/fmc-test/src/stm32f4xx_hal_msp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fmc-test/src/stm32f4xx_hal_msp.c')
-rw-r--r--src/fmc-test/src/stm32f4xx_hal_msp.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/fmc-test/src/stm32f4xx_hal_msp.c b/src/fmc-test/src/stm32f4xx_hal_msp.c
index f932c45..ee2cb7e 100644
--- a/src/fmc-test/src/stm32f4xx_hal_msp.c
+++ b/src/fmc-test/src/stm32f4xx_hal_msp.c
@@ -103,5 +103,41 @@ void HAL_SRAM_MspDeInit(SRAM_HandleTypeDef* hsram)
{
}
+void HAL_UART_MspInit(UART_HandleTypeDef* huart)
+{
+ GPIO_InitTypeDef GPIO_InitStruct;
+
+ if (huart->Instance == USART2) {
+ /* Peripheral clock enable */
+ __USART2_CLK_ENABLE();
+ __GPIOA_CLK_ENABLE();
+
+ /**USART2 GPIO Configuration
+ PA2 ------> USART2_TX
+ PA3 ------> USART2_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2 | GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Pull = GPIO_PULLUP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
+ GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ }
+
+}
+
+void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
+{
+ if (huart->Instance == USART2) {
+ /* Peripheral clock disable */
+ __USART2_CLK_DISABLE();
+
+ /**USART2 GPIO Configuration
+ PA2 ------> USART2_TX
+ PA3 ------> USART2_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2 | GPIO_PIN_3);
+ }
+}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/