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

📄 intc.h

📁 东南大学开发ARM7芯片UART模块测试代码
💻 H
字号:
/*************************************************************************************
 *	Copyright (c) 2007 by PROCHIP Limited.
 *	PROPRIETARY RIGHTS of PROCHIP Limited are involved in the subject matter of this 
 *	material.  All manufacturing, reproduction, use, and sales rights 
 *	pertaining to this subject matter are governed by the license agreement.
 *	The recipient of this software implicitly accepts the terms of the license.
 *
 *	File Name:  intc.h
 *
 *	File Description: The file define some macro definition used in some assembler file.
 *
 *    Version         Date            Author           
 *------------------------------------------------------------------------------------    
 *    0.0.1           2005.3.22       Michael <yuyu_zh@seu.edu.cn>
 *    0.0.2           2008.1.10       zhangyang <zyang@prochip.com.cn>            
 *   		      	
 *************************************************************************************
 */
 
#ifndef  __INTC_H
#define  __INTC_H

#include "ub4020evb.h"

/*
 **************************************
 * INTC 模块的中断源
 **************************************
 */

#define  INTSRC_RTC        31		        
#define  INTSRC_DMAC       30	                
#define  INTSRC_EMI        29
#define  INTSRC_MAC        28
#define  INTSRC_TIMER1     27
#define  INTSRC_TIMER2     26
#define  INTSRC_TIMER3     25
#define  INTSRC_UART0      24
#define  INTSRC_UART1      23
#define  INTSRC_UART2      22
#define  INTSRC_UART3      21
#define  INTSRC_PWM        20
#define  INTSRC_LCDC       19
#define  INTSRC_I2S        18
#define  INTSRC_SSI        17

#define  INTSRC_USB        15
#define  INTSRC_SMC0       14
#define  INTSRC_SMC1       13
#define  INTSRC_SDIO       12  
#define  INTSRC_EXINT10    11              
#define  INTSRC_EXINT9     10              
#define  INTSRC_EXINT8     9               
#define  INTSRC_EXINT7     8               
#define  INTSRC_EXINT6     7               
#define  INTSRC_EXINT5     6               
#define  INTSRC_EXINT4     5               
#define  INTSRC_EXINT3     4               
#define  INTSRC_EXINT2     3               
#define  INTSRC_EXINT1     2               
#define  INTSRC_EXINT0     1
#define  INTSRC_NULL       0



/*
 **************************************
 * 中断处理
 **************************************
 */ 
#define set_plevel(plevel)          *(RP)INTC_IPLR = plevel
#define set_int_force(intnum)       *(RP)INTC_IFR = (1 << intnum)
#define irq_enable(intnum)          *(RP)INTC_IER |= (1 << intnum)
#define irq_disable( intnum)        *(RP)INTC_IER &= ~(1<< intnum)
#define mask_irq(intnum)            *(RP)INTC_IMR |= (1 << intnum)
#define unmask_irq(intnum)          *(RP)INTC_IMR &= ~(1 << intnum)
#define mask_all_irq()              *(RP)INTC_IMR = 0xFFFFFFFF
#define unmask_all_irq()            *(RP)INTC_IMR = 0x00000000
#define enable_all_irq()            *(RP)INTC_IER = 0XFFFFFFFF
#define disable_all_irq()           *(RP)INTC_IER = 0X00000000
#define INT_INIT()                  do{mask_all_irq(); enable_all_irq();}while(0)

/* definition of vector struct for interrrupt */
typedef struct int_vector{
	U8		IntNum;
	void	(*handler)(void);
}INT_VECTOR;

/* declaration of function */
extern void int_vector_handler(void);

#endif

⌨️ 快捷键说明

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