Removed old interfaces and replaced them with the new ones.

Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
This commit is contained in:
Serban Waltter
2018-09-27 17:33:40 +03:00
parent fae1da6c6f
commit 5f9bebad14
139 changed files with 396 additions and 832 deletions

View File

@ -255,23 +255,23 @@ function (_get_current_dot_i_file filePrefix varDotIFile)
string(REPLACE "#" "%" SWIG_PERCENT_INCLUDES "${SWIG_HASH_INCLUDES}")
if(module_iface)
# Set up Python bindings
set(PYTHON_NEW_INTERFACES "#ifdef SWIGPYTHON\n")
string(APPEND PYTHON_NEW_INTERFACES "%module (package=\"pyupm_new_interfaces\") ${libname}\n")
string(APPEND PYTHON_NEW_INTERFACES "#endif")
set(PYTHON_INTERFACES "#ifdef SWIGPYTHON\n")
string(APPEND PYTHON_INTERFACES "%module (package=\"upm\") ${libname}\n")
string(APPEND PYTHON_INTERFACES "#endif")
# Include interfaces
set(IMPORT_NEW_INTERFACES "%import \"interfaces/new_interfaces.i\"")
set(IMPORT_INTERFACES "%import \"interfaces/interfaces.i\"")
# Set up Java bindings
string(APPEND JAVA_TYPEMAPS "%typemap(javaimports) SWIGTYPE %{\n")
string(APPEND JAVA_TYPEMAPS "import upm_new_interfaces.*;\n%}")
string(APPEND JAVA_TYPEMAPS "import upm_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")
set(JAVA_TYPEMAPS "%typemap(javaimports) SWIGTYPE %{\nimport upm_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")
set(JAVA_TYPEMAPS "%typemap(javaimports) SWIGTYPE %{\nimport upm_interfaces.*;\n\nimport java.util.AbstractList;\nimport java.lang.Float;\n%}\n")
endif()
endif()
endif()
@ -329,7 +329,7 @@ macro(_upm_swig_python)
set (python_wrapper_target ${SWIG_MODULE_${python_wrapper_name}_REAL_NAME})
if(module_iface)
add_dependencies(${python_wrapper_target} _pyupm_new_interfaces-python${PYTHON_VERSION_MAJOR})
add_dependencies(${python_wrapper_target} _pyupm_interfaces-python${PYTHON_VERSION_MAJOR})
endif()
add_dependencies(${python_wrapper_target} ${libname})
@ -464,7 +464,7 @@ function(upm_swig_node)
# Add interfaces if necessary
if(module_iface)
add_dependencies(jsupm_${libname} jsupm_new_interfaces)
add_dependencies(jsupm_${libname} jsupm_interfaces)
endif()
add_dependencies(jsupm_${libname} ${libname})
@ -556,15 +556,9 @@ function(upm_swig_java)
# If the C++ target depends on C++ interfaces, make the JAVA target
# depend on the JAVA interfaces
if ("${_c_cxx_dependency_list}" MATCHES interfaces)
add_dependencies(javaupm_${libname} javaupm_interfaces)
# If this target depends on interfaces, include the java interfaces
# target .jar file in the classpath, otherwise this variable will be empty
set (INTERFACES_JAR_FILE ${CMAKE_BINARY_DIR}/src/interfaces/upm_interfaces.jar)
endif ()
if(module_iface)
add_dependencies(javaupm_${libname} javaupm_new_interfaces)
set (NEW_INTERFACES_JAR_FILE ${CMAKE_BINARY_DIR}/interfaces/upm_new_interfaces.jar)
add_dependencies(javaupm_${libname} javaupm_interfaces)
set (INTERFACES_JAR_FILE ${CMAKE_BINARY_DIR}/interfaces/upm_interfaces.jar)
endif()
# For linker to report unresolved symbols. Note, there is currently no test
# for linker flags (similar to compile files), so this is it for now.
@ -616,7 +610,7 @@ function(upm_swig_java)
add_custom_command (TARGET javaupm_${libname}
POST_BUILD
COMMAND cmake -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/upm_${libname}
COMMAND ${JAVAC} *.java -d ${CMAKE_CURRENT_BINARY_DIR} -cp ${INTERFACES_JAR_FILE}:${NEW_INTERFACES_JAR_FILE}:.
COMMAND ${JAVAC} *.java -d ${CMAKE_CURRENT_BINARY_DIR} -cp ${INTERFACES_JAR_FILE}:.
COMMAND ${JAR} cf upm_${libname}.jar upm_${libname}
)
@ -678,10 +672,8 @@ if (BUILDSWIGNODE)
# Utilities and interfaces
file (COPY ${CMAKE_SOURCE_DIR}/src/utilities DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/jsupm_${libname})
file (COPY ${CMAKE_SOURCE_DIR}/src/interfaces DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/jsupm_${libname})
set (upm_LIB_SRCS_GYP "'utilities/upm_utilities.c',\n${upm_LIB_SRCS_GYP}")
set (upm_LIB_INCLUDE_DIRS_GYP "'utilities',\n${upm_LIB_INCLUDE_DIRS_GYP}")
set (upm_LIB_INCLUDE_DIRS_GYP "'interfaces',\n${upm_LIB_INCLUDE_DIRS_GYP}")
# Add readme, package.json for NPM and node-gyp config file
configure_file (${PROJECT_SOURCE_DIR}/src/binding.gyp.in ${CMAKE_CURRENT_BINARY_DIR}/jsupm_${libname}/binding.gyp @ONLY)
@ -978,12 +970,6 @@ if (NOT "${MODULE_LIST}" MATCHES ";utilities;")
set(MODULE_LIST "utilities;${MODULE_LIST}")
endif()
# If the module list does NOT include the interfaces directory, prepend it since
# some sensor library targets depend on interfaces
if (NOT "${MODULE_LIST}" MATCHES ";interfaces;")
set(MODULE_LIST "interfaces;${MODULE_LIST}")
endif()
# Iterate over each directory in MODULE_LIST
foreach(subdir ${MODULE_LIST})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/CMakeLists.txt)

