⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ti1.c

📁 用freescale 8bitMCU做的触摸屏软件
💻 C
字号:
/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : TI1.C
**     Project   : touchpanal
**     Processor : MC9S08QG8CDT
**     Beantype  : TimerInt
**     Version   : Bean 02.129, Driver 01.11, CPU db: 2.87.115
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 2007-10-10, 11:31
**     Abstract  :
**         This bean "TimerInt" implements a periodic interrupt.
**         When the bean and its events are enabled, the "OnInterrupt"
**         event is called periodically with the period that you specify.
**         TimerInt supports also changing the period in runtime.
**         The source of periodic interrupt can be timer compare or reload
**         register or timer-overflow interrupt (of free running counter).
**     Settings  :
**         Timer name                  : MTIM (8-bit)
**         Compare name                : MTIMmod
**         Counter shared              : No
**
**         High speed mode
**             Prescaler               : divide-by-1
**             Clock                   : 16350 Hz
**           Initial period/frequency
**             Xtal ticks              : 256
**             microseconds            : 7829
**             milliseconds            : 8
**             seconds (real)          : 0.0078287
**             Hz                      : 128
**
**         Runtime setting             : none
**
**         Initialization:
**              Timer                  : Enabled
**              Events                 : Enabled
**
**         Timer registers
**              Counter                : MTIMCNT   [$003E]
**              Mode                   : MTIMSC    [$003C]
**              Run                    : MTIMSC    [$003C]
**              Prescaler              : MTIMCLK   [$003D]
**
**         Compare registers
**              Compare                : MTIMMOD   [$003F]
**
**         Flip-flop registers
**     Contents  :
**         No public methods
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2006
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

/* MODULE TI1. */

#include "Events.h"
#include "PE_Error.h"
#include "TI1.h"
#pragma MESSAGE DISABLE C2705          /* WARNING C2705: Possible loss of data */
#pragma MESSAGE DISABLE C5919          /* WARNING C5919: Conversion of floating to unsigned integral */
#pragma MESSAGE DISABLE C4002          /* Disable warning C4002 "Result not used" */

/* Internal method prototypes */

/* End of Internal methods declarations */

/*
** ===================================================================
**     Method      :  TI1_Init (bean TimerInt)
**
**     Description :
**         Initializes the associated peripheral(s) and the beans 
**         internal variables. The method is called automatically as a 
**         part of the application initialization code.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void TI1_Init(void)
{
  /* MTIMSC: TOF=0,TOIE=0,TRST=0,TSTP=1,??=0,??=0,??=0,??=0 */
  setReg8(MTIMSC, 0x10);               /* Stop HW */ 
  TI1_SetCV((byte)0x7F);               /* Store appropriate value to the compare/modulo register according to High speed CPU mode */
  /* MTIMCLK: ??=0,??=0,CLKS=1,PS=0 */
  setReg8(MTIMCLK, 0x10);              /* Set prescaler */ 
  /* MTIMSC: TOF=0,TOIE=1,TRST=1,TSTP=0,??=0,??=0,??=0,??=0 */
  setReg8(MTIMSC, 0x60);               /* Reset HW Counter and run timer */ 
}


/*
** ===================================================================
**     Method      :  TI1_Interrupt (bean TimerInt)
**
**     Description :
**         The method services the interrupt of the selected peripheral(s)
**         and eventually invokes the beans event(s).
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
ISR(TI1_Interrupt)
{
  (void)MTIMSC;
  MTIMSC_TOF = 0;                      /* Reset overflow interrupt request flag */
  TI1_OnInterrupt();                   /* Invoke user event */
}



/* END TI1. */

/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 3.00 [03.89]
**     for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -