comparison Small_CPU/Src/uart_Internal.c @ 923:6fc0e3d230e4 Evo_2_23

UART6 DMA handling: Make sure that RX transmission uses DMA stream 2
author Ideenmodellierer
date Mon, 04 Nov 2024 20:21:02 +0100
parents 7c996354b8ac
children 908d9a8e8c84
comparison
equal deleted inserted replaced
922:7c996354b8ac 923:6fc0e3d230e4
101 GPIO_InitStruct.Alternate = GPIO_AF8_USART6; 101 GPIO_InitStruct.Alternate = GPIO_AF8_USART6;
102 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 102 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
103 103
104 /* USART6 DMA Init */ 104 /* USART6 DMA Init */
105 /* USART6_RX Init */ 105 /* USART6_RX Init */
106 hdma_usart6_rx.Instance = DMA2_Stream1; 106 hdma_usart6_rx.Instance = DMA2_Stream2;
107 hdma_usart6_rx.Init.Channel = DMA_CHANNEL_5; 107 hdma_usart6_rx.Init.Channel = DMA_CHANNEL_5;
108 hdma_usart6_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; 108 hdma_usart6_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
109 hdma_usart6_rx.Init.PeriphInc = DMA_PINC_DISABLE; 109 hdma_usart6_rx.Init.PeriphInc = DMA_PINC_DISABLE;
110 hdma_usart6_rx.Init.MemInc = DMA_MINC_ENABLE; 110 hdma_usart6_rx.Init.MemInc = DMA_MINC_ENABLE;
111 hdma_usart6_rx.Init.PeriphDataAlignment = DMA_MDATAALIGN_BYTE; 111 hdma_usart6_rx.Init.PeriphDataAlignment = DMA_MDATAALIGN_BYTE;
172 huart6.Init.Parity = UART_PARITY_NONE; 172 huart6.Init.Parity = UART_PARITY_NONE;
173 huart6.Init.Mode = UART_MODE_TX_RX; 173 huart6.Init.Mode = UART_MODE_TX_RX;
174 huart6.Init.HwFlowCtl = UART_HWCONTROL_NONE; 174 huart6.Init.HwFlowCtl = UART_HWCONTROL_NONE;
175 huart6.Init.OverSampling = UART_OVERSAMPLING_16; 175 huart6.Init.OverSampling = UART_OVERSAMPLING_16;
176 HAL_UART_Init(&huart6); 176 HAL_UART_Init(&huart6);
177
178 UART_clearRx6Buffer();
179 dmaRx6Active = 0;
180 dmaTx6Active = 0;
181 tx6BufferQueLen = 0;
177 } 182 }
178 183
179 184
180 185
181 void UART6_SendCmdUbx(const uint8_t *cmd, uint8_t len) 186 void UART6_SendCmdUbx(const uint8_t *cmd, uint8_t len)