void Vortex86CAN::begin(uint32_t speed) { if (can != NULL) com_Close(can); if ((can = com_Init(CAN_BUS)) == NULL) return; com_SetBPS(can, speed); com_SetTimeOut(can, 1000UL); com_EnableBypass(can); }
bool cm_init(void) { if (io_Init() == false) return false; sb_Write(0xc0, sb_Read(0xc0) & 0x7fffffffL | ((unsigned long)1UL << 31)); io_Close(); //com_SetUSBPins(2, 0, 2, 1); if ((Serial = com_Init(COM4)) == NULL) return false; com_SetTimeOut(Serial, 0); com_SetBPS(Serial, COM_UARTBAUD_1000000BPS); com_SetFormat(Serial, BYTESIZE8 + STOPBIT1 + NOPARITY); com_SetFlowControl(Serial, NO_CONTROL); com_EnableFIFO(Serial, FIFO_032); return true; }