Main Page   Data Structures   File List   Data Fields   Globals  

can.h

Go to the documentation of this file.
00001 /*
00002  * can.h - can4linux CAN driver module
00003  *
00004  * Copyright (c) 2001 port GmbH Halle/Saale
00005  *------------------------------------------------------------------
00006  * $Header: /z2/cvsroot/products/0530/software/can4linux/src/can.h,v 1.1.1.1 2001/06/11 18:30:54 oe Exp $
00007  *
00008  *--------------------------------------------------------------------------
00009  *
00010  *
00011  * modification history
00012  * --------------------
00013  * $Log: can.h,v $
00014  * Revision 1.1.1.1  2001/06/11 18:30:54  oe
00015  * minimal version can4linux embedded, compile time Konfigurierbar
00016  *
00017  *
00018  *
00019  *
00020  *--------------------------------------------------------------------------
00021  */
00022 
00023 
00037 #ifndef __CAN_H
00038 #define __CAN_H
00039 
00040 
00041 #ifndef __KERNEL__
00042 #include <sys/time.h>
00043 #endif
00044  /*---------- the can message structure */
00045 
00046 #define CAN_MSG_LENGTH 8                
00049 #define MSG_RTR         (1<<0)          
00050 #define MSG_OVR         (1<<1)          
00051 #define MSG_EXT         (1<<2)          
00052 #define MSG_PASSIVE     (1<<4)          
00056 #define MSG_ERR_MASK    (MSG_OVR + MSG_PASSIVE)
00057 
00063 typedef struct {
00065     int             flags;
00066     int             cob;         
00067     unsigned   long id;          
00068     struct timeval  timestamp;   
00069     short      int  length;      
00070     unsigned   char data[CAN_MSG_LENGTH]; 
00071 } canmsg_t;
00072 
00073 
00074 
00078 #define COMMAND          0      
00079 #define CONFIG           1      
00080 #define SEND             2      
00081 #define RECEIVE          3      
00082 #define CONFIGURERTR     4      
00084 /*---------- CAN ioctl parameter types */
00085 
00088 typedef struct Command_par {
00089     int cmd;                    
00090     int error;                  
00091     unsigned long retval;       
00092 } Command_par_t ;
00093 
00094 
00097 typedef struct Config_par {
00098     int target;                 
00099     unsigned long val;          
00100     int error;                  
00101     unsigned long retval;       
00102 } Config_par_t ;
00103 
00106 typedef struct Send_par {
00107     canmsg_t *Tx;               
00108     int error;                  
00109     unsigned long retval;       
00110 } Send_par_t ;
00111 
00114 typedef struct Receive_par {
00115     canmsg_t *Rx;               
00116     int error;                  
00117     unsigned long retval;       
00118 } Receive_par_t ;
00119 
00122 typedef struct ConfigureRTR_par {
00123     unsigned message;           
00124     canmsg_t *Tx;               
00125     int error;                  
00126     unsigned long retval;       
00127 } ConfigureRTR_par_t ;
00128 
00132 # define CMD_START      1
00133 # define CMD_STOP       2
00134 # define CMD_RESET      3
00135 
00136 
00140 # define CONF_ACCM      0
00141 # define CONF_ACCC      1
00142 # define CONF_TIMING    2
00143 # define CONF_OMODE     3
00144 # define CONF_FILTER    4
00145 # define CONF_FENABLE   5
00146 # define CONF_FDISABLE  6
00147 
00148 /* # define CONF_XTDACCM        6 */
00149 
00150 
00151 #endif  /* __CAN_H */

Generated at Fri Jun 15 17:41:40 CEST 2001 CAN driver can4linux by port GmbH service@port.de , © 1997-2001