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

📄 irq.h

📁 nxp的LPC2888处理器的示例代码.
💻 H
字号:
/******************************************************************************
 *   irq.h:  Interrupt related Header file for NXP LPC288x Family 
 *   Microprocessors
 *
 *   Copyright(C) 2007, NXP Semiconductor
 *   All rights reserved.
 *
 *   History
 *   2007.02.01  ver 1.00    Prelimnary version, first Release
 *
******************************************************************************/
#ifndef __IRQ_H 
#define __IRQ_H

typedef  void (*HandlerAddr)(void);

#define I_Bit			0x80
#define F_Bit			0x40

#define SYS32Mode		0x1F
#define IRQ32Mode		0x12
#define FIQ32Mode		0x11

/* This field need to be carefully placed. It's to be in the
2048 boundry. So it's not defined as a array but a physical
memory location. Please make sure it won't overlap with the
stack and global variable area. */
#define IRQ_TABLE_BASE	0x40D000	/* Base address of IVT */
									/* must be at 2048 boundary */
#define IRQ_SIZE		32			/* 1 based through 29 */
 
/* Mask bits for Index bits in the INT_VECTOR0 register*/
#define MASK_INDEX 		0xFFFFF800			


/* unlike Keil Compiler, don't save and restore registers into the stack
in RVD as the compiler does that for you. See RVD ARM compiler Inline and
embedded assemblers, "Rules for using __asm and asm keywords. */
static DWORD sysreg;		/* used as LR register */
#define IENABLE __asm { MRS sysreg, SPSR; MSR CPSR_c, #SYS32Mode }
#define IDISABLE __asm { MSR CPSR_c, #(IRQ32Mode|I_Bit); MSR SPSR_cxsf, sysreg }

extern void IRQ_Handler( void ) __irq;
extern void FIQ_Handler( void ) __irq;

void init_interrupt( void );
DWORD install_IRQ(BYTE IntNum, BYTE Priority, HandlerAddr IRQHandler );

#endif /* end __IRQ_H */

/******************************************************************************
**                            End Of File
******************************************************************************/

⌨️ 快捷键说明

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