#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "inc/hw_ints.h"
#include "driverlib/timer.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/adc.h"

int const PART_LM4F120H5QR;  

long  TheSysClock;

int main(void)
{
    
     unsigned long ulADC0_Value[1];	  
	   SysCtlClockSet(SYSCTL_SYSDIV_10|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                    SYSCTL_OSC_MAIN);
	   
     SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
	   SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
	   GPIOPinTypeADC(GPIO_PORTD_BASE,GPIO_PIN_0);
	   ADCSequenceConfigure(ADC0_BASE,7,ADC_TRIGGER_PROCESSOR,0);
	   ADCSequenceStepConfigure(ADC0_BASE,7,0,ADC_CTL_CH7 | ADC_CTL_IE | 
	                                          ADC_CTL_END);
	   ADCSequenceEnable(ADC0_BASE,7);
	   ADCIntClear(ADC0_BASE,7);
	   while(1)
		 {
         ADCProcessorTrigger(ADC0_BASE,7);
			   while(!ADCIntStatus(ADC0_BASE,7,false))
				 {

         }
				 ADCSequenceDataGet(ADC0_BASE,7,ulADC0_Value);
				 SysCtlDelay(SysCtlClockGet()/12);
     }
}

