summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2018-11-10 09:34:00 +0100
committerDiego Barrios Romero <eldruin@gmail.com>2018-11-10 09:34:00 +0100
commitbad297c7e4c1f39842aa55ac44506e22d154bce0 (patch)
treed4b48ab8b25cecad2e77c034dda1716c34c93da9 /src/lib.rs
parentdf8e200554dadee3f4addc887f775be03b7467cf (diff)
downloadads1x1x-async-bad297c7e4c1f39842aa55ac44506e22d154bce0.tar.gz
ads1x1x-async-bad297c7e4c1f39842aa55ac44506e22d154bce0.tar.xz
ads1x1x-async-bad297c7e4c1f39842aa55ac44506e22d154bce0.zip
Add support for setting the comparator polarity
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 21b63c5..7dc1388 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -124,6 +124,15 @@ pub enum ComparatorMode {
Window
}
+/// Comparator polarity (only for ADS1x14, ADS1x15)
+#[derive(Debug, Clone)]
+pub enum ComparatorPolarity {
+ /// Active low (default)
+ ActiveLow,
+ /// Active high
+ ActiveHigh
+}
+
/// Possible slave addresses
#[derive(Debug, Clone)]
pub enum SlaveAddr {
@@ -168,6 +177,7 @@ impl BitFlags {
const DR1 : u16 = 0b0000_0000_0100_0000;
const DR0 : u16 = 0b0000_0000_0010_0000;
const COMP_MODE : u16 = 0b0000_0000_0001_0000;
+ const COMP_POL : u16 = 0b0000_0000_0000_1000;
}