Private
Public Access
2
0
Files
mraa/src/maa.i
Brendan Le Foll 09d3f380c1 swig: add gpio enum definitions on interface file
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-16 14:31:47 +01:00

62 lines
1.2 KiB
OpenEdge ABL

%{
#include "maa.h"
#include "gpio.hpp"
#include "pwm.hpp"
#include "i2c.hpp"
#include "spi.hpp"
#include "aio.hpp"
%}
%init %{
//Adding maa_init() to the module initialisation process
maa_init();
%}
%rename(get_version) maa_get_version();
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 ####
%include "i2c.hpp"
#### PWM ####
%include "pwm.hpp"
#### SPI ####
%include "spi.hpp"
#### AIO ####
%include "aio.hpp"