/*
*******************************************************************************
* COPYRIGHT 2003 STMicroelectronics
* Source File Name : main.c
* Grou p           : IPSW,CMG-IPDF
* Author           : MCD Application Team
* Date First Issued: 22/9/2003
********************************Documentation**********************************
* General Purpose - This file shows the application example for ADC for the
                    device ST72F62.
********************************RevisionHistory********************************
_______________________________________________________________________________
Date : 22/9/2003       Release:2.0
******************************************************************************/

#include "st7lib_config.h"                        /* Select st72f62 device   */
void main(void);
void main(void)
{
                      /* Variable to get the converted digital value  */
   unsigned  int  Conv_Data1;
   unsigned char channel = 5;

   ADC_Init ((unsigned char)ADC_SPEED |(unsigned char) ADC_ONESHOT);
                                                       /*    FADC= FCPU/4   */
   ADC_Select_Channel (channel);                      /* Channel 5 selected */
   ADC_Enable () ;                                        /* Start conversion */
   while ((ADC_Test_Conversn_Complete ()) == FALSE);
   Conv_Data1 = ADC_Conversn_Read ();           /* Read the converted value */
   ADC_Disable () ;
   Nop;                              /*  Macro defined in st7lib_config.h   */
}