首先定义位变量结构体
typedef union
{
unsigned int ALL;
struct
{
unsigned int LED01 :1;
unsigned int LED01 :1;
unsigned int LED02 :1;
unsigned int LED03 :1;
unsigned int LED04 :1;
unsigned int LED05 :1;
unsigned int LED06 :1;
unsigned int LED07 :1;
unsigned int LED08 :1;
unsigned int LED09 :1;
unsigned int LED10 :1;
unsigned int LED11 :1;
unsigned int LED12 :1;
unsigned int LED13 :1;
unsigned int LED14 :1;
unsigned int LED15 :1;
unsigned int reserver :16;
}BIT;
}LEDbits_t;