2014-04-10 16:53:19 +01:00
|
|
|
%{
|
|
|
|
|
#include "maa.h"
|
2014-05-16 11:56:06 +01:00
|
|
|
#include "gpio.hpp"
|
2014-05-16 11:53:19 +01:00
|
|
|
#include "pwm.hpp"
|
2014-05-16 10:28:26 +01:00
|
|
|
#include "i2c.hpp"
|
2014-05-16 14:10:29 +01:00
|
|
|
#include "spi.hpp"
|
2014-05-15 22:47:38 +01:00
|
|
|
#include "aio.hpp"
|
2014-04-10 16:53:19 +01:00
|
|
|
%}
|
|
|
|
|
|
2014-05-07 17:39:58 +01:00
|
|
|
%init %{
|
2014-05-13 20:45:00 +00:00
|
|
|
//Adding maa_init() to the module initialisation process
|
2014-05-07 17:39:58 +01:00
|
|
|
maa_init();
|
|
|
|
|
%}
|
|
|
|
|
|
2014-05-01 15:27:34 +01:00
|
|
|
%rename(get_version) maa_get_version();
|
2014-05-02 09:52:06 +01:00
|
|
|
const char * maa_get_version();
|
2014-05-01 15:27:34 +01:00
|
|
|
|
2014-05-01 15:42:42 +01:00
|
|
|
#### GPIO ####
|
|
|
|
|
|
2014-05-16 14:28:59 +01:00
|
|
|
/**
|
|
|
|
|
* 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;
|
|
|
|
|
|
2014-05-16 11:56:06 +01:00
|
|
|
%include "gpio.hpp"
|
2014-05-01 15:42:42 +01:00
|
|
|
|
|
|
|
|
#### i2c ####
|
|
|
|
|
|
2014-05-16 10:28:26 +01:00
|
|
|
%include "i2c.hpp"
|
2014-05-01 15:42:42 +01:00
|
|
|
|
|
|
|
|
#### PWM ####
|
|
|
|
|
|
2014-05-16 11:53:19 +01:00
|
|
|
%include "pwm.hpp"
|
2014-05-01 15:42:42 +01:00
|
|
|
|
|
|
|
|
#### SPI ####
|
|
|
|
|
|
2014-05-16 14:10:29 +01:00
|
|
|
%include "spi.hpp"
|
2014-05-01 16:59:54 +01:00
|
|
|
|
|
|
|
|
#### AIO ####
|
|
|
|
|
|
2014-05-15 22:47:38 +01:00
|
|
|
%include "aio.hpp"
|