mcp3424 0.3.0

Async Rust driver for the MCP3422/3/4 ADC.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

#[derive(Copy, Clone, Default)]
#[cfg_attr(any(feature = "fmt", test), derive(Debug))]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum Mode {
    #[default]
    Continuous,
    OneShot,
}

impl Mode {
    pub const fn mask(&self) -> u8 {
        match self {
            Mode::Continuous => 1,
            Mode::OneShot => 0,
        }
    }
}