Major UART communication improvement

- the UART communication is improved based on UART Idle line detection interrupt
- an Rx ring buffer is used to manage the UART incoming data
- both Tx and Rx are efficiently handled using DMA
- fixed #1

Other:
- minor visual improvements
This commit is contained in:
EmanuelFeru
2020-06-21 23:09:27 +02:00
parent 9edd22b6b7
commit ee6ab3a886
9 changed files with 273 additions and 185 deletions

View File

@@ -112,9 +112,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
HAL_NVIC_SetPriority(USART2_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(USART2_IRQn);
/* USER CODE BEGIN USART2_MspInit 1 */
// DMA1_Channel7->CPAR = (uint32_t) & (USART2->DR);
// DMA1_Channel7->CNDTR = 0;
// DMA1->IFCR = DMA_IFCR_CTCIF7 | DMA_IFCR_CHTIF7 | DMA_IFCR_CGIF7;
__HAL_UART_ENABLE_IT (uartHandle, UART_IT_IDLE); // Enable the USART IDLE line detection interrupt
/* USER CODE END USART2_MspInit 1 */
}
}