text: /* ###################################################################
  **     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
  **     Filename    : Inhr4.h
  **     Project     : PapaCaliente
  **     Processor   : MC9S08QE128CLK
  **     Component   : BitIO
  **     Version     : Component 02.086, Driver 03.27, CPU db: 3.00.067
  **     Compiler    : CodeWarrior HCS08 C Compiler
  **     Date/Time   : 2019-11-20, 10:40, # CodeGen: 40
  **     Abstract    :
  **         This component "BitIO" implements an one-bit input/output.
  **         It uses one bit/pin of a port.
  **         Methods of this component are mostly implemented as a macros
  **         (if supported by target language and compiler).
  **     Settings    :
  **         Used pin                    :
  **             ----------------------------------------------------
  **                Number (on package)  |    Name
  **             ----------------------------------------------------
  **                       28            |  PTD5_KBI2P5
  **             ----------------------------------------------------
  **
  **         Port name                   : PTD
  **
  **         Bit number (in port)        : 5
  **         Bit mask of the port        : $0020
  **
  **         Initial direction           : Output (direction can be changed)
  **         Safe mode                   : yes
  **         Initial output value        : 0
  **         Initial pull option         : off
  **
  **         Port data register          : PTDD      [$0006]
  **         Port control register       : PTDDD     [$0007]
  **
  **         Optimization for            : speed
  **     Contents    :
  **         GetDir    - bool Inhr4_GetDir(void);
  **         SetDir    - void Inhr4_SetDir(bool Dir);
  **         SetInput  - void Inhr4_SetInput(void);
  **         SetOutput - void Inhr4_SetOutput(void);
  **         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 - 2014 Freescale Semiconductor, Inc. 
  **     All Rights Reserved.
  **     
  **     Redistribution and use in source and binary forms, with or without modification,
  **     are permitted provided that the following conditions are met:
  **     
  **     o Redistributions of source code must retain the above copyright notice, this list
  **       of conditions and the following disclaimer.
  **     
  **     o Redistributions in binary form must reproduce the above copyright notice, this
  **       list of conditions and the following disclaimer in the documentation and/or
  **       other materials provided with the distribution.
  **     
  **     o Neither the name of Freescale Semiconductor, Inc. nor the names of its
  **       contributors may be used to endorse or promote products derived from this
  **       software without specific prior written permission.
  **     
  **     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  **     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  **     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  **     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  **     ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  **     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  **     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  **     ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  **     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  **     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  **     
  **     http: www.freescale.com
  **     mail: support@freescale.com
  ** ###################################################################*/
  /*!
  ** @file Inhr4.h
  ** @version 03.27
  ** @brief
  **         This component "BitIO" implements an one-bit input/output.
  **         It uses one bit/pin of a port.
  **         Methods of this component are mostly implemented as a macros
  **         (if supported by target language and compiler).
  */         
  /*!
  **  @addtogroup Inhr4_module Inhr4 module documentation
  **  @{
  */         
  
  #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 "PE_Timer.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(PTDD) & 0x20U))    /* Return port data */ \
    )
  
  /*
  ** ===================================================================
  **     Method      :  Inhr4_PutVal (component BitIO)
  **     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 pin
  **     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.
  **           a) direction = Input  : sets the output value to "0";
  **                                   this operation will be shown on
  **                                   output after the direction has
  **                                   been switched to output
  **                                   (SetDir(TRUE);)
  **           b) direction = Output : directly writes "0" to the
  **                                   appropriate pin
  **     Parameters  : None
  **     Returns     : Nothing
  ** ===================================================================
  */
  #define Inhr4_ClrVal() ( \
      (void)clrReg8Bits(PTDD, 0x20U)     /* PTDD5=0x00U */, \
      (Shadow_PTD &= 0xDFU)              /* Set appropriate bit in shadow variable */ \
    )
  
  /*
  ** ===================================================================
  **     Method      :  Inhr4_SetVal (component BitIO)
  **     Description :
  **         This method sets (sets to one) the output value.
  **           a) direction = Input  : sets the output value 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  : None
  **     Returns     : Nothing
  ** ===================================================================
  */
  #define Inhr4_SetVal() ( \
      (void)setReg8Bits(PTDD, 0x20U)     /* PTDD5=0x01U */, \
      (Shadow_PTD |= 0x20U)              /* Set appropriate bit in shadow variable */ \
    )
  
  /*
  ** ===================================================================
  **     Method      :  Inhr4_NegVal (component BitIO)
  **     Description :
  **         This method negates (inverts) the output value.
  **           a) direction = Input  : inverts the output value;
  **                                   this operation will be shown on
  **                                   output after the direction has
  **                                   been switched to output
  **                                   (SetDir(TRUE);)
  **           b) direction = Output : directly inverts the value
  **                                   of the appropriate pin
  **     Parameters  : None
  **     Returns     : Nothing
  ** ===================================================================
  */
  #define Inhr4_NegVal() ( \
      (void)invertReg8Bits(PTDD, 0x20U)  /* PTDD5=invert */, \
      (Shadow_PTD ^= 0x20U)              /* Set appropriate bit in shadow variable */ \
    )
  
  /*
  ** ===================================================================
  **     Method      :  Inhr4_GetDir (component BitIO)
  **     Description :
  **         This method returns direction of the component.
  **     Parameters  : None
  **     Returns     :
  **         ---        - Direction of the component (<false> or <true>)
  **                      <false> = Input, <true> = Output
  ** ===================================================================
  */
  #define Inhr4_GetDir() ( \
      (bool)((getReg8(PTDDD) & 0x20U))   /* Return pin direction, 0==GPI, nonzero==GPO */ \
    )
  
  /*
  ** ===================================================================
  **     Method      :  Inhr4_SetDir (component BitIO)
  **     Description :
  **         This method sets direction of the component.
  **     Parameters  :
  **         NAME       - DESCRIPTION
  **         Dir        - Direction to set (FALSE or TRUE)
  **                      FALSE = Input, TRUE = Output
  **     Returns     : Nothing
  ** ===================================================================
  */
  void Inhr4_SetDir(bool Dir);
  
  /*
  ** ===================================================================
  **     Method      :  Inhr4_SetInput (component BitIO)
  **     Description :
  **         This method sets direction of the component to input.
  **     Parameters  : None
  **     Returns     : Nothing
  ** ===================================================================
  */
  #define Inhr4_SetInput() ( \
      (void)clrReg8Bits(PTDDD, 0x20U)    /* PTDDD5=0x00U */ \
    )
  
  /*
  ** ===================================================================
  **     Method      :  Inhr4_SetOutput (component BitIO)
  **     Description :
  **         This method sets direction of the component to output.
  **     Parameters  : None
  **     Returns     : Nothing
  ** ===================================================================
  */
  void Inhr4_SetOutput(void);
  
  
  
  /* END Inhr4. */
  #endif /* #ifndef __Inhr4_H_ */
  /*!
  ** @}
  */
  /*
  ** ###################################################################
  **
  **     This file was created by Processor Expert 10.3 [05.09]
  **     for the Freescale HCS08 series of microcontrollers.
  **
  ** ###################################################################
  */
  