diff options
author | Markus Reiter <me@reitermark.us> | 2024-11-23 22:49:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-23 22:49:30 +0100 |
commit | 0edd5527161809dfbc0c76e39c462e3a4f00beb7 (patch) | |
tree | bb55dd2015752ce100d21682a5f452b9f5c4d208 /src/devices/mode/continuous.rs | |
parent | d3af2b6074e8698b8b83f79758e23070a8b80002 (diff) | |
download | ads1x1x-async-0edd5527161809dfbc0c76e39c462e3a4f00beb7.tar.gz ads1x1x-async-0edd5527161809dfbc0c76e39c462e3a4f00beb7.tar.xz ads1x1x-async-0edd5527161809dfbc0c76e39c462e3a4f00beb7.zip |
Improve documentation. (#32)
* Use `non_exhaustive`.
* Improve docs.
Diffstat (limited to 'src/devices/mode/continuous.rs')
-rw-r--r-- | src/devices/mode/continuous.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/devices/mode/continuous.rs b/src/devices/mode/continuous.rs index edc87c2..d514a9a 100644 --- a/src/devices/mode/continuous.rs +++ b/src/devices/mode/continuous.rs @@ -1,4 +1,4 @@ -//! Continuous measurement mode +//! Continuous measurement mode. use crate::{ conversion, devices::OperatingMode, mode, Ads1x1x, ChannelId, Error, ModeChangeError, Register, @@ -10,7 +10,7 @@ where I2C: embedded_hal::i2c::I2c<Error = E>, CONV: conversion::ConvertMeasurement, { - /// Change operating mode to OneShot + /// Changes to one-shot operating mode. pub fn into_one_shot( mut self, ) -> Result<Ads1x1x<I2C, IC, CONV, mode::OneShot>, ModeChangeError<E, Self>> { @@ -29,13 +29,13 @@ where }) } - /// Read the most recent measurement + /// Reads the most recent measurement. pub fn read(&mut self) -> Result<i16, Error<E>> { let value = self.read_register(Register::CONVERSION)?; Ok(CONV::convert_measurement(value)) } - /// Select the channel for measurements. + /// Selects the channel used for measurements. /// /// Note that when changing the channel in continuous conversion mode, the /// ongoing conversion will be completed. |