summaryrefslogtreecommitdiffstats
path: root/src/devices/mode/oneshot.rs
diff options
context:
space:
mode:
authorMarkus Reiter <me@reitermark.us>2024-11-23 22:49:30 +0100
committerGitHub <noreply@github.com>2024-11-23 22:49:30 +0100
commit0edd5527161809dfbc0c76e39c462e3a4f00beb7 (patch)
treebb55dd2015752ce100d21682a5f452b9f5c4d208 /src/devices/mode/oneshot.rs
parentd3af2b6074e8698b8b83f79758e23070a8b80002 (diff)
downloadads1x1x-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/oneshot.rs')
-rw-r--r--src/devices/mode/oneshot.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/devices/mode/oneshot.rs b/src/devices/mode/oneshot.rs
index 10cdadb..22b6d51 100644
--- a/src/devices/mode/oneshot.rs
+++ b/src/devices/mode/oneshot.rs
@@ -1,16 +1,18 @@
-//! Common functions
+//! One-shot measurement mode.
+
+use core::marker::PhantomData;
+
use crate::{
conversion, devices::OperatingMode, mode, Ads1x1x, BitFlags, ChannelId, Config, Error,
ModeChangeError, Register,
};
-use core::marker::PhantomData;
impl<I2C, IC, CONV, E> Ads1x1x<I2C, IC, CONV, mode::OneShot>
where
I2C: embedded_hal::i2c::I2c<Error = E>,
CONV: conversion::ConvertMeasurement,
{
- /// Change operating mode to Continuous
+ /// Changes to continuous operating mode.
pub fn into_continuous(
mut self,
) -> Result<Ads1x1x<I2C, IC, CONV, mode::Continuous>, ModeChangeError<E, Self>> {
@@ -40,13 +42,12 @@ where
I2C: embedded_hal::i2c::I2c<Error = E>,
CONV: conversion::ConvertMeasurement,
{
- /// Request that the ADC begin a conversion on the specified channel.
+ /// Requests that the ADC begins 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).
+ /// the full-scale range ([`FullScaleRange`](crate::FullScaleRange)) selected.
///
/// Returns `nb::Error::WouldBlock` while a measurement is in progress.
///