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

📄 freescale

📁 Freescale 系列单片机常用模块与综合系统设计
💻
字号:
/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : Timer_Variable.H
**     Project   : Smoke_Detector
**     Processor : MC9S08JM60CLHE
**     Component : PPG
**     Version   : Component 02.180, Driver 01.24, CPU db: 3.00.046
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 2010-1-25, 17:10
**     Abstract  :
**         This bean "PPG" implements a programmable
**         pulse generator that generates signal with variable
**         duty and variable cycle (period).
**     Settings  :
**         Used output pin             : 
**             ----------------------------------------------------
**                Number (on package)  |    Name
**             ----------------------------------------------------
**                       15            |  PTE2_TPM1CH0
**             ----------------------------------------------------
**
**         Timer name                  : TPM1_PPG [16-bit]
**         Counter                     : TPM1CNT   [$0021]
**         Mode register               : TPM1SC    [$0020]
**         Run register                : TPM1SC    [$0020]
**         Prescaler                   : TPM1SC    [$0020]
**         Compare 1 register          : TPM1MOD   [$0023]
**         Compare 2 register          : TPM1C0V   [$0026]
**         Flip-flop 1 register        : TPM1SC    [$0020]
**         Flip-flop 2 register        : TPM1C0SC  [$0025]
**
**         Interrupt 1 name            : Vtpm1ch0
**         Interrupt enable reg.       : TPM1C0SC  [$0025]
**         Priority                    : 
**         Interrupt 2 name            : Vtpm1ovf
**         Interrupt enable reg.       : TPM1SC    [$0020]
**         Priority                    : 
**         User handling procedure     : Timer_Variable_OnEnd
**         This event is called when the 1 of cycles is generated
**
**         Output pin
**
**         Port name                   : PTE
**         Bit number (in port)        : 2
**         Bit mask of the port        : $0004
**         Port data register          : PTED      [$0008]
**         Port control register       : PTEDD     [$0009]
**
**         Runtime setting period      : none
**         Runtime setting ratio       : calculated
**         Initialization:
**              Output level           : low
**              Timer                  : Enabled
**              Event                  : Enabled
**         High speed mode
**             Prescaler               : divide-by-8
**             Clock                   : 5859 Hz
**           Initial value of            period        pulse width (ratio 100%)
**             Xtal ticks              : 96000000      96000000
**             microseconds            : 8000000       8000000
**             milliseconds            : 8000          8000
**             seconds                 : 8             8
**             seconds (real)          : 8.0           8.0
**
**     Contents  :
**         SetRatio16 - byte Timer_Variable_SetRatio16(word Ratio);
**         SetDutyUS  - byte Timer_Variable_SetDutyUS(word Time);
**         SetDutyMS  - byte Timer_Variable_SetDutyMS(word Time);
**
**     Copyright : 1997 - 2009 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

#ifndef __Timer_Variable
#define __Timer_Variable

/* MODULE Timer_Variable. */

/*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 Timer_Variable_PERIOD_VALUE 0xB71B /* Initial period value in ticks of the timer in high speed mode */
#define Timer_Variable_PERIOD_VALUE_HIGH 0xB71B /* Period value in ticks of the timer in high speed mode */



byte Timer_Variable_SetRatio16(word Ratio);
/*
** ===================================================================
**     Method      :  Timer_Variable_SetRatio16 (component PPG)
**
**     Description :
**         This method sets a new duty-cycle ratio.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Ratio      - Ratio is expressed as an 16-bit unsigned integer
**                      number. 0 - 0xFFFF value is proportional
**                      to ratio 0 - 100%
**         Note: Calculated duty depends on the timer possibilities
**               and on the selected period.
**     Returns     :
**         ---        - Error code, possible codes:
**                           ERR_OK - OK
**                           ERR_SPEED - This device does not work in
**                           the active speed mode
** ===================================================================
*/

byte Timer_Variable_SetDutyUS(word Time);
/*
** ===================================================================
**     Method      :  Timer_Variable_SetDutyUS (component PPG)
**
**     Description :
**         This method sets the new duty value of the output signal. The
**         duty is expressed in microseconds as a 16-bit unsigned integer
**         number.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Time       - Duty to set [in microseconds]
**                      (0 to 65535 us in high speed mode)
**     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
** ===================================================================
*/

byte Timer_Variable_SetDutyMS(word Time);
/*
** ===================================================================
**     Method      :  Timer_Variable_SetDutyMS (component PPG)
**
**     Description :
**         This method sets the new duty value of the output signal. The
**         duty is expressed in milliseconds as a 16-bit unsigned integer
**         number.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Time       - Duty to set [in milliseconds]
**                      (0 to 8000 ms in high speed mode)
**     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
** ===================================================================
*/

void Timer_Variable_Init(void);
/*
** ===================================================================
**     Method      :  Timer_Variable_Init (component PPG)
**
**     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.
** ===================================================================
*/

__interrupt void Timer_Variable_Interrupt(void);
/*
** ===================================================================
**     Method      :  Timer_Variable_Interrupt (component PPG)
**
**     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.
** ===================================================================
*/


/* END Timer_Variable. */

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

⌨️ 快捷键说明

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