/*
** ###################################################################
**
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**
**     Filename  : TI1.H
**
**     Project   : projRT1
** 
**     Processor : MC68HC908AZ60MFU
**
**     Beantype  : TimerInt
**
**     Version   : Bean 02.053, Driver 01.02, CPU db: 2.81.019
**
**     Compiler  : Metrowerks HC08 C Compiler V-5.0.13
**
**     Date/Time : 2.4.2002, 8:44
**
**     Abstract  :
**
**         This bean "TimerInt" implements a periodic interrupt.
**         When the bean and its events are enabled, the "OnInterrupt"
**         event is called periodically with the period that you specify.
**         TimerInt supports also changing the period in runtime.
**         The source of periodic interrupt can be timer compare or reload 
**         register or timer-overflow interrupt (of free running counter).
**
**     Settings  :
**
**         Timer name                  : TIM (16-bit)
**         Compare name                : TIMmod
**         Counter shared              : No
**
**         High-speed CPU mode
**             Prescaler               : divide-by-32
**           Initial period/frequency
**             Xtal ticks              : 8000000
**             microseconds            : 1000000
**             milliseconds            : 1000
**             seconds                 : 1
**             seconds (real)          : 1.0000000
**             Hz                      : 1
**
**         Runtime setting             : modes (list of settings)
**            -----------------------------------------------------------------------
**            |  period  |     Prescaler      |        Real period [seconds]        |
**     --------    or    |-----------------------------------------------------------
**     | mode | freqency | high | low  | slow |    high    |    low     |    slow   |
**     ------------------------------------------------------------------------------
**     |  0   |  1sec    | 32   | -    | -    | 1.0000000  | -          | -         | 
**     |  1   |  0_5sec  | 16   | -    | -    | 0.5000000  | -          | -         | 
**     |  2   |  2sec    | 64   | -    | -    | 2.0000000  | -          | -         | 
**     ------------------------------------------------------------------------------
**
**         Initialization:
**              Timer                  : Enabled
**              Events                 : Enabled
**
**         Timer registers
**              Counter                : TCNT      [76]
**              Mode                   : TSC       [75]
**              Run                    : TSC       [75]
**              Prescaler              : TSC       [75]
**
**         Compare registers
**              Compare                : TMOD      [78]
**
**         Flip-flop registers
**
**     Contents  :
**
**         SetPeriodMode - byte TI1_SetPeriodMode(byte Mode);
**
**
**     (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 __TI1
#define __TI1

/*Include shared modules, which are used for whole project*/
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"

                                       /* Constants for period mode */
#define TI1_Pm_1sec          0         /* Constant for switch to mode 0 */
#define TI1_Pm_0_5sec        1         /* Constant for switch to mode 1 */
#define TI1_Pm_2sec          2         /* Constant for switch to mode 2 */

/* MODULE TI1. */

#include "Cpu.h"

byte TI1_SetPeriodMode(byte Mode);
/*
** ===================================================================
**     Method      :  TI1_SetPeriodMode (bean TimerInt)
**
**     Description :
**         Switch the bean to the specified mode (changes the
**         period/frequency using a mode's values). This method
**         reduce the time needed for setting a new period value.
**         This method can be used only if you specify a list of
**         possible period settings at design time (see
**         Timing dialog box - Runtime setting - from a list of
**         values). Each of these settings constitutes a mode and
**         Processor ExpertTM assigns them a mode identifier. The
**         prescaler and compare values corresponding to each mode
**         are calculated at design time. You may switch modes at
**         runtime by referring only to a mode identifier. No
**         run-time calculations are performed, all the calculations
**         are performed at design time.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Mode       - Mode to switch to (0 to 2)
**                         0.   1sec
**                         1.   0_5sec
**                         2.   2sec
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_VALUE - Value out of range,
**                           requested timing mode is not defined
** ===================================================================
*/

__interrupt void  TI1_Interrupt(void);
/*
** ===================================================================
**     Method      :  TI1_Interrupt (bean TimerInt)
**
**     Description :
**         This method is internal. It is used by Processor Expert
**         only.
** ===================================================================
*/

void TI1_Init(void);
/*
** ===================================================================
**     Method      :  TI1_Init (bean TimerInt)
**
**     Description :
**         This method is internal. It is used by Processor Expert
**         only.
** ===================================================================
*/

/* END TI1. */

#endif /* ifndef __TI1 */
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 02.84 for 
**     the Motorola HC08 series of microcontrollers.
**
** ###################################################################
*/
