Allow STM32/STM32F1 pins to be set as Open Drain (OD) #27616
Merged
+2
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a feature update to add the ability to set pins on the STM32/STM32F1 processors to Open Drain (OD).
I noticed that the code to actually set a pin to OD is already present, it's just not exposed as a define. It is defined for the the SAMD family, but not for the RP2040, so I'm not sure if this is a deliberate design decision or not... I have deliberately not included changes for the RP2040 (although the code should be the same) as I don't have a mainboard with that processor to test with.
Requirements
A mainboard with an STM32/STM32F1 processor. It should also work for the STM32 clones (I am using it on a Creality 4.2.2 mainboard with an STM32 clone)
Benefits
This allows you to re-purpose an input pin on a STM32 based mainboard as an output pin without having to remove resistors and/or cut traces on the PCB.
As a bit of background, I'm personally using it on a project to change the Z limit switch on a Creality 4.2.2 mainboard from an input pin to an output pin, which is then connected to an IC on a custom daughterboard. With this firmware change, the mod can easily be fully reversed should the need arise.
Configurations
None
Related Issues
None