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 b8b15fe..1b01791 100644
--- a/tests/tier2_i2c.rs
+++ b/tests/tier2_i2c.rs
@@ -9,7 +9,6 @@ mod common;
use common::{ new_ads1014, destroy_ads1014,
DEVICE_ADDRESS as DEV_ADDR, Register, BitFlags, Config };
-
macro_rules! set_value_test {
($name:ident, $method:ident, $value:expr, $reg:ident, $msb:expr, $lsb:expr) => {
#[test]
@@ -28,6 +27,12 @@ macro_rules! config_test {
}
}
+mod can_set_comparator_thresholds {
+ use super::*;
+ set_value_test!(low, set_low_threshold, 2047, LOW_TH, 0x7F, 0xF0);
+ set_value_test!(high, set_high_threshold, 2047, HIGH_TH, 0x7F, 0xF0);
+}
+
mod can_set_comparator_mode {
use super::*;
config_test!(traditional, set_comparator_mode, ComparatorMode::Traditional, Config::default().with_low( BitFlags::COMP_MODE));