C51中位域在字节中的位置关系
扫描二维码
随时随地手机看文章
typedef struct
{
uchar DC0_ALA:1; //电源0告警
uchar DC1_ALA:1; //电源1告警
uchar AC_ALA:1; //停电告警
uchar UN_H_ALA:1; //同频信道机失锁告警
uchar UN_L_ALA:1; //异频信道机失锁告警
uchar FAR_ALA:1; //远端通讯故障告警
uchar OPEN_ALA:1; //门襟告警
uchar x:1;
}ALARM;//系统告警结构定义
这个结构占一个字节宽度,其顺序为:
typedef struct
{
D0:uchar DC0_ALA:1; //电源0告警
D1:uchar DC1_ALA:1; //电源1告警
D2:uchar AC_ALA:1; //停电告警
D3:uchar UN_H_ALA:1; //同频信道机失锁告警
D4:uchar UN_L_ALA:1; //异频信道机失锁告警
D5:uchar FAR_ALA:1; //远端通讯故障告警
D6:uchar OPEN_ALA:1; //门襟告警
D7:uchar x:1;
}ALARM;//系统告警结构定义
明白了吗?