mirror of
https://github.com/eclipse/upm.git
synced 2025-07-05 19:31:15 +03:00
Added bindings for iAcceleration sensors
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
f992876461
commit
b6e53f7da8
@ -2,4 +2,5 @@ set (libname "h3lis331dl")
|
||||
set (libdescription "I2C 3-axis Digital Accelerometer (400g)")
|
||||
set (module_src ${libname}.cxx)
|
||||
set (module_hpp ${libname}.hpp)
|
||||
set (module_iface iAcceleration.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -1,21 +1,52 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") h3lis331dl
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%include "std_vector.i"
|
||||
%{
|
||||
#include <vector>
|
||||
%}
|
||||
|
||||
%apply float *OUTPUT { float *aX, float *aY, float *aZ };
|
||||
%apply int *OUTPUT { int *x, int *y, int*z };
|
||||
|
||||
%ignore i2cContext;
|
||||
|
||||
%template(IntVector) std::vector<int>;
|
||||
%template(FloatVector) std::vector<float>;
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%typemap(javaout) std::vector<int> {
|
||||
return (AbstractList<Integer>)(new $&javaclassname($jnicall, true));
|
||||
}
|
||||
%typemap(jstype) std::vector<int> "AbstractList<Integer>"
|
||||
|
||||
%template(intVector) std::vector<int>;
|
||||
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_h3lis331dl)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
|
||||
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||
#ifdef SWIGJAVASCRIPT
|
||||
%include "../upm_vectortypes.i"
|
||||
#endif
|
||||
/* END Javascript syntax */
|
||||
|
||||
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||
#ifdef SWIGPYTHON
|
||||
%include "../upm_vectortypes.i"
|
||||
#endif
|
||||
/* END Python syntax */
|
||||
|
||||
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||
%pointer_functions(int, intp);
|
||||
%pointer_functions(float, floatp);
|
||||
|
Reference in New Issue
Block a user