summaryrefslogtreecommitdiff
path: root/peripheral/libmraa/api/mraa/gpio.h
diff options
context:
space:
mode:
Diffstat (limited to 'peripheral/libmraa/api/mraa/gpio.h')
-rw-r--r--peripheral/libmraa/api/mraa/gpio.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/peripheral/libmraa/api/mraa/gpio.h b/peripheral/libmraa/api/mraa/gpio.h
index 32e1c6e..2287c0c 100644
--- a/peripheral/libmraa/api/mraa/gpio.h
+++ b/peripheral/libmraa/api/mraa/gpio.h
@@ -40,17 +40,21 @@
extern "C" {
#endif
-#include <stdio.h>
-#include <pthread.h>
-#include "common.h"
+#ifdef SWIGPYTHON
+#include <Python.h>
+#endif
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
#include <jni.h>
-extern "C" {
- void mraa_java_isr_callback(void *args);
-}
+extern JavaVM *globVM;
+extern void mraa_java_isr_callback(void *);
#endif
+#include <stdio.h>
+#include <pthread.h>
+
+#include "common.h"
+
/**
* Opaque pointer definition to the internal struct _gpio
*/
@@ -77,13 +81,13 @@ typedef enum {
} mraa_gpio_dir_t;
/**
- * Gpio Edge types for interrupts
+ * Gpio Edge types for interupts
*/
typedef enum {
MRAA_GPIO_EDGE_NONE = 0, /**< No interrupt on Gpio */
- MRAA_GPIO_EDGE_BOTH = 1, /**< Interrupt on rising & falling */
- MRAA_GPIO_EDGE_RISING = 2, /**< Interrupt on rising only */
- MRAA_GPIO_EDGE_FALLING = 3 /**< Interrupt on falling only */
+ MRAA_GPIO_EDGE_BOTH = 1, /**< Interupt on rising & falling */
+ MRAA_GPIO_EDGE_RISING = 2, /**< Interupt on rising only */
+ MRAA_GPIO_EDGE_FALLING = 3 /**< Interupt on falling only */
} mraa_gpio_edge_t;
/**
@@ -112,11 +116,11 @@ mraa_gpio_context mraa_gpio_init_raw(int gpiopin);
mraa_result_t mraa_gpio_edge_mode(mraa_gpio_context dev, mraa_gpio_edge_t mode);
/**
- * Set an interrupt on pin
+ * Set an interupt on pin
*
* @param dev The Gpio context
* @param edge The edge mode to set the gpio into
- * @param fptr Function pointer to function to be called when interrupt is
+ * @param fptr Function pointer to function to be called when interupt is
* triggered
* @param args Arguments passed to the interrupt handler (fptr)
* @return Result of operation
@@ -124,7 +128,7 @@ mraa_result_t mraa_gpio_edge_mode(mraa_gpio_context dev, mraa_gpio_edge_t mode);
mraa_result_t mraa_gpio_isr(mraa_gpio_context dev, mraa_gpio_edge_t edge, void (*fptr)(void*), void* args);
/**
- * Stop the current interrupt watcher on this Gpio, and set the Gpio edge mode
+ * Stop the current interupt watcher on this Gpio, and set the Gpio edge mode
* to MRAA_GPIO_EDGE_NONE
*
* @param dev The Gpio context