📄 intc.h
字号:
/*************************************************************************************
* Copyright (c) 2005 by National ASIC System Engineering Research Center.
* PROPRIETARY RIGHTS of ASIC 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.
*
* Created by Michael <yuyu_zh@seu.edu.cn>, 2005-03-22
**************************************************************************************/
#ifndef INTC_H
#define INTC_H
#include "typedef.h"
/* definition of register address */
#define BASE_INTC 0x10000000
#define INTC_IEN ( BASE_INTC+0X0 ) //;IRQ中断允许寄存器
#define INTC_IMSK ( BASE_INTC+0X8 ) //;IRQ中断屏蔽寄存器
#define INTC_IFCE ( BASE_INTC+0X10 ) //;IRQ软件强制中断寄存器
#define INTC_IRSTAT ( BASE_INTC+0X18 ) //;IRQ未处理中断状态寄存器
#define INTC_ISTAT ( BASE_INTC+0X20 ) //;IRQ中断状态寄存器
#define INTC_IMSTAT ( BASE_INTC+0X28 ) //;IRQ屏蔽中断状态寄存器
#define INTC_IFSTAT ( BASE_INTC+0X30 ) //;IRQ中断最终状态寄存器
/* definition of interrupt handling */
#define set_plevel(plevel) \
*(RP)INTC_PLV = plevel
#define set_int_force(intnum) \
*(RP)INTC_IFCE = (1 << intnum)
#define irq_enable(intnum) \
*(RP)INTC_IEN |= (1 << intnum)
#define irq_disable( intnum) \
*(RP)INTC_IEN &= ~(1<< intnum)
#define mask_irq(intnum) \
*(RP)INTC_IMSK |= (1 << intnum)
#define unmask_irq(intnum) \
*(RP)INTC_IMSK &= ~(1 << intnum)
#define mask_all_irq() \
*(RP)INTC_IMSK = 0xFFFFFFFF
#define unmask_all_irq() \
*(RP)INTC_IMSK = 0x00000000
#define enable_all_irq() \
*(RP)INTC_IEN = 0XFFFFFFFF
#define disable_all_irq() \
*(RP)INTC_IEN = 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 + -