Lab 1 Program C

Dependents:   Lab1C

Fork of mbed by -deleted-

Revision:
27:7110ebee3484
Parent:
11:1c1ebd0324fa
Child:
43:aff670d0d510
--- a/InterruptIn.h	Fri Feb 11 10:33:02 2011 +0000
+++ b/InterruptIn.h	Tue Nov 29 14:59:27 2011 +0000
@@ -1,17 +1,26 @@
 /* mbed Microcontroller Library - InterruptIn
- * Copyright (c) 2006-2009 ARM Limited. All rights reserved.
- * sford
+ * Copyright (c) 2006-2011 ARM Limited. All rights reserved.
  */ 
  
 #ifndef MBED_INTERRUPTIN_H
 #define MBED_INTERRUPTIN_H
 
+#include "device.h"
+
+#if DEVICE_INTERRUPTIN
+
 #include "platform.h"
 #include "PinNames.h"
 #include "PeripheralNames.h"
 #include "Base.h"
 #include "FunctionPointer.h"
 
+#if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
+#define CHANNEL_NUM   48
+#elif defined(TARGET_LPC11U24)
+#define CHANNEL_NUM    8
+#endif
+
 namespace mbed {
 
 /* Class: InterruptIn
@@ -49,6 +58,9 @@
      *  name - (optional) A string to identify the object
      */
     InterruptIn(PinName pin, const char *name = NULL);
+#if defined(TARGET_LPC11U24)
+    virtual ~InterruptIn();
+#endif
  
      int read();
 #ifdef MBED_OPERATORS
@@ -106,13 +118,23 @@
      */
     void mode(PinMode pull);
     
-
- 	static void _irq(); 
-	static InterruptIn *_irq_objects[48];
+    static InterruptIn *_irq_objects[CHANNEL_NUM];
+    
+#if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
+    static void _irq();
+#elif defined(TARGET_LPC11U24)
+    static void handle_interrupt_in(unsigned int channel);
+    static void _irq0(); static void _irq1();
+    static void _irq2(); static void _irq3();
+    static void _irq4(); static void _irq5();
+    static void _irq6(); static void _irq7();
+#endif
 
 protected:
-	
     PinName _pin;
+#if defined(TARGET_LPC11U24)
+    Channel _channel;
+#endif
     FunctionPointer _rise;
     FunctionPointer _fall;
 
@@ -123,3 +145,5 @@
 } // namespace mbed
 
 #endif
+
+#endif