/* Set Baud Rate of MCAN. 
This function set the baud rate of MCAN. */
static void MCAN_SetBaudRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t baudRateA_Bps)
/* Set Baud Rate of MCAN. 
This function set the baud rate of MCAN. */
static void MCAN_SetBaudRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t baudRateA_Bps)
{
    mcan_timing_config_t timingConfigA;
    uint32_t preDivA = baudRateA_Bps * MCAN_TIME_QUANTA_NUM;
    if (0 == preDivA)
    {
        preDivA = 1U;
    }
    preDivA = (sourceClock_Hz / preDivA) - 1U;
    if (preDivA > 0x1FFU)
    {
        preDivA = 0x1FFU;
    }
    timingConfigA.preDivider = preDivA;
    timingConfigA.seg1 = 0xAU;
    timingConfigA.seg2 = 0x3U;
    timingConfigA.rJumpwidth = 0x3U;
    MCAN_SetArbitrationTimingConfig(base, &timingConfigA);
}