|
是在中断线程中,操作i2c总线。在i2c驱动中读到数据是正确的,但是DeviceIoControl 返回的数据不对
hI2C = CreateFile( L"I2C0:",
GENERIC_READ|GENERIC_WRITE,
0,
NULL, OPEN_EXISTING, 0, 0);
。。。。。。。。。。。。。。。。。。。。。
RETAILMSG(1, (TEXT("AXP::CreateFile(\"I2C0\") \r\n")));
axp182_reg.SlaveAddr = AXP_RD_ADDR;
axp182_reg.WordAddr = AXP_DC12_VSET;
axp182_reg.Count = 1;
ret = DeviceIoControl(hI2C, IOCTL_I2C_READ, &axp182_reg, sizeof(axp182_reg), axp182_reg.Data, 1, &retbyte, NULL);
if(!ret )
{
RETAILMSG(1, (TEXT("DeviceIoControl Failed(\"I2C0\") \r\n")));
}
RETAILMSG(1, (TEXT("DeviceIoControl Sucessed(\"I2C0\")%x \r\n")),*axp182_reg.Data); |
|