/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename    : DAC1.c
**     Project     : ProcessorExpert
**     Processor   : MC56F84789VLL
**     Component   : Init_DAC
**     Version     : Component 01.019, Driver 01.07, CPU db: 3.50.001
**     Compiler    : Metrowerks DSP C Compiler
**     Date/Time   : 2012-07-05, 11:51, # CodeGen: 8
**     Abstract    :
**         This bean encapsulates 12-bit Digital to Analog Converter (DAC) interface.
**         DAC features include: 12-bit resolution, 2 microsecond conversion rate,
**         power down mode, output can be routed to internal comparator or off chip
**         DAC can drive 3K ohm, 400pF load, choice of asynchronous or synchronous
**         updates, sync input can be connected to on chip peripherals(PITs, TMRs,
**         PWM reload flag, or GPIO inputs), automatic mode allows the DAC to
**         generate it’s own output waveforms including square, triangle, and sawtooth
**         waveforms, automatic mode allows programmable period, update rate, and range.
**     Settings    :
**          Component name                                 : DAC1
**          Device                                         : DAC
**          Settings                                       : 
**            Glitch filter                                : Enabled
**            Glitch filter count bits                     : 7
**            Up counting                                  : Disabled
**            Down counting                                : Disabled
**            Automatic mode                               : Disabled
**            Data word justification                      : Right
**            High speed/low speed                         : High speed
**            DMA enable                                   : Disabled
**            Watermark level                              : 2 samples
**          Pins                                           : 
**            Output pin                                   : Enabled
**              Analog output pin                          : GPIOC5/DACO/XB_IN7
**              Analog output pin signal                   : 
**            Synchronous mode                             : Disabled
**          Initialization                                 : 
**            Call Init method                             : yes
**            Power down                                   : no
**            Enable peripheral clock                      : yes
**            DAC data register value                      : 1000
**            DAC minimum register value                   : 0
**            DAC maximum register value                   : 4095
**            DAC step size register value                 : 0
**     Contents    :
**         Init - void DAC1_Init(void);
**
**     Copyright : 1997 - 2012 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

/* MODULE DAC1. */

#include "DAC1.h"

/*
** ===================================================================
**     Method      :  DAC1_Init (component Init_DAC)
**
**     Description :
**         This method initializes registers of the DAC 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 DAC1_Init(void)
{
  /* DAC_CTRL0: ??=0,??=0,??=0,FILT_EN=1,??=0,??=0,WTMK_LVL=1,DMA_EN=0,HSLS=0,UP=0,DOWN=0,AUTO=0,SYNC_EN=0,FORMAT=0,PDN=1 */
  setReg16(DAC_CTRL0, 0x1101U);         
  /* DAC_CTRL1: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,FILT_CNT=7 */
  setReg16(DAC_CTRL1, 0x07U);           
  /* DAC_DATAREG: DATA=0x03E8 */
  setReg16(DAC_DATAREG, 0x03E8U);       
  /* DAC_STEPVAL: STEP=0 */
  setReg16(DAC_STEPVAL, 0x00U);         
  /* DAC_MINVAL: MINVAL=0 */
  setReg16(DAC_MINVAL, 0x00U);          
  /* DAC_MAXVAL: MAXVAL=0xFFFF */
  setReg16(DAC_MAXVAL, 0xFFFFU);        
  /* DAC_CTRL0: PDN=0 */
  clrReg16Bits(DAC_CTRL0, 0x01U);       
}

/* END DAC1. */

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