![]() |
Kvaser CANLIB: Welcome to Kvaser CANLIB!
|
Data Structures | |
| struct | tagCanHWDescr |
| struct | tagCanSWDescr |
Macros | |
| #define | canCIRCUIT_ANY -1 |
| #define | canCARD_ANY -1 |
| #define | canCHANNEL_ANY -1 |
| #define | CANID_METAMSG (-1L) |
| #define | CANID_WILDCARD (-2L) |
| #define | canSTAT_INACTIVE canSTAT_RESERVED_1 |
Typedefs | |
| typedef void *(* | canMemoryAllocator) (size_t size) |
| typedef void(* | canMemoryDeallocator) (void *p) |
| typedef struct tagCanHWDescr | canHWDescr |
| typedef struct tagCanSWDescr | canSWDescr |
Functions | |
| canStatus | canLocateHardware (void) |
| int | canOpen (const canHWDescr *const hwdescr, const canSWDescr *const swdescr, const unsigned int flags) |
| canStatus | canGetCircuits (int *context, char *name, char *vendor, char *version, unsigned int *cardtype, unsigned int *circtype, unsigned int *channel) |
| canStatus | canInstallAction (int handle, long id, int(*fn)()) |
| canStatus | canUninstallAction (int handle, long id) |
| canStatus | canInstallOwnBuffer (int handle, long id, unsigned int len, void *buf) |
| canStatus | canUninstallOwnBuffer (int handle, long id) |
Some obsolete codes; they are not used nowadays. | |
| |
| #define | canERR_BUFOFL canERR_RESERVED_3 |
| #define | canERR_REINIT canERR_RESERVED_4 |
| #define | canERR_MSGLOST canERR_RESERVED_5 |
| #define | canERR_OVERRUN canERR_RESERVED_6 |
| #define | canERR_CARDCOMMFAILED canERR_RESERVED_7 |
Circuit status flags, retained for compatibility | |
| |
| #define | canCIRCSTAT_ERROR_PASSIVE 0x0001 |
| #define | canCIRCSTAT_BUS_OFF 0x0002 |
| #define | canCIRCSTAT_ERROR_WARNING 0x0004 |
retained for compatibility | |
| |
| #define | canCHANNEL_CAP_REMOTE canCHANNEL_CAP_RESERVED_1 |
Sticky status flags | |
| |
| #define | canSTICKY_ACK_ERROR 0x80000801 |
| #define | canSTICKY_FORM_ERROR 0x80000002 |
| #define | canSTICKY_STUFF_ERROR 0x80000004 |
| #define | canSTICKY_CRC_ERROR 0x80000008 |
| #define | canSTICKY_BIT0_ERROR 0x80000010 |
| #define | canSTICKY_BIT1_ERROR 0x80000020 |
| #define | canSTICKY_HW_OVERRUN 0x80000040 |
| #define | canSTICKY_SW_OVERRUN 0x80000080 |
Flags for canOpen | |
| |
| #define | canWANT_ACTIONS 0x01 |
| #define | canWANT_OWN_BUFFERS 0x02 |
| #define | canWANT_ERROR_COUNTERS 0x04 |
| #define | canWANT_EXCLUSIVE 0x08 |
| #define | canWANT_EXTENDED 0x10 |
| #define | canWANT_VIRTUAL 0x20 |
Circuit types. | |
| |
| #define | PCCAN_PHILIPS 1 |
| #define | PCCAN_INTEL526 2 |
| #define | PCCAN_INTEL527 3 |
| #define | CANCARD_NEC72005 4 |
| #define | CIRC_VIRTUAL 5 |
| #define | CIRC_SJA1000 6 |
Card types. | |
| |
| #define | canCARD_PCCAN 1 |
| #define | canCARD_CANCARD 2 |
| #define | canCARD_AC2 3 |
| #define | canCARD_LAPCAN 4 |
| #define | canCARD_ISACAN 5 |
| #define | canCARD_PCCAN_OEM 6 |
The canFlgXXX are left for compatibility. | |
| |
| #define | canFlgACCEPT 1 |
| #define | canFlgREJECT 2 |
| #define | canFlgCODE 3 |
| #define | canFlgMASK 4 |
Flags for action routines | |
| |
| #define | canDISCARD_MESSAGE 3 |
| #define | canRETAIN_MESSAGE 4 |
For busParams - sync on rising edge only or both rising and falling edge | |
| |
| #define | canSLOW_MODE 0x01 |
CAN driver types; these constants are retained for compatibility. | |
| |
| #define | canOFF 0 |
| #define | canTRISTATE 1 |
| #define | canPULLUP 2 |
| #define | canPULLDOWN 3 |
| #define | canPUSHPULL 4 |
| #define | canINVPULLUP 5 |
| #define | canINVPULLDOWN 6 |
| #define | canINVPUSHPULL 7 |
These were never implemented. | |
| |
| #define | canIOCTL_LOCAL_ECHO_ON 3 |
| #define | canIOCTL_LOCAL_ECHO_OFF 4 |
| #define | canMSG_STATUS 0x0008 |
| #define canCIRCUIT_ANY -1 |
Any circuit will do.
| #define canCARD_ANY -1 |
Any card will do.
| #define canCHANNEL_ANY -1 |
Any channel will do.
| #define CANID_METAMSG (-1L) |
Like msgs containing bus status changes.
| #define CANID_WILDCARD (-2L) |
We don't care or don't know.
| #define canERR_BUFOFL canERR_RESERVED_3 |
"Buffer overflow"
| #define canERR_REINIT canERR_RESERVED_4 |
"Reinitialization failed"
| #define canERR_MSGLOST canERR_RESERVED_5 |
"Message lost by CAN-chip"
| #define canERR_OVERRUN canERR_RESERVED_6 |
"Receive buffer overrun"
| #define canERR_CARDCOMMFAILED canERR_RESERVED_7 |
"Can't communicate with the card"
| #define canCIRCSTAT_ERROR_PASSIVE 0x0001 |
Error passive.
| #define canCIRCSTAT_BUS_OFF 0x0002 |
Bus off.
| #define canCIRCSTAT_ERROR_WARNING 0x0004 |
Error counter > 96.
| #define canCHANNEL_CAP_REMOTE canCHANNEL_CAP_RESERVED_1 |
Obsolete, use canCHANNEL_CAP_REMOTE_ACCESS or canCHANNELDATA_IS_REMOTE.
| #define canSTICKY_ACK_ERROR 0x80000801 |
| #define canSTICKY_FORM_ERROR 0x80000002 |
| #define canSTICKY_STUFF_ERROR 0x80000004 |
| #define canSTICKY_CRC_ERROR 0x80000008 |
| #define canSTICKY_BIT0_ERROR 0x80000010 |
| #define canSTICKY_BIT1_ERROR 0x80000020 |
| #define canSTICKY_HW_OVERRUN 0x80000040 |
| #define canSTICKY_SW_OVERRUN 0x80000080 |
| #define canSTAT_INACTIVE canSTAT_RESERVED_1 |
The circuit is not active (removed from the sw bus)
| #define canWANT_ACTIONS 0x01 |
| #define canWANT_OWN_BUFFERS 0x02 |
| #define canWANT_ERROR_COUNTERS 0x04 |
| #define canWANT_EXCLUSIVE 0x08 |
| #define canWANT_EXTENDED 0x10 |
| #define canWANT_VIRTUAL 0x20 |
| #define PCCAN_PHILIPS 1 |
82C200 on PCCAN 1.0
| #define PCCAN_INTEL526 2 |
Not supported.
| #define PCCAN_INTEL527 3 |
82527 on PCCAN 1.0
| #define CANCARD_NEC72005 4 |
NEC72005 on CANCard.
| #define CIRC_VIRTUAL 5 |
| #define CIRC_SJA1000 6 |
| #define canCARD_PCCAN 1 |
PCCAN ver 1.x (KVASER)
| #define canCARD_CANCARD 2 |
CANCard (Softing)
| #define canCARD_AC2 3 |
CAN-AC2 (Softing)
| #define canCARD_LAPCAN 4 |
| #define canCARD_ISACAN 5 |
| #define canCARD_PCCAN_OEM 6 |
Special for OEM PCcan cards.
| #define canFlgACCEPT 1 |
| #define canFlgREJECT 2 |
| #define canFlgCODE 3 |
| #define canFlgMASK 4 |
| #define canDISCARD_MESSAGE 3 |
| #define canRETAIN_MESSAGE 4 |
| #define canSLOW_MODE 0x01 |
Sync on rising and falling edge.
| #define canOFF 0 |
| #define canTRISTATE 1 |
| #define canPULLUP 2 |
| #define canPULLDOWN 3 |
| #define canPUSHPULL 4 |
This is the usual setting.
| #define canINVPULLUP 5 |
| #define canINVPULLDOWN 6 |
| #define canINVPUSHPULL 7 |
| #define canIOCTL_LOCAL_ECHO_ON 3 |
| #define canIOCTL_LOCAL_ECHO_OFF 4 |
| #define canMSG_STATUS 0x0008 |
| typedef void*(* canMemoryAllocator) (size_t size) |
Retained for compatibility.
| typedef void(* canMemoryDeallocator) (void *p) |
| typedef struct tagCanHWDescr canHWDescr |
| typedef struct tagCanSWDescr canSWDescr |
| canStatus canLocateHardware | ( | void | ) |
| int canOpen | ( | const canHWDescr *const | hwdescr, |
| const canSWDescr *const | swdescr, | ||
| const unsigned int | flags | ||
| ) |
| canStatus canGetCircuits | ( | int * | context, |
| char * | name, | ||
| char * | vendor, | ||
| char * | version, | ||
| unsigned int * | cardtype, | ||
| unsigned int * | circtype, | ||
| unsigned int * | channel | ||
| ) |
| canStatus canInstallAction | ( | int | handle, |
| long | id, | ||
| int(*)() | fn | ||
| ) |
| canStatus canUninstallAction | ( | int | handle, |
| long | id | ||
| ) |
| canStatus canInstallOwnBuffer | ( | int | handle, |
| long | id, | ||
| unsigned int | len, | ||
| void * | buf | ||
| ) |
| canStatus canUninstallOwnBuffer | ( | int | handle, |
| long | id | ||
| ) |