STM32 GPIO – Configuring Push-Pull and Pull-Down Simultaneously

gpiopulldownpulluppush-pullstm32

In CubeMX, there is still "pull-up" and "pull-down" options listed for an output while that output is already configured as "push-pull". How does it make sense to configure an output as both "Pull-up/down" and "Push-pull" at the same time?

enter image description here

How could a pull-up or pull-down resistor make any electrical difference (benefits) on a push-pull output?

Best Answer

The pull-up or pull-down would make sense if the IO pin is configured to be an input, or at least a pull-up would make sense if it is configured to be an open-drain output.

Not all combinations that are possible to select in hardware and software are useful. It really does not make sense to be a push-pull output with pull-down resistor enabled.

But, for example, it might make sense to have a pull-up or pull-down, if the IO pin is for example used as a bi-directional data bus for a memory chip, or SDIO card, or something along that line.