diff Discovery/Src/stm32f4xx_hal_msp_hw2.c @ 1036:5865f0aeb438 Puls_Integration

Radio data integration: Added functionality for displaying radio data as debug message. The USART3 has been configurated for receiption and a function for the visualization of the data has been added to the demo unit (draft implementation). For activation the radio as well as the logger functionality needs to be activated via compile switch. Note that at the moment bluetooth and radio DMA may not be operated in parallel.
author Ideenmodellierer
date Sun, 10 Aug 2025 15:28:59 +0200
parents 879709909dd6
children
line wrap: on
line diff
--- a/Discovery/Src/stm32f4xx_hal_msp_hw2.c	Sat Aug 09 16:55:20 2025 +0200
+++ b/Discovery/Src/stm32f4xx_hal_msp_hw2.c	Sun Aug 10 15:28:59 2025 +0200
@@ -630,18 +630,20 @@
 
   /* USER CODE END USART3_MspInit 0 */
     /* Peripheral clock enable */
-    __USART3_CLK_ENABLE();
+	USART_RADIO_RX_GPIO_CLK_ENABLE();
 
     /**USART3 GPIO Configuration
-    PC10     ------> USART3_TX
-    PC11     ------> USART3_RX
+    PB11     ------> USART3_RX
     */
-    GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11;
+    GPIO_InitStruct.Pin = USART_RADIO_RX_PIN;
     GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
     GPIO_InitStruct.Pull = GPIO_PULLUP;
     GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
-    GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
-    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
+    GPIO_InitStruct.Alternate = USART_RADIO_RX_AF;
+    HAL_GPIO_Init(USART_RADIO_RX_GPIO_PORT, &GPIO_InitStruct);
+
+    HAL_NVIC_SetPriority(USART_RADIO_IRQn, 0, 1);
+    HAL_NVIC_EnableIRQ(USART_RADIO_IRQn);
 
   /* USER CODE BEGIN USART3_MspInit 1 */
 
@@ -706,7 +708,7 @@
     PC10     ------> USART3_TX
     PC11     ------> USART3_RX
     */
-    HAL_GPIO_DeInit(GPIOC, GPIO_PIN_10|GPIO_PIN_11);
+    HAL_GPIO_DeInit(USART_RADIO_RX_GPIO_PORT, USART_RADIO_RX_PIN);
 
   /* USER CODE BEGIN USART3_MspDeInit 1 */