summaryrefslogtreecommitdiffstats
path: root/src/devices/ic.rs
blob: 81c8e44726e0f7360b6f432809daaa6d9c675c34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// ICs
#[derive(PartialEq)]
pub enum ResolutionBits {
        _12,
        _16
}

pub trait Resolution : super::private::Sealed {
    const BITS : ResolutionBits;
}

macro_rules! ic_marker {
    ($name:ident, $resolution:ident) => {
        /// IC marker
        pub struct $name(());
        impl Resolution for $name {
            const BITS: ResolutionBits = ResolutionBits::$resolution;
        }
    };
}

ic_marker!(Ads1013, _12);
ic_marker!(Ads1113, _16);