/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : HSyncTimeout.H
**     Project   : vga2scart
**     Processor : MC9S08QD4CPC
**     Component : FreeCntr
**     Version   : Component 01.112, Driver 01.09, CPU db: 3.00.002
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 1.8.2010, 16:12
**     Abstract  :
**         This device "FreeCntr" implements a free running counter for
**         time measurement.
**     Settings  :
**         Timer name                  : TPM2 (16-bit)
**         Compare name                : TPM20
**         Counter shared              : No
**
**         High speed mode
**             Prescaler               : divide-by-1
**             Clock                   : 8000000 Hz
**           Period
**             Xtal ticks              : 2
**             microseconds            : 77
**             seconds (real)          : 0.000077
**             Hz                      : 12987
**             kHz                     : 13
**           Frequency of counting (Bus clock / prescaler)
**             Hz                      : 8000000
**
**         Initialization:
**              Timer                  : Enabled
**
**         Timer registers
**              Counter                : TPM2CNT   [$0021]
**              Mode                   : TPM2SC    [$0020]
**              Run                    : TPM2SC    [$0020]
**              Prescaler              : TPM2SC    [$0020]
**              Compare                : TPM2C0V   [$0026]
**
**         Interrupt name              : Vtpm2ch0
**         Priority                    : 
**         User handling procedure     : HSyncTimeout_OnInterrupt
**         This event is called when the counter is reinitialized
**     Contents  :
**         Reset - byte HSyncTimeout_Reset(void);
**
**     Copyright : 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

#ifndef __HSyncTimeout
#define __HSyncTimeout

/* MODULE HSyncTimeout. */

/* 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"
/* Include inherited beans */
#include "Cpu.h"

/* PUBLISHED CONSTANTS */
#define HSyncTimeout_COUNTER_INPUT_CLOCK_HZ 0x007A1200UL /* Initial counter input clock frequency [Hz] */
#define HSyncTimeout_PERIOD_VALUE     0x0268UL /* Initial period value in ticks of the timer */
#define HSyncTimeout_PRESCALER_VALUE           0x01U /* Prescaler value of the timer in high speed mode */
#define HSyncTimeout_TIMER_INPUT_CLOCK         0x007A1200UL /* Deprecated, Initial timer input clock value [Hz] */
#define HSyncTimeout_UP_COUNTER                1 /* The timer counts upwards */
/* High speed mode constants */
#define HSyncTimeout_COUNTER_INPUT_CLOCK_HZ_HIGH 0x007A1200UL /* Counter input clock frequency in high speed mode [Hz] */
#define HSyncTimeout_PERIOD_VALUE_HIGH 0x0268UL /* Period value in ticks of the timer in high speed mode */
#define HSyncTimeout_PRESCALER_VALUE_HIGH      0x01U /* Prescaler value of the timer in high speed mode */
#define HSyncTimeout_TIMER_INPUT_CLOCK_HIGH    0x007A1200UL /* Deprecated, Initial timer input clock value [Hz] */

typedef word HSyncTimeout_TTimerValue; /* Counter or compare value, width depends on timer width */

#define HSyncTimeout_Reset() ( \
  TPM2CNTH = 0x00,                     /* Reset HW Counter */ \
  (byte)ERR_OK                         /* Return result */ \
)
/*
** ===================================================================
**     Method      :  HSyncTimeout_Reset (component FreeCntr)
**
**     Description :
**         This method resets the timer-counter (sets to zero for
**         up-counting HW or to appropriate value for down-counting HW).
**         The method is available only if the counter register can be
**         set by software and the counter is not shared.
**     Parameters  : None
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
** ===================================================================
*/

void HSyncTimeout_Init(void);
/*
** ===================================================================
**     Method      :  HSyncTimeout_Init (component FreeCntr)
**
**     Description :
**         Initializes the associated peripheral(s) and the bean internal 
**         variables. The method is called automatically as a part of the 
**         application initialization code.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/

__interrupt void HSyncTimeout_Interrupt(void);
/*
** ===================================================================
**     Method      :  HSyncTimeout_Interrupt (component FreeCntr)
**
**     Description :
**         The method services the interrupt of the selected peripheral(s)
**         and eventually invokes event(s) of the bean.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/


/* END HSyncTimeout. */

#endif /* ifndef __HSyncTimeout */
/*
** ###################################################################
**
**     This file was created by Processor Expert 3.07 [04.34]
**     for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/
