📄 typedefine.h
字号:
//结构体定义.
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned char uchar;
//#define testSim
typedef union
{
struct
{
unsigned time1ms :1;
unsigned time2ms :1;
unsigned time4ms :1;
unsigned time8ms :1;
unsigned time16ms :1;
unsigned time32ms :1;
unsigned time64ms :1;
unsigned time128ms :1;
//
unsigned time256ms :1;
unsigned time512ms :1;
unsigned time1s :1;
unsigned time2s :1;
unsigned time4s :1;
unsigned time8s :1;
unsigned time16s :1;
unsigned time32s :1;
}bits;
uint alltimes;
}TIMEBASEstruct;
//volatile bank1 TIMEBASEstruct TimeBase ,TimeShift;
//任务管理标记位.
typedef union
{
struct
{
unsigned scankey :1; //2ms.
unsigned keybitmanage :1; //6ms.
unsigned keymanage :1; //8ms.
unsigned ledshowdigitcou:1; //100ms
unsigned ledshow :1; //4ms
unsigned :1;
}bits;
uint allbits;
}MissionFlagStruct;
//复合键值
typedef union
{
struct
{
uchar OneKey ;
unsigned CompKey :4;
unsigned Status :4;//0:无键 1:单键 2:复合键 3:错误按键.
}bits;
uint allbits;
}KEYVALUESTRUCT;
//volatile KEYVALUESTRUCT KeyValueStruct;
//端口采集扫描键盘状态.
typedef union
{
struct
{
unsigned keyscanbit0 :1;
unsigned keyscanbit1 :1;
unsigned keyscanbit2 :1;
unsigned keyscanbit3 :1;
// unsigned :4;
}bits;
uchar allbits;
}KeyInputStruct;
//按键触发的功能TAG.
typedef union
{
struct
{
unsigned UnitaryKey :1;
unsigned MultiKey :1;
unsigned LongKeyCouTag :1;
unsigned MultiKeyOne :1;
unsigned MultiKeyTwo :1;
unsigned MultiKeyThree :1;
unsigned MultiKeyFour :1;
unsigned MultiKeyTwoCouTag :1;
unsigned MultiKeyThreeCouTag :3;
}bits;
uint allbits;
}KeyFunStruct;
//volatile KeyFunStruct Key,Keyshift;
//单键值
typedef union
{
struct
{
unsigned KeyValue_1 :1;
unsigned KeyValue_2 :1;
unsigned KeyValue_3 :1;
unsigned KeyValue_4 :1;
unsigned KeyValue_5 :1;
unsigned KeyValue_6 :1;
unsigned KeyValue_7 :1;
unsigned KeyValue_8 :1;
unsigned KeyValue_9 :1;
unsigned KeyValue_10 :1;
unsigned KeyValue_11 :1;
unsigned KeyValue_12 :1;
unsigned KeyValue_13 :1;
unsigned KeyValue_14 :1;
unsigned KeyValue_15 :1;
unsigned KeyValue_16 :1;
unsigned KeyValue_17 :1;
unsigned KeyValue_18 :1;
unsigned KeyValue_19 :1;
unsigned KeyValue_20 :1;
unsigned KeyValue_21 :1;
unsigned KeyValue_22 :1;
unsigned KeyValue_23 :1;
unsigned KeyValue_24 :1;
}bits;
unsigned long allbits;
}KEYBITVALUESTRUCT;
//bank2 volatile KEYBITVALUESTRUCT PerKeyBitValueStruct;
typedef union
{
struct
{
unsigned HostStatus :2;// 主站通讯块状态.
// 0:空闲. 1:发送. 2:接受.
unsigned UartSendTag :1;// 使能一帧发送标记.
unsigned UartSendEndTag :1;// 一帧发送结束标记.
unsigned UartLinkErrTag :1;// 通信链路错标记.
unsigned frameSendEndTag :1;
unsigned singleKeyTag :1;
}bits;
unsigned uint allbits;
}UARTSTRUCT;
//volatile UARTSTRUCT UartStruct;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -