• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 %module(directors="1") javaupm_lsm9ds0
2 %include "../upm.i"
3 %include "cpointer.i"
4 %include "typemaps.i"
5 %include "arrays_java.i";
6 %include "../java_buffer.i"
7 
8 %feature("director") IsrCallback;
9 
10 %ignore generic_callback_isr;
11 %include "../IsrCallback.h"
12 
13 %apply int {mraa::Edge};
14 %apply float *INOUT { float *x, float *y, float *z };
15 
16 %typemap(jni) float* "jfloatArray"
17 %typemap(jstype) float* "float[]"
18 %typemap(jtype) float* "float[]"
19 
20 %typemap(javaout) float* {
21     return $jnicall;
22 }
23 
24 %typemap(out) float *getAccelerometer {
25     $result = JCALL1(NewFloatArray, jenv, 3);
26     JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
27     delete [] $1;
28 }
29 
30 %typemap(out) float *getGyroscope {
31     $result = JCALL1(NewFloatArray, jenv, 3);
32     JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
33     delete [] $1;
34 }
35 
36 %typemap(out) float *getMagnetometer {
37     $result = JCALL1(NewFloatArray, jenv, 3);
38     JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
39     delete [] $1;
40 }
41 
42 %ignore getAccelerometer(float *, float *, float *);
43 %ignore getGyroscope(float *, float *, float *);
44 %ignore getMagnetometer(float *, float *, float *);
45 
46 %{
47     #include "lsm9ds0.h"
48 %}
49 
50 %include "lsm9ds0.h"
51