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

📄 timer_driver.h

📁 ARM9系列,s3c2410实验代码
💻 H
字号:
/*
 *	timer_driver.h - header file of timer driver
 *	
 *	Author: 	li ming <admin@lumit.org>
 *	Date:		2005-6-12
 *	Copyleft:	http://www.lumit.org
 */

#ifndef SYSCFG
#define SYSCFG      0x03FF0000
#endif

#ifndef IOPMOD
#define IOPMOD          (*((volatile unsigned *)(SYSCFG+0x5000)))
#endif

#ifndef IOPDATA
#define IOPDATA         (*((volatile unsigned *)(SYSCFG+0x5008)))
#endif

// interrupt register
#ifndef INTPND
#define INTPND		(*((volatile unsigned *)(SYSCFG+0x4004)))
#endif 

#ifndef INTMSK
#define INTMSK		(*((volatile unsigned *)(SYSCFG+0x4008)))
#endif 

// timer mode register
#define TMOD		(*((volatile unsigned *)(SYSCFG+0x6000)))  
#define TDATA0		(*((volatile unsigned *)(SYSCFG+0x6004)))
#define TCNT0		(*((volatile unsigned *)(SYSCFG+0x600c)))

typedef enum
{
	TIMER_SET_COUNTER = 1,
	TIMER_ENABLE_INTERRUPT,
	TIMER_CLEAR_INTERRUPT
} TIMER_IOCTL_CMD ;

int timer_open( void );

int timer_read( char * buf, int count );

int timer_write( char * buf, int count );

int timer_ioctl( unsigned int cmd, unsigned long arg );

int timer_release( void );

⌨️ 快捷键说明

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