2021-03-15 06:48 AM
Hello the pin definition> 7 in the stm32f1xx_ll_gpio.h file seems to be wrong:
in fact when I use LL_GPIO_PIN_8 with the function HAL_GPIO_WritePin (GPIO_TypeDef * GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
the ODR0 bit of the port concerned is moved instead of ODR8.
Also when I try to move the LL_GPIO_PIN_6 pin, the HAL_GPIO_WritePin function moves ODR6 and ODR14 ....
Is it really a mistake or am I making a mistake?
---------------
This group of definitions seems completely wrong to work with HAL_GPIO_WritePin function.
I can't understand what the << GPIO_PIN_MASK_POS (8 bit) scrolling is for, which generates the command on two pins when the selected pin is less than 8.
Furthermore, the following Or is even more mysterious ....
Solved! Go to Solution.
2021-03-15 09:15 AM
>> in fact when I use LL_GPIO_PIN_8 with the function HAL_GPIO_WritePin (GPIO_TypeDef * GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
You can't use LL definitions (LL_GPIO_PIN_8) with HAL_GPIO_WritePin, which is a HAL function.
Pin can be a mask like : GPIO_PIN_0 | GPIO_PIN_5 etc...
You need to use what is inside stm32f1xx_hal_gpio.h
If you need to use LL_GPIO_PIN_8, you have to use LL functions.
2021-03-15 09:15 AM
>> in fact when I use LL_GPIO_PIN_8 with the function HAL_GPIO_WritePin (GPIO_TypeDef * GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
You can't use LL definitions (LL_GPIO_PIN_8) with HAL_GPIO_WritePin, which is a HAL function.
Pin can be a mask like : GPIO_PIN_0 | GPIO_PIN_5 etc...
You need to use what is inside stm32f1xx_hal_gpio.h
If you need to use LL_GPIO_PIN_8, you have to use LL functions.
2021-03-15 09:24 AM
Ah.... As often happens, the error was so stupid that it seemed like a difficult problem !!
Thanks Mike_ST