1 %module(directors="1") javaupm_mma7660
2 %include "../upm.i"
3 %include "cpointer.i"
4 %include "typemaps.i"
5 
6 %feature("director") IsrCallback;
7 
8 %ignore generic_callback_isr;
9 %include "../IsrCallback.h"
10 
11 %apply int *OUTPUT { int *x, int *y, int *z };
12 %apply float *OUTPUT { float *ax, float *ay, float *az  };
13 
14 %{
15     #include "mma7660.h"
16 %}
17 
18 %typemap(jni) float* "jfloatArray"
19 %typemap(jstype) float* "float[]"
20 %typemap(jtype) float* "float[]"
21 
22 %typemap(javaout) float* {
23     return $jnicall;
24 }
25 
26 %typemap(out) float *getAcceleration {
27     $result = JCALL1(NewFloatArray, jenv, 3);
28     JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
29     delete [] $1;
30 }
31 
32 
33 %typemap(jni) int* "jintArray"
34 %typemap(jstype) int* "int[]"
35 %typemap(jtype) int* "int[]"
36 
37 %typemap(javaout) int* {
38     return $jnicall;
39 }
40 
41 %typemap(out) int *getRawValues {
42     $result = JCALL1(NewIntArray, jenv, 3);
43     JCALL4(SetIntArrayRegion, jenv, $result, 0, 3, (const signed int*)$1);
44     delete [] $1;
45 }
46 
47 %ignore getRawValues(int *, int *, int *);
48 %ignore getAcceleration(float *, float *, float *);
49 
50 %include "mma7660.h"
51