Class similar to InterruptIn which allows the LPC1114 to wake from deepsleep. (For other targets you can use InterruptIn).
Dependents: WakeUp WakeUp WakeUp WakeUp ... more
WakeInterruptIn.cpp
00001 #ifdef TARGET_LPC11XX_11CXX 00002 00003 #include "WakeInterruptIn.h" 00004 00005 WakeInterruptIn* WakeInterruptIn::objects[NUM_CHANNEL] = {0}; 00006 00007 WakeInterruptIn::WakeInterruptIn(PinName pin) : DigitalIn(pin) 00008 { 00009 if (pin < P1_0) 00010 channel = (pin >> PIN_SHIFT) & 0xF; 00011 else if (pin == P1_0) 00012 channel = 12; 00013 else 00014 error("Pin is not valid for WakeInterruptIn"); 00015 00016 objects[channel] = this; 00017 switch (channel) { 00018 case 0: 00019 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler0); 00020 break; 00021 case 1: 00022 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler1); 00023 break; 00024 case 2: 00025 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler2); 00026 break; 00027 case 3: 00028 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler3); 00029 break; 00030 case 4: 00031 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler4); 00032 break; 00033 case 5: 00034 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler5); 00035 break; 00036 case 6: 00037 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler6); 00038 break; 00039 case 7: 00040 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler7); 00041 break; 00042 case 8: 00043 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler8); 00044 break; 00045 case 9: 00046 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler9); 00047 break; 00048 case 10: 00049 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler10); 00050 break; 00051 case 11: 00052 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler11); 00053 break; 00054 case 12: 00055 NVIC_SetVector((IRQn_Type)channel, (uint32_t)handler12); 00056 break; 00057 } 00058 } 00059 00060 #endif
Generated on Sun Jul 17 2022 03:02:06 by 1.7.2