Driver documentation for TEWS IP810 module

For a functional description click here

Data structure

typedef struct
{
  short int	RW;            /* Mode in which Channel was opened */
  short int 	ID;            /* ID on which I/O is to happen */
  short int	Options;       /* 0 or CAN_REMOTE */
  char		Length, _1;    /* # of data bytes */
  char		Data[8];	/* at the moment only ONE message! */
} CAN_DATA;			/* 16 Bytes length */

External Variables

There are two external variables to change a part of the functionality of the driver:

External functions

There are two external functions allowing to display the status of the CANchip and to change the setting of the bus speed. The standard value is hard-coded to 250 kBit/s.

Defined Control Codes

This section describes the Control Codes for the CAN driver. Additionally, these Codes have to be set up in the CAN_DATA.RW field.

The Control Codes are only sent to the driver on IO Commands, not on OPEN or CLOSE Commands. So the process of opening is achieved via calling the IO Command with the appropriate Control Code. See CDI Driver intro!

OPEN Control Codes

   Read Codes: 	X : exclusive READ
   		W : wait for next CAN message
		R : READ with REMOTE FRAME
		AB: Read all Messages for ID not opened for READ!

CAN_CC_OPEN_R
CAN_CC_OPEN_R_X
CAN_CC_OPEN_R_W
CAN_CC_OPEN_R_WX
CAN_CC_OPEN_R_R
CAN_CC_OPEN_R_RX
CAN_CC_OPEN_AB

   Write Codes: X : exclusive WRITE


CAN_CC_OPEN_W
CAN_CC_OPEN_W_X
In these cases, exclusive means: channel must only be opened once! Any further opening is refused. For configuration purposes.

IO Codes

CAN_CC_R
CAN_CC_W

CLOSE Codes:

CAN_CC_CLOSE

Dummy Code

CAN_CC_NONE

Options

CAN_REMOTE

Startup Function call

void CANdriver();

Christof Wehner <wehner@herao1.desy.de>
Last modified: Thu Oct 27 10:17:59 1994