int can_reset(unsigned long int afcpu, uint32_t bps) { /* Configure CAN module */ CAN_DISABLE(); CAN_RESET(); /* Enables mob 0-14 interrupts */ CANIE1 = 0x7F; CANIE2 = 0xFF; /* Configure bitrate */ can_configure_bitrate(afcpu, bps); /* Configure MOBS */ can_configure_mobs(); /* Enable and return */ CAN_ENABLE(); CAN_SET_INTERRUPT(); return 0; }
void USB2CAN_close(void) { CAN_DISABLE(); }