CAN 控制器初始化程序:
#define CAN PORT INPIND
#define CAN PORT DIR DDRD
#define CAN PORT OUT PORTD
#define CAN INPUT PIN6
#define CAN_OUTPUT_ PINS
void CAN_INITO {
CAN_PORT_ DIR &= ""(1 < <CAN_NPUT_PIN );
CAN_PORT_DIR &= ""(1 < <CAN_OUTPUT_PIN);
CAN_PORT_OUT I =(1< <CAN_INPUT_PIN );
CAN_PORT_OUT I =(1< <CAN_OUTPUT_ PIN); / /配置单片机TD 、RD 引脚功能 |