#[repr(u8)]
#[derive(Clone, Copy, Default)]
#[cfg_attr(feature = "impl-defmt-format", derive(defmt::Format))]
#[cfg_attr(feature = "impl-debug", derive(core::fmt::Debug))]
pub enum Mode {
UltraLowPower = 0,
#[default]
Standard = 1,
HighResolution = 2,
UltraHighResolution = 3,
}
impl Mode {
pub fn delay_ms(&self) -> u32 {
match self {
Mode::UltraLowPower => 5,
Mode::Standard => 8,
Mode::HighResolution => 14,
Mode::UltraHighResolution => 26,
}
}
}