/*
** ###################################################################
**
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**
**     Filename  : Byte1.H
**
**     Project   : Full1
** 
**     Processor : MC68HC908AZ60MFU
**
**     Beantype  : ByteIO
**
**     Version   : Bean 02.013, Driver 02.10, CPU db: 2.81.019
**
**     Compiler  : Metrowerks HC08 C Compiler V-5.0.13
**
**     Date/Time : 2.4.2002, 9:36
**
**     Abstract  :
**
**         This bean "ByteIO" implements an one-byte input/output.
**         It uses one 8-bit port.
**         Methods of this bean are mostly implemented as a macros 
**         (if supported by target langauage and compiler).
**
**     Settings  :
**
**         Port name                   : PTA
**
**         Initial direction           : Output (direction can be changed)
**         Safe mode                   : yes
**         Initial output value        : 0 = 000H
**         Initial pull option         : off
**
**         8-bit data register         : PTA       [0]
**         8-bit control register      : DDRA      [4]
**
**             ----------------------------------------------------
**                   Bit     |   Pin   |   Name
**             ----------------------------------------------------
**                    0      |    26   |   PTA0
**                    1      |    27   |   PTA1
**                    2      |    28   |   PTA2
**                    3      |    29   |   PTA3
**                    4      |    30   |   PTA4
**                    5      |    31   |   PTA5
**                    6      |    32   |   PTA6
**                    7      |    33   |   PTA7
**             ----------------------------------------------------
**
**     Contents  :
**
**         GetDir - bool Byte1_GetDir(void);
**         SetDir - void Byte1_SetDir(bool Dir);
**         GetVal - byte Byte1_GetVal(void);
**         PutVal - void Byte1_PutVal(byte Val);
**         GetBit - bool Byte1_GetBit(byte Bit);
**         PutBit - void Byte1_PutBit(byte Bit,bool Val);
**         SetBit - void Byte1_SetBit(byte Bit);
**         ClrBit - void Byte1_ClrBit(byte Bit);
**         NegBit - void Byte1_NegBit(byte Bit);
**
**
**     (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 __Byte1_H
#define __Byte1_H


/*Including shared modules, which are used in the whole project*/
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "PE_Timer.h"
#include "PE_Cnvrt.h"
#include "Cpu.h"

/*
** ===================================================================
**     Method      :  Byte1_GetVal (bean ByteIO)
**
**     Description :
**         This method returns an input value.
**           a) direction = Input  : reads the input value from the
**                                   pins and returns it
**           b) direction = Output : returns the last written value
**     Parameters  : None
**     Returns     :
**         ---        - Input value (0 to 255)
** ===================================================================
*/
#define Byte1_GetVal() (PTA)

/*
** ===================================================================
**     Method      :  Byte1_PutVal (bean ByteIO)
**
**     Description :
**         This method writes the new output value.
**           a) direction = Input  : sets the new output value;
**                                   this operation will be shown on
**                                   output after the direction has
**                                   been switched to output
**                                   (SetDir(TRUE);)
**           b) direction = Output : directly writes the value to the
**                                   appropriate pins
**     Parameters  :
**         NAME       - DESCRIPTION
**         Value      - Output value (0 to 255)
**     Returns     : Nothing
** ===================================================================
*/
#define Byte1_PutVal(Val) (Shadow_PTA = (Val),PTA = (Val))

/*
** ===================================================================
**     Method      :  Byte1_GetBit (bean ByteIO)
**
**     Description :
**         This method returns the specified bit of the input value.
**           a) direction = Input  : reads the input value from pins
**                                   and returns the specified bit
**           b) direction = Output : returns the specified bit
**                                   of the last written value
**     Parameters  :
**         NAME       - DESCRIPTION
**         BitNum     - Number of the bit to read (0 to 7)
**     Returns     :
**         ---        - Value of the specified bit (FALSE or TRUE)
**                      FALSE = "0" or "Low", TRUE = "1" or "High"
** ===================================================================
*/
bool Byte1_GetBit(byte BitNum);

/*
** ===================================================================
**     Method      :  Byte1_PutBit (bean ByteIO)
**
**     Description :
**         This method writes the new value to the specified bit
**         of the output value.
**           a) direction = Input  : sets the value of the specified
**                                   bit; this operation will be
**                                   shown on output after the
**                                   direction has been switched to
**                                   output (SetDir(TRUE);)
**           b) direction = Output : directly writes the value of the
**                                   bit to the appropriate pin
**     Parameters  :
**         NAME       - DESCRIPTION
**         BitNum     - Number of the bit (0 to 7)
**         Val        - New value of the bit (FALSE or TRUE)
**                      FALSE = "0" or "Low", TRUE = "1" or "High"
**     Returns     : Nothing
** ===================================================================
*/
void Byte1_PutBit(byte BitNum, byte Value);

/*
** ===================================================================
**     Method      :  Byte1_SetBit (bean ByteIO)
**
**     Description :
**         This method sets (sets to one) the specified bit of the
**         output value.
**         [ It is the same as "PutBit(Bit,TRUE);" ]
**           a) direction = Input  : sets the specified bit to "1";
**                                   this operation will be shown on
**                                   output after the direction has
**                                   been switched to output
**                                   (SetDir(TRUE);)
**           b) direction = Output : directly writes "1" to the
**                                   appropriate pin
**     Parameters  :
**         NAME       - DESCRIPTION
**         BitNum     - Number of the bit to set (0 to 7)
**     Returns     : Nothing
** ===================================================================
*/
void Byte1_SetBit(byte BitNum);

/*
** ===================================================================
**     Method      :  Byte1_ClrBit (bean ByteIO)
**
**     Description :
**         This method clears (sets to zero) the specified bit
**         of the output value.
**         [ It is the same as "PutBit(Bit,FALSE);" ]
**           a) direction = Input  : sets the specified bit to "0";
**                                   this operation will be shown on
**                                   output after the direction has
**                                   beenswitched to output
**                                   (SetDir(TRUE);)
**           b) direction = Output : directly writes "0" to the
**                                   appropriate pin
**     Parameters  :
**         NAME       - DESCRIPTION
**         BitNum     - Number of the bit to clear (0 to 7)
**     Returns     : Nothing
** ===================================================================
*/
void Byte1_ClrBit(byte BitNum);

/*
** ===================================================================
**     Method      :  Byte1_NegBit (bean ByteIO)
**
**     Description :
**         This method negates (invertes) the specified bit of the
**         output value.
**           a) direction = Input  : invertes the specified bit;
**                                   this operation will be shown on
**                                   output after the direction has
**                                   been switched to output
**                                   (SetDir(TRUE);)
**           b) direction = Output : directly invertes the value
**                                   of the appropriate pin
**     Parameters  :
**         NAME       - DESCRIPTION
**         BitNum     - Number of the bit to invert (0 to 7)
**     Returns     : Nothing
** ===================================================================
*/
void Byte1_NegBit(byte BitNum);

/*
** ===================================================================
**     Method      :  Byte1_SetDir (bean ByteIO)
**
**     Description :
**         This method sets direction of the bean.
**     Parameters  :
**         NAME       - DESCRIPTION
**         DirOutput  - Direction to set (FALSE or TRUE)
**                      FALSE = Input, TRUE = Output
**     Returns     : Nothing
** ===================================================================
*/
void Byte1_SetDir(byte Output);

/*
** ===================================================================
**     Method      :  Byte1_GetDir (bean ByteIO)
**
**     Description :
**         This method returns direction of the bean.
**     Parameters  : None
**     Returns     :
**         ---        - Direction of the bean (FALSE or TRUE)
**                      FALSE = Input, TRUE = Output
** ===================================================================
*/
#define Byte1_GetDir() ((DDRA)&1)

#endif /* __Byte1_H*/
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 02.84 for 
**     the Motorola HC08 series of microcontrollers.
**
** ###################################################################
*/
