Flex/ input pull up test done
This commit is contained in:
parent
1d91405d4d
commit
00df9b507c
1 changed files with 15 additions and 12 deletions
|
@ -142,7 +142,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
// Test input pulldown
|
// Test input pulldown
|
||||||
{
|
{
|
||||||
let mut b = Flex::new(&mut b);
|
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();
|
delay();
|
||||||
assert!(b.is_low());
|
assert!(b.is_low());
|
||||||
|
|
||||||
|
@ -155,21 +155,24 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
delay();
|
delay();
|
||||||
assert!(b.is_high());
|
assert!(b.is_high());
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
// Test input pullup
|
// Test input pullup
|
||||||
{
|
{
|
||||||
let b = Input::new(&mut b, Pull::Down);
|
let mut b = Flex::new(&mut b);
|
||||||
delay();
|
b.set_as_input(Pull::Up);
|
||||||
assert!(b.is_low());
|
|
||||||
|
|
||||||
let mut a = Output::new(&mut a, Level::Low, Speed::Low);
|
|
||||||
delay();
|
|
||||||
assert!(b.is_low());
|
|
||||||
a.set_high();
|
|
||||||
delay();
|
delay();
|
||||||
assert!(b.is_high());
|
assert!(b.is_high());
|
||||||
}
|
|
||||||
|
|
||||||
|
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
|
// Test output open drain
|
||||||
{
|
{
|
||||||
let b = Input::new(&mut b, Pull::Down);
|
let b = Input::new(&mut b, Pull::Down);
|
||||||
|
|
Loading…
Reference in a new issue