/* Locks GPIO Pins configuration registers until next system reset.  */
void GPIO_PinLockConfig(GPIO_TypeDef *gpio, u16 pin)
/* Locks GPIO Pins configuration registers until next system reset.  */
void GPIO_PinLockConfig(GPIO_TypeDef *gpio, u16 pin)
{
    gpio->LCKR = GPIO_LCKR_LCKK | pin;
    gpio->LCKR = pin;
    gpio->LCKR = GPIO_LCKR_LCKK | pin;
    gpio->LCKR;
    gpio->LCKR;
}