canstat.h
Go to the documentation of this file.
1 /*
2  * Copyright 1994-2017 by KVASER AB, SWEDEN
3  *
4  * WWW: http://www.kvaser.com
5  *
6  * This software is furnished under a license and may be used and copied
7  * only in accordance with the terms of such license.
8  *
9  * \note MATLAB users on Windows: if you define WIN32_LEAN_AND_MEAN before
10  * including this file, you will see a lot less warnings.
11  *
12  */
13 
14 #ifndef _CANSTAT_H_
15 #define _CANSTAT_H_
16 
31 //
32 // Don't forget to update canGetErrorText in canlib.c if this is changed!
33 //
34 typedef enum {
39  canOK = 0,
70 
72 
98 
109 
138 
152 
159 
191  canERR_DISK = -35,
195  canERR_CRC = -36,
215 
220 
225 
230 
235 
241 
247 
253 
260 
266 
267  // The last entry - a dummy so we know where NOT to place a comma.
269 } canStatus;
276 #define CANSTATUS_SUCCESS(X) ((X) == canOK)
277 #define CANSTATUS_FAILURE(X) ((X) != canOK)
278 
286 #define canEVENT_RX 32000
287 #define canEVENT_TX 32001
288 #define canEVENT_ERROR 32002
289 #define canEVENT_STATUS 32003
290 #define canEVENT_ENVVAR 32004
291 # define canEVENT_BUSONOFF 32005
292 # define canEVENT_REMOVED 32006
293 
306 #define canNOTIFY_NONE 0
307 #define canNOTIFY_RX 0x0001
308 #define canNOTIFY_TX 0x0002
309 #define canNOTIFY_ERROR 0x0004
310 #define canNOTIFY_STATUS 0x0008
311 #define canNOTIFY_ENVVAR 0x0010
312 
313 # define canNOTIFY_BUSONOFF 0x0020
314 # define canNOTIFY_REMOVED 0x0040
315 
334 #define canSTAT_ERROR_PASSIVE 0x00000001
335 #define canSTAT_BUS_OFF 0x00000002
336 #define canSTAT_ERROR_WARNING 0x00000004
337 #define canSTAT_ERROR_ACTIVE 0x00000008
338 #define canSTAT_TX_PENDING 0x00000010
339 #define canSTAT_RX_PENDING 0x00000020
340 #define canSTAT_RESERVED_1 0x00000040
341 #define canSTAT_TXERR 0x00000080
342 #define canSTAT_RXERR 0x00000100
343 #define canSTAT_HW_OVERRUN 0x00000200
344 #define canSTAT_SW_OVERRUN 0x00000400
345 #define canSTAT_OVERRUN (canSTAT_HW_OVERRUN | canSTAT_SW_OVERRUN)
346 
365 #define canMSG_MASK 0x00ff
366 #define canMSG_RTR 0x0001
367 
368 
373 #define canMSG_STD 0x0002
374 #define canMSG_EXT 0x0004
375 #define canMSG_WAKEUP 0x0008
376 
377 
395 #define canMSG_NERR 0x0010
396 #define canMSG_ERROR_FRAME 0x0020
397 #define canMSG_TXACK 0x0040
398 #define canMSG_TXRQ 0x0080
399 #define canMSG_DELAY_MSG 0x0100
400 
401 // single shot flags:
402 #define canMSG_SINGLE_SHOT 0x1000000
403 #define canMSG_TXNACK 0x2000000
404 #define canMSG_ABL 0x4000000
405 
406 
416 #define canFDMSG_MASK 0xff0000
417 #define canFDMSG_EDL 0x010000
418 #define canFDMSG_FDF 0x010000
419 #define canFDMSG_BRS 0x020000
420 #define canFDMSG_ESI 0x040000
421 
435 #define canMSGERR_MASK 0xff00
436 // 0x0100 reserved
437 #define canMSGERR_HW_OVERRUN 0x0200
438 #define canMSGERR_SW_OVERRUN 0x0400
439 #define canMSGERR_STUFF 0x0800
440 #define canMSGERR_FORM 0x1000
441 #define canMSGERR_CRC 0x2000
442 #define canMSGERR_BIT0 0x4000
443 #define canMSGERR_BIT1 0x8000
444 
445 // Convenience values for the message error flags.
446 #define canMSGERR_OVERRUN 0x0600
447 #define canMSGERR_BIT 0xC000
448 #define canMSGERR_BUSERR 0xF800
449 
450 
463 #define canTRANSCEIVER_LINEMODE_NA 0
464 #define canTRANSCEIVER_LINEMODE_SWC_SLEEP 4
465 #define canTRANSCEIVER_LINEMODE_SWC_NORMAL 5
466 #define canTRANSCEIVER_LINEMODE_SWC_FAST 6
467 #define canTRANSCEIVER_LINEMODE_SWC_WAKEUP 7
468 #define canTRANSCEIVER_LINEMODE_SLEEP 8
469 #define canTRANSCEIVER_LINEMODE_NORMAL 9
470 #define canTRANSCEIVER_LINEMODE_STDBY 10
471 #define canTRANSCEIVER_LINEMODE_TT_CAN_H 11
472 #define canTRANSCEIVER_LINEMODE_TT_CAN_L 12
473 #define canTRANSCEIVER_LINEMODE_OEM1 13
474 #define canTRANSCEIVER_LINEMODE_OEM2 14
475 #define canTRANSCEIVER_LINEMODE_OEM3 15
476 #define canTRANSCEIVER_LINEMODE_OEM4 16
477 
478 
484 #define canTRANSCEIVER_RESNET_NA 0
485 #define canTRANSCEIVER_RESNET_MASTER 1
486 #define canTRANSCEIVER_RESNET_MASTER_STBY 2
487 #define canTRANSCEIVER_RESNET_SLAVE 3
488 
502 // Also see src\include\hwnames.h and registered document 048.
503 #define canTRANSCEIVER_TYPE_UNKNOWN 0
504 #define canTRANSCEIVER_TYPE_251 1
505 #define canTRANSCEIVER_TYPE_252 2
506 #define canTRANSCEIVER_TYPE_DNOPTO 3
507 #define canTRANSCEIVER_TYPE_W210 4
508 #define canTRANSCEIVER_TYPE_SWC_PROTO 5
509 #define canTRANSCEIVER_TYPE_SWC 6
510 #define canTRANSCEIVER_TYPE_EVA 7
511 #define canTRANSCEIVER_TYPE_FIBER 8
512 #define canTRANSCEIVER_TYPE_K251 9
513 #define canTRANSCEIVER_TYPE_K 10
514 #define canTRANSCEIVER_TYPE_1054_OPTO 11
515 #define canTRANSCEIVER_TYPE_SWC_OPTO 12
516 #define canTRANSCEIVER_TYPE_TT 13
517 #define canTRANSCEIVER_TYPE_1050 14
518 #define canTRANSCEIVER_TYPE_1050_OPTO 15
519 #define canTRANSCEIVER_TYPE_1041 16
520 #define canTRANSCEIVER_TYPE_1041_OPTO 17
521 #define canTRANSCEIVER_TYPE_RS485 18
522 #define canTRANSCEIVER_TYPE_LIN 19
523 #define canTRANSCEIVER_TYPE_KONE 20
524 #define canTRANSCEIVER_TYPE_CANFD 22
525 #define canTRANSCEIVER_TYPE_CANFD_LIN 24
526 #define canTRANSCEIVER_TYPE_LINX_LIN 64
527 #define canTRANSCEIVER_TYPE_LINX_J1708 66
528 #define canTRANSCEIVER_TYPE_LINX_K 68
529 #define canTRANSCEIVER_TYPE_LINX_SWC 70
530 #define canTRANSCEIVER_TYPE_LINX_LS 72
531 
533 #endif
Can't find req'd config s/w (e.g. CS/SS)
Definition: canstat.h:149
Definition: canstat.h:199
Definition: canstat.h:59
Reserved.
Definition: canstat.h:136
Definition: canstat.h:76
Operation not supported by hardware or firmware.
Definition: canstat.h:134
Reserved.
Definition: canstat.h:268
Definition: canstat.h:240
Definition: canstat.h:107
Definition: canstat.h:102
Definition: canstat.h:214
Reserved.
Definition: canstat.h:137
Definition: canstat.h:133
Definition: canstat.h:143
Reserved.
Definition: canstat.h:151
Definition: canstat.h:186
Definition: canstat.h:181
Definition: canstat.h:246
Definition: canstat.h:176
Definition: canstat.h:96
Definition: canstat.h:171
Definition: canstat.h:265
Definition: canstat.h:63
Definition: canstat.h:224
The card was removed or not inserted.
Definition: canstat.h:150
Definition: canstat.h:45
Reserved.
Definition: canstat.h:135
Reserved.
Definition: canstat.h:108
Definition: canstat.h:157
Definition: canstat.h:50
Definition: canstat.h:127
Definition: canstat.h:219
canStatus
Definition: canstat.h:34
Definition: canstat.h:191
Definition: canstat.h:203
The license is not valid.
Definition: canstat.h:158
Definition: canstat.h:121
Interrupted by signals.
Definition: canstat.h:71
Definition: canstat.h:229
Definition: canstat.h:259
Definition: canstat.h:148
Definition: canstat.h:81
Error in the ini-file (16-bit only)
Definition: canstat.h:97
Definition: canstat.h:195
Definition: canstat.h:90
Definition: canstat.h:234
Definition: canstat.h:39
Definition: canstat.h:252
Definition: canstat.h:115
Definition: canstat.h:164
Definition: canstat.h:69