1.1.13.11 1.8.24.24 1.10.23.26 1.11.23.26 1.12.24.26 1.13.22.26 1.14.17.26 1.15.18.26 1.16.25.26 1.17.20.26 1.18.21.26 1.19.21.26 1.20.25.26 1.21.26.26 1.22.28.26 1.23.27.26 1.24.23.26 1.27.26.24 1.34.26.24 1.35.20.24 UARTx_ErrorGet Function
C
/* x = UART instance number */
/* Blocking, non-blocking and ring buffer mode */
UART_ERROR UARTx_ErrorGet( void )
Summary
Gets the error of the given UART peripheral instance.
Description
This function returns the errors associated with the given UART peripheral instance. Multiple error conditions may be active. The function return value should be matched against each member of the UART_ERROR enumeration to handle all error cases. Calling the UARTx_Read will clear the errors, hence error handling must be performed before.
Blocking mode
Calling this API clears the hardware errors
Non-blocking and ring-buffer mode
Error flags are saved in a register and hardware errors are cleared in the Error interrupt handler. Calling this API clears the error flags saved in the register.
Precondition
UARTx_Initialize must have been called for the associated UART UART instance.
Parameters
None.
Returns
Errors occurred as listed by UART_ERROR.
Example
if ((UART_ERROR_OVERRUN & UART1_ErrorGet()) == UART_ERROR_OVERRUN) { //Errors are cleared by the API call, take respective action //for the overrun error case. }
Remarks
UART errors are normally associated with the receiver. Hence, it is recommended to use this function in receive context only.