Currently the pins always implement both InputPin and OutputPin even thought the pin might not be in the correct mode, and presumably trying to use it in the wrong mode either doesn't work or causes an error.
This could be done neatly with type states and into_output style methods like many other HALs. This would also make them more convenient to use as the user then doesn't have to manually set the correct mode before constructing the pin.
Currently the pins always implement both
InputPin
andOutputPin
even thought the pin might not be in the correct mode, and presumably trying to use it in the wrong mode either doesn't work or causes an error.This could be done neatly with type states and
into_output
style methods like many other HALs. This would also make them more convenient to use as the user then doesn't have to manually set the correct mode before constructing the pin.