Kvaser CANLIB: obsolete.h Source File

obsolete.h

Go to the documentation of this file.
00001 
00018 #ifndef _OBSOLETE_H_
00019 #define _OBSOLETE_H_
00020 
00026 #define canCIRCUIT_ANY          -1   ///< Any circuit will do \warning Obsolete! 
00027 #define canCARD_ANY             -1   ///< Any card will do    \warning Obsolete! 
00028 #define canCHANNEL_ANY          -1   ///< Any channel will do \warning Obsolete! 
00029 
00030 #define CANID_METAMSG  (-1L)        ///< Like msgs containing bus status changes. \warning Obsolete! 
00031 #define CANID_WILDCARD (-2L)        ///< We don't care or don't know. \warning Obsolete! 
00032 
00040 typedef void* (*canMemoryAllocator)  (size_t size);
00041 
00045 typedef void  (*canMemoryDeallocator)(void* p);
00046 
00050 typedef struct tagCanHWDescr {
00051     int                    circuitType;
00052     int                    cardType;
00053     int                    channel;
00054 } canHWDescr;
00055 
00059 typedef struct tagCanSWDescr {
00060     unsigned int           rxBufSize;
00061     unsigned int           txBufSize;
00062     canMemoryAllocator     alloc;
00063     canMemoryDeallocator   deAlloc;
00064 } canSWDescr;
00065 
00066 #ifdef __WIN32__
00067 
00070 typedef struct {
00071     unsigned int size;
00072     unsigned int rxBufSize;
00073     unsigned int txBufSize;
00074 } canSWDescriptorEx;
00075 #endif
00076 
00080 canStatus CANLIBAPI canLocateHardware(void);
00081 
00085 int CANLIBAPI canOpen(const canHWDescr * const hwdescr,
00086                       const canSWDescr * const swdescr,
00087                       const unsigned int flags);
00088 
00092 canStatus CANLIBAPI canGetCircuits(int * context,
00093                                    char * name,
00094                                    char * vendor,
00095                                    char * version,
00096                                    unsigned int * cardtype,
00097                                    unsigned int * circtype,
00098                                    unsigned int * channel);
00099 
00105 #define canERR_BUFOFL           canERR_RESERVED_3   ///< "Buffer overflow"                 \warning Obsolete!
00106 #define canERR_REINIT           canERR_RESERVED_4   ///< "Reinitialization failed"         \warning Obsolete!
00107 #define canERR_MSGLOST          canERR_RESERVED_5   ///< "Message lost by CAN-chip"        \warning Obsolete!
00108 #define canERR_OVERRUN          canERR_RESERVED_6   ///< "Receive buffer overrun"          \warning Obsolete!
00109 #define canERR_CARDCOMMFAILED   canERR_RESERVED_7   ///< "Can't communicate with the card" \warning Obsolete!
00110 
00117 #define canCIRCSTAT_ERROR_PASSIVE 0x0001    ///< Error passive \warning Obsolete!
00118 #define canCIRCSTAT_BUS_OFF       0x0002    ///< Bus off \warning Obsolete!
00119 #define canCIRCSTAT_ERROR_WARNING 0x0004    ///< Error counter > 96 \warning Obsolete!
00120 
00128 #define canCHANNEL_CAP_REMOTE canCHANNEL_CAP_RESERVED_1 ///< Obsolete, use \ref canCHANNEL_CAP_REMOTE_ACCESS or \ref canCHANNELDATA_IS_REMOTE
00129 
00130 
00136 #define canSTICKY_ACK_ERROR       0x80000801 ///< \warning Obsolete!
00137 #define canSTICKY_FORM_ERROR      0x80000002 ///< \warning Obsolete!
00138 #define canSTICKY_STUFF_ERROR     0x80000004 ///< \warning Obsolete!
00139 #define canSTICKY_CRC_ERROR       0x80000008 ///< \warning Obsolete!
00140 #define canSTICKY_BIT0_ERROR      0x80000010 ///< \warning Obsolete!
00141 #define canSTICKY_BIT1_ERROR      0x80000020 ///< \warning Obsolete!
00142 #define canSTICKY_HW_OVERRUN      0x80000040 ///< \warning Obsolete!
00143 #define canSTICKY_SW_OVERRUN      0x80000080 ///< \warning Obsolete!
00144 
00146 #define canSTAT_INACTIVE          canSTAT_RESERVED_1    ///< The circuit is not active (removed from the sw bus) \warning Obsolete!
00147 
00148 
00149 /*
00150 #define canCIRCSTAT_TXERR       0x0001      // TX error has occurred
00151 #define canCIRCSTAT_RXERR       0x0002      // Receive error has occurred
00152 #define canCIRCSTAT_OVERRUN     0x0004      // Receiver overrun
00153 #define canCIRCSTAT_WAKEUP      0x0008      // Wakeup has occurred
00154 #define canCIRCSTAT_INT         0x0010      // ??
00155 #define canCIRCSTAT_ACK         0x0020      // ACK error
00156 #define canCIRCSTAT_BIT         0x0040      // Bit error
00157 */
00158 /*
00159 More apocryphs.
00160 #define canCIRCSTAT_OVERRUN     0x0004      // Receiver overrun
00161 #define canCIRCSTAT_WAKEUP      0x0008      // Wakeup has occurred
00162 #define canCIRCSTAT_ACK         0x0010      // ACK error
00163 #define canCIRCSTAT_BIT0        0x0020      // Bit error
00164 #define canCIRCSTAT_BIT1        0x0040      // Bit error
00165 #define canCIRCSTAT_BOFF        0x0080      // Chip went Bus Off
00166 */
00167 /*
00168 Even more.
00169 #define canCIRCSTAT_BOFF_HW     0x10000L      // Chip is Bus Off
00170 #define canCIRCSTAT_BOFF_SW     0x20000L      // We are Bus Off
00171 */
00172 
00173 
00179 #define canWANT_ACTIONS         0x01  ///< \warning Obsolete!
00180 #define canWANT_OWN_BUFFERS     0x02  ///< \warning Obsolete!
00181 #define canWANT_ERROR_COUNTERS  0x04  ///< \warning Obsolete!
00182 #define canWANT_EXCLUSIVE       0x08  ///< \warning Obsolete! Use \ref canOPEN_xxx instead.
00183 #define canWANT_EXTENDED        0x10  ///< \warning Obsolete! Use \ref canOPEN_xxx instead.
00184 #if defined(CANLIB_DECLARE_ALL)
00185 # define canWANT_VIRTUAL        0x20  ///< \warning Obsolete! Use \ref canOPEN_xxx instead.
00186 #endif
00187 
00195 // No circuit                   0
00196 #define PCCAN_PHILIPS           1     ///< 82C200 on PCCAN 1.0  \warning Obsolete!
00197 #define PCCAN_INTEL526          2     ///< Not supported.       \warning Obsolete!
00198 #define PCCAN_INTEL527          3     ///< 82527 on PCCAN 1.0   \warning Obsolete!
00199 #define CANCARD_NEC72005        4     ///< NEC72005 on CANCard  \warning Obsolete!
00200 #define CIRC_VIRTUAL            5     ///<                      \warning Obsolete!
00201 #define CIRC_SJA1000            6     ///<                      \warning Obsolete!
00202 
00209 #define canCARD_PCCAN           1     ///< PCCAN ver 1.x (KVASER)       \warning Obsolete!
00210 #define canCARD_CANCARD         2     ///< CANCard (Softing)            \warning Obsolete!
00211 #define canCARD_AC2             3     ///< CAN-AC2 (Softing)            \warning Obsolete!
00212 #define canCARD_LAPCAN          4     ///<                              \warning Obsolete!
00213 #define canCARD_ISACAN          5     ///<                              \warning Obsolete!
00214 #define canCARD_PCCAN_OEM       6     ///< Special for OEM PCcan cards. \warning Obsolete!
00215 
00222 #define canFlgACCEPT            1     ///< \warning Obsolete!
00223 #define canFlgREJECT            2     ///< \warning Obsolete!
00224 #define canFlgCODE              3     ///< \warning Obsolete!
00225 #define canFlgMASK              4     ///< \warning Obsolete!
00226 
00233 #define canDISCARD_MESSAGE      3     ///< \warning Obsolete!
00234 #define canRETAIN_MESSAGE       4     ///< \warning Obsolete!
00235 
00243 #define canSLOW_MODE            0x01  ///< Sync on rising and falling edge \warning Obsolete!
00244 
00252 #define canOFF                  0     ///<                            \warning Obsolete!
00253 #define canTRISTATE             1     ///<                            \warning Obsolete!
00254 #define canPULLUP               2     ///<                            \warning Obsolete!
00255 #define canPULLDOWN             3     ///<                            \warning Obsolete!
00256 #define canPUSHPULL             4     ///< This is the usual setting. \warning Obsolete!
00257 #define canINVPULLUP            5     ///<                            \warning Obsolete!
00258 #define canINVPULLDOWN          6     ///<                            \warning Obsolete!
00259 #define canINVPUSHPULL          7     ///<                            \warning Obsolete!
00260 
00268 #define canIOCTL_LOCAL_ECHO_ON  3     ///< \warning Obsolete!
00269 #define canIOCTL_LOCAL_ECHO_OFF 4     ///< \warning Obsolete!
00270 
00271 #define canMSG_STATUS 0x0008
00272 
00274 #ifdef __cplusplus
00275 extern "C" {
00276 #endif
00277 
00281 canStatus CANLIBAPI canInstallAction(int handle, long id, int (*fn)());
00282 
00286 canStatus CANLIBAPI canUninstallAction(int handle, long id);
00287 
00291 canStatus CANLIBAPI canInstallOwnBuffer(int handle, long id, unsigned int len,
00292                                         void * buf);
00293 
00297 canStatus CANLIBAPI canUninstallOwnBuffer(int handle, long id);
00298 #ifdef __cplusplus
00299 }
00300 #endif
00301 
00304 #endif