2018-08-07 17:12:08 +03:00
|
|
|
#ifdef SWIGPYTHON
|
|
|
|
|
%module (package="upm") bma220
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
%import "interfaces/new_interfaces.i"
|
|
|
|
|
|
2018-01-26 11:52:34 -08:00
|
|
|
%include "../common_top.i"
|
|
|
|
|
|
|
|
|
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
|
|
|
|
#ifdef SWIGJAVA
|
2015-10-15 11:39:56 -07:00
|
|
|
%include "arrays_java.i";
|
|
|
|
|
%include "../java_buffer.i"
|
|
|
|
|
|
|
|
|
|
%apply int {mraa::Edge};
|
|
|
|
|
%apply float *INOUT { float *x, float *y, float *z };
|
|
|
|
|
|
|
|
|
|
%typemap(jni) float* "jfloatArray"
|
|
|
|
|
%typemap(jstype) float* "float[]"
|
|
|
|
|
%typemap(jtype) float* "float[]"
|
|
|
|
|
|
|
|
|
|
%typemap(javaout) float* {
|
|
|
|
|
return $jnicall;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%typemap(out) float *getAccelerometer {
|
|
|
|
|
$result = JCALL1(NewFloatArray, jenv, 3);
|
|
|
|
|
JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
|
|
|
|
|
delete [] $1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%ignore getAccelerometer(float *, float *, float *);
|
2018-01-26 11:52:34 -08:00
|
|
|
%ignore installISR(int, mraa::Edge, void *, void *);
|
2015-11-23 17:04:32 +02:00
|
|
|
|
2018-08-07 17:12:08 +03:00
|
|
|
%typemap(javaimports) SWIGTYPE %{
|
|
|
|
|
import upm_new_interfaces.*;
|
|
|
|
|
|
|
|
|
|
import java.util.AbstractList;
|
|
|
|
|
import java.lang.Float;
|
|
|
|
|
%}
|
|
|
|
|
|
2018-01-19 13:12:50 +02:00
|
|
|
%define GETTER get_gpioIntr();
|
|
|
|
|
%enddef
|
2018-01-17 14:20:32 +02:00
|
|
|
|
2018-01-26 11:52:34 -08:00
|
|
|
JAVA_ADD_INSTALLISR_GPIO(upm::BMA220)
|
2018-01-17 14:11:35 +02:00
|
|
|
JAVA_JNI_LOADLIBRARY(javaupm_bma220)
|
2018-01-26 11:52:34 -08:00
|
|
|
#endif
|
|
|
|
|
/* END Java syntax */
|
|
|
|
|
|
|
|
|
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
|
|
|
|
#ifdef SWIGJAVASCRIPT
|
2018-07-02 15:14:47 -07:00
|
|
|
%include "../upm_vectortypes.i"
|
2018-01-26 11:52:34 -08:00
|
|
|
%pointer_functions(float, floatp);
|
|
|
|
|
#endif
|
|
|
|
|
/* END Javascript syntax */
|
|
|
|
|
|
|
|
|
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
|
|
|
|
#ifdef SWIGPYTHON
|
2018-07-02 15:14:47 -07:00
|
|
|
%include "../upm_vectortypes.i"
|
2018-01-26 11:52:34 -08:00
|
|
|
%pointer_functions(float, floatp);
|
|
|
|
|
#endif
|
|
|
|
|
/* END Python syntax */
|
|
|
|
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
|
|
|
|
%{
|
|
|
|
|
#include "bma220.hpp"
|
|
|
|
|
%}
|
|
|
|
|
%include "bma220.hpp"
|
|
|
|
|
/* END Common SWIG syntax */
|