00001
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00058 #if !CANPAR_FILE_HEADER_INCLUDE
00059 #define CANPAR_FILE_HEADER_INCLUDE
00060
00061 #if _MSC_VER > 1000
00062 #pragma once
00063 #endif // _MSC_VER > 1000
00064
00065
00066
00067
00068
00069
00074 #define CANPAR_VERSION 4
00075
00076
00077
00078
00079
00080
00081
00082
00083 #ifndef CAN_DRIVER_FOR_LINUX
00084
00085 #define FILE_DEVICE_CANPAR FILE_DEVICE_PARALLEL_PORT
00086 #define IOCTL_IO_1 CTL_CODE(FILE_DEVICE_CANPAR, 0x801, METHOD_BUFFERED, FILE_ANY_ACCESS)
00087 #define IOCTL_IO_2 CTL_CODE(FILE_DEVICE_CANPAR, 0x802, METHOD_BUFFERED, FILE_ANY_ACCESS)
00088 #define IOCTL_IO_3 CTL_CODE(FILE_DEVICE_CANPAR, 0x803, METHOD_BUFFERED, FILE_ANY_ACCESS)
00089 #define IOCTL_IO_4 CTL_CODE(FILE_DEVICE_CANPAR, 0x804, METHOD_BUFFERED, FILE_ANY_ACCESS)
00090 #define IOCTL_IO_5 CTL_CODE(FILE_DEVICE_CANPAR, 0x805, METHOD_BUFFERED, FILE_ANY_ACCESS)
00091
00092 #define IOCTL_IO_7 CTL_CODE(FILE_DEVICE_CANPAR, 0x807, METHOD_BUFFERED, FILE_ANY_ACCESS)
00093 #define IOCTL_IO_8 CTL_CODE(FILE_DEVICE_CANPAR, 0x808, METHOD_BUFFERED, FILE_ANY_ACCESS)
00094 #define IOCTL_IO_9 CTL_CODE(FILE_DEVICE_CANPAR, 0x809, METHOD_BUFFERED, FILE_ANY_ACCESS)
00095 #define IOCTL_IO_10 CTL_CODE(FILE_DEVICE_CANPAR, 0x810, METHOD_BUFFERED, FILE_ANY_ACCESS)
00096 #define IOCTL_IO_11 CTL_CODE(FILE_DEVICE_CANPAR, 0x811, METHOD_BUFFERED, FILE_ANY_ACCESS)
00097 #define IOCTL_IO_12 CTL_CODE(FILE_DEVICE_CANPAR, 0x812, METHOD_BUFFERED, FILE_ANY_ACCESS)
00098 #define IOCTL_IO_13 CTL_CODE(FILE_DEVICE_CANPAR, 0x813, METHOD_BUFFERED, FILE_ANY_ACCESS)
00099 #define IOCTL_IO_14 CTL_CODE(FILE_DEVICE_CANPAR, 0x814, METHOD_BUFFERED, FILE_ANY_ACCESS)
00100 #define IOCTL_IO_15 CTL_CODE(FILE_DEVICE_CANPAR, 0x815, METHOD_BUFFERED, FILE_ANY_ACCESS)
00101 #define IOCTL_IO_16 CTL_CODE(FILE_DEVICE_CANPAR, 0x816, METHOD_BUFFERED, FILE_ANY_ACCESS)
00102 #define IOCTL_IO_17 CTL_CODE(FILE_DEVICE_CANPAR, 0x817, METHOD_BUFFERED, FILE_ANY_ACCESS)
00103
00104 #else
00105
00106
00107 #define CANPAR_IOC_MAGIC 'j'
00108
00109 #define IOCTL_IO_1 _IO(CANPAR_IOC_MAGIC, 1)
00110 #define IOCTL_IO_2 _IO(CANPAR_IOC_MAGIC, 2)
00111 #define IOCTL_IO_3 _IO(CANPAR_IOC_MAGIC, 3)
00112 #define IOCTL_IO_4 _IO(CANPAR_IOC_MAGIC, 4)
00113 #define IOCTL_IO_5 _IO(CANPAR_IOC_MAGIC, 5)
00114 #define IOCTL_IO_7 _IO(CANPAR_IOC_MAGIC, 7)
00115 #define IOCTL_IO_8 _IO(CANPAR_IOC_MAGIC, 8)
00116 #define IOCTL_IO_9 _IO(CANPAR_IOC_MAGIC, 9)
00117 #define IOCTL_IO_10 _IO(CANPAR_IOC_MAGIC, 10)
00118 #define IOCTL_IO_11 _IO(CANPAR_IOC_MAGIC, 11)
00119 #define IOCTL_IO_12 _IO(CANPAR_IOC_MAGIC, 12)
00120 #define IOCTL_IO_13 _IO(CANPAR_IOC_MAGIC, 13)
00121 #define IOCTL_IO_14 _IO(CANPAR_IOC_MAGIC, 14)
00122 #define IOCTL_IO_15 _IO(CANPAR_IOC_MAGIC, 15)
00123 #define IOCTL_IO_16 _IO(CANPAR_IOC_MAGIC, 16)
00124
00125
00126
00127
00128
00129
00130 struct ioctlTransfer
00131 {
00132 void *lpvInBuffer;
00133 int cbInBuffer;
00134 void *lpvOutBuffer;
00135 int cbOutBuffer;
00136 int cbBytesReturned;
00137 };
00138 #endif
00139
00140
00141
00142
00151 #define CAN_COMMAND_STANDBY 1
00152 #define CAN_COMMAND_ABORT_TRANSMISSION 2
00153 #define CAN_COMMAND_CLEAR_OVERRUN 3
00154 #define CAN_COMMAND_STANDBY_OFF 4
00155 #define CAN_COMMAND_DIFF_FRAMES_ON 5
00156 #define CAN_COMMAND_DIFF_FRAMES_OFF 6
00157 // Verwendbar im PELICAN-CAN Modus
00158 #define CAN_COMMAND_SELF_RECEPTION_REQUEST 0x80
00159 #define CAN_COMMAND_LISTEN_ON 0x81
00160 #define CAN_COMMAND_LISTEN_OFF 0x82
00168
00169
00174 typedef struct HighLow
00175 {
00176 unsigned long low;
00177 unsigned long high;
00178 }HIGHLOW;
00179
00180
00181
00182
00183
00184
00194 #define EV2PRG_ERROR 1
00195 #define EV2PRG_RECEIVED 2
00196 #define EV2PRG_TRANSMIT 3
00197 #define EV2PRG_BUSERROR 4
00198 #define EV2PRG_OVERRUN 5
00199 #define EV2PRG_WAKEUP 6
00201 // neu für PELICAN-Modus
00202 #define EV2PRG_WARNING 7
00203 #define EV2PRG_PASSIVE 8
00204 #define EV2PRG_ARBITRATION 9
00206 // neu für Demo
00207 #define EV2PRG_BAUDRATE_DEMO 10
00209 // neu zur Unterscheidung in Standard Frames und Extended Frames
00210 #define EV2PRG_RECEIVED_STD 11
00211 #define EV2PRG_RECEIVED_EXT 12
00212 #define EV2PRG_TRANSMIT_STD 13
00213 #define EV2PRG_TRANSMIT_EXT 14
00224 struct ISRInfo
00225 {
00226
00227 unsigned long msg;
00228 HIGHLOW timeStamp;
00229 unsigned long canIdentifier;
00230 unsigned long lost;
00231 unsigned char canRTR;
00232 unsigned char canDLC;
00233 unsigned char status;
00234 char intern;
00235 short isrNummer;
00236 unsigned char canMsg[8];
00237 };
00238
00239 typedef struct InitISRFunctions
00240 {
00241 unsigned long pCallback;
00242 unsigned long refData;
00243 }INITISRFUNCTIONS;
00244
00245
00246
00250 #define OS_WINDOWS9x 1
00251 #define OS_WINDOWSNT4 2
00252 #define OS_WINDOWS2K 3
00253
00255 #define OS_LINUX 4
00259 #define TIME_DIVIDER_WIN9X (1250)
00260 #define TIME_DIVIDER_WINNT4 (1250*8)
00269 typedef struct CanParInfo
00270 {
00271 unsigned long version;
00272 HIGHLOW time;
00273 unsigned char card;
00274 unsigned char os;
00275 }CANPARINFO;
00276
00277 #endif