/* Deinitializes the USARTx peripheral registers to their default reset values.  */
void USART_DeInit(USART_TypeDef *USARTx)
/* Deinitializes the USARTx peripheral registers to their default reset values.  */
void USART_DeInit(USART_TypeDef *USARTx)
{
    assert_param(IS_USART_ALL_PERIPH(USARTx));
    if (USARTx == USART1)
    {
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, ENABLE);
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, DISABLE);
    }
    else
    {
        if (USARTx == USART2)
        {
            RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, ENABLE);
            RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, DISABLE);
        }
    }
}