/* Change Logs: Date Author Notes  Bernard The first version for LPC40xx  RT_learning The first version for LPC5410x  */
static uint32_t _UART_DivClk(uint32_t pclk, uint32_t m)
/* Change Logs: Date Author Notes  Bernard The first version for LPC40xx  RT_learning The first version for LPC5410x  */
static uint32_t _UART_DivClk(uint32_t pclk, uint32_t m)
{
    uint32_t q, r, u = pclk >> 24, l = pclk << 8;
    m = m + 256;
    q = (1 << 24) / m;
    r = (1 << 24) - (q * m);
    return ((q * u) << 8) + (((r * u) << 8) + l) / m;
}