summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-17 08:06:25 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-17 08:06:25 +0100
commite012a0a1d7f5f0c46b3d4cc1136160c1762cb63b (patch)
tree941716e18d36a3289b23600a684a53f48ba08918
parent91a8b5c46c12fc38427b55cbc83790b5a4af7892 (diff)
downloadads1x1x-async-e012a0a1d7f5f0c46b3d4cc1136160c1762cb63b.tar.gz
ads1x1x-async-e012a0a1d7f5f0c46b3d4cc1136160c1762cb63b.tar.xz
ads1x1x-async-e012a0a1d7f5f0c46b3d4cc1136160c1762cb63b.zip
Add FSR to device struct
-rw-r--r--src/construction/i2c.rs3
-rw-r--r--src/devices/mode/continuous.rs1
-rw-r--r--src/devices/mode/oneshot.rs1
-rw-r--r--src/lib.rs1
4 files changed, 5 insertions, 1 deletions
diff --git a/src/construction/i2c.rs b/src/construction/i2c.rs
index 4fa4177..8c63a4b 100644
--- a/src/construction/i2c.rs
+++ b/src/construction/i2c.rs
@@ -3,7 +3,7 @@
extern crate embedded_hal as hal;
use hal::blocking;
use core::marker::PhantomData;
-use { Ads1x1x, DEVICE_BASE_ADDRESS, SlaveAddr, ic, Config, mode };
+use { Ads1x1x, DEVICE_BASE_ADDRESS, SlaveAddr, ic, Config, mode, FullScaleRange };
use interface::I2cInterface;
@@ -21,6 +21,7 @@ macro_rules! impl_new_destroy {
address: address.addr(DEVICE_BASE_ADDRESS)
},
config: Config::default(),
+ fsr: FullScaleRange::default(),
a_conversion_was_started: false,
_conv: PhantomData,
_ic: PhantomData,
diff --git a/src/devices/mode/continuous.rs b/src/devices/mode/continuous.rs
index e90b1ae..cb62f8d 100644
--- a/src/devices/mode/continuous.rs
+++ b/src/devices/mode/continuous.rs
@@ -14,6 +14,7 @@ where
Ok(Ads1x1x {
iface: self.iface,
config: self.config,
+ fsr: self.fsr,
a_conversion_was_started: self.a_conversion_was_started,
_conv: PhantomData,
_ic: PhantomData,
diff --git a/src/devices/mode/oneshot.rs b/src/devices/mode/oneshot.rs
index de7e11e..9563286 100644
--- a/src/devices/mode/oneshot.rs
+++ b/src/devices/mode/oneshot.rs
@@ -17,6 +17,7 @@ where
Ok(Ads1x1x {
iface: self.iface,
config: self.config,
+ fsr: self.fsr,
a_conversion_was_started: self.a_conversion_was_started,
_conv: PhantomData,
_ic: PhantomData,
diff --git a/src/lib.rs b/src/lib.rs
index bb7112b..1a34b6f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -405,6 +405,7 @@ impl Default for FullScaleRange {
pub struct Ads1x1x<DI, IC, CONV, MODE> {
iface: DI,
config: Config,
+ fsr: FullScaleRange,
a_conversion_was_started: bool,
_conv: PhantomData<CONV>,
_ic: PhantomData<IC>,