/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : TOD1.C
**     Project   : PE_LL64_Quick_Start
**     Processor : MC9S08LL64C_LQFP80
**     Component : Init_TOD
**     Version   : Component 01.000, Driver 01.01, CPU db: 3.00.023
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 11/30/2009, 6:01 PM
**     Abstract  :
**          This file implements the TOD (TOD) module initialization
**          according to the Peripheral Initialization Bean settings,
**          and defines interrupt service routines prototypes.
**     Settings  :
**          Bean name                                      : TOD1
**          Device                                         : TOD
**          Settings                                       : 
**            Clock settings                               : 
**              Clock select                               : External clock
**              Prescaler                                  : divide by 8192
**              Counter frequency                          : 0.2500 ms
**              TOD clock                                  : Disabled
**            Match function                               : Disabled
**            Match value                                  : 0
**          Interrupts                                     : 
**            Interrupt                                    : Vtod
**            Quarter-second interrupt                     : Disabled
**            One second interrupt                         : Enabled
**            Match interrupt                              : Enabled
**            ISR name                                     : TOD_isr
**          Initialization                                 : 
**            Enable TOD                                   : yes
**            Reset TOD                                    : no
**            Call Init method                             : yes
**     Contents  :
**         Init - void TOD1_Init(void);
**
**     Copyright : 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

/* MODULE TOD1. */

#include "TOD1.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      :  TOD1_Init (component Init_TOD)
**
**     Description :
**         This method initializes registers of the TOD module
**         according to this Peripheral Initialization Bean 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 bean for more details.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void TOD1_Init(void)
{
  /* TODC: TODEN=0 */
  clrReg8Bits(TODC, 0x80);              
  /* TODC: TODCLKS=0,TODR=0,TODCLKEN=0,TODPS=1 */
  clrSetReg8Bits(TODC, 0x7E, 0x01);     
  /* TODM: TODM=0,MQSEC=0 */
  setReg8(TODM, 0x00);                  
  /* TODSC: QSECF=1,SECF=1,MTCHF=1,QSECIE=0,SECIE=1,MTCHIE=1,MTCHEN=0,MTCHWC=0 */
  setReg8(TODSC, 0xEC);                 
  /* TODC: TODEN=1 */
  setReg8Bits(TODC, 0x80);              
}
/*
** ###################################################################
**
**  The interrupt service routine(s) must be implemented
**  by user in one of the following user modules.
**
**  If the "Generate ISR" option is enabled, Processor Expert generates
**  ISR templates in the CPU event module.
**
**  User modules:
**      PE_LL64_Quick_Start.c
**      Events.c
**
** ###################################################################
ISR(TOD_isr)
{
// NOTE: The routine should include actions to clear the appropriate
//       interrupt flags.
//
}

*/


/* END TOD1. */
/*
** ###################################################################
**
**     This file was created by Processor Expert 3.07 [04.34]
**     for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/
