Private
Public Access
2
0

aio: add aio swig object

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-05-01 16:59:54 +01:00
parent 207c54a5e7
commit d1de6a48c9
2 changed files with 27 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
#include "pwm.h"
#include "i2c.h"
#include "spi.h"
#include "aio.h"
%}
%rename(get_version) maa_get_version();
@@ -192,3 +193,28 @@ typedef struct {
return maa_spi_write($self, data);
}
}
#### AIO ####
%rename(Aio) maa_aio_context;
typedef struct {
unsigned int channel;
FILE *adc_in_fp;
} maa_aio_context;
%nodefault maa_aio_context;
%extend maa_aio_context {
maa_aio_context(unsigned int aio_channel)
{
return maa_aio_init(aio_channel);
}
~maa_aio_context()
{
maa_aio_close($self);
}
unsigned int read()
{
return maa_aio_read_u16($self);
}
}