2022-04-20 12:40 AM
2022-04-20 12:51 AM
I don't know what's "otype PP". If you are using some Cube/HAL/LL or SPL terminology, note, that it's misleading (it comes from the STM32F1xx era, which are different than all other STM32 families are) and only what's written actually into GPIO registers matters.
If a pin is set to AF in GPIOx_MODER, its "direction" (or more precisely, whether output drivers are enabled or not) is determined by the module. If it's set as "input", i.e. output drivers are turned off (as is the case of UART Rx pins), then the setting of register determining the output behaviour (i.e. GPIOx_OTYPER) is irrelevant. Also the setting of GPIOx_ODR is irrevelant, as it is used only if the pin is set to Out in GPIOx_MODER.
Setting of GPIOx_PUPDR still applies.
JW
2022-04-20 6:12 PM
I don`t speak good English.Yes,when I learned F1, the RM book has a table to tell me usart tx is AF_PP rx is Floating_IN, so F4 is totally different.
Also the setting of GPIOx_ODR is irrevelant, as it is used only if the pin is set to Out in GPIOx_MODER
as you said up.I read the RM, I think GPIOx_ODR is irrevelant whether the pin is set to Out or not, because ODR is not connected to output control. What do you think. I get it right?
2022-04-20 10:05 PM
> I get it right?
If pin is set to AF (Alternate Function) in GPIO_MODER, yes.
JW