timer.h

来自「MCF523X系列处理器初始化代码,对开发523X些列freescale处理器有」· C头文件 代码 · 共 42 行

H
42
字号
/*
 * File:		timer.h
 * Purpose:		routines for accessing integrated timer modules
 *
 * Notes:		
 *
 */

#ifndef _TIMER_H
#define _TIMER_H

#include "src/init/mcf5xxx.h"
/********************************************************************/

typedef struct
{
	float	period;					/* tick period in nano-seconds */
	uint16	then;					/* previous TCN value */
	uint16	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? */
} mcf523x_timer;

uint32 timer_init(uint8, float,	float, uint32); 
uint32 timer_set_secs(uint8, uint32);
uint32 timer_get_reference(uint8);
uint32 timer_default_isr(mcf523x_timer *);
static void timer_stop(uint8 channel);
static void timer_start(uint8 channel);
static uint32 timer_get_time(uint8 channel);
static uint32 timer_read(uint8 channel);

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

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

#endif

⌨️ 快捷键说明

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