/* This function replaces the original CANGetBitTiming() API and performs the same actions. A macro is provided in  */
void CANBitTimingGet(unsigned long ulBase, tCANBitClkParms *pClkParms)
/* This function replaces the original CANGetBitTiming() API and performs the same actions. A macro is provided in  */
void CANBitTimingGet(unsigned long ulBase, tCANBitClkParms *pClkParms)
{
    unsigned int uBitReg;
    ASSERT(CANBaseValid(ulBase));
    ASSERT(pClkParms != 0);
    uBitReg = CANRegRead(ulBase + CAN_O_BIT);
    pClkParms->uPhase2Seg =
        ((uBitReg & CAN_BIT_TSEG2_M) >> CAN_BIT_TSEG2_S) + 1;
    pClkParms->uSyncPropPhase1Seg =
        ((uBitReg & CAN_BIT_TSEG1_M) >> CAN_BIT_TSEG1_S) + 1;
    pClkParms->uSJW = ((uBitReg & CAN_BIT_SJW_M) >> CAN_BIT_SJW_S) + 1;
    pClkParms->uQuantumPrescaler =
        ((uBitReg & CAN_BIT_BRP_M) |
         ((CANRegRead(ulBase + CAN_O_BRPE) & CAN_BRPE_BRPE_M) << 6)) + 1;
}