找回密码
 注册
搜索
查看: 750|回复: 2

[讨论] MT9D112的I2C的问题!

[复制链接]
发表于 2007-12-4 16:57:31 | 显示全部楼层 |阅读模式
我们在读写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]
 楼主| 发表于 2007-12-4 16:58:23 | 显示全部楼层
请各位大哥帮忙!
点评回复

使用道具 举报

 楼主| 发表于 2007-12-6 17:04:05 | 显示全部楼层
版主:帮忙看一看!
谢谢!
[em03]
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-11-30 13:59 , Processed in 0.043595 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表