打印

S3C2440中ADC的问题

[复制链接]
1203|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
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

粉丝