View File

@ -2,14 +2,14 @@
%module (package="upm") a110x
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
/* Macro for loading javaupm_a110x */

View File

@ -2,14 +2,14 @@
%module (package="upm") htu21d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_abp)

View File

@ -2,7 +2,7 @@ set (libname "ads1x15")
set (libdescription "Texas Instruments I2C ADC Library")
set (module_src ${libname}.cxx ads1115.cxx ads1015.cxx)
set (module_hpp ${libname}.hpp ads1115.hpp ads1015.hpp)
upm_module_init(interfaces mraa)
upm_module_init(mraa)
compiler_flag_supported(CXX is_supported -Wno-overloaded-virtual)
if (is_supported)
target_compile_options(${libname} PUBLIC -Wno-overloaded-virtual)

View File

@ -26,7 +26,6 @@
#pragma once
#include "ads1x15.hpp"
#include "interfaces/iADC.hpp"
#define ADS1015_VREF 2.048
@ -85,7 +84,9 @@ namespace upm {
* @snippet ads1x15-ads1015.cxx Interesting
* @snippet ads1x15-adc-sensor.cxx Interesting
*/
class ADS1015 : public ADS1X15, public IADC {
#define UPM_THROW(msg) throw std::runtime_error(std::string(__FUNCTION__) + ": " + (msg))
class ADS1015 : public ADS1X15 {
public:

View File

@ -2,27 +2,10 @@
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%import "../interfaces/javaupm_iADC.i"
%typemap(javaimports) SWIGTYPE %{import upm_interfaces.*;%}
JAVA_JNI_LOADLIBRARY(javaupm_ads1x15)
#endif
/* END Java syntax */
/* BEGIN Javascript syntax ------------------------------------------------- */
#ifdef SWIGJAVASCRIPT
%include "iModuleStatus.hpp"
%include "iADC.hpp"
#endif
/* END Javascript syntax */
/* BEGIN Python syntax ----------------------------------------------------- */
#ifdef SWIGPYTHON
%include "iModuleStatus.hpp"
%include "iADC.hpp"
#endif
/* END Python syntax */
/* BEGIN Common SWIG syntax ------------------------------------------------- */
%{
#include "ads1x15.hpp"

View File

@ -2,7 +2,7 @@
%module (package="upm") adxl335
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -10,7 +10,7 @@
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,7 +2,7 @@
%module (package="upm") adxl345
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -36,7 +36,7 @@
}
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,14 +2,14 @@
%module (package="upm") htu21d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_bh1750)

View File

@ -2,7 +2,7 @@
%module (package="upm") bma220
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -32,7 +32,7 @@
%ignore installISR(int, mraa::Edge, void *, void *);
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,7 +2,7 @@
%module (package="upm") bma250e
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -14,7 +14,7 @@
%ignore installISR (BMA250E_INTERRUPT_PINS_T, int, mraa::Edge , void *, void *);
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,7 +2,7 @@
%module (package="upm") bmi160
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -29,7 +29,7 @@
%ignore getMagnetometer(float *, float *, float *);
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -6,5 +6,5 @@ upm_mixed_module_init (NAME bmp280
CPP_SRC bmp280.cxx bme280.cxx
IFACE_HDR iHumidity.hpp iPressure.hpp iTemperature.hpp
CPP_WRAPS_C
REQUIRES mraa interfaces utilities-c)
REQUIRES mraa utilities-c)
target_link_libraries(${libnamec} m)

View File

@ -2,14 +2,14 @@
%module (package="upm") bmp280
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_bmp280)

