summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-17 07:43:01 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-17 07:43:01 +0100
commit311103b79eb800a756c7ae5b771921322ff92459 (patch)
treea3c235c745c16b72ae4460ccab0540504bdb6ad8 /src/lib.rs
parent254a0dce912e252e78a42eead98429dc0b27f1ba (diff)
downloadads1x1x-async-311103b79eb800a756c7ae5b771921322ff92459.tar.gz
ads1x1x-async-311103b79eb800a756c7ae5b771921322ff92459.tar.xz
ads1x1x-async-311103b79eb800a756c7ae5b771921322ff92459.zip
Add support for setting the comparator queue
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b7b3ce0..9680ea3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -12,6 +12,7 @@
//! - Set the comparator mode. See: [`set_comparator_mode()`].
//! - Set the comparator polarity. See: [`set_comparator_polarity()`].
//! - Set the comparator latching. See: [`set_comparator_latching()`].
+//! - Set the comparator queue. See: [`set_comparator_queue()`].
//! - Disable the comparator. See: [`disable_comparator()`].
//!
//! [`into_continuous()`]: struct.Ads1x1x.html#method.into_continuous
@@ -21,6 +22,7 @@
//! [`set_comparator_mode()`]: struct.Ads1x1x.html#method.set_comparator_mode
//! [`set_comparator_polarity()`]: struct.Ads1x1x.html#method.set_comparator_polarity
//! [`set_comparator_latching()`]: struct.Ads1x1x.html#method.set_comparator_latching
+//! [`set_comparator_queue()`]: struct.Ads1x1x.html#method.set_comparator_queue
//! [`disable_comparator()`]: struct.Ads1x1x.html#method.disable_comparator
//!
//! ## The devices
@@ -220,6 +222,17 @@ pub enum ComparatorLatching {
Latching
}
+/// Comparator alert queue (only for ADS1x14, ADS1x15)
+#[derive(Debug, Clone, PartialEq)]
+pub enum ComparatorQueue {
+ /// Activate comparator and assert after one conversion exceeding thresholds
+ One,
+ /// Activate comparator and assert after two consecutive conversions exceeding thresholds
+ Two,
+ /// Activate comparator and assert after four consecutive conversions exceeding thresholds
+ Four,
+}
+
/// Possible slave addresses
#[derive(Debug, Clone)]
pub enum SlaveAddr {