From 09d3f380c164040ccbf18a2818556a8581fb7ea3 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Fri, 16 May 2014 14:28:59 +0100 Subject: [PATCH] swig: add gpio enum definitions on interface file Signed-off-by: Brendan Le Foll --- src/maa.i | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/maa.i b/src/maa.i index e053282..60ac1ee 100644 --- a/src/maa.i +++ b/src/maa.i @@ -17,6 +17,31 @@ const char * maa_get_version(); #### GPIO #### +/** + * GPIO Output modes + */ +typedef enum { + MAA_GPIO_STRONG = 0, /**< Default. Strong high and low */ + MAA_GPIO_PULLUP = 1, /**< Resistive High */ + MAA_GPIO_PULLDOWN = 2, /**< Resistive Low */ + MAA_GPIO_HIZ = 3 /**< High Z State */ +} gpio_mode_t; + +/** + * GPIO Direction options. + */ +typedef enum { + MAA_GPIO_OUT = 0, /**< Output. A Mode can also be set */ + MAA_GPIO_IN = 1 /**< Input. */ +} gpio_dir_t; + +typedef enum { + MAA_GPIO_EDGE_NONE = 0, /**< No interrupt on GPIO */ + MAA_GPIO_EDGE_BOTH = 1, /**< Interupt on rising & falling */ + MAA_GPIO_EDGE_RISING = 2, /**< Interupt on rising only */ + MAA_GPIO_EDGE_FALLING = 3 /**< Interupt on falling only */ +} gpio_edge_t; + %include "gpio.hpp" #### i2c ####