View File

@ -7,5 +7,5 @@ upm_mixed_module_init (NAME bmpx8x
IFACE_HDR iPressure.hpp
FTI_SRC bmpx8x_fti.c
CPP_WRAPS_C
REQUIRES mraa interfaces utilities-c)
REQUIRES mraa utilities-c)
target_link_libraries(${libnamec} m)

View File

@ -2,14 +2,14 @@
%module (package="upm") htu21d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_bmpx8x)

View File

@ -2,7 +2,7 @@
%module (package="upm") bmx055
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -17,7 +17,7 @@
%ignore getGyroscope(float *, float *, float *);
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -4,4 +4,5 @@ upm_mixed_module_init (NAME button
C_SRC button.c
CPP_HDR button.hpp
CPP_SRC button.cxx
IFACE_HDR iButton.hpp
REQUIRES mraa)

View File

@ -1,7 +1,16 @@
#ifdef SWIGPYTHON
%module (package="upm") button
#endif
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_interfaces.*;
%}
%apply int {mraa::Edge}
JAVA_ADD_INSTALLISR_EDGE(upm::Button)

View File

@ -5,5 +5,6 @@ upm_mixed_module_init (NAME collision
CPP_HDR collision.hpp
CPP_SRC collision.cxx
FTI_SRC collision_fti.c
IFACE_HDR iCollision.hpp
CPP_WRAPS_C
REQUIRES mraa)

View File

@ -6,6 +6,7 @@ if (MRAA_OW_FOUND)
CPP_HDR dfrec.hpp
CPP_SRC dfrec.cxx
FTI_SRC dfrec_fti.c
IFACE_HDR iEC.hpp
CPP_WRAPS_C
REQUIRES ds18b20 mraa utilities-c)
# make sure the C library has the appropriate dependency on the UPM

View File

@ -1,7 +1,17 @@
#ifdef SWIGPYTHON
%module (package="upm") dfrec
#endif
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_dfrec)
#endif
/* END Java syntax */

View File

@ -5,5 +5,6 @@ upm_mixed_module_init (NAME dfrorp
CPP_HDR dfrorp.hpp
CPP_SRC dfrorp.cxx
FTI_SRC dfrorp_fti.c
IFACE_HDR iOrp.hpp
CPP_WRAPS_C
REQUIRES mraa utilities-c)

View File

@ -1,7 +1,17 @@
#ifdef SWIGPYTHON
%module (package="upm") dfrorp
#endif
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_dfrorp)
#endif
/* END Java syntax */

View File

@ -5,5 +5,6 @@ upm_mixed_module_init (NAME dfrph
CPP_HDR dfrph.hpp
CPP_SRC dfrph.cxx
FTI_SRC dfrph_fti.c
IFACE_HDR iPH.hpp
CPP_WRAPS_C
REQUIRES mraa)

View File

@ -2,4 +2,4 @@ set (libname "ds1808lc")
set (libdescription "Lighting Controller")
set (module_src ${libname}.cxx mraa-utils.cxx)
set (module_hpp ${libname}.hpp)
upm_module_init(interfaces mraa)
upm_module_init(mraa )

View File

