/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : ADC2.C
**     Project   : bldc_hall_demo
**     Processor : MC56F8006_48_LQFP
**     Beantype  : Init_ADC
**     Version   : Bean 01.283, Driver 01.00, CPU db: 3.00.177
**     Compiler  : Metrowerks DSP C Compiler
**     Date/Time : 28.11.2008, 14:14
**     Abstract  :
**         This "Init_ADC" Peripheral Inspector implements the
**         Analog-to-Digital converter module (ADC), basic 
**         initialization and settings.
**     Settings  :
**          Bean name                                      : ADC2
**          Device                                         : ADC0
**          Settings                                       : 
**            Clock settings                               : 
**              Input clock                                : Bus clock
**              Continuous clock output                    : Inactived
**              Clock divide select                        : Input clock / 4
**              Sample time                                : Short
**              ADCK frequency                             : 8 MHz
**              Conversion time                            : 3.03 us
**            Continuous conversion A                      : Disabled
**            Continuous conversion B                      : Disabled
**            Conversion mode                              : 12-bit
**            Power configuration                          : High speed
**            Conversion trigger                           : Hardware
**            Voltage reference                            : VDDA/VSSA
**          Pins/Signals                                   : 
**            ADC input pins                               : 2
**              Input pin 0                                : 
**                Pin                                      : GPIOC0_ANA5_FAULT0_CMP1_M1
**                Pin signal                               : 
**              Input pin 0                                : 
**                Pin                                      : GPIOC1_PGA0NON_INV_ANA7_CMP2_M2
**                Pin signal                               : 
**          Interrupts                                     : 
**            Conversion complete                          : 
**              Interrupt                                  : INT_ADC0_Complete
**              Interrupt priority                         : 1 (USER1)
**              Conversion A complete                      : Disabled interrupt
**              Conversion B complete                      : Enabled interrupt
**              ISR name                                   : ISR_ADCA_Complete
**          Initialization                                 : 
**            Call Init method                             : yes
**            Enable peripheral clock                      : yes
**            Initial channel A select                     : AD5
**            Initial channel B select                     : AD7
**     Contents  :
**         Init - void ADC2_Init(void);
**
**     (c) Copyright UNIS, a.s. 1997-2008
**     UNIS, a.s.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

/* MODULE ADC2. */

#include "ADC2.h"


/*
** ###################################################################
**
**  The following method must be implemented by the user in one
**  of the following modules:
**
**    #pragma interrupt
**    void ISR_ADCA_Complete(void)
**
**  Modules:
**       bldc_hall_demo
**       Events
**
** ###################################################################
*/

/*
** ===================================================================
**     Method      :  ADC2_Init (bean Init_ADC)
**
**     Description :
**         This method initializes registers of the ADC module
**         according to this Peripheral Initialization Bean settings.
**         Call this method in the user code to initialize the
**         module. By default, the method is called by PE
**         automatically; see "Call Init method" property of the
**         bean for more details.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void ADC2_Init(void)
{
  /* ADC0_ADCCFG: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,ADLPC=0,ADIV=2,ADLSMP=0,MODE=1,ADICLK=0 */
  setReg16(ADC0_ADCCFG, 0x44);          
  /* ADC0_ADCSC2: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,ADACT=0,ADTRG=1,??=0,??=0,??=0,ECC=0,REFSEL=1 */
  setReg16(ADC0_ADCSC2, 0x41);          
  /* ADC0_ADCSC1B: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,COCO=0,AIEN=1,ADCO=0,ADCH=7 */
  setReg16(ADC0_ADCSC1B, 0x47);         
  /* ADC0_ADCSC1A: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,COCO=0,AIEN=0,ADCO=0,ADCH=5 */
  setReg16(ADC0_ADCSC1A, 0x05);         
}

/* END ADC2. */

/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 2.99 [04.17]
**     for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/
