/* param base MCAN peripheral base address. param sourceClock_Hz Source Clock in Hz. param baudRate_Bps Baud Rate in Bps. return kStatus_Success - Set CAN baud rate (only has Nominal phase) successfully.  */
status_t MCAN_SetBaudRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Bps)
/* param base MCAN peripheral base address. param sourceClock_Hz Source Clock in Hz. param baudRate_Bps Baud Rate in Bps. return kStatus_Success - Set CAN baud rate (only has Nominal phase) successfully.  */
status_t MCAN_SetBaudRate(CAN_Type *base, uint32_t sourceClock_Hz, uint32_t baudRate_Bps)
{
    mcan_timing_config_t timingCfg;
    if (MCAN_CalculateImprovedTimingValues(baudRate_Bps, sourceClock_Hz, &timingCfg))
    {
        base->CCCR |= CAN_CCCR_INIT_MASK;
        while (0U == (base->CCCR & CAN_CCCR_INIT_MASK))
        {
        }
        base->CCCR |= CAN_CCCR_CCE_MASK;
        MCAN_SetArbitrationTimingConfig(base, &timingCfg);
        MCAN_EnterNormalMode(base);
        return kStatus_Success;
    }
    else
    {
        return kStatus_Fail;
    }
}