@ -22,7 +22,6 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "iLightController.hpp"
#include "mraa/i2c.hpp"
namespace upm
@ -51,7 +50,9 @@ namespace upm
*
* @snippet ds1808lc.cxx Interesting
*/
class DS1808LC : public upm::ILightController
#define UPM_THROW(msg) throw std::runtime_error(std::string(__FUNCTION__) + ": " + (msg))
class DS1808LC
{
public:
DS1808LC(int gpioPower, int i2cBus);

View File

@ -4,8 +4,6 @@
#ifdef SWIGJAVA
%include "arrays_java.i";
%include "../java_buffer.i"
%typemap(javaimports) SWIGTYPE %{import upm_interfaces.*;%}
%import "../interfaces/javaupm_iLightController.i"
JAVA_JNI_LOADLIBRARY(javaupm_ds1808lc)
#endif
@ -13,15 +11,11 @@ JAVA_JNI_LOADLIBRARY(javaupm_ds1808lc)
/* BEGIN Javascript syntax ------------------------------------------------- */
#ifdef SWIGJAVASCRIPT
%include "iModuleStatus.hpp"
%include "iLightController.hpp"
#endif
/* END Javascript syntax */
/* BEGIN Python syntax ----------------------------------------------------- */
#ifdef SWIGPYTHON
%include "iModuleStatus.hpp"
%include "iLightController.hpp"
#endif
/* END Python syntax */

View File

@ -5,5 +5,6 @@ upm_mixed_module_init (NAME ecezo
CPP_HDR ecezo.hpp
CPP_SRC ecezo.cxx
FTI_SRC ecezo_fti.c
IFACE_HDR iEC.hpp
CPP_WRAPS_C
REQUIRES mraa utilities-c)

View File

@ -1,7 +1,17 @@
#ifdef SWIGPYTHON
%module (package="upm") ecezo
#endif
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_ecezo)
#endif
/* END Java syntax */

View File

@ -2,14 +2,14 @@
%module (package="upm") ehr
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
%ignore beatISR;

View File

@ -5,4 +5,5 @@ upm_mixed_module_init (NAME emg
CPP_HDR emg.hpp
CPP_SRC emg.cxx
FTI_SRC emg_fti.c
IFACE_HDR iEmg.hpp
REQUIRES mraa)

View File

@ -5,5 +5,6 @@ upm_mixed_module_init (NAME gp2y0a
CPP_HDR gp2y0a.hpp
CPP_SRC gp2y0a.cxx
FTI_SRC gp2y0a_fti.c
IFACE_HDR iProximity.hpp
CPP_WRAPS_C
REQUIRES mraa)

View File

@ -2,14 +2,14 @@
%module (package="upm") htu21d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
%apply int {mraa::Edge}

View File

@ -2,4 +2,5 @@ set (libname "grovecollision")
set (libdescription "Collision Sensor")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iCollision.hpp)
upm_module_init(mraa)

View File

@ -2,14 +2,14 @@
%module (package="upm") ehr
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
%ignore beatISR;

View File

@ -2,4 +2,5 @@ set (libname "groveemg")
set (libdescription "Electromyography (EMG) Sensor")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iEmg.hpp)
upm_module_init(mraa)

View File

@ -2,4 +2,5 @@ set (libname "grovegsr")
set (libdescription "Galvanic Skin Response (GSR) Sensor")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iEC.hpp)
upm_module_init(mraa)

View File

@ -2,4 +2,5 @@ set (libname "grovelinefinder")
set (libdescription "Line Finder")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iLineFinder.hpp)
upm_module_init(mraa)

View File

@ -2,4 +2,5 @@ set (libname "grovevdiv")
set (libdescription "Voltage Divider")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iVDiv.hpp)
upm_module_init(mraa)

View File

@ -5,4 +5,5 @@ upm_mixed_module_init (NAME gsr
CPP_HDR gsr.hpp
CPP_SRC gsr.cxx
FTI_SRC gsr_fti.c
IFACE_HDR iEC.hpp
REQUIRES mraa)

View File

@ -2,7 +2,7 @@
%module (package="upm") h3lis331dl
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -18,7 +18,7 @@
%ignore i2cContext;
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,14 +2,14 @@
%module (package="upm") hcsr04
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_hcsr04)

View File

@ -2,4 +2,4 @@ set (libname "hlg150h")
set (libdescription "150W Constant Voltage/current LED Driver")
set (module_src ${libname}.cxx mraa-utils.cxx)
set (module_hpp ${libname}.hpp)
upm_module_init(mraa interfaces)
upm_module_init(mraa)

