/*
** ###################################################################
**
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**
**     Filename  : PWM1.H
**
**     Project   : Full1
** 
**     Processor : MC68HC908AZ60MFU
**
**     Beantype  : PWM
**
**     Version   : Bean 02.039, 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 bean implements a pulse-width modulation generator
**         that generates signal with variable duty and fixed cycle. 
**
**     Settings  :
**
**         Used output pin             : 
**             ----------------------------------------------------
**                Number (on package)  |    Name
**             ----------------------------------------------------
**                       8             |  PTF4_TBCH0
**             ----------------------------------------------------
**
**         Timer name                  : TIMB_PWM [16-bit] 
**           PWM signal generation     : unbuffered
**
**         Counter                     : TBCNT     [65]
**         Mode register               : TBSCR     [64]
**         Run register                : TBSCR     [64]
**         Prescaler                   : TBSCR     [64]
**         Compare register            : TBCH0     [70]
**         Flip-flop register          : TBSC0     [69]
**
**         User handling procedure     : not specified
**
**         Port name                   : PTF
**         Bit number (in port)        : 4
**         Bit mask of the port        : 16
**         Port data register          : PTF       [9]
**         Port control register       : DDRF      [13]
**
**         Initialization:
**              Output level           : low
**              Timer                  : Enabled
**              Event                  : Enabled
**         High-speed CPU mode
**             Prescaler               : divide-by-8
**             Clock                   : 250000 Hz
**           Initial value of            period     pulse width
**             Xtal ticks              : 2048000    1024000
**             microseconds            : 256000     128000
**             milliseconds            : 256        128
**             seconds (real)          : 0.2560000  0.1280000
**
**
**     Contents  :
**
**         SetRatio16 - byte PWM1_SetRatio16(word Ratio);
**         SetDutyUS  - byte PWM1_SetDutyUS(word Time);
**         SetDutyMS  - byte PWM1_SetDutyMS(word Time);
**
**
**     (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 __PWM1
#define __PWM1

/*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 "PE_Timer.h"

/* MODULE PWM1. */

#include "Cpu.h"

byte PWM1_SetRatio16(word Ratio);
/*
** ===================================================================
**     Method      :  PWM1_SetRatio16 (bean PWM)
**
**     Description :
**         This method sets a new duty-cycle ratio.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Ratio      - Ratio is expressed as an 16-bit unsigned integer
**                      number. 0 - 65535 value is proportional
**                      to ratio 0 - 100%
**     Returns     :
**         ---        - Error code
** ===================================================================
*/

byte PWM1_SetDutyUS(word Time);
/*
** ===================================================================
**     Method      :  PWM1_SetDutyUS (bean PWM)
**
**     Description :
**         This method sets the new duty value of the output signal.
**         The duty is expressed in microseconds as a 16-bit
**         unsigned integer number.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Time            - Duty to set [in microseconds]
**                      (0 to 65535 us in high speed CPU mode)
**     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
** ===================================================================
*/

byte PWM1_SetDutyMS(word Time);
/*
** ===================================================================
**     Method      :  PWM1_SetDutyMS (bean PWM)
**
**     Description :
**         This method sets the new duty value of the output signal.
**         The duty is expressed in milliseconds as a 16-bit
**         unsigned integer number.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Time            - Duty to set [in milliseconds]
**                      (0 to 256 ms in high speed CPU mode)
**     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 PWM1_Init(void);
/*
** ===================================================================
**     Method      :  PWM1_Init (bean PWM)
**
**     Description :
**         This method is internal. It is used by Processor Expert
**         only.
** ===================================================================
*/


/* END PWM1. */

#endif /* ifndef __PWM1 */
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 02.84 for 
**     the Motorola HC08 series of microcontrollers.
**
** ###################################################################
*/
