From dbecb1c3af672b06e7443134e1efc7f5050e99ff Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Thu, 8 Nov 2018 19:01:40 +0100 Subject: Enforce IC type to contain a resolution --- src/devices/ads1x1x/mode/continuous.rs | 5 +++-- src/devices/ads1x1x/mode/oneshot.rs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/devices') diff --git a/src/devices/ads1x1x/mode/continuous.rs b/src/devices/ads1x1x/mode/continuous.rs index 1532b62..1472478 100644 --- a/src/devices/ads1x1x/mode/continuous.rs +++ b/src/devices/ads1x1x/mode/continuous.rs @@ -1,12 +1,13 @@ //! Common functions use core::marker::PhantomData; -use { Ads1x1x, mode, Error, interface }; +use { Ads1x1x, mode, Error, interface, ic }; use super::super::OperatingMode; impl Ads1x1x where - DI: interface::WriteData + DI: interface::WriteData, + IC: ic::Resolution { /// Change operating mode to OneShot pub fn into_one_shot(mut self) -> Result, Error> { diff --git a/src/devices/ads1x1x/mode/oneshot.rs b/src/devices/ads1x1x/mode/oneshot.rs index cc36f89..554a55e 100644 --- a/src/devices/ads1x1x/mode/oneshot.rs +++ b/src/devices/ads1x1x/mode/oneshot.rs @@ -8,7 +8,8 @@ use super::convert_measurement; impl Ads1x1x where - DI: interface::WriteData + interface::ReadData + DI: interface::WriteData + interface::ReadData, + IC: ic::Resolution { /// Change operating mode to Continuous pub fn into_continuous(mut self) -> Result, Error> { -- cgit v1.2.3-54-g00ecf