/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : LED0.C
**     Project   : DC18
**     Processor : MC56F8006_32_LQFP
**     Component : BitIO
**     Version   : Component 02.075, Driver 01.18, CPU db: 3.00.188
**     Compiler  : Metrowerks DSP C Compiler
**     Date/Time : 5/31/2010, 10:09 AM
**     Abstract  :
**         This bean "BitIO" implements an one-bit input/output.
**         It uses one bit/pin of a port.
**         Note: This bean is set to work in Output direction only.
**         Methods of this bean are mostly implemented as a macros
**         (if supported by target language and compiler).
**     Settings  :
**         Used pin                    :
**             ----------------------------------------------------
**                Number (on package)  |    Name
**             ----------------------------------------------------
**                       29            |  GPIOA0_PWM0
**             ----------------------------------------------------
**
**         Port name                   : GPIOA
**
**         Bit number (in port)        : 0
**         Bit mask of the port        : 1
**
**         Initial direction           : Output (direction cannot be changed)
**         Initial output value        : 0
**         Initial pull option         : off
**
**         Port data register          : GPIO_A_DR [61825]
**         Port control register       : GPIO_A_DDR [61826]
**         Port function register      : GPIO_A_PER [61827]
**
**         Optimization for            : code size
**     Contents  :
**         PutVal - void LED0_PutVal(bool Val);
**         NegVal - void LED0_NegVal(void);
**
**     Copyright : 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

/* MODULE LED0. */

#include "LED0.h"
/*Include shared modules, which are used for whole project*/
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"

#include "Cpu.h"


/*
** ===================================================================
**     Method      :  BitIO__PutVal (component BitIO)
**
**     Description :
**         Sets pin value. The method is called automatically as a part 
**         of several methods if optimization for code size is required.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void BitIO__PutVal(byte port, register word mask, bitAction value, register byte safe, word *Shadow)
{
  tBitIO_portDsc *Item=&BitIO_portDsc[port];
  register word *TempReg=Item->portReg; /* Temporary variable - data port address */

  switch (value) {                     /* Which operation should be performed? */
  case CLR:                            /* Set output value to zero */
    if (safe) {                        /* Is Safe mode active? */
      *Shadow &= ~mask;                /* Clear appropriate bit in shadow variable */
    }
    *TempReg &= ~mask;                 /* Clear appropriate bit in appropriate port */
    break;
  case SET:                            /* Set output value to one */
    if (safe) {                        /* Is Safe mode active? */
      *Shadow |= mask;                 /* Set appropriate bit in shadow variable */
    }
    *TempReg |= mask;                  /* Set appropriate bit in appropriate port */
    break;
  case NEG:                            /* Negate output value */
    if (safe) {                        /* Is Safe mode active? */
      *Shadow ^= mask;                 /* Negate appropriate bit in shadow variable */
    }
    *TempReg ^= mask;                  /* Negate appropriate bit in appropriate port */
    break;
  }
}

/*
** ===================================================================
**     Method      :  LED0_PutVal (component BitIO)
**
**     Description :
**         This method writes the new output value.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Val             - Output value. Possible values:
**                           FALSE - logical "0" (Low level)
**                           TRUE - logical "1" (High level)
**     Returns     : Nothing
** ===================================================================
*/
/*
void LED0_PutVal(bool Val)

**  This method is implemented as a macro. See LED0.h file.  **
*/

/*
** ===================================================================
**     Method      :  LED0_NegVal (component BitIO)
**
**     Description :
**         This method negates (inverts) the output value.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
/*
void LED0_NegVal(void)

**  This method is implemented as a macro. See LED0.h file.  **
*/

/* END LED0. */

/*
** ###################################################################
**
**     This file was created by Processor Expert 3.00 [04.35]
**     for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/
