📄 types.h.bak
字号:
/*
*文件:types.h
*作者:黄峰
*日期:2002-6-5
*描述:类型定义头文件
*Copyright (C) 2002,深圳宝利达实业有限公司
*/
#ifndef _TYPES_H
#define _TYPES_H
#define _(text) text
#define TEXT(text) text
/*
* sizeof (int) == 4;
* sizeof (short) == 2;
* sizeof (char) == 1;
*/
typedef int LONG;
typedef unsigned short WORD;
typedef unsigned int DWORD;
typedef unsigned char BYTE;
typedef char TCHAR;
typedef int INT32;
typedef short INT16;
typedef char INT8;
typedef unsigned int UINT32;
typedef unsigned short UINT16;
typedef unsigned char UINT8;
typedef int int32;
typedef short int16;
typedef char int8;
typedef unsigned int uint32;
typedef unsigned short uint16;
typedef unsigned char uint8;
/*指令结构定义*/
typedef struct {
UINT32 process_no; //集中器指令处理序列号
BYTE address_id[6]; //电表通信地址ID号
BYTE control_id; //指令控制码
BYTE data_len[2]; //指令数据域长度
BYTE *ins_data; //指令数据
BYTE serial_no[5]; //主站指令流水号
BYTE chk_sum; //指令校验和
UINT16 destination; //指令方向
UINT16 source; //指令来源
UINT16 priority; //指令处理优先级
UINT16 response; //指令是否需要应答标志
INT32 ins_name; //指令码
} STR_COMM;
typedef struct {
UINT32 process_no; //集中器指令处理序列号
UINT16 insname; //指令码
BYTE serial_no[5]; //主站指令流水号
UINT16 response; //响应标识
UINT16 priority; //指令优先级
//数据位
BYTE *send_comm; //发送指令
UINT32 data_len; //发送指令长度
} STR_SEND;
/*串口结构定义*/
typedef struct {
INT8 prompt; // prompt after reciving data
INT32 baudrate; // baudrate
INT8 databit; // data bits, 5, 6, 7, 8
INT8 debug; // debug mode, 0:none, 1:debug
INT8 echo; // echo mode, 0:none, 1:echo
INT8 fctrl; // flow control, 0:None, 1:Hardware, 2:Software
INT8 tty; // tty: 0, 1, 2, 3, 4, 5, 6, 7
INT8 parity; // parity, 0:none, 1:odd, 2:even
INT8 stopbit; // stop bits, 1, 2 supported, 1.5 don't
const INT32 reserved; // reserved, must be zero
} portinfo_t;
typedef portinfo_t *pportinfo_t;
#endif /* types.h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -