use stm32f4xx_hal::{ gpio::{ gpiod::{PD9, PD10, PD11}, Output, PushPull, }, hal::digital::v2::OutputPin, }; pub struct Leds { /// Red LED L1 pub r1: Led>>, /// Green LED L3 pub g3: Led>>, /// Green LED L4 pub g4: Led>>, } impl Leds { pub fn new(r1: PD9, g3: PD10, g4: PD11) -> Self { Leds { r1: Led::new(r1.into_push_pull_output()), g3: Led::new(g3.into_push_pull_output()), g4: Led::new(g4.into_push_pull_output()), } } } pub struct Led

{ pin: P, } impl Led

{ pub fn new(pin: P) -> Self { Led { pin } } pub fn on(&mut self) { let _ = self.pin.set_high(); } pub fn off(&mut self) { let _ = self.pin.set_low(); } }