source: pacpussensors/trunk/CanGateway/driver/kvaser/windows/obsolete.h@ 107

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

move files in windows folder

File size: 9.5 KB
Line 
1/**
2 * \section LICENSE
3 * Copyright 1998-2011 by KVASER AB, SWEDEN
4 *
5 * WWW: http://www.kvaser.com
6 *
7 * This software is furnished under a license and may be used and copied
8 * only in accordance with the terms of such license.
9 *
10 * \section DESCRIPTION
11 *
12 * This file contains definitions which are retained for compatibility.
13 *
14 * \file obsolete.h
15 * \author Kvaser AB
16 */
17
18#ifndef _OBSOLETE_H_
19#define _OBSOLETE_H_
20
21/**
22 * \defgroup Obsolete Obsolete API Reference
23 * @{
24 */
25
26#define canCIRCUIT_ANY -1 ///< Any circuit will do \warning Obsolete!
27#define canCARD_ANY -1 ///< Any card will do \warning Obsolete!
28#define canCHANNEL_ANY -1 ///< Any channel will do \warning Obsolete!
29
30#define CANID_METAMSG (-1L) ///< Like msgs containing bus status changes. \warning Obsolete!
31#define CANID_WILDCARD (-2L) ///< We don't care or don't know. \warning Obsolete!
32
33/**
34 * Retained for compatibility.
35 */
36
37/**
38 * \warning Obsolete!
39 */
40typedef void* (*canMemoryAllocator) (size_t size);
41
42/**
43 * \warning Obsolete!
44 */
45typedef void (*canMemoryDeallocator)(void* p);
46
47/**
48 * \warning Obsolete!
49 */
50typedef struct tagCanHWDescr {
51 int circuitType;
52 int cardType;
53 int channel;
54} canHWDescr;
55
56/**
57 * \warning Obsolete!
58 */
59typedef struct tagCanSWDescr {
60 unsigned int rxBufSize;
61 unsigned int txBufSize;
62 canMemoryAllocator alloc;
63 canMemoryDeallocator deAlloc;
64} canSWDescr;
65
66#ifdef __WIN32__
67/**
68 * \warning Obsolete!
69 */
70typedef struct {
71 unsigned int size;
72 unsigned int rxBufSize;
73 unsigned int txBufSize;
74} canSWDescriptorEx;
75#endif
76
77/**
78 * \warning Obsolete!
79 */
80canStatus CANLIBAPI canLocateHardware(void);
81
82/**
83 * \warning Obsolete!
84 */
85int CANLIBAPI canOpen(const canHWDescr * const hwdescr,
86 const canSWDescr * const swdescr,
87 const unsigned int flags);
88
89/**
90 * \warning Obsolete!
91 */
92canStatus CANLIBAPI canGetCircuits(int * context,
93 char * name,
94 char * vendor,
95 char * version,
96 unsigned int * cardtype,
97 unsigned int * circtype,
98 unsigned int * channel);
99
100/**
101 * \name Some obsolete codes; they are not used nowadays.
102 * \warning Obsolete!
103 * @{
104 */
105#define canERR_BUFOFL canERR_RESERVED_3 ///< "Buffer overflow" \warning Obsolete!
106#define canERR_REINIT canERR_RESERVED_4 ///< "Reinitialization failed" \warning Obsolete!
107#define canERR_MSGLOST canERR_RESERVED_5 ///< "Message lost by CAN-chip" \warning Obsolete!
108#define canERR_OVERRUN canERR_RESERVED_6 ///< "Receive buffer overrun" \warning Obsolete!
109#define canERR_CARDCOMMFAILED canERR_RESERVED_7 ///< "Can't communicate with the card" \warning Obsolete!
110/** @} */
111
112/**
113 * \name Circuit status flags, retained for compatibility
114 * \warning Obsolete!
115 * @{
116 */
117#define canCIRCSTAT_ERROR_PASSIVE 0x0001 ///< Error passive \warning Obsolete!
118#define canCIRCSTAT_BUS_OFF 0x0002 ///< Bus off \warning Obsolete!
119#define canCIRCSTAT_ERROR_WARNING 0x0004 ///< Error counter > 96 \warning Obsolete!
120/** @} */
121
122/**
123 * \name Sticky status flags
124 * \warning Obsolete!
125 * @{
126 */
127#define canSTICKY_ACK_ERROR 0x80000801 ///< \warning Obsolete!
128#define canSTICKY_FORM_ERROR 0x80000002 ///< \warning Obsolete!
129#define canSTICKY_STUFF_ERROR 0x80000004 ///< \warning Obsolete!
130#define canSTICKY_CRC_ERROR 0x80000008 ///< \warning Obsolete!
131#define canSTICKY_BIT0_ERROR 0x80000010 ///< \warning Obsolete!
132#define canSTICKY_BIT1_ERROR 0x80000020 ///< \warning Obsolete!
133#define canSTICKY_HW_OVERRUN 0x80000040 ///< \warning Obsolete!
134#define canSTICKY_SW_OVERRUN 0x80000080 ///< \warning Obsolete!
135/** @} */
136
137#define canSTAT_INACTIVE canSTAT_RESERVED_1 ///< The circuit is not active (removed from the sw bus) \warning Obsolete!
138
139
140/*
141#define canCIRCSTAT_TXERR 0x0001 // TX error has occurred
142#define canCIRCSTAT_RXERR 0x0002 // Receive error has occurred
143#define canCIRCSTAT_OVERRUN 0x0004 // Receiver overrun
144#define canCIRCSTAT_WAKEUP 0x0008 // Wakeup has occurred
145#define canCIRCSTAT_INT 0x0010 // ??
146#define canCIRCSTAT_ACK 0x0020 // ACK error
147#define canCIRCSTAT_BIT 0x0040 // Bit error
148*/
149/*
150More apocryphs.
151#define canCIRCSTAT_OVERRUN 0x0004 // Receiver overrun
152#define canCIRCSTAT_WAKEUP 0x0008 // Wakeup has occurred
153#define canCIRCSTAT_ACK 0x0010 // ACK error
154#define canCIRCSTAT_BIT0 0x0020 // Bit error
155#define canCIRCSTAT_BIT1 0x0040 // Bit error
156#define canCIRCSTAT_BOFF 0x0080 // Chip went Bus Off
157*/
158/*
159Even more.
160#define canCIRCSTAT_BOFF_HW 0x10000L // Chip is Bus Off
161#define canCIRCSTAT_BOFF_SW 0x20000L // We are Bus Off
162*/
163
164
165/**
166 * \name Flags for canOpen
167 * \warning Obsolete! Use \ref canOPEN_xxx instead.
168 * @{
169 */
170#define canWANT_ACTIONS 0x01 ///< \warning Obsolete!
171#define canWANT_OWN_BUFFERS 0x02 ///< \warning Obsolete!
172#define canWANT_ERROR_COUNTERS 0x04 ///< \warning Obsolete!
173#define canWANT_EXCLUSIVE 0x08 ///< \warning Obsolete! Use \ref canOPEN_xxx instead.
174#define canWANT_EXTENDED 0x10 ///< \warning Obsolete! Use \ref canOPEN_xxx instead.
175#if defined(CANLIB_DECLARE_ALL)
176# define canWANT_VIRTUAL 0x20 ///< \warning Obsolete! Use \ref canOPEN_xxx instead.
177#endif
178
179/** @} */
180
181/**
182 * \name Circuit types.
183 * \warning Obsolete!
184 * @{
185 */
186// No circuit 0
187#define PCCAN_PHILIPS 1 ///< 82C200 on PCCAN 1.0 \warning Obsolete!
188#define PCCAN_INTEL526 2 ///< Not supported. \warning Obsolete!
189#define PCCAN_INTEL527 3 ///< 82527 on PCCAN 1.0 \warning Obsolete!
190#define CANCARD_NEC72005 4 ///< NEC72005 on CANCard \warning Obsolete!
191#define CIRC_VIRTUAL 5 ///< \warning Obsolete!
192#define CIRC_SJA1000 6 ///< \warning Obsolete!
193/** @} */
194
195/**
196 * \name Card types.
197 * \warning Obsolete!
198 * @{
199 */
200#define canCARD_PCCAN 1 ///< PCCAN ver 1.x (KVASER) \warning Obsolete!
201#define canCARD_CANCARD 2 ///< CANCard (Softing) \warning Obsolete!
202#define canCARD_AC2 3 ///< CAN-AC2 (Softing) \warning Obsolete!
203#define canCARD_LAPCAN 4 ///< \warning Obsolete!
204#define canCARD_ISACAN 5 ///< \warning Obsolete!
205#define canCARD_PCCAN_OEM 6 ///< Special for OEM PCcan cards. \warning Obsolete!
206/** @} */
207
208/**
209 * \name The canFlgXXX are left for compatibility.
210 * \warning Obsolete!
211 * @{
212 */
213#define canFlgACCEPT 1 ///< \warning Obsolete!
214#define canFlgREJECT 2 ///< \warning Obsolete!
215#define canFlgCODE 3 ///< \warning Obsolete!
216#define canFlgMASK 4 ///< \warning Obsolete!
217/** @} */
218
219/**
220 * \name Flags for action routines
221 * \warning Obsolete!
222 * @{
223 */
224#define canDISCARD_MESSAGE 3 ///< \warning Obsolete!
225#define canRETAIN_MESSAGE 4 ///< \warning Obsolete!
226/** @} */
227
228/**
229 * \name For busParams - sync on rising edge only or both rising and falling edge
230 * (Not supported)
231 * \warning Obsolete!
232 * @{
233 */
234#define canSLOW_MODE 0x01 ///< Sync on rising and falling edge \warning Obsolete!
235/** @} */
236
237/**
238 * \name CAN driver types; these constants are retained for compatibility.
239 * (Not supported)
240 * \warning Obsolete!
241 * @{
242 */
243#define canOFF 0 ///< \warning Obsolete!
244#define canTRISTATE 1 ///< \warning Obsolete!
245#define canPULLUP 2 ///< \warning Obsolete!
246#define canPULLDOWN 3 ///< \warning Obsolete!
247#define canPUSHPULL 4 ///< This is the usual setting. \warning Obsolete!
248#define canINVPULLUP 5 ///< \warning Obsolete!
249#define canINVPULLDOWN 6 ///< \warning Obsolete!
250#define canINVPUSHPULL 7 ///< \warning Obsolete!
251/** @} */
252
253/**
254 * \name These were never implemented.
255 * (Not supported)
256 * \warning Obsolete!
257 * @{
258 */
259#define canIOCTL_LOCAL_ECHO_ON 3 ///< \warning Obsolete!
260#define canIOCTL_LOCAL_ECHO_OFF 4 ///< \warning Obsolete!
261
262#define canMSG_STATUS 0x0008
263/** @} */
264
265#ifdef __cplusplus
266extern "C" {
267#endif
268
269/**
270 * \warning Obsolete!
271 */
272canStatus CANLIBAPI canInstallAction(int handle, long id, int (*fn)());
273
274/**
275 * \warning Obsolete!
276 */
277canStatus CANLIBAPI canUninstallAction(int handle, long id);
278
279/**
280 * \warning Obsolete!
281 */
282canStatus CANLIBAPI canInstallOwnBuffer(int handle, long id, unsigned int len,
283 void * buf);
284
285/**
286 * \warning Obsolete!
287 */
288canStatus CANLIBAPI canUninstallOwnBuffer(int handle, long id);
289#ifdef __cplusplus
290}
291#endif
292
293/** @} */
294
295#endif
Note: See TracBrowser for help on using the repository browser.