From 254a0dce912e252e78a42eead98429dc0b27f1ba Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Sat, 17 Nov 2018 07:42:39 +0100 Subject: Add function to disable comparator --- tests/tier2_i2c.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/tier2_i2c.rs') diff --git a/tests/tier2_i2c.rs b/tests/tier2_i2c.rs index 956aeb2..75c4b5f 100644 --- a/tests/tier2_i2c.rs +++ b/tests/tier2_i2c.rs @@ -50,3 +50,11 @@ mod can_set_comparator_latching { config_test!(lat, set_comparator_latching, ComparatorLatching::Latching, Config::default().with_high(BitFlags::COMP_LAT)); } +#[test] +fn can_disable_comparator() { + let config = Config::default().with_high(BitFlags::COMP_QUE1).with_high(BitFlags::COMP_QUE0); + let transactions = [ I2cTrans::write(DEV_ADDR, vec![Register::CONFIG, config.msb(), config.lsb()]) ]; + let mut dev = new_ads1014(&transactions); + dev.disable_comparator().unwrap(); + destroy_ads1014(dev); +} -- cgit v1.2.3-54-g00ecf