From 1d91405d4d5ceee64fa0331e63f6ed565906a77a Mon Sep 17 00:00:00 2001 From: "amugniere@gmail.com" Date: Fri, 8 Jul 2022 22:08:14 +0200 Subject: [PATCH] Flex/ input pull down test done --- tests/stm32/src/bin/gpio.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/stm32/src/bin/gpio.rs b/tests/stm32/src/bin/gpio.rs index b82ad81a7..f9b9e8f7f 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();