/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : Frekvence_filtr.H
**     Project   : Generator
**     Processor : MC9S08GT16ACFB
**     Component : TimerOut
**     Version   : Component 03.016, Driver 01.20, CPU db: 2.87.091
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 27.3.2010, 21:03
**     Abstract  :
**         This bean implements a periodic signal generator 1:1 (Flip-Flop Output).
**         The signal alternates the "0" and "1" output values in exactly
**         regular intervals; that is why the time length of the "0" part
**         of one pulse is equal to the "1" part of one pulse.
**     Settings  :
**         Used output pin             : 
**             ----------------------------------------------------
**                Number (on package)  |    Name
**             ----------------------------------------------------
**                       20            |  PTD3_TPM2CLK_TPM2CH0
**             ----------------------------------------------------
**
**         Timer name                  : TPM2 (16-bit)
**         Compare name                : TPM20
**           Counter shared            : No
**
**         High speed mode
**             Prescaler               : divide-by-1
**             Clock                   : 10000000 Hz
**           Pulse width
**             Xtal ticks              : 20
**             microseconds            : 1
**             seconds (real)          : 0.000001
**             Hz                      : 1000000
**             kHz                     : 1000
**             MHz                     : 1
**
**         Runtime setting             : pulse width interval (continual setting)
**             ticks                   : 4 to 400 ticks
**             microseconds            : 1 to 20 microseconds
**             seconds (real)          : 0.0000002 to 0.00002 seconds
**             Hz                      : 50000 to 5000000 Hz
**             kHz                     : 50 to 5000 kHz
**             MHz                     : 1 to 5 MHz
**
**         Initialization:
**              Output level           : low
**              Timer                  : Disabled
**              Events                 : Enabled
**
**         Timer registers
**              Counter                : TPM2CNT   [$0061]
**              Mode                   : TPM2SC    [$0060]
**              Run                    : TPM2SC    [$0060]
**              Prescaler              : TPM2SC    [$0060]
**
**         Compare registers
**              Compare                : TPM2C0V   [$0066]
**
**         Flip-flop registers
**              Mode                   : TPM2C0SC  [$0065]
**     Contents  :
**         Enable        - byte Frekvence_filtr_Enable(void);
**         Disable       - byte Frekvence_filtr_Disable(void);
**         SetPeriodReal - byte Frekvence_filtr_SetPeriodReal(float Time);
**
**     Copyright : 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

#ifndef __Frekvence_filtr
#define __Frekvence_filtr

/* MODULE Frekvence_filtr. */

/*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 "Cpu.h"

/* PUBLISHED CONSTANTS */
#define Frekvence_filtr_SPREAL_MIN 0.0000002F /* Lower bound of interval for method SetPeriodReal */
#define Frekvence_filtr_SPRMin Frekvence_filtr_SPREAL_MIN /* Deprecated */
#define Frekvence_filtr_SPREAL_MAX 0.00002F /* Upper bound of interval for method SetPeriodReal */
#define Frekvence_filtr_SPRMax Frekvence_filtr_SPREAL_MAX /* Deprecated */

byte Frekvence_filtr_Enable(void);
/*
** ===================================================================
**     Method      :  Frekvence_filtr_Enable (component TimerOut)
**
**     Description :
**         This method enables the component - It starts the signal
**         generation. Events may be generated (<DisableEvent>
**         /<EnableEvent>).
**     Parameters  : None
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
** ===================================================================
*/

byte Frekvence_filtr_Disable(void);
/*
** ===================================================================
**     Method      :  Frekvence_filtr_Disable (component TimerOut)
**
**     Description :
**         This method disables the timer - it stops signal generation
**         and events calling. When the timer is disabled, it is
**         possible to call methods <ClrValue> and <SetValue>.
**     Parameters  : None
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
** ===================================================================
*/

byte Frekvence_filtr_SetPeriodReal(float Time);
/*
** ===================================================================
**     Method      :  Frekvence_filtr_SetPeriodReal (component TimerOut)
**
**     Description :
**         This method sets the new period of the output signal. The
**         period is expressed in seconds as a real number.
**         This method is available only if the runtime setting type
**         'from interval' is selected in the Timing dialog box in
**         the Runtime setting area.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Time            - Period to set [in seconds]
**                      (0.0000002 to 0.00002 seconds)
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_MATH - Overflow during evaluation
**                           ERR_RANGE - Parameter out of range
** ===================================================================
*/

void Frekvence_filtr_InitTO(void);
/*
** ===================================================================
**     Method      :  Frekvence_filtr_InitTO (component TimerOut)
**
**     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.
** ===================================================================
*/

#define Frekvence_filtr_SetPV(_Val) \
  TPM2CNTH = 0x00; \
  TPM2SC = (byte)((TPM2SC & 0x78) | _Val);
/*
** ===================================================================
**     Method      :  SetPV (component TimerOut)
**
**     Description :
**         The method sets prescaler of the device.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/

static void Frekvence_filtr_SetCV(word Val);
/*
** ===================================================================
**     Method      :  SetCV (component TimerOut)
**
**     Description :
**         The method computes and sets compare eventually modulo value 
**         for time measuring.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/


/* END Frekvence_filtr. */

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