📄 t2.h
字号:
//****************************************************************************
// @Module Timer 2
// @Filename T2.H
// @Project DaveTest.dav
//----------------------------------------------------------------------------
// @Controller Infineon XC866-4FR
//
// @Compiler Keil
//
// @Codegenerator 1.1
//
// @Description: This file contains all function prototypes and macros for
// the T2 module.
//
//----------------------------------------------------------------------------
// @Date 09.02.2005 00:47:36
//
//****************************************************************************
// USER CODE BEGIN (T2_Header,1)
// USER CODE END
#ifndef _T2_H_
#define _T2_H_
//****************************************************************************
// @Project Includes
//****************************************************************************
// USER CODE BEGIN (T2_Header,2)
// USER CODE END
//****************************************************************************
// @Macros
//****************************************************************************
// USER CODE BEGIN (T2_Header,3)
// USER CODE END
//****************************************************************************
// @Defines
//****************************************************************************
// USER CODE BEGIN (T2_Header,4)
// USER CODE END
//****************************************************************************
// @Typedefs
//****************************************************************************
// USER CODE BEGIN (T2_Header,5)
// USER CODE END
//****************************************************************************
// @Imported Global Variables
//****************************************************************************
// USER CODE BEGIN (T2_Header,6)
// USER CODE END
//****************************************************************************
// @Global Variables
//****************************************************************************
// USER CODE BEGIN (T2_Header,7)
// USER CODE END
//****************************************************************************
// @Prototypes Of Global Functions
//****************************************************************************
void T2_vInit(void);
// USER CODE BEGIN (T2_Header,8)
// USER CODE END
//****************************************************************************
// @Macro T2_vStartTmr()
//
//----------------------------------------------------------------------------
// @Description This macro starts timer 2 by setting bit TR2.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 09.02.2005
//
//****************************************************************************
#define T2_vStartTmr() TR2 = 1
//****************************************************************************
// @Macro T2_vStopTmr()
//
//----------------------------------------------------------------------------
// @Description This macro stops timer 2 by clearing bit TR2.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 09.02.2005
//
//****************************************************************************
#define T2_vStopTmr() TR2 = 0
//****************************************************************************
// @Macro T2_uwReadTmr()
//
//----------------------------------------------------------------------------
// @Description This macro reads the contents of the T2 timer register. The
// timer is not stopped.
//
// Please take into account that an active timer 2 unit may
// interfere with the sequence of high and low byte access.
// Thus you should stop the timer first, unless you are sure
// that the access takes place at a save moment.
//
//----------------------------------------------------------------------------
// @Returnvalue 16-bit timer register contents
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 09.02.2005
//
//****************************************************************************
#define T2_uwReadTmr() ((((uword)T2_T2H) << 8) + T2_T2L)
//****************************************************************************
// @Macro T2_vSetRC2Reg(Value)
//
//----------------------------------------------------------------------------
// @Description This macro writes the passed value into the reload/capture
// timer 2 register (RC2H/RC2L).
//
// Please take into account that an active timer 2 unit may
// interfere with the sequence of high and low byte access.
// Thus you should stop the timer first, unless you are sure
// that the access takes place at a save moment.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters Value:
// 16-bit timer reload value
//
//----------------------------------------------------------------------------
// @Date 09.02.2005
//
//****************************************************************************
#define T2_vSetRC2Reg(Value) { uword uwTmp = Value; \
T2_RC2H = (ubyte)(uwTmp >> 8); T2_RC2L = (ubyte)uwTmp; }
//****************************************************************************
// @Macro T2_uwGetRC2Reg()
//
//----------------------------------------------------------------------------
// @Description This macro reads the contents of the reload/capture timer 2
// register (RC2H/RC2L).
//
// Please take into account that an active timer 2 unit may
// interfere with the sequence of high and low byte access.
// Thus you should stop the timer first, unless you are sure
// that the access takes place at a save moment.
//
//----------------------------------------------------------------------------
// @Returnvalue 16-bit reload/capture register contents
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 09.02.2005
//
//****************************************************************************
#define T2_uwGetRC2Reg() ((((uword)T2_RC2H) << 8) + T2_RC2L)
//****************************************************************************
// @Interrupt Vectors
//****************************************************************************
#define T2INT 5
// USER CODE BEGIN (T2_Header,9)
// USER CODE END
#endif // ifndef _T2_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -