/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : Inhr4.H
**     Project   : Generator
**     Processor : MC9S08GT16ACFB
**     Component : BitIO
**     Version   : Component 02.075, Driver 03.21, CPU db: 2.87.091
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 20.5.2010, 20:09
**     Abstract  :
**         This bean "BitIO" implements an one-bit input/output.
**         It uses one bit/pin of a port.
**         Note: This bean is not set in the "Safe mode". See help.
**         Methods of this bean are mostly implemented as a macros
**         (if supported by target language and compiler).
**     Settings  :
**         Used pin                    :
**             ----------------------------------------------------
**                Number (on package)  |    Name
**             ----------------------------------------------------
**                       5             |  PTC3_SCL
**             ----------------------------------------------------
**
**         Port name                   : PTC
**
**         Bit number (in port)        : 3
**         Bit mask of the port        : $0008
**
**         Initial direction           : Input (direction can be changed)
**         Safe mode                   : no
**         Initial output value        : 1
**         Initial pull option         : up
**
**         Port data register          : PTCD      [$0008]
**         Port control register       : PTCDD     [$000B]
**
**         Optimization for            : speed
**     Contents  :
**         SetDir - void Inhr4_SetDir(bool Dir);
**         GetVal - bool Inhr4_GetVal(void);
**         PutVal - void Inhr4_PutVal(bool Val);
**         ClrVal - void Inhr4_ClrVal(void);
**         SetVal - void Inhr4_SetVal(void);
**         NegVal - void Inhr4_NegVal(void);
**
**     Copyright : 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

#ifndef Inhr4_H_
#define Inhr4_H_

/* MODULE Inhr4. */

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


/*
** ===================================================================
**     Method      :  Inhr4_GetVal (component BitIO)
**
**     Description :
**         This method returns an input value.
**           a) direction = Input  : reads the input value from the
**                                   pin and returns it
**           b) direction = Output : returns the last written value
**     Parameters  : None
**     Returns     :
**         ---             - Input value. Possible values:
**                           FALSE - logical "0" (Low level)
**                           TRUE - logical "1" (High level)

** ===================================================================
*/
#define Inhr4_GetVal() ( \
    (bool)((getReg8(PTCD) & 0x08))     /* Return port data */ \
  )

/*
** ===================================================================
**     Method      :  Inhr4_PutVal (component BitIO)
**
**     Description :
**         This method writes the new output value.
**         Note: If direction is set to input the method code may not
**               work properly.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Val             - Output value. Possible values:
**                           FALSE - logical "0" (Low level)
**                           TRUE - logical "1" (High level)
**     Returns     : Nothing
** ===================================================================
*/
void Inhr4_PutVal(bool Val);

/*
** ===================================================================
**     Method      :  Inhr4_ClrVal (component BitIO)
**
**     Description :
**         This method clears (sets to zero) the output value.
**         Note: If direction is set to input the method code may not
**               work properly.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
#define Inhr4_ClrVal() ( \
    (void)clrReg8Bits(PTCD, 0x08)      /* PTCD3=0x00 */ \
  )

/*
** ===================================================================
**     Method      :  Inhr4_SetVal (component BitIO)
**
**     Description :
**         This method sets (sets to one) the output value.
**         Note: If direction is set to input the method code may not
**               work properly.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
#define Inhr4_SetVal() ( \
    (void)setReg8Bits(PTCD, 0x08)      /* PTCD3=0x01 */ \
  )

/*
** ===================================================================
**     Method      :  Inhr4_NegVal (component BitIO)
**
**     Description :
**         This method negates (inverts) the output value.
**         Note: If direction is set to input the method code may not
**               work properly.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
#define Inhr4_NegVal() ( \
    (void)invertReg8Bits(PTCD, 0x08)   /* PTCD3=invert */ \
  )

/*
** ===================================================================
**     Method      :  Inhr4_SetDir (component BitIO)
**
**     Description :
**         This method sets direction of the bean.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Dir        - Direction to set (FALSE or TRUE)
**                      FALSE = Input, TRUE = Output
**     Returns     : Nothing
** ===================================================================
*/
void Inhr4_SetDir(bool Dir);



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