/* Lock the GPIO prot. Once locked, can only change the output data. Only when the CPU reset to unlock the GPIO port.  */
void ald_gpio_lock_pin(GPIO_TypeDef *GPIOx, uint16_t pin)
/* Lock the GPIO prot. Once locked, can only change the output data. Only when the CPU reset to unlock the GPIO port.  */
void ald_gpio_lock_pin(GPIO_TypeDef *GPIOx, uint16_t pin)
{
    assert_param(IS_GPIO_PORT(GPIOx));
    assert_param(IS_GPIO_PIN(pin));
    MODIFY_REG(GPIOx->LOCK, GPIO_LOCK_KEY_MSK, ALD_UNLOCK_KEY << GPIO_LOCK_KEY_POSS);
    WRITE_REG(GPIOx->LOCK, pin);
    return;
}