View File

@ -22,12 +22,12 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "interfaces/iLightController.hpp"
// #include "mraa/gpio.hpp"
#include "mraa/pwm.hpp"
namespace upm
{
#define UPM_THROW(msg) throw std::runtime_error(std::string(__FUNCTION__) + ": " + (msg))
/**
* @brief Meanwell HLG150H Lighting Power Supply Controller
@ -53,13 +53,13 @@ namespace upm
* @snippet hlg150h.cxx Interesting
*/
class HLG150H : public upm::ILightController
class HLG150H
{
public:
HLG150H(int pinRelay, int pinPWM);
~HLG150H();
virtual int getBrightness();
int getBrightness();
const char* getModuleName() { return "hlg150h"; }
void setPowerOn();
void setPowerOff();

View File

@ -4,8 +4,6 @@
#ifdef SWIGJAVA
%include "arrays_java.i";
%include "../java_buffer.i"
%typemap(javaimports) SWIGTYPE %{import upm_interfaces.*;%}
%import "../interfaces/javaupm_iLightController.i"
JAVA_JNI_LOADLIBRARY(javaupm_hlg150h)
#endif

View File

@ -2,14 +2,14 @@
%module (package="upm") htu21d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
%ignore getHumidityData(float*, float*, float*);

View File

@ -2,14 +2,14 @@
%module (package="upm") hwxpxx
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_hwxpxx)

View File

@ -2,14 +2,14 @@
%module (package="upm") htu21d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_ims)

View File

@ -1,22 +0,0 @@
set (libname "interfaces")
set (libdescription "CXX Interface Library")
set (module_src ${libname}.cxx)
upm_module_init()
# Add a PUBLIC include directory to the CMAKE src dir
target_include_directories (${libname} PUBLIC ${CMAKE_SOURCE_DIR}/src)
# Don't add the hpp files with upm_module_init, this allows
# them to be installed separately
set (module_hpp iADC.hpp
iCO2Sensor.hpp
iHumiditySensor.hpp
iLightController.hpp
iLightSensor.hpp
iModuleStatus.hpp
iPressureSensor.hpp
iTemperatureSensor.hpp)
# Install interfaces headers a bit differently
install (FILES ${module_hpp} DESTINATION include/upm/${libname}
COMPONENT ${CMAKE_PROJECT_NAME})

View File

@ -1,47 +0,0 @@
/*
* Author: Henry Bruce <henry.bruce@intel.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <stdint.h>
#include "iModuleStatus.hpp"
namespace upm
{
/**
* @brief Interface for ADC Sensors
*/
class IADC : virtual public IModuleStatus
{
public:
virtual unsigned int getResolutionInBits() = 0;
virtual unsigned int getNumInputs() = 0;
virtual uint16_t getRawValue(unsigned int input) = 0;
virtual float getVoltage(unsigned int input) = 0;
virtual ~IADC() {}
};
}

View File

@ -1,43 +0,0 @@
/*
* Author: Henry Bruce <henry.bruce@intel.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include "iModuleStatus.hpp"
namespace upm
{
/**
* @brief Interface for CO Sensor
*/
class ICO2Sensor : virtual public IModuleStatus
{
public:
virtual uint16_t getPpm() = 0;
virtual ~ICO2Sensor() {}
};
}

View File

@ -1,42 +0,0 @@
/*
* Author: Henry Bruce <henry.bruce@intel.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include "iModuleStatus.hpp"
namespace upm
{
/**
* @brief Interface for Humidity Sensors
*/
class IHumiditySensor : virtual public IModuleStatus
{
public:
virtual int getHumidityRelative () = 0;
virtual ~IHumiditySensor() {}
};
}

View File

