CAN总线通信程序
#define TXFrameInfo1 XBYTE[CS1_SJA1000+16]
#define TXID1 XBYTE[CS1_SJA1000+17]
#define TXID2 XBYTE[CS1_SJA1000+18]
#define TXID3 XBYTE[CS1_SJA1000+19]
#define TXID4 XBYTE[CS1_SJA1000+20]
#define TXDATA1 XBYTE[CS1_SJA1000+21]
#define TXDATA2 XBYTE[CS1_SJA1000+22]
#define TXDATA3 XBYTE[CS1_SJA1000+23]
#define TXDATA4 XBYTE[CS1_SJA1000+24]
#define TXDATA5 XBYTE[CS1_SJA1000+25]
#define TXDATA6 XBYTE[CS1_SJA1000+26]
#define TXDATA7 XBYTE[CS1_SJA1000+27]
#define TXDATA8 XBYTE[CS1_SJA1000+28]
#define RXFrameInfo1 XBYTE[CS1_SJA1000+16]
#define RXID1 XBYTE[CS1_SJA1000+17]
#define RXID2 XBYTE[CS1_SJA1000+18]
#define RXID3 XBYTE[CS1_SJA1000+19]
#define RXID4 XBYTE[CS1_SJA1000+20]
#define RXDATA1 XBYTE[CS1_SJA1000+21]
#define RXDATA2 XBYTE[CS1_SJA1000+22]
#define RXDATA3 XBYTE[CS1_SJA1000+23]
#define RXDATA4 XBYTE[CS1_SJA1000+24]
#define RXDATA5 XBYTE[CS1_SJA1000+25]
#define RXDATA6 XBYTE[CS1_SJA1000+26]
#define RXDATA7 XBYTE[CS1_SJA1000+27]
#define RXDATA8 XBYTE[CS1_SJA1000+28]
#defineGoToRESET0x01
#defineReleaseRXBuf0x04
#defineRequest_TX0x01
#defineNOT0
#defineYES1
//4800bps 5bits 1.04mS
#define TIME_MS1
#define temp_TH0(0 - 922*TIME_MS)/256
#define temp_TL0(0 - 922*TIME_MS)%256
sbit LED1 = P1^2;
sbit LED2 = P1^3;
sbit LED3 = P1^5;
sbit LED4 = P1^4;
sbit WDT = P3^4;
void System_init(void);
void Delay(unsigned char time);
void W_WDT(void);
void Interrupt_init(void);
void CAN_init(void);
//void CAN_Transmit(unsigned char Farmeinfo);
void CAN_Transmit(bit FarmeType);
void CAN_Receive(void);
void Timer_init(void);
void UART_ini(void);
void UART_Send_Byte(unsigned char Data);
void UART_Transmit(void);
void Clear_Buffer(unsigned char *pointer,unsigned char length);
#endif
CAN总线通信程 相关文章:
- 基于STM32的CAN总线通信程序(11-24)
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)