📄 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 "HA_TypeDef.h"
#include "hardware.h"
/* 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);
/*
**************************************
* 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
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -