From fce3d8546bd619964ec5dd1594cd93e744a99521 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Sun, 11 Nov 2018 17:32:52 +0100 Subject: Implement value conversions over type parameter --- src/lib.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 6601888..2d421fc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -275,10 +275,11 @@ impl Default for Config { /// ADS1x1x ADC driver #[derive(Debug, Default)] -pub struct Ads1x1x { +pub struct Ads1x1x { iface: DI, config: Config, a_conversion_was_started: bool, + converter: CONV, _ic: PhantomData, _mode: PhantomData } @@ -288,9 +289,12 @@ pub mod interface; #[doc(hidden)] pub mod ic; mod channels; +pub use channels::channel; mod devices; mod construction; -pub use channels::channel; +mod conversion; +pub use conversion::ConvertThreshold; +pub use conversion::ConvertMeasurement; mod private { use super::{ ic, interface }; @@ -299,6 +303,9 @@ mod private { impl Sealed for interface::I2cInterface {} impl Sealed for interface::SpiInterface {} + impl Sealed for ic::Resolution12Bit {} + impl Sealed for ic::Resolution16Bit {} + impl Sealed for ic::Ads1013 {} impl Sealed for ic::Ads1113 {} impl Sealed for ic::Ads1014 {} -- cgit v1.2.3-54-g00ecf