aboutsummaryrefslogtreecommitdiff
path: root/tests/stm32/src
diff options
context:
space:
mode:
author[email protected] <[email protected]>2022-07-08 22:08:14 +0200
committer[email protected] <[email protected]>2022-07-08 22:08:14 +0200
commit1d91405d4d5ceee64fa0331e63f6ed565906a77a (patch)
tree9f8b80f5659c48f3303d12f9d3b0094eb8a3952f /tests/stm32/src
parent555f18aa95651f39ea62d965e348ba62eab71414 (diff)
Flex/ input pull down test done
Diffstat (limited to 'tests/stm32/src')
-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 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) {
138 assert!(b.is_high()); 138 assert!(b.is_high());
139 } 139 }
140 140
141 /* 141
142 // Test input pulldown 142 // Test input pulldown
143 { 143 {
144 let b = Input::new(&mut b, Pull::Down); 144 let mut b = Flex::new(&mut b);
145 b.set_as_input(Pull::Down); // no pull, the status is undefined
145 delay(); 146 delay();
146 assert!(b.is_low()); 147 assert!(b.is_low());
147 148
148 let mut a = Output::new(&mut a, Level::Low, Speed::Low); 149 let mut a = Flex::new(&mut a);
150 a.set_low();
151 a.set_as_output(Speed::Low);
149 delay(); 152 delay();
150 assert!(b.is_low()); 153 assert!(b.is_low());
151 a.set_high(); 154 a.set_high();
152 delay(); 155 delay();
153 assert!(b.is_high()); 156 assert!(b.is_high());
154 } 157 }
155 158 /*
156 // Test input pullup 159 // Test input pullup
157 { 160 {
158 let b = Input::new(&mut b, Pull::Up); 161 let b = Input::new(&mut b, Pull::Down);
159 delay(); 162 delay();
160 assert!(b.is_high()); 163 assert!(b.is_low());
161 164
162 let mut a = Output::new(&mut a, Level::Low, Speed::Low); 165 let mut a = Output::new(&mut a, Level::Low, Speed::Low);
163 delay(); 166 delay();