diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-10-01 21:17:46 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-12-19 12:29:50 +0100 |
| commit | 62ed44f99af9e33d689c8308149f8f992176895f (patch) | |
| tree | ee9f4352e70815e97e424bb534c1c096242b9af0 /embassy-mcxa/src/lpuart/mod.rs | |
| parent | 3214021ed5ae17b96ac006c0f460e222502e411d (diff) | |
Update to embedded-io 0.7
Diffstat (limited to 'embassy-mcxa/src/lpuart/mod.rs')
| -rw-r--r-- | embassy-mcxa/src/lpuart/mod.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/embassy-mcxa/src/lpuart/mod.rs b/embassy-mcxa/src/lpuart/mod.rs index bce3986b5..ae511e8d3 100644 --- a/embassy-mcxa/src/lpuart/mod.rs +++ b/embassy-mcxa/src/lpuart/mod.rs | |||
| @@ -568,6 +568,27 @@ pub enum Error { | |||
| 568 | ClockSetup(ClockError), | 568 | ClockSetup(ClockError), |
| 569 | } | 569 | } |
| 570 | 570 | ||
| 571 | impl core::fmt::Display for Error { | ||
| 572 | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | ||
| 573 | match self { | ||
| 574 | Error::Read => write!(f, "Read error"), | ||
| 575 | Error::Overrun => write!(f, "Buffer overflow"), | ||
| 576 | Error::Noise => write!(f, "Noise error"), | ||
| 577 | Error::Framing => write!(f, "Framing error"), | ||
| 578 | Error::Parity => write!(f, "Parity error"), | ||
| 579 | Error::Fail => write!(f, "Failure"), | ||
| 580 | Error::InvalidArgument => write!(f, "Invalid argument"), | ||
| 581 | Error::UnsupportedBaudrate => write!(f, "Unsupported baud rate"), | ||
| 582 | Error::RxFifoEmpty => write!(f, "RX FIFO empty"), | ||
| 583 | Error::TxFifoFull => write!(f, "TX FIFO full"), | ||
| 584 | Error::TxBusy => write!(f, "TX busy"), | ||
| 585 | Error::ClockSetup(e) => write!(f, "Clock setup error: {:?}", e), | ||
| 586 | } | ||
| 587 | } | ||
| 588 | } | ||
| 589 | |||
| 590 | impl core::error::Error for Error {} | ||
| 591 | |||
| 571 | /// A specialized Result type for LPUART operations | 592 | /// A specialized Result type for LPUART operations |
| 572 | pub type Result<T> = core::result::Result<T, Error>; | 593 | pub type Result<T> = core::result::Result<T, Error>; |
| 573 | 594 | ||
