/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : PIT1.C
**     Project   : bldc_hall_demo
**     Processor : MC56F8006_48_LQFP
**     Beantype  : Init_PIT
**     Version   : Bean 01.054, Driver 01.04, CPU db: 3.00.177
**     Compiler  : Metrowerks DSP C Compiler
**     Date/Time : 27.11.2008, 16:03
**     Abstract  :
**         This module encapsulates the Programmable Interval Timer module (PIT)
**         contains a 16 bit up counter, a modulo register, and a control register.
**         The PIT module design includes these distinctive features: 16 bit counter/timer,
**         programmable count modulo, max count rate equals peripheral clock rate,
**         slave mode allows synchronization of multiple PIT count enables.
**     Settings  :
**          Bean name                                      : PIT1
**          Device                                         : PIT
**          Settings
**            Slave mode                                   : Disabled
**            Clock settings
**              Prescaler                                  : 32
**              Modulo register value                      : 2000
**          Interrupts
**            Roll-over interrupt                          : 
**              Interrupt                                  : INT_PIT
**              Roll-over interrupt                        : Enabled
**              Interrupt priority                         : medium priority
**              ISR name                                   : ISR_SpeedController
**          Initialization
**            Call Init method                             : yes
**            Counter enable                               : yes
**     Contents  :
**         Init - void PIT1_Init(void);
**
**     (c) Copyright UNIS, a.s. 1997-2008
**     UNIS, a.s.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

/* MODULE PIT1. */

#include "PIT1.h"

/*
** ###################################################################
**
**  The following method(s) must be implemented by the user in one
**  of the following modules:
**
**    #pragma interrupt
**    void ISR_SpeedController(void)
**
**  Modules:
**       bldc_hall_demo
**       Events
**
** ###################################################################
*/

/*
** ===================================================================
**     Method      :  PIT1_Init (bean Init_PIT)
**
**     Description :
**         This method initializes registers of the PIT 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 PIT1_Init(void)
{
  /* PIT_CTRL: ??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,PRESCALER=5,PRF=0,PRIE=1,CNT_EN=0 */
  setReg16(PIT_CTRL, 0x2A);            /* Set PIT_CTRL register and clear PRF flag */ 
  /* PIT_MOD: MODULO_VALUE=0x07D0 */
  setReg16(PIT_MOD, 0x07D0);            
  /* PIT_CTRL: CNT_EN=1 */
  setReg16Bits(PIT_CTRL, 0x01);        /* Run PIT */ 

}

/* END PIT1. */

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