/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename    : TMR4.c
**     Project     : ProcessorExpert
**     Processor   : MC56F84789VLL
**     Component   : Init_TMR
**     Version     : Component 01.158, Driver 02.07, CPU db: 3.50.001
**     Compiler    : Metrowerks DSP C Compiler
**     Date/Time   : 2012-04-26, 16:03, # CodeGen: 1
**     Abstract    :
**         This "Init_TMR" Peripheral Inspector implements the
**         Quad Timer module (TMR), basic initialization
**         and settings.
**     Settings    :
**          Component name                                 : TMR4
**          Device                                         : TMRB3
**          Settings                                       : 
**            Clock settings                               : 
**              Primary source                             : 
**                Primary source                           : counter 2 output pin
**              Secondary source                           : 
**                Secondary source                         : counter 0 input pin
**            Operation mode                               : Cascaded count mode
**            Count once                                   : count once (untill compare)
**            Count length                                 : roll-over
**            Count direction                              : up
**            Master mode                                  : Disabled
**            External OFLAG force                         : Disabled
**            Forced OFLAG value                           : 0
**            Force OFLAG output                           : no
**            Output enable                                : yes
**            Output polarity                              : true
**            Input polarity                               : true
**            Co-channel initialization                    : Disabled
**            Input capture mode                           : Disabled
**            Reload on Capture                            : no
**            OutputMode                                   : asserted while counter is active
**            Compare load control 1                       : Disabled
**            Compare load control 2                       : Disabled
**            Debug mode action                            : Normal operation
**            Fault                                        : Disabled
**            Alternative load                             : Disabled
**            Input filter                                 : Disabled
**          Pins                                           : 
**            Output                                       : Disabled
**            Input 0                                      : Disabled
**            Input 1                                      : Disabled
**            Input 2                                      : Disabled
**            Input 3                                      : Disabled
**          Interrupts / DMA                               : 
**            Timer Channel                                : 
**              Interrupt                                  : INT_TMRB_3
**              Timer compare interrupt                    : Disabled
**              Timer overflow interrupt                   : Disabled
**              Input edge interrupt                       : Disabled
**              Compare 1 interrupt                        : Disabled
**              Compare 2 interrupt                        : Disabled
**              Interrupt priority                         : default
**              ISR name                                   : 
**              Input edge DMA                             : Disabled
**              Compare 1 DMA                              : Disabled
**              Compare 2 DMA                              : Disabled
**          Registers                                      : 
**            Timer Compare register 1                     : 0FFF
**            Timer Compare register 2                     : 0000
**            Timer Capture register                       : 0000
**            Timer Load register                          : 0000
**            Timer Counter register                       : 0000
**            Timer Comparator Load register 1             : 0000
**            Timer Comparator Load register 2             : 0000
**          Initialization                                 : 
**            Call Init method                             : yes
**            Enable peripheral clock                      : yes
**            Enable channel                               : yes
**     Contents    :
**         Init - void TMR4_Init(void);
**
**     Copyright : 1997 - 2012 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

/* MODULE TMR4. */

#include "TMR4.h"

/*
** ===================================================================
**     Method      :  TMR4_Init (component Init_TMR)
**
**     Description :
**         This method initializes registers of the TMR module
**         according to this Peripheral Initialization Bean settings.
**         Call this method in the user code to initialize the
**         module. By default, the method is called by PE
**         automatically; see "Call Init method" property of the
**         bean for more details.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void TMR4_Init(void)
{
  /* TMRB_3_CTRL: CM=0,PCS=0,SCS=0,ONCE=0,LENGTH=0,DIR=0,COINIT=0,OUTMODE=0 */
  setReg16(TMRB_3_CTRL, 0x00U);        /* Disable timer */ 
  setReg16(TMRB_3_COMP1, 0x0FFFU);     /* Set the Compare register 1 */ 
  setReg16(TMRB_3_COMP2, 0x00U);       /* Set the Compare register 2 */ 
  setReg16(TMRB_3_CAPT, 0x00U);        /* Set the Capture register */ 
  setReg16(TMRB_3_LOAD, 0x00U);        /* Set the Load register */ 
  setReg16(TMRB_3_CNTR, 0x00U);        /* Set the Counter register */ 
  /* TMRB_3_SCTRL: TCF=0,TCFIE=0,TOF=0,TOFIE=0,IEF=0,IEFIE=0,IPS=0,INPUT=1,CAPTURE_MODE=0,MSTR=0,EEOF=0,VAL=0,FORCE=0,OPS=0,OEN=1 */
  setReg16(TMRB_3_SCTRL, 0x0101U);     /* Set the Status and control register */ 
  /* TMRB_3_CMPLD1: COMPARATOR_LOAD_1=0 */
  setReg16(TMRB_3_CMPLD1, 0x00U);      /* Set the Comparator load register 1 */ 
  /* TMRB_3_CMPLD2: COMPARATOR_LOAD_2=0 */
  setReg16(TMRB_3_CMPLD2, 0x00U);      /* Set the Comparator load register 2 */ 
  /* TMRB_3_CSCTRL: DBG_EN=0,FAULT=0,ALT_LOAD=0,ROC=0,TCI=0,UP=0,??=0,TCF2EN=0,TCF1EN=0,TCF2=0,TCF1=0,CL2=0,CL1=0 */
  setReg16(TMRB_3_CSCTRL, 0x00U);      /* Set the Comparator status/control register */ 
  /* TMRB_3_FILT: ??=0,??=0,??=0,??=0,??=0,FILT_CNT=0,FILT_PER=0 */
  setReg16(TMRB_3_FILT, 0x00U);        /* Set Filter register */ 
  /* TMRB_3_DMA: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,CMPLD2DE=0,CMPLD1DE=0,IEFDE=0 */
  setReg16(TMRB_3_DMA, 0x00U);         /* Set the DMA register */ 
  /* TMRB_3_CTRL: CM=7,PCS=6,SCS=0,ONCE=1,LENGTH=0,DIR=0,COINIT=0,OUTMODE=0 */
  setReg16(TMRB_3_CTRL, 0xEC40U);      /* Set the Control register */ 
}

/* END TMR4. */

/*
** ###################################################################
**
**     This file was created by Processor Expert 5.3 [05.01]
**     for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/
