source: pacpussensors/trunk/CanGateway/driver/kvaser/sing.h@ 89

Last change on this file since 89 was 89, checked in by DHERBOMEZ Gérald, 9 years ago

Add KVASER CAN driver support for CanGateway component. Tested only for Windows.

File size: 8.2 KB
Line 
1/*
2** Copyright 1997 by KVASER AB
3** P.O Box 4076 S-51104 KINNAHULT, SWEDEN Tel. +46 320 15287
4**
5** This software is furnished under a license and may be used and copied
6** only in accordance with the terms of such license.
7**
8*/
9/*
10** This file replaces cancard.h from Softing GmbH.
11*/
12
13#ifndef _SING_H_
14#define _SING_H_
15
16#if defined(__WIN32__) || defined(_WIN32)
17
18# if !defined(FAR)
19# define FAR
20# endif
21# if !defined(SINGAPI)
22# define SINGAPI extern int __declspec(dllimport) __stdcall
23# endif
24
25#else
26
27# if !defined(FAR)
28# define FAR far
29# endif
30# if !defined(SINGAPI)
31# define SINGAPI extern int __export FAR PASCAL
32# endif
33
34#endif
35
36typedef struct {
37 unsigned long Ident;
38 int DataLength;
39 int RecOverrun_flag;
40 int RCV_fifo_lost_msg;
41 unsigned char RCV_data[8];
42 int AckOverrun_flag;
43 int XMT_ack_fifo_lost_acks;
44 int XMT_rmt_fifo_lost_remotes;
45 int Bus_state;
46 int Error_state;
47 int Can;
48 unsigned long Time;
49} param_struct;
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55SINGAPI INIPC_initialize_board(int address);
56
57SINGAPI CANPC_reset_board(void);
58
59SINGAPI CANPC_reset_chip(void);
60
61SINGAPI CANPC_initialize_chip (int presc, int sjw, int tseg1,
62 int tseg2, int sam);
63
64SINGAPI CANPC_initialize_chip2(int presc, int sjw, int tseg1,
65 int tseg2, int sam);
66
67SINGAPI CANPC_set_mode (int SleepMode, int SpeedMode);
68
69SINGAPI CANPC_set_mode2(int SleepMode, int SpeedMode);
70
71SINGAPI CANPC_set_acceptance (unsigned int AccCodeStd,
72 unsigned int AccMaskStd,
73 unsigned long AccCodeXtd,
74 unsigned long AccMaskXtd);
75
76SINGAPI CANPC_set_acceptance2(unsigned int AccCodeStd,
77 unsigned int AccMaskStd,
78 unsigned long AccCodeXtd,
79 unsigned long AccMaskXtd);
80
81SINGAPI CANPC_set_output_control (int OutputControl);
82
83SINGAPI CANPC_set_output_control2(int OutputControl);
84
85SINGAPI CANPC_initialize_interface(int ReceiveFifoEnable,
86 int ReceivePollAll,
87 int ReceiveEnableAll,
88 int ReceiveIntEnableAll,
89 int AutoRemoteEnableAll,
90 int TransmitReqFifoEnable,
91 int TransmitPollAll,
92 int TransmitAckEnableAll,
93 int TransmitAckFifoEnableAll,
94 int TransmitRmtFifoEnableAll);
95
96SINGAPI CANPC_enable_fifo(void);
97
98SINGAPI CANPC_optimize_rcv_speed(void);
99
100SINGAPI CANPC_enable_timestamps(void);
101
102SINGAPI CANPC_enable_fifo_transmit_ack (void);
103
104SINGAPI CANPC_enable_fifo_transmit_ack2(void);
105
106SINGAPI CANPC_get_version(int * sw_version,
107 int * fw_version,
108 int * hw_version,
109 int * license,
110 int * can_chip_type);
111
112SINGAPI CANPC_start_chip(void);
113
114SINGAPI CANPC_read_ac(param_struct * param);
115
116SINGAPI CANPC_send_data (unsigned long Ident, int Xtd,
117 int DataLength, unsigned char * pData);
118
119SINGAPI CANPC_send_data2(unsigned long Ident, int Xtd,
120 int DataLength, unsigned char * pData);
121
122SINGAPI CANPC_send_remote (unsigned long Ident, int Xtd, int DataLength);
123
124SINGAPI CANPC_send_remote2(unsigned long Ident, int Xtd, int DataLength);
125
126SINGAPI CANPC_reinitialize(void);
127
128SINGAPI CANPC_reset_rcv_fifo(void);
129
130SINGAPI CANPC_get_time(unsigned long * time);
131
132SINGAPI INIPC_close_board(void);
133
134SINGAPI CANPC_set_interrupt_event(HANDLE hEvent);
135
136SINGAPI CANPC_get_serial_number(unsigned long * ser_number);
137
138SINGAPI CANPC_get_trigger (int * level);
139
140SINGAPI CANPC_get_trigger2(int * level);
141
142SINGAPI CANPC_set_trigger (int level);
143
144SINGAPI CANPC_set_trigger2(int level);
145
146SINGAPI CANPC_get_bus_state(int Can);
147
148SINGAPI CANPC_reset_xmt_fifo(void);
149
150SINGAPI CANPC_reset_lost_msg_counter(void);
151
152SINGAPI CANPC_read_rcv_fifo_level(void);
153
154SINGAPI CANPC_read_xmt_fifo_level(void);
155
156SINGAPI CANPC_set_path(char * path);
157
158SINGAPI CANPC_enable_error_frame_detection(void);
159
160// Dummy functions.
161SINGAPI CANPC_define_cyclic (int ObjectNumber,
162 unsigned int Rate,
163 unsigned int Cycles);
164SINGAPI CANPC_define_cyclic2(int ObjectNumber,
165 unsigned int Rate,
166 unsigned int Cycles);
167SINGAPI CANPC_define_object (unsigned long Handle,
168 int FAR * ObjectNumber,
169 int Type,
170 int ReceiveIntEnable,
171 int AutoRemoteEnable,
172 int TransmitAckEnable);
173SINGAPI CANPC_define_object2(unsigned long Handle,
174 int FAR * ObjectNumber,
175 int Type,
176 int ReceiveIntEnable,
177 int AutoRemoteEnable,
178 int TransmitAckEnable);
179SINGAPI CANPC_enable_dyn_obj_buf(void);
180SINGAPI CANPC_initialize_interface(int ReceiveFifoEnable,
181 int ReceivePollAll,
182 int ReceiveEnableAll,
183 int ReceiveIntEnableAll,
184 int AutoRemoteEnable,
185 int TransmitReqFifoEnable,
186 int TransmitPollAll,
187 int TransmitAckEnableAll,
188 int TransmitAckFifoEnable,
189 int TransmitRmtFifoEnable);
190SINGAPI CANPC_read_rcv_data (int ObjectNumber,
191 unsigned char FAR * pRCV_Data,
192 unsigned long FAR * Time);
193SINGAPI CANPC_read_rcv_data2(int ObjectNumber,
194 unsigned char FAR * pRCV_Data,
195 unsigned long FAR * Time);
196SINGAPI CANPC_read_xmt_data (int ObjectNumber,
197 int FAR * pDataLength,
198 unsigned char FAR * pXMT_Data);
199SINGAPI CANPC_read_xmt_data2(int ObjectNumber,
200 int FAR * pDataLength,
201 unsigned char FAR * pXMT_Data);
202SINGAPI CANPC_send_object (int ObjectNumber,
203 int DataLength);
204SINGAPI CANPC_send_object2(int ObjectNumber,
205 int DataLength);
206SINGAPI CANPC_send_remote_object (int ObjectNumber,
207 int DataLength);
208SINGAPI CANPC_send_remote_object2(int ObjectNumber,
209 int DataLength);
210SINGAPI CANPC_supply_object_data (int ObjectNumber,
211 int DataLength,
212 unsigned char FAR * pData);
213SINGAPI CANPC_supply_object_data2(int ObjectNumber,
214 int DataLength,
215 unsigned char FAR * pData);
216SINGAPI CANPC_supply_rcv_object_data (int ObjectNumber,
217 int DataLength,
218 unsigned char FAR * pData);
219SINGAPI CANPC_supply_rcv_object_data2(int ObjectNumber,
220 int DataLength,
221 unsigned char FAR * pData);
222SINGAPI CANPC_write_object (int ObjectNumber,
223 int DataLength,
224 unsigned char FAR * pData);
225SINGAPI CANPC_write_object2(int ObjectNumber,
226 int DataLength,
227 unsigned char FAR * pData);
228
229
230
231
232// Additions.
233SINGAPI CANPC_GetEventHandle(HANDLE *h);
234SINGAPI CANPC_SetTimerRate(unsigned int rate);
235
236#ifdef __cplusplus
237}
238#endif
239
240#endif
Note: See TracBrowser for help on using the repository browser.