Skip to content

Commit a802056

Browse files
committed
Add test for lots of gpio settings
1 parent 096c599 commit a802056

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/nucleo-h533.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,30 @@ mod tests {
7575
assert!(pin.is_low());
7676
assert!(is_pax_low(pin_num));
7777
}
78+
79+
#[test]
80+
fn gpio_settings() {
81+
use super::*;
82+
83+
let (gpioa, _) = init();
84+
let pin = gpioa.pa8;
85+
86+
let mut pin = pin.into_floating_input();
87+
88+
pin.set_internal_resistor(Pull::Up);
89+
90+
pin.set_internal_resistor(Pull::Down);
91+
92+
let pin = pin.into_analog();
93+
let pin = pin.into_push_pull_output();
94+
let pin = pin.into_open_drain_output();
95+
let pin: gpio::Pin<'A', 8, gpio::Alternate<7>> = pin.into_alternate();
96+
let mut pin: gpio::Pin<'A', 8, gpio::Alternate<15>> =
97+
pin.into_alternate();
98+
99+
pin.set_speed(gpio::Speed::Low);
100+
pin.set_speed(gpio::Speed::VeryHigh);
101+
}
78102
}
79103

80104
fn init() -> (gpio::gpioa::Parts, Delay) {

0 commit comments

Comments
 (0)