rubberduck203 / switch-hal

Rust no_std embedded-hal driver and traits for Input/Output switches (leds, transistors, buttons, switches)
Apache License 2.0
27 stars 4 forks source link

OutputPin into OutputSwitch #5

Closed rubberduck203 closed 4 years ago

rubberduck203 commented 4 years ago

Per #2, allow construction of OutputSwitch from an OutputPin via into_active_high_output_switch() and into_active_low_output_switch() methods.

i.e.

let sw = gpiob.pb4
  .into_push_pull_output()
  .into_active_high();