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

📄 sja1000.h

📁 CAN例程 源码 CAN例程 源码
💻 H
字号:
/* SJA1000.h - definitions for Phillips SJA1000 CAN Controller *//* Copyright 2001 Wind River Systems, Inc. *//* modification history --------------------09nov01,dnb modified for integration into Tornado12jul01,jac written*//* DESCRIPTIONThis file contains the functions declarations, specific to the Phillips SJA1000 CAN controller, that implement the interface defined in the windnet_can.h header file. */#ifndef SJA1000_H_#define SJA1000_H_/* mode register bits */#define MOD_RM                      0x01#define MOD_LOM                     0x02#define MOD_STM                     0x04#define MOD_AFM                     0x08#define MOD_SM                      0x10/* command register bits */#define CMR_TR                      0x01#define CMR_AT                      0x02#define CMR_RRB                     0x04#define CMR_CDO                     0x08#define CMR_SRR                     0x10/* status register bits */#define SR_RBS                      0x01#define SR_DOS                      0x02#define SR_TBS                      0x04#define SR_TCS                      0x08#define SR_RS                       0x10#define SR_TS                       0x20#define SR_ES                       0x40#define SR_BS                       0x80/* interrupt register bits */#define IR_RI                       0x01#define IR_TI                       0x02#define IR_EI                       0x04#define IR_DOI                      0x08#define IR_WUI                      0x10#define IR_EPI                      0x20#define IR_ALI                      0x40#define IR_BEI                      0x80/* interrupt enable register bits */#define IER_RIE                     0x01#define IER_TIE                     0x02#define IER_EIE                     0x04#define IER_DOIE                    0x08#define IER_WUIE                    0x10#define IER_EPIE                    0x20#define IER_ALIE                    0x40#define IER_BEIE                    0x80/* error code capture register */#define ECC_SEG0                    0x01#define ECC_SEG1                    0x02#define ECC_SEG2                    0x04#define ECC_SEG3                    0x08#define ECC_SEG4                    0x10#define ECC_DIR                     0x20#define ECC_ERRC0                   0x40#define ECC_ERCC1                   0x80/* max number of message objects for sja1000 */#define SJA1000_MAX_MSG_OBJ 2/* sja1000 channel types */#define TX_CHN_NUM 0#define RX_CHN_NUM 1extern const UINT g_sja1000chnType[SJA1000_MAX_MSG_OBJ];struct TxMsg{    ULONG id;    BOOL  ext;    BOOL  rtr;    UCHAR len;    UCHAR data[8];};void sja1000ISR(ULONG context);#endif /* SJA1000_H_ */

⌨️ 快捷键说明

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