資源描述:
《ARM菜鳥中斷系統(tǒng)提高班學(xué)習(xí)筆記》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、ARM菜鳥中斷系統(tǒng)提高班學(xué)習(xí)筆記/*----------------------------------------------------------------------ARM菜鳥外部中斷及中斷控制提高班學(xué)習(xí)結(jié)業(yè)筆記HotPower@126.com2005.7.22于西安大雁塔村隊部-----------------------------------------------------------------------*//***********************************
2、************************************//*ThisfileispartoftheCAARMCCompilerpackage*//*CopyrightKEILELEKTRONIKGmbH2002-2004*//***********************************************************************//**//*MAIN.C:Demonstrationofvariousinterruptfunctions*//**//
3、***********************************************************************/#include//PhilipsPeripheralRegisters#include"LPC213xDEF.H"http://ARM菜鳥HotPower創(chuàng)建定義文件/**softwareinterruptfunctionacceptparametersandrunin*supervisormode(interruptprotected).*/in
4、tmyfunc1(inti1,longi2)__swi(8){return(i1/i2);}intmyfunc2(inti1)__swi(9){return(i1<<4);}voidSetVICProtection(unsignedlongval)__swi(10){VICProtection=val;//VICProtection可以隨意置'1',但清'0'必須在管理模式下}/**具有特權(quán)保護的用戶非向量中斷,它只能在VICProtection=0時在用戶模式下調(diào)用,比SWI更安全*/voidUser
5、DefineIRQ(void)__irq{if(VICIRQStatus&(1<6、urnswith*/voidDefaultIRQ(void)__irq{//VICIntSelect=0且VICVectCntl0~VICVectCntl15都未中斷使能unsignedlongtemp;temp=VICIRQStatus;if(temp&(1<7、8、3中斷標(biāo)志}VICSoftIntClr=temp;VICVectAddr=0;}voidEINT0IRQ(void)__irq{//IRQ中斷函數(shù)EINT0IRQ被掛接在VICVectCntl0if(VICIRQStatus&(1<