cancontroller.c

来自「美国wind river 公司的CAN总线源代码」· C语言 代码 · 共 86 行

C
86
字号
/* canController.c - implementation of CAN Controller routines *//* Copyright 2001 Wind River Systems, Inc. *//* modification history --------------------09nov01,dnb modified for integration into Tornado12jul01,jac written*//* DESCRIPTIONimplementation of CAN controller routines*//* includes */#include <vxWorks.h>#include <errnoLib.h>#include <CAN/wnCAN.h>#include <CAN/canBoard.h>#include <CAN/canController.h>/* forward declarations */ void I82527_establishLinks(struct WNCAN_Device *pDev);void SJA1000_establishLinks(struct WNCAN_Device *pDev);void TouCAN_establishLinks(struct WNCAN_Device *pDev);void MCP2510_establishLinks(struct WNCAN_Device *pDev);/************************************************************************** WNCAN_Controller_establishLinks - connect the function pointers in the*                                 Device structure to the appropriate*                                 routines. Set the number of channels in *                                 the controller structure *** RETURNS: OK or ERROR*   * ERRNO: S_can_unknown_controller**/STATUS WNCAN_Controller_establishLinks(    struct WNCAN_Device *pDev,     WNCAN_ControllerType ctrlType){    STATUS retCode = OK;        switch(ctrlType)    {#ifdef INCLUDE_I82527        case WNCAN_I82527:            I82527_establishLinks(pDev);                        break;#endif#ifdef INCLUDE_SJA1000        case WNCAN_SJA1000:            SJA1000_establishLinks(pDev);                       break;#endif#ifdef INCLUDE_TOUCAN        case WNCAN_TOUCAN:            TouCAN_establishLinks(pDev);                                    break;#endif#ifdef INCLUDE_MCP2510        case WNCAN_MCP2510:            MCP2510_establishLinks(pDev);            break;#endif        default:            errnoSet(S_can_unknown_controller);            retCode = ERROR;            break;     }       return retCode;}

⌨️ 快捷键说明

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