diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-17 07:43:01 +0100 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2018-11-17 07:43:01 +0100 |
commit | 311103b79eb800a756c7ae5b771921322ff92459 (patch) | |
tree | a3c235c745c16b72ae4460ccab0540504bdb6ad8 /tests | |
parent | 254a0dce912e252e78a42eead98429dc0b27f1ba (diff) | |
download | ads1x1x-async-311103b79eb800a756c7ae5b771921322ff92459.tar.gz ads1x1x-async-311103b79eb800a756c7ae5b771921322ff92459.tar.xz ads1x1x-async-311103b79eb800a756c7ae5b771921322ff92459.zip |
Add support for setting the comparator queue
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tier2_i2c.rs | 11 |
1 files changed, 10 insertions, 1 deletions
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)); +} + |