/* Get the UART instance from peripheral base address.  */
uint32_t UART_GetInstance(UART_Type *base)
/* Get the UART instance from peripheral base address.  */
uint32_t UART_GetInstance(UART_Type *base)
{
    uint32_t instance;
    uint32_t uartArrayCount = (sizeof(s_uartBases) / sizeof(s_uartBases[0]));
    for (instance = 0; instance < uartArrayCount; instance++)
    {
        if (s_uartBases[instance] == base)
        {
            break;
        }
    }
    assert(instance < uartArrayCount);
    return instance;
}