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

📄 int0_driver.h

📁 ARM9系列,s3c2410实验代码
💻 H
字号:
/*
 *	int0_driver.h - header file of int0 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 IOPCON
#define IOPCON          (*((volatile unsigned *)(SYSCFG+0x5004)))
#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 

// INT0 mask
#define INT0_MASK					(1 << 0)

typedef enum
{
	INT0_ENABLE_INTERRUPT,
	INT0_CLEAR_INTERRUPT,
	INT0_RISING_EDGE_INTERRUPT,
	INT0_FALLING_EDGE_INTERRUPT,
	INT0_BOTH_EDGE_INTERRUPT,
	INT0_ACTIVE_HIGH
} INT0_IOCTL_CMD ;


#define INT0_IO_ENABLE					(1<<4)
#define INT0_IO_ACTIVE_HIGH				(1<<3)
#define INT0_IO_RISING_EDGE				(0x01)
#define INT0_IO_FALLING_EDGE				(0x02)
#define INT0_IO_BOTH_EDGE				(0x03)

int int0_open( void );

int int0_read( char * buf, int count );

int int0_write( char * buf, int count );

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

int int0_release( void );

⌨️ 快捷键说明

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