i2cInit();
i = i2cOpen();
if(i < 0)
{
DBG_PRINTF("Open I2C error!\n");
}
i2cIoctl(I2C_IOC_SET_DEV_ADDRESS, 0x28, 0);
i2cIoctl(I2C_IOC_SET_SPEED, 100, 0);
i2cIoctl(I2C_IOC_SET_SINGLE_MASTER, 1, 0);
i2cIoctl(I2C_IOC_SET_SUB_ADDRESS, 0x8047, 2);
i = 1000;
while(i-- > 0)
{
ret = i2cRead(value, 2);
DBG_PRINTF("ret = %d\n",ret);
if(i2cRead(value, 2) == 2)
break;
}
总是返回错误码:ret = FFFF1103 也就是data transfer error ,还有改成i2cIoctl(I2C_IOC_SET_SPEED, 400, 0); ret =ret = FFFF1101.哪位帮我看看这是怎么回事! |