bousiya03 / interruptin_mod

Dependents:   inte_mod_test test_irm2121 BallCheck_IRM2121_InterrputInAdd CatPot_SensorRight

Files at this revision

API Documentation at this revision

Comitter:
bousiya03
Date:
Thu Nov 13 10:27:52 2014 +0000
Child:
1:c63d872cfdb7
Commit message:
first-commit

Changed in this revision

interruptin_mod.cpp Show annotated file Show diff for this revision Revisions of this file
interruptin_mod.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/interruptin_mod.cpp	Thu Nov 13 10:27:52 2014 +0000
@@ -0,0 +1,19 @@
+
+#include"mbed.h"
+#include"interruptin_mod.h"
+
+
+    interruptin_mod::interruptin_mod(PinName pin) : InterruptIn(pin){}
+    
+    void interruptin_mod::fall_disable(void (*fptr)(void)){
+            _rise.attach(fptr);
+            gpio_irq_set(&gpio_irq, IRQ_RISE, 0);
+        
+    }
+        
+    void interruptin_mod::rise_disable(void (*fptr)(void)) {
+        
+            _fall.attach(fptr);
+            gpio_irq_set(&gpio_irq, IRQ_FALL, 0);
+    
+    } 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/interruptin_mod.h	Thu Nov 13 10:27:52 2014 +0000
@@ -0,0 +1,18 @@
+#ifndef INTE_MOD
+#define INTE_MOD
+
+
+#include"mbed.h"
+
+class interruptin_mod:InterruptIn{
+    
+    public:
+    
+        interruptin_mod(PinName pin);
+        
+        void fall_disable(void (*fptr)(void));
+        void rise_disable(void (*fptr)(void));
+    
+    };
+    
+#endif
\ No newline at end of file