用的芯片是MC56F84462,CW版本10.6
工程中定义了结构体,结构体中都是对位的定义,比如
typedef union
{
unsigned long LONG;
struct
{
unsigned short L_FLAG;//低位
unsigned short H_FLAG;//高位
} WORD;
struct
{
unsigned long RELAY :1;
unsigned long SERCH_FR :1;//
unsigned long VOL_END :1;//
unsigned long SERCH_RST :1;
unsigned long STOP_E0 :2;
unsigned long CLR_E0 :1;
unsigned long FIRST :1;
unsigned long START :2;
unsigned long RST_START :1;
unsigned long VOL_SH_ST :1;
unsigned long VOL_SH_END :1;
unsigned long SERCH_START :1;
unsigned long DC_START :2;
unsigned long ABORT_REVERT :1;
unsigned long WR_FLASH_START :1;
unsigned long PRE_SHUT :1;
unsigned long PASSWORD :1;//密码锁定
unsigned long MD :2;//
unsigned long RX_DATA_LEN :1;
unsigned long TREF :1;
unsigned long END :1;
unsigned long OWNER_DATA :1;
unsigned long COMM_END :1;//
unsigned long LT_LED :1;//
unsigned long LV_LED :1;//
unsigned long VOL_TRIG :1;//
unsigned long VOL_BREAK_FULL :1;//
unsigned long DC_FLAG :1;//
} BIT;
} flag_val;
程序中对位可以直接进行赋值,但是芯片是怎么执行赋值过程的呢,对于val.BIT.DC_FLAG=1是先进行清零再赋值1? |