/* This function replaces the original UARTConfigSet() API and performs the same actions. A macro is provided in  */
void UARTConfigSetExpClk(unsigned long ulBase, unsigned long ulUARTClk, unsigned long ulBaud, unsigned long ulConfig)
/* This function replaces the original UARTConfigSet() API and performs the same actions. A macro is provided in  */
void UARTConfigSetExpClk(unsigned long ulBase, unsigned long ulUARTClk, unsigned long ulBaud, unsigned long ulConfig)
{
    unsigned long ulDiv;
    ASSERT(UARTBaseValid(ulBase));
    ASSERT(ulBaud != 0);
    ASSERT(ulUARTClk >= (ulBaud * UART_CLK_DIVIDER));
    UARTDisable(ulBase);
    if((ulBaud * 16) > ulUARTClk)
    {
        HWREG(ulBase + UART_O_CTL) |= UART_CTL_HSE;
        ulBaud /= 2;
    }
    else
    {
        HWREG(ulBase + UART_O_CTL) &= ~(UART_CTL_HSE);
    }
    ulDiv = (((ulUARTClk * 8) / ulBaud) + 1) / 2;
    HWREG(ulBase + UART_O_IBRD) = ulDiv / 64;
    HWREG(ulBase + UART_O_FBRD) = ulDiv % 64;
    HWREG(ulBase + UART_O_LCRH) = ulConfig;
    HWREG(ulBase + UART_O_FR) = 0;
    UARTEnable(ulBase);
}