stm32-rs / stm32g0xx-hal

Peripheral access API for STM32G0 series microcontrollers
Apache License 2.0
73 stars 51 forks source link

add fully erasable pins: allow downgrading partially erased pins (pin… #107

Closed jacobbarssbailey closed 2 years ago

jacobbarssbailey commented 2 years ago

PR to add fully erasable pins (#104)

Borrows heavily from https://github.com/stm32-rs/stm32f0xx-hal

Adds onto existing partially erasable pins, allowing a pin to be downgraded once to remove its number (as exists today), and then a second time to then remove its port as well (new).

let generic_pa_pin = gpioa.pa0.into_push_pull().downgrade(); // PAx<Output>
let generic_pin = generic_pa_pin.downgrade(); // PXx<Output>
andresv commented 2 years ago

Thanks for the PR. CI fails at the moment, could you run cargo fmt.

andresv commented 2 years ago

@dotcypress do you have any objections?