/* File: BASICCAN.h Purpose: routines for handling the SJA1000 in BasicCAN mode Autor: M. Czamai, PEAK-System Technik GmbH, Darmstadt, Germany Date: 11/2000 */ #ifndef __BASICCAN_H__ #define __BASICCAN_H__ #include "MyTypes.H" // custom datatypes #include "SJA1000.h" // structure of a single CAN message typedef struct tagCANMsg { WORD wID; // CAN ID bool fRTR; // Remote Request bit BYTE bLen; // message length in bytes BYTE bData[8]; // data DWORD dwRCVCnt; // number of received messages DWORD dwXMTCnt; // number of transmitted messages bool fIsNewMsg; // indicator to detect a new received message BYTE bCIdx; // index of the CAN controller: - on reiving msg: where it came from }CANMsg; // - on tranmitting: which controller to target bool CANRead(CANMsg& Msg); // read the received CAN message bool CANWrite(CANMsg& Msg); // write the given CAN message to the bus #endif // __BASICCAN_H__