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 
296 #define canEVENT_ENVVAR 32004
297 #define canEVENT_BUSONOFF 32005
298 #define canEVENT_REMOVED 32006
299 
312 #define canNOTIFY_NONE 0
313 #define canNOTIFY_RX 0x0001
314 #define canNOTIFY_TX 0x0002
315 #define canNOTIFY_ERROR 0x0004
316 #define canNOTIFY_STATUS 0x0008
317 #define canNOTIFY_ENVVAR 0x0010
318 
319 #define canNOTIFY_BUSONOFF 0x0020
320 #define canNOTIFY_REMOVED 0x0040
321 
340 #define canSTAT_ERROR_PASSIVE 0x00000001
341 #define canSTAT_BUS_OFF 0x00000002
342 #define canSTAT_ERROR_WARNING 0x00000004
343 #define canSTAT_ERROR_ACTIVE 0x00000008
344 #define canSTAT_TX_PENDING 0x00000010
345 #define canSTAT_RX_PENDING 0x00000020
346 #define canSTAT_RESERVED_1 0x00000040
347 #define canSTAT_TXERR 0x00000080
348 #define canSTAT_RXERR 0x00000100
349 #define canSTAT_HW_OVERRUN 0x00000200
350 #define canSTAT_SW_OVERRUN 0x00000400
351 #define canSTAT_OVERRUN (canSTAT_HW_OVERRUN | canSTAT_SW_OVERRUN)
352 
371 #define canMSG_MASK 0x00ff
372 #define canMSG_RTR 0x0001
373 
374 
379 #define canMSG_STD 0x0002
380 #define canMSG_EXT 0x0004
381 #define canMSG_WAKEUP 0x0008
382 
383 
401 #define canMSG_NERR 0x0010
402 #define canMSG_ERROR_FRAME 0x0020
403 #define canMSG_TXACK 0x0040
404 #define canMSG_TXRQ 0x0080
405 #define canMSG_DELAY_MSG 0x0100
406 
407 #define canMSG_LOCAL_TXACK 0x10000000
408 
409 // single shot flags:
410 #define canMSG_SINGLE_SHOT 0x1000000
411 #define canMSG_TXNACK 0x2000000
412 #define canMSG_ABL 0x4000000
413 
414 
424 #define canFDMSG_MASK 0xff0000
425 #define canFDMSG_EDL 0x010000
426 #define canFDMSG_FDF 0x010000
427 #define canFDMSG_BRS 0x020000
428 #define canFDMSG_ESI 0x040000
429 
443 #define canMSGERR_MASK 0xff00
444 // 0x0100 reserved
445 #define canMSGERR_HW_OVERRUN 0x0200
446 #define canMSGERR_SW_OVERRUN 0x0400
447 #define canMSGERR_STUFF 0x0800
448 #define canMSGERR_FORM 0x1000
449 #define canMSGERR_CRC 0x2000
450 #define canMSGERR_BIT0 0x4000
451 #define canMSGERR_BIT1 0x8000
452 
453 // Convenience values for the message error flags.
454 #define canMSGERR_OVERRUN 0x0600
455 #define canMSGERR_BIT 0xC000
456 #define canMSGERR_BUSERR 0xF800
457 
458 
460 #define canMSG_RESERVED_FOR_EXTENDING 0x80000000
461 
462 
473 #define canTRANSCEIVER_LINEMODE_NA 0
474 #define canTRANSCEIVER_LINEMODE_SWC_SLEEP 4
475 #define canTRANSCEIVER_LINEMODE_SWC_NORMAL 5
476 #define canTRANSCEIVER_LINEMODE_SWC_FAST 6
477 #define canTRANSCEIVER_LINEMODE_SWC_WAKEUP 7
478 #define canTRANSCEIVER_LINEMODE_SLEEP 8
479 #define canTRANSCEIVER_LINEMODE_NORMAL 9
480 #define canTRANSCEIVER_LINEMODE_STDBY 10
481 #define canTRANSCEIVER_LINEMODE_TT_CAN_H 11
482 #define canTRANSCEIVER_LINEMODE_TT_CAN_L 12
483 #define canTRANSCEIVER_LINEMODE_OEM1 13
484 #define canTRANSCEIVER_LINEMODE_OEM2 14
485 #define canTRANSCEIVER_LINEMODE_OEM3 15
486 #define canTRANSCEIVER_LINEMODE_OEM4 16
487 
488 
494 #define canTRANSCEIVER_RESNET_NA 0
495 #define canTRANSCEIVER_RESNET_MASTER 1
496 #define canTRANSCEIVER_RESNET_MASTER_STBY 2
497 #define canTRANSCEIVER_RESNET_SLAVE 3
498 
512 // Also see src\include\hwnames.h and registered document 048.
513 #define canTRANSCEIVER_TYPE_UNKNOWN 0
514 #define canTRANSCEIVER_TYPE_251 1
515 #define canTRANSCEIVER_TYPE_252 2
516 #define canTRANSCEIVER_TYPE_DNOPTO 3
517 #define canTRANSCEIVER_TYPE_W210 4
518 #define canTRANSCEIVER_TYPE_SWC_PROTO 5
519 #define canTRANSCEIVER_TYPE_SWC 6
520 #define canTRANSCEIVER_TYPE_EVA 7
521 #define canTRANSCEIVER_TYPE_FIBER 8
522 #define canTRANSCEIVER_TYPE_K251 9
523 #define canTRANSCEIVER_TYPE_K 10
524 #define canTRANSCEIVER_TYPE_1054_OPTO 11
525 #define canTRANSCEIVER_TYPE_SWC_OPTO 12
526 #define canTRANSCEIVER_TYPE_TT 13
527 #define canTRANSCEIVER_TYPE_1050 14
528 #define canTRANSCEIVER_TYPE_1050_OPTO 15
529 #define canTRANSCEIVER_TYPE_1041 16
530 #define canTRANSCEIVER_TYPE_1041_OPTO 17
531 #define canTRANSCEIVER_TYPE_RS485 18
532 #define canTRANSCEIVER_TYPE_LIN 19
533 #define canTRANSCEIVER_TYPE_KONE 20
534 #define canTRANSCEIVER_TYPE_CANFD 22
535 #define canTRANSCEIVER_TYPE_CANFD_LIN 24
536 #define canTRANSCEIVER_TYPE_LINX_LIN 64
537 #define canTRANSCEIVER_TYPE_LINX_J1708 66
538 #define canTRANSCEIVER_TYPE_LINX_K 68
539 #define canTRANSCEIVER_TYPE_LINX_SWC 70
540 #define canTRANSCEIVER_TYPE_LINX_LS 72
541 
543 #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