📄 int.h
字号:
/**************************************************
* MODULE : int.h
* VERSION : Version 0.1
* 12/11/2000
*************************************************/
#define iSRAMBase 0x06000000 // internal SRAM base address
#define iSRAMTop 0x06001FFC // top address of interanl SRAM
#define eSRAMBase 0x04000000 // external SRAM base address
#define SDRAMBase 0x08000000 // SDRAM address
#define SDRAMTop 0x08FFFFFC // top address of SDRAM address
/* the number of interrupt source */
#define NumOfInt 32
/* Interrupt Vector table address */
#define IntVectorTable iSRAMTop-(NumOfInt << 2) //internal SRAM area
#define IntVectorTableEnd iSRAMTop
//#define IntVectorTable SDRAMTop-(NumOfInt << 2) //SDRAM area
//#define IntVectorTableEnd SDRAMTop
/*
* Interrupt Vector Table
*/
#define pIVT_WDT (*(volatile unsigned *)(IntVectorTable+0x00))
#define pIVT_RTC (*(volatile unsigned *)(IntVectorTable+0x04))
#define pIVT_TIMER0 (*(volatile unsigned *)(IntVectorTable+0x08))
#define pIVT_MAC (*(volatile unsigned *)(IntVectorTable+0x0C)) //unused item
#define pIVT_TIMER2 (*(volatile unsigned *)(IntVectorTable+0x10))
#define pIVT_TIMER3 (*(volatile unsigned *)(IntVectorTable+0x14))
#define pIVT_EXT0 (*(volatile unsigned *)(IntVectorTable+0x18))
#define pIVT_USB (*(volatile unsigned *)(IntVectorTable+0x1C))
#define pIVT_UART0 (*(volatile unsigned *)(IntVectorTable+0x20))
#define pIVT_RESV0 (*(volatile unsigned *)(IntVectorTable+0x24))
#define pIVT_LCDC (*(volatile unsigned *)(IntVectorTable+0x28))
#define pIVT_DMA (*(volatile unsigned *)(IntVectorTable+0x2C))
#define pIVT_EXT1 (*(volatile unsigned *)(IntVectorTable+0x30))
#define pIVT_TIMER1 (*(volatile unsigned *)(IntVectorTable+0x34))
#define pIVT_PPI (*(volatile unsigned *)(IntVectorTable+0x38))
#define pIVT_EXT3 (*(volatile unsigned *)(IntVectorTable+0x3C))
#define pIVT_UART1 (*(volatile unsigned *)(IntVectorTable+0x40))
#define pIVT_I2C (*(volatile unsigned *)(IntVectorTable+0x44))
#define pIVT_COMMRX (*(volatile unsigned *)(IntVectorTable+0x48))
#define pIVT_COMMTX (*(volatile unsigned *)(IntVectorTable+0x4C))
#define pIVT_TEAKLITE (*(volatile unsigned *)(IntVectorTable+0x50))
#define pIVT_KMI0 (*(volatile unsigned *)(IntVectorTable+0x54))
#define pIVT_KMI1 (*(volatile unsigned *)(IntVectorTable+0x58))
#define pIVT_EXT2 (*(volatile unsigned *)(IntVectorTable+0x5C))
#define pIVT_RESV2 (*(volatile unsigned *)(IntVectorTable+0x60))
#define pIVT_RESV3 (*(volatile unsigned *)(IntVectorTable+0x64))
#define pIVT_PCMCIA (*(volatile unsigned *)(IntVectorTable+0x68)) //unused item
#define pIVT_SMI (*(volatile unsigned *)(IntVectorTable+0x6C))
#define pIVT_GPIO (*(volatile unsigned *)(IntVectorTable+0x70))
#define pIVT_RESV4 (*(volatile unsigned *)(IntVectorTable+0x74))
#define pIVT_RESV5 (*(volatile unsigned *)(IntVectorTable+0x78))
#define pIVT_SSP (*(volatile unsigned *)(IntVectorTable+0x7C))
/*
* define the interrupt source corresponing to each interrupt register bits
*/
#define INT_WDT 0x00000001
#define INT_RTC 0x00000002
#define INT_TIMER0 0x00000004
#define INT_MAC 0x00000008 //unsued item
#define INT_TIMER2 0x00000010
#define INT_TIMER3 0x00000020
#define INT_EXT0 0x00000040
#define INT_USB 0x00000080
#define INT_UART0 0x00000100
#define INT_RESV0 0x00000200
#define INT_LCDC 0x00000400
#define INT_DMA 0x00000800
#define INT_EXT1 0x00001000
#define INT_TIMER1 0x00002000
#define INT_PPI 0x00004000
#define INT_EXT3 0x00008000
#define INT_UART1 0x00010000
#define INT_I2C 0x00020000
#define INT_COMMRX 0x00040000
#define INT_COMMTX 0x00080000
#define INT_TEAKLITE 0x00100000
#define INT_KMI0 0x00200000
#define INT_KMI1 0x00400000
#define INT_EXT2 0x00800000
#define INT_RESV2 0x01000000
#define INT_RESV3 0x02000000
#define INT_PCMCIA 0x04000000 //unused item
#define INT_SMI 0x08000000
#define INT_GPIO 0x10000000
#define INT_RESV4 0x20000000
#define INT_RESV5 0x40000000
#define INT_SSP 0x80000000
#define EnableFIQ() (rINTCON = ((rINTCON) & (0x0E)))
#define DisableFIQ() (rINTCON = ((rINTCON) | (0x01)))
#define EnableIRQ() (rINTCON = ((rINTCON )& (0x0D)))
#define DisableIRQ() (rINTCON = ((rINTCON) | (0x02)))
#define EnableGMask() (rINTCON = ((rINTCON) | (0x08)))
#define DisableGMask() (rINTCON = ((rINTCON) & (0x07)))
#define EnableInt(x) (rINTMSK = ((rINTMSK) & (~(x))))
#define DisableInt(x) (rINTMSK = ((rINTMSK) | (x)))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -