From 2c61277fb4f8e6263f0776b878ecebd861e03dbb Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 14 Jan 2024 07:38:03 +0100 Subject: [PATCH] Improve docs. --- src/devices/features/tier2.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/devices/features/tier2.rs b/src/devices/features/tier2.rs index 01bf14b..81a14a7 100644 --- a/src/devices/features/tier2.rs +++ b/src/devices/features/tier2.rs @@ -138,23 +138,18 @@ macro_rules! impl_tier2_features { Ok(()) } - /// Sets the ALERT/RDY pin as conversion-ready pin. + /// Enables the ALERT/RDY pin as conversion-ready function. /// - /// This the ALERT/RDY pin outputs the OS bit when in OneShot mode, and - /// provides a continuous-conversion ready pulse when in - /// continuous-conversion mode. + /// When in one-shot mode, this makes the ALERT/RDY pin output the OS bit, + /// in continuous-conversion mode, provides a continuous-conversion ready pulse when. /// - /// When calling this the comparator will be disabled and the thresholds will be cleared. + /// When calling this the comparator will be disabled and any thresholds will be cleared. pub fn use_alert_rdy_pin_as_ready(&mut self) -> Result<(), E> { - if self.config - != self - .config - .union(Config::COMP_QUE1) - .union(Config::COMP_QUE0) + if !self.config.contains(Config::COMP_QUE) { self.disable_comparator()?; } - self.write_reg_u16(HiThresh(0x8000))?; + self.write_reg_u16(HiThresh(0b1000000000000000))?; self.write_reg_u16(LoThresh(0)) } }