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

📄 cancontroller.h

📁 cpc-1631的BSP包for VxWorks操作系统
💻 H
字号:
/* canController.h - CAN controller definitions for Wind River CAN Common Interface */

/* Copyright 2001 Wind River Systems, Inc. */

/* 
modification history 
--------------------
08apr04,lsg added FlexCAN related macros
26feb04,bjn Added MPC5200 support
26dec01,lsg added TOUCAN (PPC5xx) related macros
09nov01,dnb modified for integration into Tornado
12jul01,jac written

*/

/* 

DESCRIPTION
This file contains CAN controller definitions for the 
CAN Common Interface.

*/

#ifndef CAN_CONTROLLER_H_
#define CAN_CONTROLLER_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

struct WNCAN_Device;
typedef UINT WNCAN_ControllerType;

/* Datatypes used for controller's linked list */
typedef void  (*pfn_Ctrlr_EstabLnks_Type)(struct WNCAN_Device *pDev);


/* The CAN_ControllerType lists the available controllers */
#define WNCAN_I82527   1
#define WNCAN_SJA1000  2
#define WNCAN_TOUCAN   3    
#define WNCAN_MCP2510  4
#define WNCAN_HCAN2    5
#define WNCAN_MOTMSCAN 6
#define WNCAN_FLEXCAN  7    

struct WNCAN_Controller
{
    WNCAN_ControllerType ctrlType;  /* type of controller */
    UCHAR                ctrlID;    /* handle identifier of this controller */
    UCHAR                brp;       
    UCHAR                sjw;  
    UCHAR                tseg1;
    UCHAR                tseg2; 
    UCHAR                samples;
    struct WNCAN_Device  *pDev;    /* pointer to parent CAN_Device structure */
    const UINT           *chnType; /* number of ways a message buffer can be configured */    
    UINT                 *chnMode; /* current way a message buffer is configured */
    UCHAR                numChn;   /* number of available channels */
    void                 *csData;  /* pointer to chip-specific data */    
};


/* function prototypes */
STATUS WNCAN_Controller_establishLinks(struct WNCAN_Device *pDev, 
    WNCAN_ControllerType ctrlType);


/* define access macros for use with the controller's linked list */
#define CONTROLLERLL_INIT()   FLL_Create(&g_ControllerLLRoot)
#define CONTROLLERLL_ADD(n)   FLL_Add(&g_ControllerLLRoot, n)
#define CONTROLLERLL_GET(key) ((ControllerLLNode*)FLL_Find(&g_ControllerLLRoot, key))
#define CONTROLLERLL_FIRST()  ((ControllerLLNode*)FLL_FirstNode(&g_ControllerLLRoot))
#define CONTROLLERLL_NEXT(n)  ((ControllerLLNode*)FLL_NextNode(n))

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* CAN_CONTROLLER_H_ */

⌨️ 快捷键说明

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