From ff3eeb49fc60369cb545eb0e7980c92cc84405c5 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Tue, 20 Nov 2018 19:32:25 +0100 Subject: Improve continuous function documentation --- src/devices/mode/continuous.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/devices') 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> { 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> { if !self.a_conversion_was_started { return Err(Error::NotStarted); -- cgit v1.2.3-54-g00ecf