From 28b16cc364cc4f4112aca2195df389ea6f007048 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Wed, 7 Nov 2018 20:19:06 +0100 Subject: Convert between modes through transformation of the struct --- src/devices/ic.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/devices/ic.rs (limited to 'src/devices/ic.rs') diff --git a/src/devices/ic.rs b/src/devices/ic.rs new file mode 100644 index 0000000..9795de6 --- /dev/null +++ b/src/devices/ic.rs @@ -0,0 +1,22 @@ +/// ICs +#[derive(PartialEq)] +pub enum ResolutionBits { + _12, + _16 +} + +pub trait Resolution : super::private::Sealed { + const BITS : ResolutionBits; +} + +/// ADS1013 IC marker +pub struct Ads1013(()); +impl Resolution for Ads1013 { + const BITS: ResolutionBits = ResolutionBits::_12; +} + +/// ADS1113 IC marker +pub struct Ads1113(()); +impl Resolution for Ads1113 { + const BITS: ResolutionBits = ResolutionBits::_16; +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf