2018-01-09 08:38 AM
2019-12-17 02:58 AM
Hello,
Thanks! Stream UART code looks very useful. Could you please clarify one more thing? If I understood correctly, this approach requires special actions to close receive stream before transmitting data? Like in UART_RxISR_8BIT:
/* Disable the UART Parity Error Interrupt and RXNE interrupts */
CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE));
/* Disable the UART Error Interrupt: (Frame error, noise error, overrun error) */
CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE);
/* Rx process is completed, restore huart->RxState to Ready */
huart->RxState = HAL_UART_STATE_READY;
/* Clear RxISR function pointer */
huart->RxISR = NULL;
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
/*Call registered Rx complete callback*/
huart->RxCpltCallback(huart);
#else
/*Call legacy weak Rx complete callback*/
HAL_UART_RxCpltCallback(huart);
#endif /* USE_HAL_UART_REGISTER_CALLBACKS */
2020-03-22 02:37 AM
Hello,
Is it that this solution is only for L4 ? or can it be used with F4 too ?
Another thing, I find in code USART_CR1_FIFOEN. Can't it be used for solving the same problem ?
Thanks!
2020-03-22 07:23 AM