summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoramugniere@gmail.com <antoine.mugnier@depixus.com>2022-07-08 22:08:14 +0200
committeramugniere@gmail.com <antoine.mugnier@depixus.com>2022-07-08 22:08:14 +0200
commit1d91405d4d5ceee64fa0331e63f6ed565906a77a (patch)
tree9f8b80f5659c48f3303d12f9d3b0094eb8a3952f /tests
parent555f18aa95651f39ea62d965e348ba62eab71414 (diff)
downloadembassy-1d91405d4d5ceee64fa0331e63f6ed565906a77a.zip
Flex/ input pull down test done
Diffstat (limited to 'tests')
-rw-r--r--tests/stm32/src/bin/gpio.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/stm32/src/bin/gpio.rs b/tests/stm32/src/bin/gpio.rs
index b82ad81a..f9b9e8f7 100644
--- a/tests/stm32/src/bin/gpio.rs
+++ b/tests/stm32/src/bin/gpio.rs
@@ -138,26 +138,29 @@ async fn main(_spawner: Spawner, p: Peripherals) {
assert!(b.is_high());
}
- /*
+
// Test input pulldown
{
- let b = Input::new(&mut b, Pull::Down);
+ let mut b = Flex::new(&mut b);
+ b.set_as_input(Pull::Down); // no pull, the status is undefined
delay();
assert!(b.is_low());
-
- let mut a = Output::new(&mut a, Level::Low, Speed::Low);
+
+ let mut a = Flex::new(&mut a);
+ a.set_low();
+ a.set_as_output(Speed::Low);
delay();
assert!(b.is_low());
a.set_high();
delay();
assert!(b.is_high());
}
-
+ /*
// Test input pullup
{
- let b = Input::new(&mut b, Pull::Up);
+ let b = Input::new(&mut b, Pull::Down);
delay();
- assert!(b.is_high());
+ assert!(b.is_low());
let mut a = Output::new(&mut a, Level::Low, Speed::Low);
delay();