2008-08-11 07:56 AM
Doc RM006UART & Error Flags don't match NewFW Lib
2011-05-17 12:54 AM
UM0006 says on page 288 about Reg RSECR use 0x000F to clear error flags
But their code Function UART_ClearFlag() in file 91x_uart.c on line 426 uses UART_ClearFlag_Mask which is 0xAA If I use DMA & UART1 can I still use DR or RSECR Registers to get old/stale Error Info? * May need to check for Framing Errors * See Reg UART1->DR * Overrun Error is bit 11 * Break Error is bit 10 * Parity Error is bit 9 * Framing Error is bit 8 ****************** * Warning: Looks like there are two (2) places to read these errors * The received data character must first be read from the UART_DR register * before reading the error status associated with that data character * from the UART_RSECR register. However, the status information can also * be obtained by reading the UART_DR register. ****************** * To Clear Error bits See Reg UART1->RSECR bits 3 - 0 * Overrun Error is bit 3 & Read clears it * Break Error is bit 2 & Read clears it * Parity Error is bit 1 & Read clears it * Framing Error is bit 0 & Read clears it /******************************************************************************* * Function Name : UART_ClearFlag * Description : Clears the UARTx’s flags(Frame, Parity, Break, Overrun error). * Input : - UARTx: where x can be 0,1or 2 to select the UART peripheral. * Output : None * Return : None *******************************************************************************/ void UART_ClearFlag(UART_TypeDef* UARTx) { /* Clear the flag */ UARTx->RSECR = UART_ClearFlag_Mask; }