/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename    : CMP1.c
**     Project     : ProcessorExpert
**     Processor   : MC56F84789VLL
**     Component   : Init_HSCMP
**     Version     : Component 01.006, Driver 01.06, CPU db: 3.50.001
**     Compiler    : Metrowerks DSP C Compiler
**     Date/Time   : 2012-04-06, 16:26, # CodeGen: 22
**     Abstract    :
**          This file implements the HSCMP (CMPA) module initialization
**          according to the Peripheral Initialization settings, and
**          defines interrupt service routines prototypes.
**     Settings    :
**          Component name                                 : CMP1
**          Device                                         : CMPA
**          Settings                                       : 
**            Sample                                       : Disabled
**            Windowing                                    : Disabled
**            Filter sample count                          : 3
**            Filter sample period                         : 50
**            Sampling period                              : 0.5000 us
**            Invert control                               : Do NOT invert
**            Comparator output select                     : Filtered
**            Power mode                                   : High speed
**            Hysteresis control                           : Level 3
**          Pins/Signals                                   : 
**            Positive input pins                          : Enabled
**              Positive input pin0                        : Disabled
**              Positive input pin1                        : Disabled
**              Positive input pin2                        : Disabled
**              Positive input pin3                        : Disabled
**              Positive input pin4                        : Disabled
**              Positive input pin7                        : Enabled
**                Positive input pin7                      : DAC6b0_Output
**                Positive input pin7 signal               : 
**            Negative input pins                          : Enabled
**              Negative input pin0                        : Enabled
**                Negative input pin0                      : GPIOA1/ANA1/CMPA_IN0
**                Negative input pin0 signal               : 
**              Negative input pin1                        : Disabled
**              Negative input pin2                        : Disabled
**              Negative input pin3                        : Disabled
**              Negative input pin4                        : Disabled
**              Negative input pin7                        : Disabled
**            Window/Sample input                          : Enabled
**              Window/Sample input pin                    : Logic_One
**              Window/Sample input pin signal             : 
**            Output pin                                   : Disabled
**          Interrupts/DMA                                 : 
**            Rising or Falling compare                    : 
**              Interrupt                                  : INT_CMPA
**              Interrupt priority                         : default
**              ISR name                                   : 
**              Rising compare interrupt                   : Disabled
**              Falling compare interrupt                  : Disabled
**          Initialization                                 : 
**            Comparator module                            : Enabled
**            Initial positive input                       : P7
**            Initial negative input                       : M0
**            Peripheral clock enable                      : Enabled
**            Call Init method                             : yes
**     Contents    :
**         Init - void CMP1_Init(void);
**
**     Copyright : 1997 - 2012 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

/* MODULE CMP1. */

#include "CMP1.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      :  CMP1_Init (component Init_HSCMP)
**
**     Description :
**         This method initializes registers of the HSCMP module
**         according to the Peripheral Initialization settings.
**         Call this method in user code to initialize the module. By
**         default, the method is called by PE automatically; see "Call
**         Init method" property of the component for more details.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void CMP1_Init(void)
{
  /* CMPA_CR1: SE=0,WE=0,??=0,PMODE=0,INV=0,COS=0,OPE=0,EN=0 */
  clrReg16Bits(CMPA_CR1, 0xFFU);        
  /* CMPA_CR0: ??=0,FILTER_CNT=0,??=0,??=0,HYSTCTR=0 */
  clrReg16Bits(CMPA_CR0, 0xFFU);        
  /* CMPA_MUXCR: ??=0,??=0,PSEL=0,MSEL=0 */
  clrReg16Bits(CMPA_MUXCR, 0xFFU);      
  /* CMPA_FPR: FILT_PER=0x32 */
  clrSetReg16Bits(CMPA_FPR, 0xCDU, 0x32U); 
  /* CMPA_CR1: SE=0,WE=0,??=0,PMODE=1,INV=0,COS=0,OPE=0,EN=0 */
  clrSetReg16Bits(CMPA_CR1, 0xEFU, 0x10U); 
  /* CMPA_SCR: ??=0,IER=0,IEF=0,CFR=1,CFF=1,COUT=0 */
  clrSetReg16Bits(CMPA_SCR, 0x99U, 0x06U); 
  /* CMPA_CR0: ??=0,FILTER_CNT=3,??=0,??=0,HYSTCTR=3 */
  clrSetReg16Bits(CMPA_CR0, 0xCCU, 0x33U); 
  /* CMPA_MUXCR: PSEL=7,MSEL=0 */
  clrSetReg16Bits(CMPA_MUXCR, 0x07U, 0x38U); 
  /* CMPA_CR1: EN=1 */
  setReg16Bits(CMPA_CR1, 0x01U);        
}


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