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/lib.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/lib.rs')
-rw-r--r-- | src/lib.rs | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -275,10 +275,11 @@ impl Default for Config { /// ADS1x1x ADC driver #[derive(Debug, Default)] -pub struct Ads1x1x<DI, IC, MODE> { +pub struct Ads1x1x<DI, IC, CONV, MODE> { iface: DI, config: Config, a_conversion_was_started: bool, + converter: CONV, _ic: PhantomData<IC>, _mode: PhantomData<MODE> } @@ -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<I2C> Sealed for interface::I2cInterface<I2C> {} impl<SPI, CS> Sealed for interface::SpiInterface<SPI, CS> {} + 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 {} |