summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-20 19:32:25 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-20 19:32:25 +0100
commitff3eeb49fc60369cb545eb0e7980c92cc84405c5 (patch)
treeccc1c9ee0cf21da797ae15e781064d3731182567 /src
parent9cf9208dca6b32b2e3c7b1c7181901db78896b2f (diff)
downloadads1x1x-async-ff3eeb49fc60369cb545eb0e7980c92cc84405c5.tar.gz
ads1x1x-async-ff3eeb49fc60369cb545eb0e7980c92cc84405c5.tar.xz
ads1x1x-async-ff3eeb49fc60369cb545eb0e7980c92cc84405c5.zip
Improve continuous function documentation
Diffstat (limited to 'src')
-rw-r--r--src/devices/mode/continuous.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/devices/mode/continuous.rs b/src/devices/mode/continuous.rs
index 7998a46..0740ca2 100644
--- a/src/devices/mode/continuous.rs
+++ b/src/devices/mode/continuous.rs
@@ -25,6 +25,8 @@ where
}
/// Start continuous conversions
+ ///
+ /// _Note:_ this method is only available in continuous mode.
pub fn start(&mut self) -> Result<(), Error<E>> {
self.set_operating_mode(OperatingMode::Continuous)?;
self.a_conversion_was_started = true;
@@ -32,6 +34,13 @@ where
}
/// Read the most recent measurement
+ ///
+ /// The continuous measurement must be started with [`start()`] before
+ /// calling this method. Otherwise, `Error::NotStarted` will be returned.
+ ///
+ /// _Note:_ this method is only available in continuous mode.
+ ///
+ /// [`start()`]: struct.Ads1x1x.html#method.start
pub fn read(&mut self) -> Result<i16, Error<E>> {
if !self.a_conversion_was_started {
return Err(Error::NotStarted);