goowang
驱动牛犊
驱动牛犊
  • 注册日期2002-09-28
  • 最后登录2003-11-14
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:997回复:0

Sl811hs固件中这段代码什么意思

楼主#
更多 发布于:2003-11-12 17:47
我看了CYPRESS网站中关于SL811HS的例子代码,请问它在读写时,用
shiftx、shifty左移,右移是什么意思??


void SL811BufRead(BYTE addr, BYTE *s, BYTE c)
{
BYTE i;
shiftx=addr;
newbit=oldbit;
for (i=0;i<7;i++)
{
 shiftx= shiftx<<1;
 shifty= shifty>>1;
 newbit=oldbit;
}
SL811H_ADDR = shifty;
   while (c--)
  {
shiftx = SL811H_DATA;
newbit=oldbit;
for (i=0;i<7;i++)
{
shiftx= shiftx<<1;
shifty= shifty>>1;
 newbit=oldbit;
}
*s++=shifty;
 }
}
游客

返回顶部