aboutsummaryrefslogtreecommitdiffstats
path: root/arduino/cores/nRF5/WInterrupts.h
diff options
context:
space:
mode:
Diffstat (limited to 'arduino/cores/nRF5/WInterrupts.h')
-rwxr-xr-xarduino/cores/nRF5/WInterrupts.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/arduino/cores/nRF5/WInterrupts.h b/arduino/cores/nRF5/WInterrupts.h
new file mode 100755
index 0000000..c35a857
--- /dev/null
+++ b/arduino/cores/nRF5/WInterrupts.h
@@ -0,0 +1,58 @@
+/*
+ Copyright (c) 2015 Arduino LLC. All right reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _WIRING_INTERRUPTS_
+#define _WIRING_INTERRUPTS_
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// LOW 0
+// HIGH 1
+#define CHANGE 2
+#define FALLING 3
+#define RISING 4
+
+#define ISR_DEFERRED 0x0100
+
+#define DEFAULT 1
+#define EXTERNAL 0
+
+typedef void (*voidFuncPtr)(void);
+
+/*
+ * \brief Specifies a named Interrupt Service Routine (ISR) to call when an interrupt occurs.
+ * Replaces any previous function that was attached to the interrupt.
+ *
+ * \return Interrupt Mask
+ */
+int attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode);
+
+/*
+ * \brief Turns off the given interrupt.
+ */
+void detachInterrupt(uint32_t pin);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif