TI中文支持网
TI专业的中文技术问题搜集分享网站

急!!请问I2CMCS寄存器值为0x20时为什么连I2CMasterControl函数都无法使得I2CMCS寄存器改变其中的值??

我知道0x20是IDLE位为1,但是我在调试代码时查看寄存器值得变化发现用I2CMasterControl没法使得I2CMCS的值发生改变,甚至用HWREG函数操作都不行,代码如下,求救啊

unsigned int XX7299A_I2CRead(unsigned int I2C_BASE,uchar REG_ADDR,uchar ID)
{
uchar DATA;
unsigned int i;
I2CMasterInitExpClk(I2C_BASE,SysCtlClockGet(),true); 
I2CMasterSlaveAddrSet(I2C_BASE,ID,true);
I2CMasterDataPut(I2C_BASE,REG_ADDR);
//查询忙与错误
while(I2CMasterBusBusy(I2C_BASE));

I2CMasterControl(I2C_BASE,I2C_MASTER_CMD_BURST_SEND_ERROR_STOP);

while(I2CMasterBusy(I2C_BASE));

i = I2CMasterErr(I2C_BASE);

I2CMasterSlaveAddrSet(I2C_BASE,ID,false);
I2CMasterControl(I2C_BASE,I2C_MASTER_CMD_BURST_RECEIVE_FINISH);

while(I2CMasterBusy(I2C_BASE));

i = I2CMasterErr(I2C_BASE);

switch(i)
{
case I2C_MASTER_ERR_NONE:
{
//

DATA = I2CMasterDataGet(I2C_BASE);

return DATA;
};break;
case I2C_MASTER_ERR_ADDR_ACK:XX7299A_I2CRead(I2C_BASE,REG_ADDR,ID);break;
case I2C_MASTER_ERR_DATA_ACK:XX7299A_I2CRead(I2C_BASE,REG_ADDR,ID);break;
case I2C_MASTER_ERR_ARB_LOST:XX7299A_I2CRead(I2C_BASE,REG_ADDR,ID);break;
case I2C_MASTER_ERR_CLK_TOUT:XX7299A_I2CRead(I2C_BASE,REG_ADDR,ID);break;
default:XX7299A_I2CRead(I2C_BASE,REG_ADDR,ID);
}
}

X tank:

I2CMDR寄存器也没法输入值

赞(0)
未经允许不得转载:TI中文支持网 » 急!!请问I2CMCS寄存器值为0x20时为什么连I2CMasterControl函数都无法使得I2CMCS寄存器改变其中的值??
分享到: 更多 (0)