mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 01:41:12 +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
@ -263,10 +263,21 @@ function (_get_current_dot_i_file filePrefix varDotIFile)
|
||||
# Set up Java bindings
|
||||
string(APPEND JAVA_TYPEMAPS "%typemap(javaimports) SWIGTYPE %{\n")
|
||||
string(APPEND JAVA_TYPEMAPS "import upm_new_interfaces.*;\n%}")
|
||||
if (CMAKE_VERSION VERSION_LESS "3.3" )
|
||||
list (FIND module_iface "iAcceleration.hpp" _index)
|
||||
if (${_index} GREATER -1)
|
||||
set(JAVA_TYPEMAPS "%typemap(javaimports) SWIGTYPE %{\nimport upm_new_interfaces.*;\n\nimport java.util.AbstractList;\nimport java.lang.Float;\n%}\n")
|
||||
endif()
|
||||
else()
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
if ("iAcceleration.hpp" IN_LIST module_iface)
|
||||
set(JAVA_TYPEMAPS "%typemap(javaimports) SWIGTYPE %{\nimport upm_new_interfaces.*;\n\nimport java.util.AbstractList;\nimport java.lang.Float;\n%}\n")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
# Write the interface file
|
||||
configure_file (${PROJECT_SOURCE_DIR}/src/swigme.i.in "${${varDotIFile}}" @ONLY)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
set(${varDotIFile} "${${varDotIFile}}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
@ -2,4 +2,5 @@ set (libname "adxl335")
|
||||
set (libdescription "Low-power, 3-axis +/- 3 g Accelerometer")
|
||||
set (module_src ${libname}.cxx)
|
||||
set (module_hpp ${libname}.hpp)
|
||||
set (module_iface iAcceleration.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -1,7 +1,33 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") adxl335
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
import java.lang.Integer;
|
||||
%}
|
||||
|
||||
%{
|
||||
#include <vector>
|
||||
%}
|
||||
|
||||
%typemap(javaout) std::vector<int> {
|
||||
return (AbstractList<Integer>)(new $&javaclassname($jnicall, true));
|
||||
}
|
||||
%typemap(jstype) std::vector<int> "AbstractList<Integer>"
|
||||
|
||||
%template(intVector) std::vector<int>;
|
||||
|
||||
%apply int *OUTPUT { int *xVal, int *yVal, int *zVal };
|
||||
%apply float *OUTPUT { float *xAccel, float *yAccel, float *zAccel };
|
||||
|
||||
@ -41,6 +67,7 @@ JAVA_JNI_LOADLIBRARY(javaupm_adxl335)
|
||||
|
||||
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||
#ifdef SWIGJAVASCRIPT
|
||||
%include "../upm_vectortypes.i"
|
||||
%pointer_functions(int, intp);
|
||||
%pointer_functions(float, floatp);
|
||||
#endif
|
||||
@ -48,6 +75,7 @@ JAVA_JNI_LOADLIBRARY(javaupm_adxl335)
|
||||
|
||||
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||
#ifdef SWIGPYTHON
|
||||
%include "../upm_vectortypes.i"
|
||||
%pointer_functions(int, intp);
|
||||
%pointer_functions(float, floatp);
|
||||
#endif
|
||||
|
@ -2,4 +2,5 @@ set (libname "adxl345")
|
||||
set (libdescription "3-axis, +/- 2/4/8/16 g Digital Accelerometer")
|
||||
set (module_src ${libname}.cxx)
|
||||
set (module_hpp ${libname}.hpp)
|
||||
set (module_iface iAcceleration.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -1,3 +1,9 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") adxl345
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
@ -29,6 +35,13 @@
|
||||
delete [] $1;
|
||||
}
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_adxl345)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
@ -37,6 +50,7 @@ JAVA_JNI_LOADLIBRARY(javaupm_adxl345)
|
||||
#ifdef SWIGJAVASCRIPT
|
||||
%include "../carrays_int16_t.i"
|
||||
%include "../carrays_float.i"
|
||||
%include "../upm_vectortypes.i"
|
||||
|
||||
%typemap(out) int16_t * {
|
||||
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int16Array, 0 | 0 );
|
||||
@ -54,6 +68,7 @@ JAVA_JNI_LOADLIBRARY(javaupm_adxl345)
|
||||
#ifdef SWIGPYTHON
|
||||
%include "../carrays_int16_t.i"
|
||||
%include "../carrays_float.i"
|
||||
%include "../upm_vectortypes.i"
|
||||
|
||||
%typemap(out) int16_t * {
|
||||
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int16Array, 0 | 0 );
|
||||
|
@ -7,6 +7,7 @@ AUTOBOX(float, Float)
|
||||
AUTOBOX(boolean, Boolean)
|
||||
AUTOBOX(signed char, Byte)
|
||||
AUTOBOX(short, Short)
|
||||
AUTOBOX(unsigned char, Short)
|
||||
AUTOBOX(int, Integer)
|
||||
AUTOBOX(long, Long)
|
||||
AUTOBOX(SWIGTYPE, $typemap(jstype,$1_basetype))
|
@ -2,4 +2,5 @@ set (libname "bma220")
|
||||
set (libdescription "Digital Triaxial Acceleration Sensor")
|
||||
set (module_src ${libname}.cxx)
|
||||
set (module_hpp ${libname}.hpp)
|
||||
set (module_iface iAcceleration.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -1,3 +1,9 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") bma220
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
@ -25,6 +31,13 @@
|
||||
%ignore getAccelerometer(float *, float *, float *);
|
||||
%ignore installISR(int, mraa::Edge, void *, void *);
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%define GETTER get_gpioIntr();
|
||||
%enddef
|
||||
|
||||
|
@ -4,6 +4,7 @@ upm_mixed_module_init (NAME bma250e
|
||||
C_SRC bma250e.c
|
||||
CPP_HDR bma250e.hpp
|
||||
CPP_SRC bma250e.cxx
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
FTI_SRC bma250e_fti.c
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -1,3 +1,9 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") bma250e
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
@ -8,6 +14,8 @@
|
||||
%ignore installISR (BMA250E_INTERRUPT_PINS_T, int, mraa::Edge , void *, void *);
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
@ -15,12 +23,6 @@ import java.lang.Float;
|
||||
%typemap(javaout) upm::BMA250E {
|
||||
return new $&javaclassname($jnicall, true);
|
||||
}
|
||||
%typemap(javaout) std::vector<float> {
|
||||
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
||||
}
|
||||
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
||||
|
||||
%template(floatVector) std::vector<float>;
|
||||
|
||||
%define INTERRUPT BMA250E_INTERRUPT_PINS_T
|
||||
%enddef
|
||||
|
@ -4,6 +4,7 @@ upm_mixed_module_init (NAME bmi160
|
||||
C_SRC bmi160.c bosch_bmi160.c
|
||||
CPP_HDR bmi160.hpp
|
||||
CPP_SRC bmi160.cxx
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
# FTI_SRC bmi160_fti.c
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -1,3 +1,9 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") bmi160
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
@ -22,18 +28,27 @@
|
||||
%ignore getGyroscope(float *, float *, float *);
|
||||
%ignore getMagnetometer(float *, float *, float *);
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_bmi160)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
|
||||
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||
#ifdef SWIGJAVASCRIPT
|
||||
%include "../upm_vectortypes.i"
|
||||
%pointer_functions(float, floatp);
|
||||
#endif
|
||||
/* END Javascript syntax */
|
||||
|
||||
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||
#ifdef SWIGPYTHON
|
||||
%include "../upm_vectortypes.i"
|
||||
%pointer_functions(float, floatp);
|
||||
#endif
|
||||
/* END Python syntax */
|
||||
|
@ -2,4 +2,5 @@ upm_mixed_module_init (NAME bmx055
|
||||
DESCRIPTION "Bosch IMU Sensor Library"
|
||||
CPP_HDR bmx055.hpp bmc150.hpp bmi055.hpp
|
||||
CPP_SRC bmx055.cxx bmc150.cxx bmi055.cxx
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
REQUIRES mraa bmg160 bma250e bmm150)
|
||||
|
@ -1,3 +1,9 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") bmx055
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
@ -11,20 +17,12 @@
|
||||
%ignore getGyroscope(float *, float *, float *);
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%typemap(javaout) SWIGTYPE {
|
||||
return new $&javaclassname($jnicall, true);
|
||||
}
|
||||
%typemap(javaout) std::vector<float> {
|
||||
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
||||
}
|
||||
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
||||
|
||||
%template(floatVector) std::vector<float>;
|
||||
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_bmx055)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
|
@ -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);
|
||||
|
@ -5,5 +5,6 @@ upm_mixed_module_init (NAME lis2ds12
|
||||
CPP_HDR lis2ds12.hpp
|
||||
CPP_SRC lis2ds12.cxx
|
||||
FTI_SRC lis2ds12_fti.c
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -1,3 +1,9 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") lis2ds12
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
@ -5,6 +11,13 @@
|
||||
%ignore getAccelerometer(float *, float *, float *);
|
||||
#%ignore installISR(LIS2DS12_INTERRUPT_PINS_T , int , mraa::Edge, void *, void *);
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%define INTERRUPT LIS2DS12_INTERRUPT_PINS_T
|
||||
%enddef
|
||||
JAVA_ADD_INSTALLISR_INTERRUPT(upm::LIS2DS12)
|
||||
@ -13,8 +26,19 @@ JAVA_JNI_LOADLIBRARY(javaupm_lis2ds12)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
|
||||
/* BEGIN Common SWIG 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 ------------------------------------------------- */
|
||||
%{
|
||||
#include "lis2ds12.hpp"
|
||||
%}
|
||||
|
@ -5,5 +5,6 @@ upm_mixed_module_init (NAME lis3dh
|
||||
CPP_HDR lis3dh.hpp
|
||||
CPP_SRC lis3dh.cxx
|
||||
FTI_SRC lis3dh_fti.c
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -1,8 +1,13 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") lis3dh
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%include "../upm_vectortypes.i"
|
||||
|
||||
%ignore getAccelerometer(float *, float *, float *);
|
||||
%ignore installISR(LIS3DH_INTERRUPT_PINS_T , int , mraa::Edge , void *, void* );
|
||||
@ -10,13 +15,31 @@
|
||||
%define INTERRUPT LIS3DH_INTERRUPT_PINS_T
|
||||
%enddef
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
JAVA_ADD_INSTALLISR_INTERRUPT(upm::LIS3DH)
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_lis3dh)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
|
||||
/* BEGIN Common SWIG 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 ------------------------------------------------- */
|
||||
%{
|
||||
#include "lis3dh_defs.h"
|
||||
#include "lis3dh.hpp"
|
||||
|
@ -5,5 +5,6 @@ upm_mixed_module_init (NAME lsm303agr
|
||||
CPP_HDR lsm303agr.hpp
|
||||
CPP_SRC lsm303agr.cxx
|
||||
FTI_SRC lsm303agr_fti.c
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -1,28 +1,25 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") lsm303agr
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%include "../upm_javastdvector.i"
|
||||
|
||||
%ignore getMagnetometer(float *, float *, float *);
|
||||
%ignore getAccelerometer(float *, float *, float *);
|
||||
%ignore installISR(LSM303AGR_INTERRUPT_PINS_T , int , mraa::Edge , void *, void *);
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%typemap(javaout) SWIGTYPE {
|
||||
return new $&javaclassname($jnicall, true);
|
||||
}
|
||||
%typemap(javaout) std::vector<float> {
|
||||
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
||||
}
|
||||
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
||||
|
||||
%template(floatVector) std::vector<float>;
|
||||
|
||||
%define INTERRUPT LSM303AGR_INTERRUPT_PINS_T
|
||||
%enddef
|
||||
|
||||
|
@ -4,5 +4,6 @@ upm_mixed_module_init (NAME lsm303d
|
||||
C_SRC lsm303d.c
|
||||
CPP_HDR lsm303d.hpp
|
||||
CPP_SRC lsm303d.cxx
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -1,27 +1,24 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") lsm303d
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%include "../upm_javastdvector.i"
|
||||
|
||||
%ignore getMagnetometer(float *, float *, float *);
|
||||
%ignore getAccelerometer(float *, float *, float *);
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%typemap(javaout) SWIGTYPE {
|
||||
return new $&javaclassname($jnicall, true);
|
||||
}
|
||||
%typemap(javaout) std::vector<float> {
|
||||
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
||||
}
|
||||
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
||||
|
||||
%template(floatVector) std::vector<float>;
|
||||
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_lsm303d)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
|
@ -5,5 +5,6 @@ upm_mixed_module_init (NAME lsm6ds3h
|
||||
CPP_HDR lsm6ds3h.hpp
|
||||
CPP_SRC lsm6ds3h.cxx
|
||||
FTI_SRC lsm6ds3h_fti.c
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -1,8 +1,19 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") lsm6ds3h
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%include "../upm_vectortypes.i"
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%ignore getAccelerometer(float *, float *, float *);
|
||||
%ignore getGyroscope(float *, float *, float *);
|
||||
@ -17,8 +28,19 @@ JAVA_JNI_LOADLIBRARY(javaupm_lsm6ds3h)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
|
||||
/* BEGIN Common SWIG 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 ------------------------------------------------- */
|
||||
%{
|
||||
#include "lsm6ds3h_defs.h"
|
||||
#include "lsm6ds3h.hpp"
|
||||
|
@ -4,6 +4,7 @@ upm_mixed_module_init (NAME lsm6dsl
|
||||
C_SRC lsm6dsl.c
|
||||
CPP_HDR lsm6dsl.hpp
|
||||
CPP_SRC lsm6dsl.cxx
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
FTI_SRC lsm6dsl_fti.c
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa utilities-c)
|
||||
|
@ -1,9 +1,19 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") lsm6dsl
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%include "../upm_vectortypes.i"
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
%ignore getAccelerometer(float *, float *, float *);
|
||||
%ignore getGyroscope(float *, float *, float *);
|
||||
|
||||
@ -17,8 +27,21 @@ JAVA_JNI_LOADLIBRARY(javaupm_lsm6dsl)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
|
||||
/* BEGIN Common SWIG 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 ------------------------------------------------- */
|
||||
%include "std_vector.i"
|
||||
%template(floatVector) std::vector<float>;
|
||||
%{
|
||||
#include "lsm6dsl_defs.h"
|
||||
#include "lsm6dsl.hpp"
|
||||
|
@ -2,4 +2,5 @@ set (libname "lsm9ds0")
|
||||
set (libdescription "Triaxial Gyroscope/accelerometer/magnetometer Sensor")
|
||||
set (module_src ${libname}.cxx)
|
||||
set (module_hpp ${libname}.hpp)
|
||||
set (module_iface iAcceleration.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -1,3 +1,9 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") lsm9ds0
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
@ -5,6 +11,13 @@
|
||||
%include "arrays_java.i";
|
||||
%include "../java_buffer.i"
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%apply int {mraa::Edge};
|
||||
%apply float *INOUT { float *x, float *y, float *z };
|
||||
|
||||
@ -51,12 +64,14 @@ JAVA_JNI_LOADLIBRARY(javaupm_lsm9ds0)
|
||||
|
||||
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||
#ifdef SWIGJAVASCRIPT
|
||||
%include "../upm_vectortypes.i"
|
||||
%pointer_functions(float, floatp);
|
||||
#endif
|
||||
/* END Javascript syntax */
|
||||
|
||||
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||
#ifdef SWIGPYTHON
|
||||
%include "../upm_vectortypes.i"
|
||||
%pointer_functions(float, floatp);
|
||||
#endif
|
||||
/* END Python syntax */
|
||||
|
@ -2,4 +2,5 @@ set (libname "mma7455")
|
||||
set (libdescription "Three Axis +/- 2/4/8 g Digital Accelerometer")
|
||||
set (module_src ${libname}.cxx)
|
||||
set (module_hpp ${libname}.hpp)
|
||||
set (module_iface iAcceleration.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -1,17 +1,52 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") mma7455
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%include "arrays_java.i";
|
||||
%include "../java_buffer.i"
|
||||
%include "std_vector.i"
|
||||
%apply short *OUTPUT { short * ptrX, short * ptrY, short * ptrZ };
|
||||
%template(ShortVector) std::vector<short>;
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
import java.lang.Short;
|
||||
%}
|
||||
|
||||
%{
|
||||
#include <vector>
|
||||
%}
|
||||
|
||||
%typemap(javaout) std::vector<short> {
|
||||
return (AbstractList<Short>)(new $&javaclassname($jnicall, true));
|
||||
}
|
||||
%typemap(jstype) std::vector<short> "AbstractList<Short>"
|
||||
|
||||
%template(shortVector) std::vector<short>;
|
||||
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_mma7455)
|
||||
#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 ------------------------------------------------- */
|
||||
%{
|
||||
#include "mma7455.hpp"
|
||||
|
@ -4,6 +4,7 @@ upm_mixed_module_init (NAME mma7660
|
||||
C_SRC mma7660.c
|
||||
CPP_HDR mma7660.hpp
|
||||
CPP_SRC mma7660.cxx
|
||||
IFACE_HDR iAcceleration.hpp
|
||||
FTI_SRC mma7660_fti.c
|
||||
CPP_WRAPS_C
|
||||
REQUIRES mraa)
|
||||
|
@ -1,23 +1,57 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") mma7660
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%include "arrays_java.i";
|
||||
%include "../java_buffer.i"
|
||||
%include "std_vector.i"
|
||||
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
import java.lang.Integer;
|
||||
%}
|
||||
|
||||
%{
|
||||
#include <vector>
|
||||
%}
|
||||
|
||||
%typemap(javaout) std::vector<int> {
|
||||
return (AbstractList<Integer>)(new $&javaclassname($jnicall, true));
|
||||
}
|
||||
%typemap(jstype) std::vector<int> "AbstractList<Integer>"
|
||||
|
||||
%template(intVector) std::vector<int>;
|
||||
|
||||
|
||||
%apply float *OUTPUT { float *ax, float *ay, float *az };
|
||||
%apply int *OUTPUT { int *x, int *y, int *z };
|
||||
%ignore installISR(int , void *, void *);
|
||||
|
||||
%template(IntVector) std::vector<int>;
|
||||
%template(FloatVector) std::vector<float>;
|
||||
|
||||
JAVA_ADD_INSTALLISR_PIN(upm::MMA7660)
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_mma7660)
|
||||
#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);
|
||||
|
@ -2,4 +2,5 @@ set (libname "mma8x5x")
|
||||
set (libdescription "Tri-axis Accelerometer Sensor")
|
||||
set (module_src ${libname}.cpp)
|
||||
set (module_hpp ${libname}.hpp)
|
||||
set (module_iface iAcceleration.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -2,4 +2,5 @@ set (libname "mpu9150")
|
||||
set (libdescription "IMU Sensor Library Based On the Mpu9150")
|
||||
set (module_src ${libname}.cxx ak8975.cxx mpu60x0.cxx mpu9250.cxx)
|
||||
set (module_hpp ${libname}.hpp ak8975.hpp mpu60x0.hpp mpu9250.hpp)
|
||||
set (module_iface iAcceleration.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -1,3 +1,9 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="upm") mpu9150
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
@ -6,7 +12,12 @@
|
||||
%include "arrays_java.i"
|
||||
%include "../java_buffer.i"
|
||||
|
||||
%template(FloatVector) std::vector<float>;
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
%}
|
||||
|
||||
%apply int {mraa::Edge};
|
||||
|
||||
@ -22,6 +33,7 @@ JAVA_JNI_LOADLIBRARY(javaupm_mpu9150)
|
||||
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||
#ifdef SWIGJAVASCRIPT
|
||||
%include "std_vector.i"
|
||||
%include "../upm_vectortypes.i"
|
||||
%pointer_functions(float, floatp);
|
||||
#endif
|
||||
/* END Javascript syntax */
|
||||
@ -29,6 +41,7 @@ JAVA_JNI_LOADLIBRARY(javaupm_mpu9150)
|
||||
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||
#ifdef SWIGPYTHON
|
||||
%include "std_vector.i"
|
||||
%include "../upm_vectortypes.i"
|
||||
%pointer_functions(float, floatp);
|
||||
#endif
|
||||
/* END Python syntax */
|
||||
|
@ -1,16 +1,20 @@
|
||||
/* This SWIG .i file is generated from UPM CMake. If additional functionality
|
||||
* is required, custom .i files can be placed in the library directory.
|
||||
*/
|
||||
@PYTHON_NEW_INTERFACES@
|
||||
|
||||
@IMPORT_NEW_INTERFACES@
|
||||
|
||||
/* Common SWIG syntax */
|
||||
%include "../common_top.i"
|
||||
|
||||
/* Java-specific SWIG syntax */
|
||||
#ifdef SWIGJAVA
|
||||
@JAVA_TYPEMAPS@
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_@libname@)
|
||||
#endif
|
||||
|
||||
%{
|
||||
@SWIG_HASH_INCLUDES@
|
||||
%}
|
||||
@SWIG_PERCENT_INCLUDES@
|
||||
|
||||
/* Java-specific SWIG syntax */
|
||||
#ifdef SWIGJAVA
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_@libname@)
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user