@ -1,94 +0,0 @@
/*
* Author: Henry Bruce <henry.bruce@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include "iModuleStatus.hpp"
namespace upm
{
/**
* @brief ILightController Interface for Light Controllers
*/
/**
*
* @brief Interface for Light Controllers
* This interface is used to represent light controllers
* @snippet light-controllers.cxx Interesting
*/
class ILightController : virtual public IModuleStatus
{
public:
/**
* Turn on power
*
* @throws std::runtime_error
*/
virtual void setPowerOn() = 0;
/**
* Turn off power
*
* @throws std::runtime_error
*/
virtual void setPowerOff() = 0;
/**
* Get power state
*
* @return true if powered, false otherwise
*
* @throws std::runtime_error
*/
virtual bool isPowered() = 0;
/**
* Set brightness
*
* @param percent brightness as percentage
*
* @throws std::runtime_error
*/
virtual void setBrightness(int percent) = 0;
/**
* Get brightness
*
* @return brightness as percentage
*
* @throws std::runtime_error
*/
virtual int getBrightness() = 0;
virtual ~ILightController() {}
};
}

View File

@ -1,61 +0,0 @@
/*
* Author: Henry Bruce <henry.bruce@intel.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <stdint.h>
#include "iModuleStatus.hpp"
namespace upm
{
/**
* @brief ILightSensor Interface for Light Sensors
*/
/**
*
* @brief Interface for Light Sensors
* This interface is used to represent light sensors
* @snippet light-sensor.cxx Interesting
*/
class ILightSensor : virtual public IModuleStatus
{
public:
/**
* Get visible illuminance in Lux.
*
* @return double visible illuminance in Lux
*/
virtual double getVisibleLux() = 0;
virtual ~ILightSensor() {}
};
}

View File

@ -1,53 +0,0 @@
/*
* Author: Henry Bruce <henry.bruce@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <stdexcept>
namespace upm
{
/**
* @brief Interface for Module Status. Sensor and Actuactor Interfaces Derive from this Interface.
*/
#define UPM_THROW(msg) throw std::runtime_error(std::string(__FUNCTION__) + ": " + (msg))
class IModuleStatus
{
public:
/**
* Returns name of module. This is the string in library name after libupm_
* @return name of module
*/
virtual const char* getModuleName() = 0;
virtual ~IModuleStatus() {}
};
}

View File

@ -1,44 +0,0 @@
/*
* Author: Henry Bruce <henry.bruce@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <stdint.h>
#include "iModuleStatus.hpp"
namespace upm
{
/*
* @brief Interface for Pressue Sensors
*/
class IPressureSensor : virtual public IModuleStatus
{
public:
virtual int getPressurePa() = 0;
virtual ~IPressureSensor() {}
};
}

View File

@ -1,42 +0,0 @@
/*
* Author: Henry Bruce <henry.bruce@intel.com>
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include "iModuleStatus.hpp"
namespace upm
{
/**
* @brief Interface for Temperature Sensors
*/
class ITemperatureSensor : virtual public IModuleStatus
{
public:
virtual int getTemperatureCelsius () = 0;
virtual ~ITemperatureSensor() {}
};
}

View File

@ -1 +0,0 @@
#include "iLightSensor.hpp"

View File

@ -1,18 +0,0 @@
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%import "../_upm.i"
%include javaupm_iModuleStatus.i
%include javaupm_iADC.i
%include javaupm_iCO2Sensor.i
%include javaupm_iHumiditySensor.i
%include javaupm_iLightController.i
%include javaupm_iLightSensor.i
%include javaupm_iPressureSensor.i
%include javaupm_iTemperatureSensor.i
JAVA_JNI_LOADLIBRARY(javaupm_interfaces)
#endif
/* END Java syntax */

View File

@ -1,11 +0,0 @@
#if SWIG_VERSION >= 0x030009
%include <swiginterface.i>
%interface_impl(upm::IADC);
#endif
%include "interfaces.i"
%include "javaupm_iModuleStatus.i"
%include "iADC.hpp"
%{
#include "iADC.hpp"
%}

View File

@ -1,12 +0,0 @@
#if SWIG_VERSION >= 0x030009
%include <swiginterface.i>
%interface_impl(upm::ICO2Sensor);
#endif
%include "stdint.i"
%include "interfaces.i"
%include "javaupm_iModuleStatus.i"
%include "iCO2Sensor.hpp"
%{
#include "iCO2Sensor.hpp"
%}

View File

@ -1,11 +0,0 @@
#if SWIG_VERSION >= 0x030009
%include <swiginterface.i>
%interface_impl(upm::IHumiditySensor);
#endif
%include "interfaces.i"
%include "javaupm_iModuleStatus.i"
%include "iHumiditySensor.hpp"
%{
#include "iHumiditySensor.hpp"
%}

View File

