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-04-30 14:33:25 +01:00
|
|
|
#include "spi.h"
|
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 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 ####
|
|
|
|
|
|
|
|
|
|
%rename(Spi) maa_spi_context;
|
|
|
|
|
|
2014-05-02 13:54:51 +01:00
|
|
|
%ignore spifd;
|
2014-05-01 15:42:42 +01:00
|
|
|
typedef struct {
|
|
|
|
|
/*@{*/
|
|
|
|
|
int spifd; /**< File descriptor to SPI Device */
|
|
|
|
|
/*@}*/
|
|
|
|
|
} maa_spi_context;
|
|
|
|
|
|
|
|
|
|
%nodefault maa_spi_context;
|
|
|
|
|
%extend maa_spi_context {
|
|
|
|
|
maa_spi_context()
|
|
|
|
|
{
|
|
|
|
|
return maa_spi_init();
|
|
|
|
|
}
|
|
|
|
|
~maa_spi_context()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
int mode(unsigned short mode)
|
|
|
|
|
{
|
|
|
|
|
return maa_spi_mode($self, mode);
|
|
|
|
|
}
|
|
|
|
|
int frequency(int hz)
|
|
|
|
|
{
|
|
|
|
|
return maa_spi_frequency($self, hz);
|
|
|
|
|
}
|
|
|
|
|
unsigned int write(unsigned int data)
|
|
|
|
|
{
|
|
|
|
|
return maa_spi_write($self, data);
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-05-01 16:59:54 +01:00
|
|
|
|
|
|
|
|
#### AIO ####
|
|
|
|
|
|
2014-05-15 22:47:38 +01:00
|
|
|
%include "aio.hpp"
|