diff --git a/va416xx-hal/src/uart.rs b/va416xx-hal/src/uart.rs index b6c8908..6c64675 100644 --- a/va416xx-hal/src/uart.rs +++ b/va416xx-hal/src/uart.rs @@ -305,10 +305,14 @@ pub struct Uart { pins: Pins, } -/// Serial receiver +/// Serial receiver. +/// +/// Can be created by using the [Uart::split] or [UartBase::split] API. pub struct Rx(Uart); /// Serial transmitter +/// +/// Can be created by using the [Uart::split] or [UartBase::split] API. pub struct Tx(Uart); impl Rx { @@ -677,6 +681,29 @@ pub struct IrqUartError { } impl IrqUartError { + #[inline(always)] + pub fn overflow(&self) -> bool { + self.overflow + } + + #[inline(always)] + pub fn framing(&self) -> bool { + self.framing + } + + #[inline(always)] + pub fn parity(&self) -> bool { + self.parity + } + + #[inline(always)] + pub fn other(&self) -> bool { + self.other + } +} + +impl IrqUartError { + #[inline(always)] pub fn error(&self) -> bool { self.overflow || self.framing || self.parity }