@ -1,11 +0,0 @@
#if SWIG_VERSION >= 0x030009
%include <swiginterface.i>
%interface_impl(upm::ILightController);
#endif
%include "interfaces.i"
%include "javaupm_iModuleStatus.i"
%{
#include "iLightController.hpp"
%}
%include "iLightController.hpp"

View File

@ -1,11 +0,0 @@
#if SWIG_VERSION >= 0x030009
%include <swiginterface.i>
%interface_impl(upm::ILightSensor);
#endif
%include "interfaces.i"
%include "javaupm_iModuleStatus.i"
%include "iLightSensor.hpp"
%{
#include "iLightSensor.hpp"
%}

View File

@ -1,8 +0,0 @@
#if SWIG_VERSION >= 0x030009
%include <swiginterface.i>
%interface_impl(upm::IModuleStatus);
#endif
%include "iModuleStatus.hpp"
%{
#include "iModuleStatus.hpp"
%}

View File

@ -1,11 +0,0 @@
#if SWIG_VERSION >= 0x030009
%include <swiginterface.i>
%interface_impl(upm::IPressureSensor);
#endif
%include "interfaces.i"
%include "javaupm_iModuleStatus.i"
%include "iPressureSensor.hpp"
%{
#include "iPressureSensor.hpp"
%}

View File

@ -1,11 +0,0 @@
#if SWIG_VERSION >= 0x030009
%include <swiginterface.i>
%interface_impl(upm::ITemperatureSensor);
#endif
%include "interfaces.i"
%include "javaupm_iModuleStatus.i"
%include "iTemperatureSensor.hpp"
%{
#include "iTemperatureSensor.hpp"
%}

View File

@ -2,14 +2,14 @@
%module (package="upm") lidarlitev3
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_lidarlitev3)

View File

@ -5,5 +5,6 @@ upm_mixed_module_init (NAME linefinder
CPP_HDR linefinder.hpp
CPP_SRC linefinder.cxx
FTI_SRC linefinder_fti.c
IFACE_HDR iLineFinder.hpp
CPP_WRAPS_C
REQUIRES mraa)

View File

@ -2,7 +2,7 @@
%module (package="upm") lis2ds12
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -12,7 +12,7 @@
#%ignore installISR(LIS2DS12_INTERRUPT_PINS_T , int , mraa::Edge, void *, void *);
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,7 +2,7 @@
%module (package="upm") lis3dh
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -16,7 +16,7 @@
%enddef
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,4 +2,4 @@ set (libname "lp8860")
set (libdescription "LED Lighting Controller")
set (module_src ${libname}.cxx mraa-utils.cxx)
set (module_hpp ${libname}.hpp)
upm_module_init(mraa interfaces)
upm_module_init(mraa)

View File

@ -22,11 +22,12 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "interfaces/iLightController.hpp"
#include "mraa/i2c.hpp"
namespace upm
{
#define UPM_THROW(msg) throw std::runtime_error(std::string(__FUNCTION__) + ": " + (msg))
/**
* @brief LP8860 LED Lighting Controller
* @defgroup lp8860 libupm-lp8860
@ -51,12 +52,12 @@ namespace upm
*
* @snippet lp8860.cxx Interesting
*/
class LP8860 : public upm::ILightController
class LP8860
{
public:
LP8860(int gpioPower, int i2cBus);
~LP8860();
virtual const char* getModuleName() { return "lp8860"; }
const char* getModuleName() { return "lp8860"; }
bool isPowered();
void setPowerOn();
void setPowerOff();

View File

@ -2,9 +2,6 @@
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{import upm_interfaces.*;%}
%import "../interfaces/javaupm_iLightController.i"
JAVA_JNI_LOADLIBRARY(javaupm_lp8860)
#endif
/* END Java syntax */

View File

@ -2,7 +2,7 @@
%module (package="upm") lsm303agr
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -14,7 +14,7 @@
%ignore installISR(LSM303AGR_INTERRUPT_PINS_T , int , mraa::Edge , void *, void *);
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,7 +2,7 @@
%module (package="upm") lsm303d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -13,7 +13,7 @@
%ignore getAccelerometer(float *, float *, float *);
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,14 +2,14 @@
%module (package="upm") lsm6ds3h
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,14 +2,14 @@
%module (package="upm") lsm6dsl
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,7 +2,7 @@
%module (package="upm") lsm9ds0
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -12,7 +12,7 @@
%include "../java_buffer.i"
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,4 +2,5 @@ set (libname "max31723")
set (libdescription "SPI/3-wire Digital Thermometer")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iTemperature.hpp)
upm_module_init(mraa)

View File

@ -2,4 +2,5 @@ set (libname "max44000")
set (libdescription "Ambient and Infrared Proximity Sensor")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iProximity.hpp)
upm_module_init(mraa)

