Skip to main content
VNado.1
Associate III
December 17, 2020
Solved

Does the order of the pins assigned with GPIO_InitStruct.Pin matter? ex: PIN1 | PIN2 | PIN3 vs PIN2 | PIN1 | PIN3, does it give the same result? and what about HAL_GPIO_WritePin, does the order of the pins matter?

  • December 17, 2020
  • 1 reply
  • 603 views

..

This topic has been closed for replies.
Best answer by Peter BENSCH

The pins are represented by bits, which are put together using the OR function, so their order at the line of source doesn't matter. This applies to all similar function calls.

Good luck!

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

/Peter

1 reply

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
December 18, 2020

The pins are represented by bits, which are put together using the OR function, so their order at the line of source doesn't matter. This applies to all similar function calls.

Good luck!

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.