#[derive(Debug, Clone, Copy, PartialEq)]
pub enum IntegrationTime {
_25ms,
_50ms,
_100ms,
_200ms,
_400ms,
_800ms,
}
impl IntegrationTime {
pub fn as_ms(&self) -> u16 {
match self {
IntegrationTime::_25ms => 25,
IntegrationTime::_50ms => 50,
IntegrationTime::_100ms => 100,
IntegrationTime::_200ms => 200,
IntegrationTime::_400ms => 400,
IntegrationTime::_800ms => 800,
}
}
pub fn as_us(&self) -> u32 {
(self.as_ms() as u32) * 1000
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Gain {
OneEighth,
OneQuarter,
One,
Two,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum FaultCount {
One,
Two,
Four,
Eight,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum PowerSavingMode {
One,
Two,
Three,
Four,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct InterruptStatus {
pub was_too_low: bool,
pub was_too_high: bool,
}