From 311103b79eb800a756c7ae5b771921322ff92459 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Sat, 17 Nov 2018 07:43:01 +0100 Subject: Add support for setting the comparator queue --- tests/tier2_i2c.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/tier2_i2c.rs b/tests/tier2_i2c.rs index 75c4b5f..a4c4df3 100644 --- a/tests/tier2_i2c.rs +++ b/tests/tier2_i2c.rs @@ -1,7 +1,8 @@ extern crate embedded_hal_mock as hal; use hal::i2c::Transaction as I2cTrans; extern crate ads1x1x; -use ads1x1x::{ ComparatorMode, ComparatorPolarity, ComparatorLatching}; +use ads1x1x::{ ComparatorMode, ComparatorPolarity, ComparatorLatching, + ComparatorQueue }; #[macro_use] mod common; @@ -58,3 +59,11 @@ fn can_disable_comparator() { dev.disable_comparator().unwrap(); destroy_ads1014(dev); } + +mod can_set_comparator_queue { + use super::*; + config_test!(one, set_comparator_queue, ComparatorQueue::One, Config::default().with_low( BitFlags::COMP_QUE1).with_low( BitFlags::COMP_QUE0)); + config_test!(two, set_comparator_queue, ComparatorQueue::Two, Config::default().with_low( BitFlags::COMP_QUE1).with_high(BitFlags::COMP_QUE0)); + config_test!(four, set_comparator_queue, ComparatorQueue::Four, Config::default().with_high(BitFlags::COMP_QUE1).with_low( BitFlags::COMP_QUE0)); +} + -- cgit v1.2.3-54-g00ecf