cancel
Showing results for 
Search instead for 
Did you mean: 

One by one port pin configuration locking

brat0x2
Associate

There is no clear information in the reference manual about port pin configuration locking one by one. For example (desired code):

 

void SomeFunction()
{
  // locking pin configuration one by one
  LL_GPIO_LockPin(GPIOA, LL_GPIO_PIN_0);
  LL_GPIO_LockPin(GPIOA, LL_GPIO_PIN_1);
  LL_GPIO_LockPin(GPIOA, LL_GPIO_PIN_2);
  ...
}

 

 

May I lock pin's configuration one by one, not all at once (see code below)?

 

void OtherFunction()
{
  // locking all pins configuration at once
  LL_GPIO_LockPin(GPIOA, LL_GPIO_PIN_2 | LL_GPIO_PIN_1 | LL_GPIO_PIN_0);
  ...
}

 

3 REPLIES 3
STTwo-32
ST Employee

Hello @brat0x2 

Yes, you can lock only 1 pin for each call of the LL_GPIO_LockPin.

Best Regards.

STTwo-32 

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.

FYI Full source code to the libraries is provided, so you can review it, and expand upon it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
SofLit
ST Employee

Hello @brat0x2 ,

You can do it with both ways, by Oring all pins or one by one, but better to lock them at once for performance reasons.

This is the register:

SofLit_0-1732218368270.png

You can write all the bits at once (by oring).

See also this linkLL_GPIO_PIN_ALL value is the oring of all pins.

 

 

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.