2024-11-21 11:04 AM - edited 2024-11-21 11:06 AM
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);
...
}
2024-11-21 11:29 AM
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.
2024-11-21 11:31 AM
FYI Full source code to the libraries is provided, so you can review it, and expand upon it.
2024-11-21 11:48 AM
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:
You can write all the bits at once (by oring).
See also this link. LL_GPIO_PIN_ALL value is the oring of all pins.