gainst的笔记 https://bbs.21ic.com/?362107 [收藏] [复制] [RSS]

日志

LM3S3748 DEMO ADC

已有 1074 次阅读2009-11-29 08:07 |系统分类:ARM| Luminarymicro

此代碼基於LM3S3748 DEMO KIT編寫
   


//
   // Enable the first sample sequence to capture the value of channel 0 when
   // the processor trigger occurs.
   //
   ADCSequenceConfigure(ADC0_BASE, 0, ADC_TRIGGER_PROCESSOR, 0);
   ADCSequenceStepConfigure(ADC0_BASE, 0, 0,
                            ADC_CTL_IE | ADC_CTL_END | ADC_CTL_CH7);
   
   
   ADCHardwareOversampleConfigure(ADC0_BASE,8);
     
   ADCSequenceEnable(ADC0_BASE, 0);
   //
   // Trigger the sample sequence.
   //
   ADCProcessorTrigger(ADC0_BASE, 0);
   
   ADCIntEnable(ADC0_BASE, 0);
   IntEnable(INT_ADC0);
   
   unsigned long l_Dat;
   while(1)
   {
      l_Dat++;
      l_Dat = l_Dat;
   }
}



void
ADCIntHandler(void)
{
   unsigned long ulValue;
   ADCSequenceDataGet(ADC0_BASE, 0, &ulValue);
   ulValue = ulValue;
   ADCProcessorTrigger(ADC0_BASE, 0);
}


路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)