⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpconst.h

📁 Controller Area Network Programming Interface Environment Ver0.8。 CanPie版本0.8. CAN总线通讯编程接口源代码。
💻 H
📖 第 1 页 / 共 2 页
字号:
/*****************************************************************************\*  CANpie                                                                     **                                                                             **  File        : cpconst.h                                                    **  Description : Definitions / Constants for CANpie                           **  Author      : Uwe Koppe                                                    **  e-mail      : koppe@microcontrol.net                                       **                                                                             ** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - **                                                                             **   This program is free software; you can redistribute it and/or modify      **   it under the terms of the GNU General Public License as published by      **   the Free Software Foundation; either version 2 of the License, or         **   (at your option) any later version.                                       **                                                                             ** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - **                                                                             **  History                                                                    **  Vers.    Date        Comment                                         Aut.  **  -----    ----------  ---------------------------------------------   ----  **  0.1      04.12.1998  Initial version                                 UK    **  0.2      29.04.1999  Changed structures, new data type definitions   UK    **  0.3                  - no changes -                                        **  0.4                  - no changes -                                        **  0.5                  - no changes -                                        **  0.6      15.06.2000  moved defintions from cpmsg.h                   UK    **                       set to CANpie release 0.6                             **	0.7		06.11.2000	added new error codes									UK		**								added missing buffer number									**	0.8		15.02.2001	set to CANpie release 0.8								UK		**                                                                             *\*****************************************************************************/#ifndef  _CANpie_Constants_#define  _CANpie_Constants_/*-----------------------------------------------------------------------------**    Online documentation for Doxygen*//*!   \file    cpconst.h**    \brief   CANpie constants, structures and enumerations****    This file holds constants and structures used within CANpie.***/#include "compiler.h"      // compiler definitions#include "cpconfig.h"      // configuration options/*----------------------------------------------------------------------------*//*!** \enum    CpErr** \brief   CANpie Error codes*****/enum CpErr {   /*!   No error (00dec / 00hex)   */   CpErr_OK = 0,   /*!   Error not specified (01dec / 01hex)   */   CpErr_GENERIC,   /*!   Hardware failure (02dec / 02hex)   */   CpErr_HARDWARE,   /*!   Initialisation failure (03dec / 03hex)   */   CpErr_INIT_FAIL,   /*!   Channel is initialized, ready to run (04dec / 04hex)   */   CpErr_INIT_READY,   /*!    CAN channel was not initialized (05dec / 05hex)   */   CpErr_INIT_MISSING,   /*!   Receive buffer is empty (05dec / 05hex)   */	CpErr_RCV_EMPTY,	/*!	Receive buffer overrun (06dec / 06hex)	*/	CpErr_OVERRUN,   /*!   Transmit buffer is full (07dec / 07hex)   */	CpErr_TRM_FULL,	/*!   CAN message has wrong format (10dec / 0Ahex)	*/   CpErr_CAN_MESSAGE = 10,   /*!   CAN identifier not valid (11dec / 0Bhex)   */   CpErr_CAN_ID,   /*!   FIFO is empty (20dec / 14hex)   */   CpErr_FIFO_EMPTY = 20,   /*!   Message is waiting in FIFO (21dec / 15hex)   */   CpErr_FIFO_WAIT,   /*!   FIFO is full (22dec / 16hex)   */   CpErr_FIFO_FULL,   /*!   FIFO size is out of range (23dec / 17hex)   */   CpErr_FIFO_SIZE,   /*!   Controller is in error passive (30dec / 1Ehex)   */   CpErr_BUS_PASSIVE = 30,   /*!   Controller is in bus off (31dec / 1Fhex)   */   CpErr_BUS_OFF,   /*!   Controller is in warning status (32dec / 20hex)   */   CpErr_BUS_WARNING,   /*!   Channel out of range (40dec / 28hex)   */   CpErr_CHANNEL = 40,   /*!   Register address out of range (41dec / 29hex)   */   CpErr_REGISTER,   /*!   Baudrate out of range (42dec / 2Ahex)   */   CpErr_BAUDRATE,   /*!   Function is not supported (50dec / 32hex)   */   CpErr_NOT_SUPPORTED = 50};/*----------------------------------------------------------------------------*//*!** \enum    CP_CC** \brief   CAN controller identification numbers***/enum CP_CC {   /*!   Philips 82C200   */   CP_CC_82C200 = 0,   /*!   Philips SJA1000   */   CP_CC_SJA1000,   /*!   Philips 80C591   */   CP_CC_80C591,   /*!   Philips 80C592   */   CP_CC_80C592,   /*!   Infineon C505   */   CP_CC_C505 = 20,   /*!   Infineon C515   */   CP_CC_C515,   /*!   Infineon C161   */   CP_CC_C161,   /*!   Infineon C164   */   CP_CC_C164,   /*!   Infineon C167   */   CP_CC_C167,   /*!   Infineon 81C90   */   CP_CC_81C90,   /*!   Infineon 81C91   */   CP_CC_81C91,   /*!   Intel AN82527   */   CP_CC_AN82527 = 40,   /*!   Intel AN87C196CA   */   CP_CC_AN87C196CA,   /*!   Intel AN87C196CB   */   CP_CC_AN87C196CB,   /*!   Motorola 68HC05   */   CP_CC_68HC05 = 60,   /*!   Motorola 68HC08   */   CP_CC_68HC08,   /*!   Motorola 68HC912   */   CP_CC_68HC912,   /*!   Motorola 68376   */   CP_CC_MC68376,   /*!   Motorola MPC555   */   CP_CC_MPC555,   /*!   Microchip MCP2510   */   CP_CC_MCP2510 = 80};/*----------------------------------------------------------------------------*//*!** \enum    CP_FIFO** \brief   FIFO Buffer numbers*/enum CP_FIFO {   CP_FIFO_RCV = 0,   CP_FIFO_TRM};/*----------------------------------------------------------------------------*//*!** \enum    CP_CALLBACK** \brief   Callback Return Codes**** These return values are used by the callback functions that can be** installed by the function CpUserIntFunctions(). <p>** \b Example** \code** _U08 MyCallback(CpStruct_CAN * pCanMsgV)** {**    // Do something with IDs < 100**    if( CpMacGetStdId(pCanMsgV) < 100)**    {**       //.....**       return(CP_CALLBACK_PROCESSED)**    }****    // Put all other messages into the FIFO**    return (CP_CALLBACK_PUSH_FIFO);** }** \endcode** <br>*/enum CP_CALLBACK {   /*!   ** Message was processed by callback and is not inserted in the FIFO   */   CP_CALLBACK_PROCESSED = 0,   /*!   ** Message was processed by callback and is inserted in the FIFO   */   CP_CALLBACK_PUSH_FIFO};/*----------------------------------------------------------------------------*//*!** \enum    CP_BAUD** \brief   Fixed baudrates**** The values of the enumeration CP_BAUD are used as parameter for the** function CpUserBaudrate().*/enum CP_BAUD {   /*!   ** Baudrate 10 kBit/sec   */   CP_BAUD_10K = 0,   /*!   ** Baudrate 20 kBit/sec   */   CP_BAUD_20K,   /*!   ** Baudrate 50 kBit/sec   */   CP_BAUD_50K,   /*!   ** Baudrate 100 kBit/sec   */   CP_BAUD_100K,   /*!   ** Baudrate 125 kBit/sec   */   CP_BAUD_125K,   /*!   ** Baudrate 250 kBit/sec   */   CP_BAUD_250K,   /*!   ** Baudrate 500 kBit/sec   */   CP_BAUD_500K,   /*!   ** Baudrate 800 kBit/sec   */   CP_BAUD_800K,   /*!   ** Baudrate 1 MBit/sec   */   CP_BAUD_1M};/*----------------------------------------------------------------------------*//*!** \enum    CP_CHANNEL** \brief   Channel definition*/enum CP_CHANNEL {   CP_CHANNEL_1 = 0,   CP_CHANNEL_2,   CP_CHANNEL_3,   CP_CHANNEL_4,   CP_CHANNEL_5,   CP_CHANNEL_6,   CP_CHANNEL_7,   CP_CHANNEL_8};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -