This commit is contained in:
parent
58e4a3a211
commit
bb5402ebdb
@ -305,10 +305,14 @@ pub struct Uart<UartInstance, Pins> {
|
||||
pins: Pins,
|
||||
}
|
||||
|
||||
/// Serial receiver
|
||||
/// Serial receiver.
|
||||
///
|
||||
/// Can be created by using the [Uart::split] or [UartBase::split] API.
|
||||
pub struct Rx<Uart>(Uart);
|
||||
|
||||
/// Serial transmitter
|
||||
///
|
||||
/// Can be created by using the [Uart::split] or [UartBase::split] API.
|
||||
pub struct Tx<Uart>(Uart);
|
||||
|
||||
impl<Uart: Instance> Rx<Uart> {
|
||||
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user