cancel
Showing results for 
Search instead for 
Did you mean: 

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?

VNado.1
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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.

View solution in original post

1 REPLY 1
Peter BENSCH
ST Employee

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.