S3C2440中ADC的问题

[复制链接]
 楼主| 1025367421 发表于 2011-8-22 09:48 | 显示全部楼层 |阅读模式
高手们请问一下,S3C2440中ADC中的正常模式与待机模式有什么差别?
int ReadAdc(int ch)  //读值
{
int i;
static int prevCh=-1;
rADCCON = (1<<14)|(preScaler<<6)|(ch<<3);  //setup channel
if(prevCh!=ch)
{
  rADCCON = (1<<14)|(preScaler<<6)|(ch<<3); //setup channel
  for(i=0;i<LOOP;i++);       //delay to set up the next channel
  prevCh=ch;
}
rADCCON|=0x1;         //start ADC 读使能
while(rADCCON & 0x1);       //check if Enable_start is low
while(!(rADCCON & 0x8000));      //check if EC(End of Conversion) flag is high  查看是否转换完成
return ( (int)rADCDAT0 & 0x3ff );
}

这个程序看起来有点模糊,为什么选择待机模式?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

5

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部

0

主题

5

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部