/* Reads the current settings for the CAN controller bit timing. */
void CANBitTimingGet(uint32_t ui32Base, tCANBitClkParms *psClkParms)
/* Reads the current settings for the CAN controller bit timing. */
void CANBitTimingGet(uint32_t ui32Base, tCANBitClkParms *psClkParms)
{
    uint32_t ui32BitReg;
    ASSERT(_CANBaseValid(ui32Base));
    ASSERT(psClkParms);
    ui32BitReg = HWREG(ui32Base + CAN_O_BIT);
    psClkParms->ui32Phase2Seg =
        ((ui32BitReg & CAN_BIT_TSEG2_M) >> CAN_BIT_TSEG2_S) + 1;
    psClkParms->ui32SyncPropPhase1Seg =
        ((ui32BitReg & CAN_BIT_TSEG1_M) >> CAN_BIT_TSEG1_S) + 1;
    psClkParms->ui32SJW = ((ui32BitReg & CAN_BIT_SJW_M) >> CAN_BIT_SJW_S) + 1;
    psClkParms->ui32QuantumPrescaler =
        ((ui32BitReg & CAN_BIT_BRP_M) |
         ((HWREG(ui32Base + CAN_O_BRPE) & CAN_BRPE_BRPE_M) << 6)) + 1;
}