summaryrefslogtreecommitdiffstats
path: root/src/devices
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-17 14:24:13 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-17 14:24:13 +0100
commit7ac25f537bb7684be136e0168bbad2a85922b3fc (patch)
treee7cd05080a00f0d1862dbd802fea4d56d60d1aec /src/devices
parent950120f4a2d0199a63b59b523f1a1638e20c4f13 (diff)
downloadads1x1x-async-7ac25f537bb7684be136e0168bbad2a85922b3fc.tar.gz
ads1x1x-async-7ac25f537bb7684be136e0168bbad2a85922b3fc.tar.xz
ads1x1x-async-7ac25f537bb7684be136e0168bbad2a85922b3fc.zip
Improve documentation of values
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/features/tier2.rs10
-rw-r--r--src/devices/mode/oneshot.rs6
2 files changed, 16 insertions, 0 deletions
diff --git a/src/devices/features/tier2.rs b/src/devices/features/tier2.rs
index 2a35f7c..79843f6 100644
--- a/src/devices/features/tier2.rs
+++ b/src/devices/features/tier2.rs
@@ -32,12 +32,22 @@ where
}
/// Set raw comparator lower threshold
+ ///
+ /// The input value must be within `[2047..-2048]` for 12-bit devices (`ADS101x`)
+ /// and within `[32767..-32768]` for 16-bit devices (`ADS111x`). The voltage that
+ /// these values correspond to must be calculated using the full-scale range
+ /// selected. See [`FullScaleRange`](enum.FullScaleRange.html).
pub fn set_low_threshold_raw(&mut self, value: i16) -> Result<(), Error<E>> {
let register_value = CONV::convert_threshold(value)?;
self.iface.write_register(Register::LOW_TH, register_value)
}
/// Set raw comparator upper threshold
+ ///
+ /// The input value must be within `[2047..-2048]` for 12-bit devices (`ADS101x`)
+ /// and within `[32767..-32768]` for 16-bit devices (`ADS111x`). The voltage that
+ /// these values correspond to must be calculated using the full-scale range
+ /// selected. See [`FullScaleRange`](enum.FullScaleRange.html).
pub fn set_high_threshold_raw(&mut self, value: i16) -> Result<(), Error<E>> {
let register_value = CONV::convert_threshold(value)?;
self.iface.write_register(Register::HIGH_TH, register_value)
diff --git a/src/devices/mode/oneshot.rs b/src/devices/mode/oneshot.rs
index 9563286..fc4a5ed 100644
--- a/src/devices/mode/oneshot.rs
+++ b/src/devices/mode/oneshot.rs
@@ -49,6 +49,12 @@ where
/// Request that the ADC begin a conversion on the specified channel.
///
+ /// The output value will be within `[2047..-2048]` for 12-bit devices
+ /// (`ADS101x`) and within `[32767..-32768]` for 16-bit devices (`ADS111x`).
+ /// The voltage that these values correspond to must be calculated using
+ /// the full-scale range selected.
+ /// See [`FullScaleRange`](enum.FullScaleRange.html).
+ ///
/// Returns `nb::Error::WouldBlock` while a measurement is in progress.
///
/// In case a measurement was requested and after is it is finished a