summaryrefslogtreecommitdiffstats
path: root/src/devices
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-08 19:17:12 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-08 19:17:12 +0100
commit6e7b9558cf6d586f67e509efc157b7d41751ac26 (patch)
tree1de75b8b7366d41a4f882f06434eb34436da36fa /src/devices
parentb972e13b0d279170573cc19d02b3f13ef2478676 (diff)
downloadads1x1x-async-6e7b9558cf6d586f67e509efc157b7d41751ac26.tar.gz
ads1x1x-async-6e7b9558cf6d586f67e509efc157b7d41751ac26.tar.xz
ads1x1x-async-6e7b9558cf6d586f67e509efc157b7d41751ac26.zip
Improve documentation
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/ads1x1x/mode/oneshot.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/devices/ads1x1x/mode/oneshot.rs b/src/devices/ads1x1x/mode/oneshot.rs
index 554a55e..0da4a7b 100644
--- a/src/devices/ads1x1x/mode/oneshot.rs
+++ b/src/devices/ads1x1x/mode/oneshot.rs
@@ -24,7 +24,7 @@ where
}
fn is_measurement_in_progress(&mut self) -> Result<bool, Error<E>> {
- let config = Config {
+ let config = Config {
bits: self.iface.read_register(Register::CONFIG)?
};
Ok(!config.is_high(BitFlags::OS))
@@ -44,6 +44,7 @@ where
{
type Error = Error<E>;
+ /// Request that the ADC begin a conversion on the specified channel
fn read(&mut self, _channel: &mut CH) -> nb::Result<i16, Self::Error> {
//TODO for devices with MUX select channel, if it is the wrong one, return AlreadyInProgress or WrongChannel error
if self.is_measurement_in_progress().map_err(nb::Error::Other)? {