cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE 1.1.0 LL GPIO bug? (stm32g0xx_ll_gpio.h)

BCoch
Senior

Shouldn't these be (Pin * 2U) , or (Pin + Pin)?

__STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)
{
  MODIFY_REG(GPIOx->MODER, ((Pin * Pin) * GPIO_MODER_MODE0), ((Pin * Pin) * Mode));
}
 
__STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin)
{
  return (uint32_t)(READ_BIT(GPIOx->MODER, ((Pin * Pin) * GPIO_MODER_MODE0)) / (Pin * Pin));
}

1 REPLY 1
BCoch
Senior

Never mind. It's fine. :smiling_face_with_smiling_eyes: