summaryrefslogtreecommitdiffstats
path: root/tests/tier2_i2c.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tier2_i2c.rs')
-rw-r--r--tests/tier2_i2c.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/tier2_i2c.rs b/tests/tier2_i2c.rs
index e8162c4..e032a6c 100644
--- a/tests/tier2_i2c.rs
+++ b/tests/tier2_i2c.rs
@@ -2,7 +2,7 @@ extern crate embedded_hal;
extern crate embedded_hal_mock as hal;
use hal::i2c::Transaction as I2cTrans;
extern crate ads1x1x;
-use ads1x1x::{ ComparatorMode, ComparatorPolarity };
+use ads1x1x::{ ComparatorMode, ComparatorPolarity, ComparatorLatching};
#[macro_use]
mod common;
@@ -33,4 +33,9 @@ mod can_set_comparator_polarity {
set_value_test!(high, set_comparator_polarity, ComparatorPolarity::ActiveHigh, Config::default().with_high(BitFlags::COMP_POL));
}
+mod can_set_comparator_latching {
+ use super::*;
+ set_value_test!(non, set_comparator_latching, ComparatorLatching::Nonlatching, Config::default().with_low( BitFlags::COMP_LAT));
+ set_value_test!(lat, set_comparator_latching, ComparatorLatching::Latching, Config::default().with_high(BitFlags::COMP_LAT));
+}