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

📄 timer.h

📁 motorola自己开发的针对coldfire 5272的Dbug bootloader程序
💻 H
字号:
/*
 * File:		timer.h
 * Purpose:		routines for accessing integrated timer modules
 *
 * Notes:		
 *
 *
 * Modifications:
 *
 */

#ifndef _TIMER_H
#define _TIMER_H

/********************************************************************/

typedef struct
{
	void	(*isr)(void*, void*);	/* current iterrupt service routine */
	float	period;					/* tick period in nano-seconds */
	uint32	then;					/* previous TCN value */
	uint32	now;					/* most recent TCN value */
	uint32	timeouts;				/* count of timer reference reaches */
	uint32	reference;				/* number of timeouts desired */
	uint32	level;					/* Interrupt priority for this channel */
	uint16	tmr;					/* Timer Mode Register */
	uint16	trr;					/* Timer Reference Register */
	uint8	channel;				/* which channel is this structure for? */
} mcf5282_timer;

/********************************************************************/

uint32 
timer_init(
	uint8,				/* channel - Timer to initialize (0->3)				*/
	float,				/* period - Tick period in nano-seconds				*/
						/*    Min = 1/sysclock, Max = (256 * 16)/sysclock)	*/
						/*    If period == 0, disable timer					*/
	float,				/* sysclock	- System bus clock						*/
	uint32,				/* level - Interrupt priority level					*/
	void(*)(void*, void*)	/* isr - Interrupt Service Routine				*/
	); 

/********************************************************************/

/* Vector numbers for all the timer channels */
#define TIMER_VECTOR(a)		(a + 83)

/********************************************************************/

#endif

⌨️ 快捷键说明

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