2016-07-25 05:34 AM
When we setup a GPIO pin for Alternate function, their is only option for Alternate function output. Even if some alternate functions are actually input to the peripheral (like USART_RX, Timer Capture Input etc). Even in those case we have to configure them like Alternate Output Pushpull type. Why?
It seems like if we make them alternate function pushpul and default ODR value is 0, then it will pull down the level on the physical pin.
2016-07-25 09:52 AM
Depends on the STM32 Family, but
In AF mode the peripheral controls the driver more directly, it can enable the input/output for bidirectional use cases.The pin can be in OD or PP mode, depending on the signalling requirements.The pin can have a pull up or down, or neither.Flexibility is a good thing, review the pin-driver diagram, and don't try to overthink things, it is not that complicated.