summaryrefslogtreecommitdiffstats
path: root/src/devices/ic.rs
blob: 7b30f851c77d00cbf3c68d71e1fa3a92749f6a7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/// ICs
use private;

#[derive(PartialEq)]
pub enum ResolutionBits {
        _12,
        _16
}

pub trait Resolution : 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);
ic_marker!(Ads1014, _12);
ic_marker!(Ads1114, _16);
ic_marker!(Ads1015, _12);
ic_marker!(Ads1115, _16);

pub trait Tier2Features : private::Sealed { }

macro_rules! tier2_features {
    ($name:ident) => {
        impl Tier2Features for $name {}
    }
}

tier2_features!(Ads1014);
tier2_features!(Ads1114);
tier2_features!(Ads1015);
tier2_features!(Ads1115);