/*
** ###################################################################
**
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**
**     Filename  : AD2.H
**
**     Project   : Full1
** 
**     Processor : MC68HC908AZ60MFU
**
**     Beantype  : ADconverter
**
**     Version   : Bean 02.024, Driver 01.02, CPU db: 2.81.019
**
**     Compiler  : Metrowerks HC08 C Compiler V-5.0.13
**
**     Date/Time : 2.4.2002, 9:36
**
**     Abstract  :
**
**         This device "ADconverter" implements an A/D converter,
**         its control methods and interrupt/event handling procedure.
**
**     Settings  :
**
**         AD control register         : ADSCR       [56]
**         AD control register         : ADICLK      [58]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         AD result register          : ADCres      [57]
**         Interrupt name              : INT_ADC 
**         Interrupt enable reg.       : ADSCR       [56]
**         User handling procedure     : AD2_OnEnd
**         Number of conversions       : 1
**
**         Input pins
**
**              Port name              : PTB
**              Bit number (in port)   : 1
**              Bit mask of the port   : 2
**              Port data register     : PTB         [1]
**              Port control register  : DDRB        [5]
**              
**              Port name              : PTB
**              Bit number (in port)   : 0
**              Bit mask of the port   : 1
**              Port data register     : PTB         [1]
**              Port control register  : DDRB        [5]
**              
**              Port name              : PTB
**              Bit number (in port)   : 2
**              Bit mask of the port   : 4
**              Port data register     : PTB         [1]
**              Port control register  : DDRB        [5]
**              
**              Port name              : PTB
**              Bit number (in port)   : 3
**              Bit mask of the port   : 8
**              Port data register     : PTB         [1]
**              Port control register  : DDRB        [5]
**              
**              Port name              : PTB
**              Bit number (in port)   : 4
**              Bit mask of the port   : 16
**              Port data register     : PTB         [1]
**              Port control register  : DDRB        [5]
**              
**              Port name              : PTB
**              Bit number (in port)   : 5
**              Bit mask of the port   : 32
**              Port data register     : PTB         [1]
**              Port control register  : DDRB        [5]
**              
**              Port name              : PTB
**              Bit number (in port)   : 6
**              Bit mask of the port   : 64
**              Port data register     : PTB         [1]
**              Port control register  : DDRB        [5]
**              
**              Port name              : PTB
**              Bit number (in port)   : 7
**              Bit mask of the port   : 128
**              Port data register     : PTB         [1]
**              Port control register  : DDRB        [5]
**              
**              Port name              : PTD
**              Bit number (in port)   : 0
**              Bit mask of the port   : 1
**              Port data register     : PTD         [3]
**              Port control register  : DDRD        [7]
**              
**              Port name              : PTD
**              Bit number (in port)   : 1
**              Bit mask of the port   : 2
**              Port data register     : PTD         [3]
**              Port control register  : DDRD        [7]
**              
**              Port name              : PTD
**              Bit number (in port)   : 2
**              Bit mask of the port   : 4
**              Port data register     : PTD         [3]
**              Port control register  : DDRD        [7]
**              
**              Port name              : PTD
**              Bit number (in port)   : 3
**              Bit mask of the port   : 8
**              Port data register     : PTD         [3]
**              Port control register  : DDRD        [7]
**              
**              Port name              : PTD
**              Bit number (in port)   : 4
**              Bit mask of the port   : 16
**              Port data register     : PTD         [3]
**              Port control register  : DDRD        [7]
**              
**              Port name              : PTD
**              Bit number (in port)   : 5
**              Bit mask of the port   : 32
**              Port data register     : PTD         [3]
**              Port control register  : DDRD        [7]
**              
**              Port name              : PTD
**              Bit number (in port)   : 6
**              Bit mask of the port   : 64
**              Port data register     : PTD         [3]
**              Port control register  : DDRD        [7]
**              
**         Initialization:
**              Conversion             : Enabled
**              Event                  : Enabled
**         High-speed CPU mode
**             Prescaler               : divide-by-16
**
**     Contents  :
**
**         Start    - byte AD2_Start(void);
**         Stop     - byte AD2_Stop(void);
**         Measure  - byte AD2_Measure(bool WaitForResult);
**         GetValue - byte AD2_GetValue(byte *Values);
**
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2002
**
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
**
** ###################################################################
*/

#ifndef __AD2
#define __AD2

/* MODULE AD2. */

#include "Cpu.h"

void AD2_Init(void);
/*
** ===================================================================
**     Method      :  AD2_Init (bean ADconverter)
**
**     Description :
**         This method is internal. It is used by Processor Expert
**         only.
** ===================================================================
*/

byte  AD2_Start(void);
/*
** ===================================================================
**     Method      :  AD2_Start (bean ADconverter)
**
**     Description :
**         Start automatic measurements - they run one after another
**         (event OnEnd is called whenever a measurement is done).
**     Parameters  : None
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_BUSY - A conversion is already
**                           running
** ===================================================================
*/

byte  AD2_Stop(void);
/*
** ===================================================================
**     Method      :  AD2_Stop (bean ADconverter)
**
**     Description :
**         Stop automatic measurements.
**     Parameters  : None
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_BUSY - A conversion is already
**                           running
** ===================================================================
*/

byte  AD2_Measure(bool WaitForResult);
/*
** ===================================================================
**     Method      :  AD2_Measure (bean ADconverter)
**
**     Description :
**         If the automatic measurements are not started, it starts
**         one measure, otherwise it uses current automatically
**         started measure. Then this method waits till the current
**         measurement is finished and returns the measured value
**         (you can determine by a parameter how much time the
**         procedure should wait till the end of the measurement
**         (loop). Take care that in this interval no other task is
**         performed - e.g. the watchdog cannot be cleared) .
**     Parameters  :
**         NAME            - DESCRIPTION
**         Wai             - Wait for result of
**                           the convertion
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_DISABLED - Device is disabled
**                           ERR_BUSY - a conversion is already
**                           running
** ===================================================================
*/

byte AD2_GetValue(byte *Values);
/*
** ===================================================================
**     Method      :  AD2_GetValue (bean ADconverter)
**
**     Description :
**         Return the last measured value.
**     Parameters  :
**         NAME            - DESCRIPTION
**       * Dat             - Pointer to array contained
**                           measured data
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_DISABLED - Device is disabled
**                           ERR_BUSY - A conversion is already
**                           running
**                           ERR_NOTAVAIL - Requested value not
**                           available
** ===================================================================
*/

/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 02.84 for 
**     the Motorola HC08 series of microcontrollers.
**
** ###################################################################
*/
#endif /* ifndef __AD2 */

