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

📄 can.h

📁 基于S3C2410和Wince4.2操作系统的CAN总线驱动
💻 H
字号:
#ifndef	CAN_H
#define CAN_H

#define CAN_MAX_CHAR_IN_MESSAGE (8)
#define CAN_OK         (0)
#define CAN_FAILINIT   (1)
#define CAN_FAILTX     (2)
#define CAN_MSGAVAIL   (3)
#define CAN_NOMSG      (4)
#define CAN_CTRLERROR  (5)
#define CAN_FAIL       (0xff)

#define CAN_STDID (0)
#define CAN_EXTID (1)

#define CANDEFAULTIDENT    (0x1111)
#define CANDEFAULTIDENTEXT (0x0)

extern char CAN_Message[8];

typedef struct {
	// identifier CAN_xxxID
	unsigned char  extended_identifier; 
	// either extended (the 29 LSB) or standard (the 11 LSB)
	unsigned int identifier; 
	// data length:
	unsigned int  dlc;
	char  dta[CAN_MAX_CHAR_IN_MESSAGE];
	
	// used for receive only:
	// Received Remote Transfer Bit 
	//  (0=no... 1=remote transfer request received)
	unsigned char  rtr;  
	// Acceptence Filter that enabled the reception
	unsigned char  filhit;
} CanMessage;

#define CAN_20KBPS   1
#define CAN_125KBPS  CAN_20KBPS+1
 

void CAN_Write(char * value,int n);

void CAN_Init(void);

void __irq CAN_LISR(void);

void CAN_Data_Process(char * message);

#endif

⌨️ 快捷键说明

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