Changeset 23 for trunk/fw_g473rct/Core
- Timestamp:
- Aug 29, 2025, 7:18:36 PM (32 hours ago)
- Location:
- trunk/fw_g473rct/Core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fw_g473rct/Core/Inc/stm32g4xx_it.h
r22 r23 62 62 void DMA1_Channel5_IRQHandler(void); 63 63 void DMA1_Channel6_IRQHandler(void); 64 void DMA1_Channel7_IRQHandler(void); 64 65 void USART1_IRQHandler(void); 65 66 void USART2_IRQHandler(void); -
trunk/fw_g473rct/Core/Src/dma.c
r22 r23 63 63 HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0); 64 64 HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn); 65 /* DMA1_Channel7_IRQn interrupt configuration */ 66 HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0); 67 HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn); 65 68 66 69 } -
trunk/fw_g473rct/Core/Src/stm32g4xx_it.c
r22 r23 63 63 extern DMA_HandleTypeDef hdma_adc5; 64 64 extern DMA_HandleTypeDef hdma_usart2_rx; 65 extern DMA_HandleTypeDef hdma_usart2_tx; 65 66 extern UART_HandleTypeDef huart1; 66 67 extern UART_HandleTypeDef huart2; … … 292 293 293 294 /** 295 * @brief This function handles DMA1 channel7 global interrupt. 296 */ 297 void DMA1_Channel7_IRQHandler(void) 298 { 299 /* USER CODE BEGIN DMA1_Channel7_IRQn 0 */ 300 301 /* USER CODE END DMA1_Channel7_IRQn 0 */ 302 HAL_DMA_IRQHandler(&hdma_usart2_tx); 303 /* USER CODE BEGIN DMA1_Channel7_IRQn 1 */ 304 305 /* USER CODE END DMA1_Channel7_IRQn 1 */ 306 } 307 308 /** 294 309 * @brief This function handles USART1 global interrupt / USART1 wake-up interrupt through EXTI line 25. 295 310 */ -
trunk/fw_g473rct/Core/Src/usart.c
r22 r23 28 28 UART_HandleTypeDef huart2; 29 29 DMA_HandleTypeDef hdma_usart2_rx; 30 DMA_HandleTypeDef hdma_usart2_tx; 30 31 31 32 /* USART1 init function */ … … 86 87 /* USER CODE END USART2_Init 1 */ 87 88 huart2.Instance = USART2; 88 huart2.Init.BaudRate = 1 15200;89 huart2.Init.BaudRate = 19200; 89 90 huart2.Init.WordLength = UART_WORDLENGTH_9B; 90 91 huart2.Init.StopBits = UART_STOPBITS_1; … … 209 210 __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart2_rx); 210 211 212 /* USART2_TX Init */ 213 hdma_usart2_tx.Instance = DMA1_Channel7; 214 hdma_usart2_tx.Init.Request = DMA_REQUEST_USART2_TX; 215 hdma_usart2_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; 216 hdma_usart2_tx.Init.PeriphInc = DMA_PINC_DISABLE; 217 hdma_usart2_tx.Init.MemInc = DMA_MINC_ENABLE; 218 hdma_usart2_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; 219 hdma_usart2_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; 220 hdma_usart2_tx.Init.Mode = DMA_NORMAL; 221 hdma_usart2_tx.Init.Priority = DMA_PRIORITY_LOW; 222 if (HAL_DMA_Init(&hdma_usart2_tx) != HAL_OK) 223 { 224 Error_Handler(); 225 } 226 227 __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx); 228 211 229 /* USART2 interrupt Init */ 212 230 HAL_NVIC_SetPriority(USART2_IRQn, 0, 0); … … 257 275 /* USART2 DMA DeInit */ 258 276 HAL_DMA_DeInit(uartHandle->hdmarx); 277 HAL_DMA_DeInit(uartHandle->hdmatx); 259 278 260 279 /* USART2 interrupt Deinit */
Note: See TracChangeset
for help on using the changeset viewer.