- UID
- 348621
- 性别
- 男
|
IICS_SRW位是个只读位,它是在什么时候变化的?是根据收到的地址字节的最后一位自动变化的吗?收到的并不是本机地址也会变化吗?
在我的程序中系统初始化过后SRW位就变成了1,但是查看寄存器此时IICD是"0",IAAS也是"0".
初始化如下:
void init_setting()
{ byte i=0 ;
/* RED_LIGHT = 0; //red light on
GREEN_LIGHT = 1; //green light off
STANDBY = 0; //standby on
PTBD_PTBD0 = 0; //AMP_P OFF
ir_count = 0;
PTBD_PTBD1 = 1; //BL_POWER OFF
power_flag = OFF; //power off now */
IICA = 0x90 ; //write address 0x90
//read address 0x91
i2c_startflag = 0;
IICC_IICEN = 1;
IICC_IICIE = 1;
IICC_MST = 0; //slave mode actually
// IICF = 0x83;
IICS_BUSY = 1; //clear bus busy flag;
IICS_SRW = 0; //R/W bit = 0;
IICS_IICIF = 0;
IICS_ARBL = 0;
}
这个问题搞得我目前很困惑,请版主帮忙分析!谢谢! |
|