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

📄 ticktimer.h

📁 FreeRTOS-3.2.4-HCS08 Files
💻 H
字号:
/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : TickTimer.H
**     Project   : RTOSDemo
**     Processor : MC9S08GT60CFB
**     Beantype  : TimerInt
**     Version   : Bean 02.110, Driver 01.08, CPU db: 2.87.086
**     Compiler  : Metrowerks HCS08 C Compiler
**     Date/Time : 3/10/2006, 2:35 PM
**     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                  : TPM2 (16-bit)
**         Compare name                : TPM21
**         Counter shared              : No
**
**         High speed mode
**             Prescaler               : divide-by-4
**             Clock                   : 4998857 Hz
**           Initial period/frequency
**             Xtal ticks              : 4000
**             microseconds            : 1000
**             milliseconds            : 1
**             seconds (real)          : 0.0010000
**             Hz                      : 1000
**             kHz                     : 1
**
**         Runtime setting             : period/frequency interval (continual setting)
**             ticks                   : 8 to 40000 ticks
**             microseconds            : 2 to 10000 microseconds
**             milliseconds            : 1 to 10 milliseconds
**             seconds (real)          : 0.0000018 to 0.0100001 seconds
**             Hz                      : 100 to 555428 Hz
**             kHz                     : 1 to 555 kHz
**
**         Initialization:
**              Timer                  : Disabled
**              Events                 : Enabled
**
**         Timer registers
**              Counter                : TPM2CNT   [0061]
**              Mode                   : TPM2SC    [0060]
**              Run                    : TPM2SC    [0060]
**              Prescaler              : TPM2SC    [0060]
**
**         Compare registers
**              Compare                : TPM2C1V   [0069]
**
**         Flip-flop registers
**              Mode                   : TPM2C1SC  [0068]
**     Contents  :
**         Enable    - byte TickTimer_Enable(void);
**         SetFreqHz - byte TickTimer_SetFreqHz(word Freq);
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2005
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

#ifndef __TickTimer
#define __TickTimer

/* MODULE TickTimer. */

/*Include shared modules, which are used for whole project*/
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "PE_Timer.h"
#include "Cpu.h"

#define TickTimer_SFHzMin  0x64        /* Lower bound of interval for method SetFreqHz */
#define TickTimer_SFHzMax  0xFFFF      /* Upper bound of interval for method SetFreqHz */

byte TickTimer_Enable(void);
/*
** ===================================================================
**     Method      :  TickTimer_Enable (bean TimerInt)
**
**     Description :
**         Enables the bean - it starts the timer. Events may be
**         generated ("DisableEvent"/"EnableEvent").
**     Parameters  : None
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
** ===================================================================
*/

byte TickTimer_SetFreqHz(word Freq);
/*
** ===================================================================
**     Method      :  TickTimer_SetFreqHz (bean TimerInt)
**
**     Description :
**         This method sets the new frequency of the generated
**         events. The frequency is expressed in Hz as a 16-bit
**         unsigned integer number.
**         This method is available only if the runtime setting type
**         'from interval' is selected in the Timing dialog box in
**         the Runtime setting area.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Freq            - Frequency to set [in Hz]
**                      (100 to 65535 Hz)
**     Returns     :
**         ---             - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
**                           ERR_MATH - Overflow during evaluation
**                           ERR_RANGE - Parameter out of range
** ===================================================================
*/

__interrupt void TickTimer_Interrupt(void);
/*
** ===================================================================
**     Method      :  TickTimer_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.
** ===================================================================
*/

void TickTimer_Init(void);
/*
** ===================================================================
**     Method      :  TickTimer_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 TickTimer_SetHigh(void);
/*
** ===================================================================
**     Method      :  TickTimer_SetHigh (bean TimerInt)
**
**     Description :
**         The method reconfigures the bean and its selected peripheral(s)
**         when the CPU is switched to the High speed mode. The method is 
**         called automatically as s part of the CPU SetHighSpeed method.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/

void TickTimer_SetLow(void);
/*
** ===================================================================
**     Method      :  TickTimer_SetLow (bean TimerInt)
**
**     Description :
**         The method reconfigures the bean and its selected peripheral(s)
**         when the CPU is switched to the Low speed mode. The method is 
**         called automatically as a part of the CPU SetLowSpeed method.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/


#define TickTimer_SetPV(_Val) \
  TPM2CNTH = 0x00; \
  TPM2SC = (TPM2SC & 0x78) | _Val;
static void TickTimer_SetCV(word Val);
/*
** ===================================================================
**     Method      :  SetCV (bean TimerInt)
**
**     Description :
**         The method computes and sets compare eventually modulo value 
**         for time measuring.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/

/* END TickTimer. */

#endif /* ifndef __TickTimer */
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 2.97 [03.74]
**     for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

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