diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-11 17:32:52 +0100 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-11 17:32:52 +0100 |
commit | fce3d8546bd619964ec5dd1594cd93e744a99521 (patch) | |
tree | 7bc17d465652c86b25b9fb34ccd7ed3bf0218b56 /src/ic.rs | |
parent | b9b5349b4b78a5d59be4a7e4a11f712e2f6a8256 (diff) | |
download | ads1x1x-async-fce3d8546bd619964ec5dd1594cd93e744a99521.tar.gz ads1x1x-async-fce3d8546bd619964ec5dd1594cd93e744a99521.tar.xz ads1x1x-async-fce3d8546bd619964ec5dd1594cd93e744a99521.zip |
Implement value conversions over type parameter
Diffstat (limited to 'src/ic.rs')
-rw-r--r-- | src/ic.rs | 27 |
1 files changed, 9 insertions, 18 deletions
@@ -1,32 +1,23 @@ /// ICs use private; -#[derive(PartialEq)] -pub enum ResolutionBits { - _12, - _16 -} +pub struct Resolution12Bit(pub(crate)()); +pub struct Resolution16Bit(pub(crate)()); -pub trait Resolution : private::Sealed { - const BITS : ResolutionBits; -} macro_rules! ic_marker { - ($name:ident, $resolution:ident) => { + ($name: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); +ic_marker!(Ads1013); +ic_marker!(Ads1113); +ic_marker!(Ads1014); +ic_marker!(Ads1114); +ic_marker!(Ads1015); +ic_marker!(Ads1115); pub trait Tier2Features : private::Sealed { } |