📄 semiuart.h
字号:
#ifndef SEMIUART_H
#define SEMIUART_H 1
#ifdef SEMIUART_GLOBAL
#define SEMIUART_EXT
#else
#define SEMIUART_EXT extern
#endif
#define MAX_SEMI_BUF 5
#define _ALARM 2 //串口的状态//
#define _BUSY 1
#define _IDLE 0
#define SEND_FAIL 0x55 //the result of send
#define SEND_SUCCESS 0xaa
#define CENTER_RELEASE 0x02 //中心撤防//
#define CENTER_DEFEND 0x04 //中心布防//
#define CON_CARLED 0x40 //控制车灯//
#define CON_BELL_OUT 0x80 //控制喇叭//
#define NEED_COMMON 0x01 //发送属性//
#define NEED_SUCCESS 0x02
typedef struct
{
uchar head;
uchar tail;
uchar recvbuf[MAX_SEMI_BUF];
uchar sendbuf[MAX_SEMI_BUF];
uchar sendlen;
uchar recvlen;
uchar fail_time;
uchar recvstatus;
uchar sendstatus;
} SEMIUART;
typedef struct
{
uchar defend;
uchar doorstatus;
uchar alarm;
uchar shake;
uchar guard;
uchar privat;
}SEMI_RECV_STATUS;
SEMIUART_EXT SEMIUART semiuart;
SEMIUART_EXT SEMI_RECV_STATUS Recv_Status;
SEMIUART_EXT uchar send_semi_type;
//----------------------------------------
SEMIUART_EXT void Init_Common(void);
SEMIUART_EXT void Init_Semiuart(void);
SEMIUART_EXT void Reset_Semiuart(void);
SEMIUART_EXT void Resetsemi_Proc(void);
SEMIUART_EXT uchar Assemble_Data(void);
SEMIUART_EXT void Deal_Fail(void);
SEMIUART_EXT void Write_To_Send(uchar con);
SEMIUART_EXT void Sendsemiproc(void);
SEMIUART_EXT uchar SendSemidata(uchar *ptr,uchar len);
SEMIUART_EXT void RecvSemidata(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -