1#[derive(Debug, Clone, Copy, PartialEq)]
3#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
4pub enum Error {
5 OutOfRange,
7 InvalidVoltage,
9 InvalidLoadResistance,
11}
12
13impl core::fmt::Display for Error {
14 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15 match self {
16 Error::OutOfRange => write!(f, "Rs/R0 ratio out of sensor range"),
17 Error::InvalidVoltage => write!(f, "ADC voltage invalid"),
18 Error::InvalidLoadResistance => write!(f, "load resistance must be positive"),
19 }
20 }
21}