cap1.h
来自「飞思卡尔单片机MC9SDG128B的脉冲捕获程序」· C头文件 代码 · 共 162 行
H
162 行
/** ###################################################################
** THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
** Filename : Cap1.H
** Project : Capture
** Processor : MC9S12DG128BCPV
** Beantype : Capture
** Version : Bean 02.108, Driver 01.10, CPU db: 2.87.280
** Compiler : Metrowerks HC12 C Compiler
** Date/Time : 2008-3-5, 上午 09:42
** Abstract :
** This bean "Capture" simply implements the capture function
** of timer. The counter counts the same way as in free run mode. On
** the selected edge of the input signal (on the input pin), the current
** content of the counter register is written into the capture
** register and the OnCapture event is called.
** Settings :
** Timer capture encapsulation : Capture
**
** Timer
** Timer : ECT
** Counter shared : Yes
**
** High speed mode
** Prescaler : divide-by-32
** Maximal time for capture register
** Xtal ticks : 4194304
** microseconds : 262144
** milliseconds : 262
** seconds (real) : 0.2621440
** Hz : 4
** One tick of timer is
** microseconds : 4
**
** Initialization:
** Timer : Enabled
** Events : Enabled
**
** Timer registers
** Capture : TC2 [84]
** Counter : TCNT [68]
** Mode : TIOS [64]
** Run : TSCR1 [70]
** Prescaler : TSCR2 [77]
**
** Used input pin :
** ----------------------------------------------------
** Number (on package) | Name
** ----------------------------------------------------
** 11 | PT2_IOC2
** ----------------------------------------------------
**
** Port name : T
** Bit number (in port) : 2
** Bit mask of the port : 4
**
** Signal edge/level : falling
** Priority : 1
** Pull option : off
**
** Contents :
** Reset - byte Cap1_Reset(void);
** GetCaptureValue - byte Cap1_GetCaptureValue(word *Value);
**
** (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 __Cap1
#define __Cap1
/* MODULE Cap1. */
#include "Cpu.h"
#pragma DATA_SEG Cap1_DATA
#pragma CODE_SEG Cap1_CODE
extern volatile word Cap1_CntrState; /* Content of counter */
#define Cap1_Reset() (Cap1_CntrState = TCNT , ERR_OK)
/*
** ===================================================================
** Method : Cap1_Reset (bean Capture)
**
** Description :
** This method resets the counter register.
** Parameters : None
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ===================================================================
*/
#define Cap1_GetCaptureValue(Value) \
(*(Value) = TC2 , *(Value) -= Cap1_CntrState , ERR_OK)
/*
** ===================================================================
** Method : Cap1_GetCaptureValue (bean Capture)
**
** Description :
** This method gets the last value captured by enabled timer.
** Note: one tick of timer is
** 4 us in high speed mode
** Parameters :
** NAME - DESCRIPTION
** * Value - A pointer to the content of the
** capture register
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ===================================================================
*/
void Cap1_Init(void);
/*
** ===================================================================
** Method : Cap1_Init (bean Capture)
**
** 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.
** ===================================================================
*/
#pragma CODE_SEG __NEAR_SEG NON_BANKED
__interrupt void Cap1_Interrupt(void);
#pragma CODE_SEG Cap1_CODE
/*
** ===================================================================
** Method : Interrupt (bean Capture)
**
** 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.
** ===================================================================
*/
#pragma CODE_SEG DEFAULT
/* END Cap1. */
#endif /* ifndef __Cap1 */
/*
** ###################################################################
**
** This file was created by UNIS Processor Expert 2.96 [03.76]
** for the Freescale HCS12 series of microcontrollers.
**
** ###################################################################
*/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?