/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : Bit1.H
**     Project   : LED_ADC
**     Processor : MC9S08QE128CLK
**     Beantype  : BitIO
**     Version   : Bean 02.068, Driver 03.13, CPU db: 3.00.000
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 14/5/2007, 15:07
**     Abstract  :
**         This bean "BitIO" implements an one-bit input/output.
**         It uses one bit/pin of a port.
**         Methods of this bean are mostly implemented as a macros
**         (if supported by target language and compiler).
**     Settings  :
**         Used pin                    :
**             ----------------------------------------------------
**                Number (on package)  |    Name
**             ----------------------------------------------------
**                       34            |  PTC0_TPM3CH0
**             ----------------------------------------------------
**
**         Port name                   : PTC
**
**         Bit number (in port)        : 0
**         Bit mask of the port        : $0001
**
**         Initial direction           : Output (direction can be changed)
**         Safe mode                   : yes
**         Initial output value        : 0
**         Initial pull option         : off
**
**         Port data register          : PTCD      [$0004]
**         Port control register       : PTCDD     [$0005]
**
**         Optimization for            : speed
**     Contents  :
**         SetDir   - void Bit1_SetDir(bool Dir);
**         SetInput - void Bit1_SetInput(void);
**         ClrVal   - void Bit1_ClrVal(void);
**         SetVal   - void Bit1_SetVal(void);
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2006
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

#ifndef Bit1_H_
#define Bit1_H_

/* MODULE Bit1. */

  /* 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      :  Bit1_ClrVal (bean 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 Bit1_ClrVal() ( \
    (void)clrReg8Bits(PTCD, 0x01)      /* PTCD0=0x00 */, \
    Shadow_PTC &= ~0x01                /* Set appropriate bit in shadow variable */ \
  )

/*
** ===================================================================
**     Method      :  Bit1_SetVal (bean 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 Bit1_SetVal() ( \
    (void)setReg8Bits(PTCD, 0x01)      /* PTCD0=0x01 */, \
    Shadow_PTC |= 0x01                 /* Set appropriate bit in shadow variable */ \
  )

/*
** ===================================================================
**     Method      :  Bit1_SetDir (bean 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 Bit1_SetDir(bool Dir);

/*
** ===================================================================
**     Method      :  Bit1_SetInput (bean BitIO)
**
**     Description :
**         This method sets direction of the bean to input.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
#define Bit1_SetInput() ( \
    (void)clrReg8Bits(PTCDD, 0x01)     /* PTCDD0=0x00 */ \
  )



/* END Bit1. */
#endif /* #ifndef __Bit1_H_ */
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 3.00 [03.89]
**     for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/
