drivers: uart: add support for collision detection error

Certain uarts support collision detection. This is mainly used in
half-duplex scenarios, like RS-485 and raises an error when bits
output on the TX line do not match the bits received on the RX line.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
This commit is contained in:
Arvin Farahmand 2021-04-20 14:11:05 -04:00 committed by Anas Nashif
commit bc839c8707

View file

@ -167,6 +167,16 @@ enum uart_rx_stop_reason {
* start time + data bits + parity + stop bits.
*/
UART_BREAK = (1 << 3),
/**
* @brief Collision error
*
* This error is raised when transmitted data does not match
* received data. Typically this is useful in scenarios where
* the TX and RX lines maybe connected together such as
* RS-485 half-duplex. This error is only valid on UARTs that
* support collision checking.
*/
UART_ERROR_COLLISION = (1 << 4),
};
/** @brief UART TX event data. */