|
我们在读写MT9D112的driver Variables时不正常,每次读到的driver Variables的值都是0;请问是什么问题呢?
我在读写Registers的值时都是正常的,麻烦指点一下!
不胜感激!!
代码如下:
XLLP_BOOL_T Write_M9D112Variable(UINT8 usDrID, UINT8 usOffs,UINT16 mVariable)
{
UINT8 SlaveAddr = MT9D111_I2C_WADDR;
UINT16 mAddress = 0x338C;
UINT16 mData = 0;
mData |= (usDrID<<8)|usOffs;
mData |= M9D_LOGICAL | M9D_16BIT;
if(I2C_Write_M2(SlaveAddr, mAddress, mData))
return XLLP_TRUE;
mAddress = 0x3390;
if(I2C_Write_M2(SlaveAddr, mAddress, mVariable))
return XLLP_TRUE;
return XLLP_FALSE;
}
XLLP_BOOL_T Read_M9D112Variable(UINT8 usDrID, UINT8 usOffs,UINT16 *mRegister)
{
UINT8 SlaveAddr = MT9D111_I2C_WADDR;
UINT16 mAddress = 0x338C;
UINT16 mData = 0;
mData |= (usDrID<<8)|usOffs;
mData |= M9D_LOGICAL|M9D_16BIT;
if(Write_M9D112Register(mAddress, mData))
return XLLP_TRUE;
mAddress = 0x3390;
if(Read_M9D112Register(mAddress, mRegister))
return XLLP_TRUE;
return XLLP_FALSE;
}
[em03] |
|