Skip to main content

sht4x/
error.rs

1//! Driver error type.
2
3/// Errors returned by the SHT4x driver.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
6pub enum Error<E> {
7    /// Underlying I²C bus error.
8    I2c(E),
9    /// CRC byte did not match the received data.
10    Crc,
11}
12
13impl<E> From<E> for Error<E> {
14    fn from(e: E) -> Self {
15        Error::I2c(e)
16    }
17}