结构体呀
__sfr __no_init volatile union
{
unsigned char ADC_CONTR; /* A/D 转换控制寄存器 */
struct /* A/D 转换控制寄存器 */
{
unsigned char ADC_CHS0 : 1;
unsigned char ADC_CHS1 : 1;
unsigned char ADC_CHS2 : 1;
unsigned char ADC_START : 1;
unsigned char ADC_FLAG : 1;
unsigned char ADC_SPEED0 : 1;
unsigned char ADC_SPEED1 : 1;
unsigned char ADC_POWER : 1;
} ADC_CONTR_bit;
} @ 0xBC;
enum {
ADC_CHS0 = 0x01,
ADC_CHS1 = 0x02,
ADC_CHS2 = 0x04,
ADC_START = 0x08,
ADC_FLAG = 0x10,
ADC_SPEED0 = 0x20,
ADC_SPEED1 = 0x40,
ADC_POWER = 0x80,
};
应用:
ADC_CONTR = ADC_CHS0 + ADC_START + ADC_POWER; |