aboutsummaryrefslogtreecommitdiff
path: root/wirish/include
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-09-03 18:29:45 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-09-03 18:29:45 -0400
commitc5dfc108e6c0313f54fc0ebaa7b31e5f2b41e8e8 (patch)
treedfbbf24f499ca6dee1ad40a4639a196d502805c4 /wirish/include
parent9992325cefda4213e61b24cc4b52955ba3f538d2 (diff)
parentd9f8b4f8c462b4fb2e1324567803cfcb839cfc2f (diff)
Merge branch 'callback_interrupt_handlers'
Diffstat (limited to 'wirish/include')
-rw-r--r--wirish/include/wirish/ext_interrupts.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/wirish/include/wirish/ext_interrupts.h b/wirish/include/wirish/ext_interrupts.h
index 933be04..ce1ca03 100644
--- a/wirish/include/wirish/ext_interrupts.h
+++ b/wirish/include/wirish/ext_interrupts.h
@@ -69,6 +69,28 @@ typedef enum ExtIntTriggerMode {
void attachInterrupt(uint8 pin, voidFuncPtr handler, ExtIntTriggerMode mode);
/**
+ * @brief Registers an interrupt handler on a pin.
+ *
+ * The interrupt will be triggered on a given transition on the pin,
+ * as specified by the mode parameter. The handler runs in interrupt
+ * context. The new handler will replace whatever handler is
+ * currently registered for the pin, if any.
+ *
+ * @param pin Pin number
+ * @param handler Static class member function to run upon external interrupt
+ * trigger. The handler should take 1 argument and return void
+ * @param arg Argument that the handler will be passed when it's called. One
+ * use of this is to pass the specific instance of the class that
+ * will handle the interrupt.
+ * @param mode Type of transition to trigger on, e.g. falling, rising, etc.
+ *
+ * @sideeffect Registers a handler
+ * @see detachInterrupt()
+ */
+void attachInterrupt(uint8 pin, voidArgumentFuncPtr handler, void *arg,
+ ExtIntTriggerMode mode);
+
+/**
* @brief Disable any registered external interrupt.
* @param pin Maple pin number
* @sideeffect unregisters external interrupt handler