/* Deinitializes the UARTx peripheral registers to their default reset values.  */
void UART_DeInit(UART_TypeDef *UARTx)
/* Deinitializes the UARTx peripheral registers to their default reset values.  */
void UART_DeInit(UART_TypeDef *UARTx)
{
    assert_param(IS_UART_ALL_PERIPH(UARTx));
    switch (*(uint32_t*)&UARTx)
    {
    case UART1_BASE:
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_UART1, ENABLE);
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_UART1, DISABLE);
        break;
    case UART2_BASE:
        RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART2, ENABLE);
        RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART2, DISABLE);
        break;
    case UART3_BASE:
        RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART3, ENABLE);
        RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART3, DISABLE);
        break;       
    default:
        break;
    }
}