diff options
author | amugniere@gmail.com <antoine.mugnier@depixus.com> | 2022-07-08 22:10:52 +0200 |
---|---|---|
committer | amugniere@gmail.com <antoine.mugnier@depixus.com> | 2022-07-08 22:10:52 +0200 |
commit | 00df9b507c66526dee1e395fc82a0f71b17c557e (patch) | |
tree | a60f8ae6eeb1d3fc4bfbb57597e68a51980889b9 /tests | |
parent | 1d91405d4d5ceee64fa0331e63f6ed565906a77a (diff) | |
download | embassy-00df9b507c66526dee1e395fc82a0f71b17c557e.zip |
Flex/ input pull up test done
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stm32/src/bin/gpio.rs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/stm32/src/bin/gpio.rs b/tests/stm32/src/bin/gpio.rs index f9b9e8f7..edcb1eca 100644 --- a/tests/stm32/src/bin/gpio.rs +++ b/tests/stm32/src/bin/gpio.rs @@ -142,10 +142,10 @@ async fn main(_spawner: Spawner, p: Peripherals) { // Test input pulldown { let mut b = Flex::new(&mut b); - b.set_as_input(Pull::Down); // no pull, the status is undefined + b.set_as_input(Pull::Down); delay(); assert!(b.is_low()); - + let mut a = Flex::new(&mut a); a.set_low(); a.set_as_output(Speed::Low); @@ -155,21 +155,24 @@ async fn main(_spawner: Spawner, p: Peripherals) { delay(); assert!(b.is_high()); } - /* + // Test input pullup { - let b = Input::new(&mut b, Pull::Down); + let mut b = Flex::new(&mut b); + b.set_as_input(Pull::Up); delay(); - assert!(b.is_low()); + assert!(b.is_high()); - let mut a = Output::new(&mut a, Level::Low, Speed::Low); - delay(); - assert!(b.is_low()); + let mut a = Flex::new(&mut a); a.set_high(); + a.set_as_output(Speed::Low); delay(); assert!(b.is_high()); + a.set_low(); + delay(); + assert!(b.is_low()); } - + /* // Test output open drain { let b = Input::new(&mut b, Pull::Down); |