summaryrefslogtreecommitdiff
path: root/src/fmc-test/src/stm32f4xx_hal_msp.c
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2015-09-10 10:47:08 +0200
committerFredrik Thulin <fredrik@thulin.net>2015-09-10 10:47:08 +0200
commitb5f7b6b8ed23eccc15415776b6d2fa05e10b9c7d (patch)
tree090598d1c4a421c049267e2ba3d9069a68262480 /src/fmc-test/src/stm32f4xx_hal_msp.c
parentf194c02df057411c0b4b4bb86a629a931901e80f (diff)
Implement UART outputing of results
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****/