/* : Deinitialinzes the CAN registers to their default reset values  */
void CAN_DeInit(CAN_TypeDef *CANx)
/* : Deinitialinzes the CAN registers to their default reset values  */
void CAN_DeInit(CAN_TypeDef *CANx)
{
    assert_param(IS_CAN_ALL_PERIPH(CANx));
    switch (*(uint32_t*)&CANx)
    {
        case CAN1_BASE:
            RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN1, ENABLE);
            RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN1, DISABLE);
            break;
                case CAN2_BASE:
            RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN2, ENABLE);
            RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN2, DISABLE);
            break;
        default:
            break;
    }
}