View File

@ -1,7 +1,17 @@
#ifdef SWIGPYTHON
%module (package="upm") max44000
#endif
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_max44000)
#endif
/* END Java syntax */

View File

@ -3,4 +3,4 @@ set (libdescription "I2C Low-power Digital Ambient Light Sensor")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iLight.hpp)
upm_module_init(mraa interfaces)
upm_module_init(mraa)

View File

@ -2,14 +2,14 @@
%module (package="upm") htu21d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_max44009)

View File

@ -2,14 +2,14 @@
%module (package="upm") mb704x
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_mb704x)

View File

@ -2,4 +2,5 @@ set (libname "mcp9808")
set (libdescription "High Accuracy I2C Temperature Sensor")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iTemperature.hpp)
upm_module_init(mraa)

View File

@ -2,4 +2,5 @@ set (libname "mlx90614")
set (libdescription "Digital No-contact Infrared Thermometer")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iTemperature.hpp)
upm_module_init(mraa)

View File

@ -2,7 +2,7 @@
%module (package="upm") mma7455
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -13,7 +13,7 @@
%apply short *OUTPUT { short * ptrX, short * ptrY, short * ptrZ };
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,7 +2,7 @@
%module (package="upm") mma7660
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -12,7 +12,7 @@
%include "../java_buffer.i"
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -2,7 +2,7 @@
%module (package="upm") mpu9150
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
@ -13,7 +13,7 @@
%include "../java_buffer.i"
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
import java.util.AbstractList;
import java.lang.Float;

View File

@ -3,4 +3,4 @@ set (libdescription "Barometric Pressure and Temperature Sensor")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
set (module_iface iPressure.hpp iTemperature.hpp)
upm_module_init(mraa interfaces)
upm_module_init(mraa)

View File

@ -2,14 +2,14 @@
%module (package="upm") htu21d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_ms5611)

View File

@ -2,14 +2,14 @@
%module (package="upm") htu21d
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
%include "arrays_java.i"

View File

@ -5,5 +5,6 @@ upm_mixed_module_init (NAME otp538u
CPP_HDR otp538u.hpp
CPP_SRC otp538u.cxx
FTI_SRC otp538u_fti.c
IFACE_HDR iTemperature.hpp
CPP_WRAPS_C
REQUIRES mraa utilities-c)

View File

@ -2,14 +2,14 @@
%module (package="upm") rhusb
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
%include "arrays_java.i";

View File

@ -5,4 +5,5 @@ upm_mixed_module_init (NAME rotary
CPP_HDR rotary.hpp
CPP_SRC rotary.cxx
FTI_SRC rotary_fti.c
IFACE_HDR iAngle.hpp
REQUIRES mraa)

View File

@ -5,5 +5,6 @@ upm_mixed_module_init (NAME rotaryencoder
CPP_HDR rotaryencoder.hpp
CPP_SRC rotaryencoder.cxx
FTI_SRC rotaryencoder_fti.c
IFACE_HDR iAngle.hpp
CPP_WRAPS_C
REQUIRES mraa)

View File

@ -1,7 +1,17 @@
#ifdef SWIGPYTHON
%module (package="upm") rotaryencoder
#endif
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_interfaces.*;
%}
%ignore signalAISR;
JAVA_JNI_LOADLIBRARY(javaupm_rotaryencoder)

View File

@ -2,14 +2,14 @@
%module (package="upm") sht1x
#endif
%import "interfaces/new_interfaces.i"
%import "interfaces/interfaces.i"
%include "../common_top.i"
/* BEGIN Java syntax ------------------------------------------------------- */
#ifdef SWIGJAVA
%typemap(javaimports) SWIGTYPE %{
import upm_new_interfaces.*;
import upm_interfaces.*;
%}
JAVA_JNI_LOADLIBRARY(javaupm_sht1x)

Some files were not shown because too many files have changed in this diff Show More