Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions embedded-hal-bus/src/spi/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! `SpiDevice` implementations.

use core::convert::Infallible;
use core::fmt::{self, Debug, Display, Formatter};
use embedded_hal::spi::{Error, ErrorKind};

Expand Down Expand Up @@ -63,6 +64,15 @@ where
}
}

impl From<DeviceError<Infallible, Infallible>> for Infallible {
fn from(value: DeviceError<Infallible, Infallible>) -> Self {
match value {
DeviceError::Spi(e) => e,
DeviceError::Cs(e) => e,
}
}
}

/// Dummy [`DelayNs`](embedded_hal::delay::DelayNs) implementation that panics on use.
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
Expand Down