/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : Inhr3.C
**     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
**             ----------------------------------------------------
**                       4             |  PTC2_SDA
**             ----------------------------------------------------
**
**         Port name                   : PTC
**
**         Bit number (in port)        : 2
**         Bit mask of the port        : $0004
**
**         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 Inhr3_SetDir(bool Dir);
**         GetVal - bool Inhr3_GetVal(void);
**         PutVal - void Inhr3_PutVal(bool Val);
**         ClrVal - void Inhr3_ClrVal(void);
**         SetVal - void Inhr3_SetVal(void);
**         NegVal - void Inhr3_NegVal(void);
**
**     Copyright : 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

/* MODULE Inhr3. */

#include "Inhr3.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 "Cpu.h"


/*
** ===================================================================
**     Method      :  Inhr3_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)

** ===================================================================
*/
/*
bool Inhr3_GetVal(void)

**  This method is implemented as a macro. See Inhr3.h file.  **
*/

/*
** ===================================================================
**     Method      :  Inhr3_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 Inhr3_PutVal(bool Val)
{
  if (Val) {
    setReg8Bits(PTCD, 0x04);           /* PTCD2=0x01 */
  } else { /* !Val */
    clrReg8Bits(PTCD, 0x04);           /* PTCD2=0x00 */
  } /* !Val */
}

/*
** ===================================================================
**     Method      :  Inhr3_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
** ===================================================================
*/
/*
void Inhr3_ClrVal(void)

**  This method is implemented as a macro. See Inhr3.h file.  **
*/

/*
** ===================================================================
**     Method      :  Inhr3_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
** ===================================================================
*/
/*
void Inhr3_SetVal(void)

**  This method is implemented as a macro. See Inhr3.h file.  **
*/

/*
** ===================================================================
**     Method      :  Inhr3_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
** ===================================================================
*/
/*
void Inhr3_NegVal(void)

**  This method is implemented as a macro. See Inhr3.h file.  **
*/

/*
** ===================================================================
**     Method      :  Inhr3_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 Inhr3_SetDir(bool Dir)
{
  if (Dir) {
    setReg8Bits(PTCDD, 0x04);          /* PTCDD2=0x01 */
  } else { /* !Dir */
    clrReg8Bits(PTCDD, 0x04);          /* PTCDD2=0x00 */
  } /* !Dir */
}


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