C:/nxpdrv/LPC1700CMSIS/Drivers/source/lpc17xx_nvic.c
Go to the documentation of this file.00001 00022 /* Peripheral group ----------------------------------------------------------- */ 00027 /* Includes ------------------------------------------------------------------- */ 00028 #include "lpc17xx_nvic.h" 00029 00030 00031 /* Private Macros ------------------------------------------------------------- */ 00036 /* Vector table offset bit mask */ 00037 #define NVIC_VTOR_MASK 0x3FFFFF80 00038 00044 /* Public Functions ----------------------------------------------------------- */ 00050 /*****************************************************************************/ 00061 void NVIC_DeInit(void) 00062 { 00063 uint8_t tmp; 00064 00065 /* Disable all interrupts */ 00066 NVIC->ICER[0] = 0xFFFFFFFF; 00067 NVIC->ICER[1] = 0x00000001; 00068 /* Clear all pending interrupts */ 00069 NVIC->ICPR[0] = 0xFFFFFFFF; 00070 NVIC->ICPR[1] = 0x00000001; 00071 00072 /* Clear all interrupt priority */ 00073 for (tmp = 0; tmp < 32; tmp++) { 00074 NVIC->IP[tmp] = 0x00; 00075 } 00076 } 00077 00078 /*****************************************************************************/ 00096 void NVIC_SCBDeInit(void) 00097 { 00098 uint8_t tmp; 00099 00100 SCB->ICSR = 0x0A000000; 00101 SCB->VTOR = 0x00000000; 00102 SCB->AIRCR = 0x05FA0000; 00103 SCB->SCR = 0x00000000; 00104 SCB->CCR = 0x00000000; 00105 00106 for (tmp = 0; tmp < 32; tmp++) { 00107 SCB->SHP[tmp] = 0x00; 00108 } 00109 00110 SCB->SHCSR = 0x00000000; 00111 SCB->CFSR = 0xFFFFFFFF; 00112 SCB->HFSR = 0xFFFFFFFF; 00113 SCB->DFSR = 0xFFFFFFFF; 00114 } 00115 00116 00117 /*****************************************************************************/ 00122 void NVIC_SetVTOR(uint32_t offset) 00123 { 00124 SCB->VTOR = (offset & NVIC_VTOR_MASK); 00125 } 00126 00135 /* --------------------------------- End Of File ------------------------------ */
Generated on Mon Feb 8 10:01:37 2010 for LPC1700CMSIS Standard Peripheral Firmware Library by 1.5.9