📄 serial.h
字号:
#ifndef _SNMP_SERIAL_H_
#define _SNMP_SERIAL_H_
#include "define.h"
#define UARTSEND(status) (TI = status)
typedef enum { OK = 0, ERROR = ~OK } IDBSTATUS;
#define RECEIVE_TIME_START 0
#define RECEIVE_TIME_OUT 2
#define RECEIVE_TIME_OVER 4
#define RECEIVE_WAIT 0
#define RECEIVE_STATUS_1 1
#define RECEIVE_STATUS_2 2
#define RECEIVE_STATUS_3 3
#define RECEIVE_STATUS_4 4
#define RECEIVE_STATUS_5 5
#define RECEIVE_STATUS_6 6
#define RECEIVE_OVER 0xff
#define SERIALLENGTH 0x14
#define SYNCHRONIZATION_WORD0 0xff
#define SYNCHRONIZATION_WORD1 0xa6
#define SENDWAIT 1
#define SENDING 0
#define SERIAL_CHANB_SYN_CHAR1_M1 0x7e
#define SERIAL_CHANB_SYN_CHAR1_M2_1 0x81
#define SERIAL_CHANB_SYN_CHAR1_M2_2 0x82
#define RC7017_PROTOCOL_TYPE 0xc0
#define RC7017_PROTOCOL_SET 0xc0
#define RC7017_PROTOCOL_GET 0x80
#define RC7017_PROTOCOL_VALAR 0x40
#define RC7017_PROTOCOL_SET_LENGTH 11
#define RC7017_PROTOCOL_GET_LENGTH 15
#define RC7017_PROTOCOL_VALAR_LENGTH 12
typedef struct
{
BYTE ReceiceLength, Iocounter;
BYTE SendLength, SendCounter;
BYTE ReveiveOverTime, ReveiveStatus;
BYTE ReceiceBuffer[SERIALLENGTH];
BYTE SendBuffer[SERIALLENGTH];
}SERIALSTRUCT;
extern SERIALSTRUCT idata gIoSerial;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -