mirror of
https://github.com/eclipse/upm.git
synced 2025-07-08 04:41:12 +03:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
655ccee9af | |||
102d86870a | |||
a88ec4237d | |||
cf2b8c9a6e | |||
68aa067f82 | |||
24062f6a9d | |||
db8d708798 | |||
edfdf6ec34 | |||
7c66d5c321 | |||
0e365590c4 | |||
ba127ec4d4 | |||
b6572e1f28 | |||
02974f242e | |||
e809016152 |
@ -15,7 +15,12 @@ message (INFO " found mraa version: ${MRAA_VERSION}")
|
|||||||
|
|
||||||
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.
|
# Appends the cmake/modules path to MAKE_MODULE_PATH variable.
|
||||||
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
||||||
set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation path for libraries")
|
# Older cmake might not pick CMAKE_INSTALL_LIBDIR right
|
||||||
|
if (CMAKE_INSTALL_LIBDIR)
|
||||||
|
set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation path for libraries")
|
||||||
|
else ()
|
||||||
|
set (LIB_INSTALL_DIR "lib" CACHE PATH "Installation path for libraries")
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Set CMAKE_LIB_INSTALL_DIR if not defined
|
# Set CMAKE_LIB_INSTALL_DIR if not defined
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
@ -25,7 +30,7 @@ include (GetGitRevisionDescription)
|
|||||||
git_describe (VERSION "--tags")
|
git_describe (VERSION "--tags")
|
||||||
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
|
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
|
||||||
message (WARNING " - Install git to compile a production UPM!")
|
message (WARNING " - Install git to compile a production UPM!")
|
||||||
set (VERSION "v0.6.0-dirty")
|
set (VERSION "v0.6.1-dirty")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
message (INFO " - UPM Version ${VERSION}")
|
message (INFO " - UPM Version ${VERSION}")
|
||||||
@ -126,7 +131,6 @@ if (BUILDDOC)
|
|||||||
string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
|
string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
|
||||||
list (GET PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
|
list (GET PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
|
||||||
list (GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
|
list (GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
|
||||||
set (SITE_PACKAGES ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
|
|
||||||
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/pydoc/conf.py @ONLY)
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/pydoc/conf.py @ONLY)
|
||||||
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/index.rst ${CMAKE_CURRENT_BINARY_DIR}/pydoc/index.rst COPYONLY)
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/doxy/index.rst ${CMAKE_CURRENT_BINARY_DIR}/pydoc/index.rst COPYONLY)
|
||||||
add_custom_target (pydoc ALL
|
add_custom_target (pydoc ALL
|
||||||
|
@ -4,6 +4,15 @@ Changelog {#changelog}
|
|||||||
Here's a list summarizing some of the key undergoing changes to our library
|
Here's a list summarizing some of the key undergoing changes to our library
|
||||||
from earlier versions:
|
from earlier versions:
|
||||||
|
|
||||||
|
### v0.6.1
|
||||||
|
|
||||||
|
* Fixed library build process for different configurations across multiple
|
||||||
|
environments reported by users.
|
||||||
|
* Fixed multiple GFX library header clash and improved SSD1351 compatibility
|
||||||
|
by changing SPI mode
|
||||||
|
* Added Node and Python array typemaps for nrf24l01
|
||||||
|
* Added 2 new JAVA examples
|
||||||
|
|
||||||
### v0.6.0
|
### v0.6.0
|
||||||
|
|
||||||
* Introduced C++ Interfaces for several sensor categories that will help
|
* Introduced C++ Interfaces for several sensor categories that will help
|
||||||
|
@ -286,7 +286,7 @@ int main()
|
|||||||
else ads->setCompMode();
|
else ads->setCompMode();
|
||||||
break;
|
break;
|
||||||
case 18:
|
case 18:
|
||||||
cout << ads->getCompLatch() << cout;
|
cout << ads->getCompLatch() << endl;
|
||||||
break;
|
break;
|
||||||
case 19:
|
case 19:
|
||||||
cout << "select one of the following:" << endl;
|
cout << "select one of the following:" << endl;
|
||||||
@ -296,7 +296,7 @@ int main()
|
|||||||
else ads->setCompLatch();
|
else ads->setCompLatch();
|
||||||
break;
|
break;
|
||||||
case 20:
|
case 20:
|
||||||
cout << ads->getContinuous() << cout;
|
cout << ads->getContinuous() << endl;
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 21:
|
||||||
cout << "select one of the following:" << endl;
|
cout << "select one of the following:" << endl;
|
||||||
|
66
examples/java/AM2315Example.java
Normal file
66
examples/java/AM2315Example.java
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* Author: Abhishek Malik <abhishek.malik@intel.com>
|
||||||
|
* Copyright (c) 2016 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.
|
||||||
|
*/
|
||||||
|
import upm_am2315.AM2315;
|
||||||
|
|
||||||
|
public class AM2315Example {
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
System.loadLibrary("javaupm_am2315");
|
||||||
|
System.loadLibrary("mraajava");
|
||||||
|
} catch (UnsatisfiedLinkError e) {
|
||||||
|
System.err.println(
|
||||||
|
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
|
||||||
|
e);
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
//! [Interesting]
|
||||||
|
float humidity = 0;
|
||||||
|
float temperature = 0;
|
||||||
|
|
||||||
|
// Instantiate the sensor
|
||||||
|
AM2315 sensor = new AM2315(0, upm_am2315.javaupm_am2315Constants.AM2315_I2C_ADDRESS);
|
||||||
|
sensor.testSensor();
|
||||||
|
|
||||||
|
while(true){
|
||||||
|
// retrieving the humidity and temperature values
|
||||||
|
humidity = sensor.getHumidity();
|
||||||
|
temperature = sensor.getTemperature();
|
||||||
|
|
||||||
|
System.out.println("Temperature : "+temperature+" Humidity: "+humidity);
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
System.out.println("The following exception occured: "+e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [Interesting]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -110,6 +110,8 @@ add_example(TEAMS_Example teams)
|
|||||||
add_example(APA102Sample apa102)
|
add_example(APA102Sample apa102)
|
||||||
add_example(TEX00_Example tex00)
|
add_example(TEX00_Example tex00)
|
||||||
add_example(BMI160_Example bmi160)
|
add_example(BMI160_Example bmi160)
|
||||||
|
add_example(Tsl2561 tsl2561)
|
||||||
|
add_example(AM2315Example am2315)
|
||||||
if (MODBUS_FOUND)
|
if (MODBUS_FOUND)
|
||||||
add_example(H803X_Example h803x)
|
add_example(H803X_Example h803x)
|
||||||
endif()
|
endif()
|
||||||
|
61
examples/java/Tsl2561.java
Normal file
61
examples/java/Tsl2561.java
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Author: Abhishek Malik <abhishek.malik@intel.com>
|
||||||
|
* Copyright (c) 2016 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.
|
||||||
|
*/
|
||||||
|
import upm_tsl2561.TSL2561;
|
||||||
|
|
||||||
|
public class Tsl2561 {
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
System.loadLibrary("javaupm_tsl2561");
|
||||||
|
System.loadLibrary("mraajava");
|
||||||
|
} catch (UnsatisfiedLinkError e) {
|
||||||
|
System.err.println(
|
||||||
|
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
|
||||||
|
e);
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
//! [Interesting]
|
||||||
|
TSL2561 sensor = null;
|
||||||
|
int loopCount = 100;
|
||||||
|
// Instantiate the sensor object
|
||||||
|
sensor = new TSL2561();
|
||||||
|
|
||||||
|
for (int i=0; i<loopCount; i++){
|
||||||
|
// retrieving and displaying the Lux value
|
||||||
|
System.out.println("Lux: "+sensor.getLux());
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
System.out.println("The following exception occured: "+e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [Interesting]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -29,6 +29,10 @@ endmacro (upm_CREATE_INSTALL_PKGCONFIG)
|
|||||||
macro(upm_SWIG_PYTHON)
|
macro(upm_SWIG_PYTHON)
|
||||||
if (BUILDSWIGPYTHON AND BUILDSWIG)
|
if (BUILDSWIGPYTHON AND BUILDSWIG)
|
||||||
|
|
||||||
|
include_directories (
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||||
|
)
|
||||||
|
|
||||||
set_source_files_properties (pyupm_${libname}.i PROPERTIES CPLUSPLUS ON)
|
set_source_files_properties (pyupm_${libname}.i PROPERTIES CPLUSPLUS ON)
|
||||||
set_source_files_properties (pyupm_${libname}.i PROPERTIES SWIG_FLAGS "-I${CMAKE_CURRENT_BINARY_DIR}/..")
|
set_source_files_properties (pyupm_${libname}.i PROPERTIES SWIG_FLAGS "-I${CMAKE_CURRENT_BINARY_DIR}/..")
|
||||||
swig_add_module (pyupm_${libname} python pyupm_${libname}.i ${module_src})
|
swig_add_module (pyupm_${libname} python pyupm_${libname}.i ${module_src})
|
||||||
@ -40,7 +44,7 @@ macro(upm_SWIG_PYTHON)
|
|||||||
)
|
)
|
||||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/_pyupm_${libname}.so
|
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/_pyupm_${libname}.so
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/pyupm_${libname}.py
|
${CMAKE_CURRENT_BINARY_DIR}/pyupm_${libname}.py
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/
|
DESTINATION ${LIB_INSTALL_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/
|
||||||
COMPONENT ${libname})
|
COMPONENT ${libname})
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
@ -58,7 +62,9 @@ macro(upm_SWIG_NODE)
|
|||||||
string (LENGTH "${V8_VERSION_HEX}" V8_VERSION_HEX_length)
|
string (LENGTH "${V8_VERSION_HEX}" V8_VERSION_HEX_length)
|
||||||
endwhile ()
|
endwhile ()
|
||||||
|
|
||||||
# include_directories (${NODE_INCLUDE_DIRS})
|
include_directories (
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||||
|
)
|
||||||
|
|
||||||
set_property (SOURCE jsupm_${libname}.i PROPERTY SWIG_FLAGS "-node" "-DV8_VERSION=${V8_VERSION_HEX}")
|
set_property (SOURCE jsupm_${libname}.i PROPERTY SWIG_FLAGS "-node" "-DV8_VERSION=${V8_VERSION_HEX}")
|
||||||
set_source_files_properties (jsupm_${libname}.i PROPERTIES CPLUSPLUS ON)
|
set_source_files_properties (jsupm_${libname}.i PROPERTIES CPLUSPLUS ON)
|
||||||
@ -100,7 +106,6 @@ macro(upm_SWIG_NODE)
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
createpackagejson(${libname})
|
createpackagejson(${libname})
|
||||||
set (NODE_MODULE_INSTALL_PATH ${NODE_ROOT_DIR}/lib/node_modules/jsupm_${libname}/)
|
|
||||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/jsupm_${libname}.node
|
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/jsupm_${libname}.node
|
||||||
DESTINATION ${NODE_MODULE_INSTALL_PATH} COMPONENT ${libname})
|
DESTINATION ${NODE_MODULE_INSTALL_PATH} COMPONENT ${libname})
|
||||||
endif()
|
endif()
|
||||||
@ -132,8 +137,8 @@ macro(upm_SWIG_JAVA)
|
|||||||
PREFIX "lib"
|
PREFIX "lib"
|
||||||
SUFFIX ".so"
|
SUFFIX ".so"
|
||||||
)
|
)
|
||||||
install (TARGETS javaupm_${libname} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
install (TARGETS javaupm_${libname} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
|
||||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/upm_${libname}.jar DESTINATION ${CMAKE_INSTALL_LIBDIR}/../lib/java)
|
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/upm_${libname}.jar DESTINATION ${LIB_INSTALL_DIR}/../lib/java)
|
||||||
|
|
||||||
if (NOT DEFINED $ENV{JAVA_HOME_NATIVE})
|
if (NOT DEFINED $ENV{JAVA_HOME_NATIVE})
|
||||||
set (JAVAC $ENV{JAVA_HOME}/bin/javac)
|
set (JAVAC $ENV{JAVA_HOME}/bin/javac)
|
||||||
@ -174,8 +179,11 @@ if (SWIG_FOUND)
|
|||||||
if (BUILDSWIGPYTHON)
|
if (BUILDSWIGPYTHON)
|
||||||
if(NOT PYTHONLIBS_FOUND)
|
if(NOT PYTHONLIBS_FOUND)
|
||||||
find_package (PythonLibs ${PYTHONBUILD_VERSION} REQUIRED)
|
find_package (PythonLibs ${PYTHONBUILD_VERSION} REQUIRED)
|
||||||
|
string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
|
||||||
|
list (GET PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
|
||||||
|
list (GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif(BUILDSWIGPYTHON)
|
||||||
if (BUILDSWIGNODE)
|
if (BUILDSWIGNODE)
|
||||||
if(NOT NODE_FOUND)
|
if(NOT NODE_FOUND)
|
||||||
find_package(Node)
|
find_package(Node)
|
||||||
@ -192,13 +200,19 @@ if (SWIG_FOUND)
|
|||||||
)
|
)
|
||||||
macro(createpackagejson)
|
macro(createpackagejson)
|
||||||
configure_file (${PROJECT_SOURCE_DIR}/src/package.json.in ${CMAKE_CURRENT_BINARY_DIR}/package.json @ONLY)
|
configure_file (${PROJECT_SOURCE_DIR}/src/package.json.in ${CMAKE_CURRENT_BINARY_DIR}/package.json @ONLY)
|
||||||
set (NODE_MODULE_INSTALL_PATH ${NODE_ROOT_DIR}/lib/node_modules/jsupm_${libname}/)
|
# If a CMAKE_INSTALL_PREFIX has NOT been provided, set NODE_MODULE_INSTALL_PATH
|
||||||
|
# base on the NODE_ROOT_DIR.
|
||||||
|
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
|
set (NODE_MODULE_INSTALL_PATH ${NODE_ROOT_DIR}/${LIB_INSTALL_DIR}/node_modules/jsupm_${libname}/)
|
||||||
|
# If a CMAKE_INSTALL_PREFIX has been provided, set NODE_MODULE_INSTALL_PATH
|
||||||
|
# relative to the provided install directory.
|
||||||
|
else ()
|
||||||
|
set (NODE_MODULE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/node_modules/jsupm_${libname}/)
|
||||||
|
endif ()
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/package.json
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/package.json
|
||||||
DESTINATION ${NODE_MODULE_INSTALL_PATH} COMPONENT ${libname})
|
DESTINATION ${NODE_MODULE_INSTALL_PATH} COMPONENT ${libname})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
endif(BUILDSWIGNODE)
|
endif(BUILDSWIGNODE)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
macro(upm_module_init)
|
macro(upm_module_init)
|
||||||
@ -207,7 +221,7 @@ macro(upm_module_init)
|
|||||||
foreach (linkflag ${ARGN})
|
foreach (linkflag ${ARGN})
|
||||||
target_link_libraries (${libname} ${linkflag})
|
target_link_libraries (${libname} ${linkflag})
|
||||||
endforeach ()
|
endforeach ()
|
||||||
include_directories (${MRAA_INCLUDE_DIRS} .)
|
include_directories (${MRAA_INCLUDE_DIRS} . ..)
|
||||||
target_link_libraries (${libname} ${MRAA_LIBRARIES})
|
target_link_libraries (${libname} ${MRAA_LIBRARIES})
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
${libname}
|
${libname}
|
||||||
@ -215,7 +229,7 @@ macro(upm_module_init)
|
|||||||
SOVERSION ${upm_VERSION_MAJOR}
|
SOVERSION ${upm_VERSION_MAJOR}
|
||||||
VERSION ${upm_VERSION_STRING}
|
VERSION ${upm_VERSION_STRING}
|
||||||
)
|
)
|
||||||
upm_create_install_pkgconfig (upm-${libname}.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
upm_create_install_pkgconfig (upm-${libname}.pc ${LIB_INSTALL_DIR}/pkgconfig)
|
||||||
if (SWIG_FOUND)
|
if (SWIG_FOUND)
|
||||||
if (NOT ";${PYTHONSWIG_BLACKLIST};" MATCHES ";${libname};")
|
if (NOT ";${PYTHONSWIG_BLACKLIST};" MATCHES ";${libname};")
|
||||||
upm_swig_python()
|
upm_swig_python()
|
||||||
@ -230,7 +244,7 @@ macro(upm_module_init)
|
|||||||
if (BUILDDOC)
|
if (BUILDDOC)
|
||||||
upm_doxygen()
|
upm_doxygen()
|
||||||
endif()
|
endif()
|
||||||
install(TARGETS ${libname} DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
install(TARGETS ${libname} DESTINATION ${LIB_INSTALL_DIR})
|
||||||
install (FILES ${module_h} DESTINATION include/upm COMPONENT ${libname})
|
install (FILES ${module_h} DESTINATION include/upm COMPONENT ${libname})
|
||||||
|
|
||||||
if (IPK)
|
if (IPK)
|
||||||
|
@ -339,7 +339,7 @@ return v_data_uncomp_hum_int32;
|
|||||||
* device address with global structure bme280
|
* device address with global structure bme280
|
||||||
*-------------------------------------------------------------------------*/
|
*-------------------------------------------------------------------------*/
|
||||||
int8_t BME280::I2C_routine()
|
int8_t BME280::I2C_routine()
|
||||||
{
|
{
|
||||||
/*--------------------------------------------------------------------------*
|
/*--------------------------------------------------------------------------*
|
||||||
* By using bme280 the following structure parameter can be accessed
|
* By using bme280 the following structure parameter can be accessed
|
||||||
* Bus write function pointer: BME280_WR_FUNC_PTR
|
* Bus write function pointer: BME280_WR_FUNC_PTR
|
||||||
@ -371,9 +371,8 @@ int32_t BME280::i2c_write_string(uint8_t dev_addr,uint8_t* ptr, uint8_t cnt)
|
|||||||
if((ret = m_i2c->write((const uint8_t*) (ptr), cnt)) != 0)
|
if((ret = m_i2c->write((const uint8_t*) (ptr), cnt)) != 0)
|
||||||
{
|
{
|
||||||
UPM_THROW("I2C write error");
|
UPM_THROW("I2C write error");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* \Brief: The function is used as I2C bus write
|
/* \Brief: The function is used as I2C bus write
|
||||||
@ -448,7 +447,6 @@ void BME280::BME280_delay_msek(uint16_t mseconds)
|
|||||||
// Iterate nanosleep in a loop until the total sleep time is the original
|
// Iterate nanosleep in a loop until the total sleep time is the original
|
||||||
// value of the seconds parameter
|
// value of the seconds parameter
|
||||||
while ( ( nanosleep( &sleepTime, &sleepTime ) != 0 ) && ( errno == EINTR ) );
|
while ( ( nanosleep( &sleepTime, &sleepTime ) != 0 ) && ( errno == EINTR ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
set (libname "ili9341")
|
set (libname "ili9341")
|
||||||
set (libdescription "libupm ILI9341 SPI LCD")
|
set (libdescription "libupm ILI9341 SPI LCD")
|
||||||
set (module_src gfx.cxx ili9341.cxx)
|
set (module_src ili9341_gfx.cxx ili9341.cxx)
|
||||||
set (module_h gfx.h ili9341.h)
|
set (module_h ili9341_gfx.h ili9341.h)
|
||||||
upm_module_init()
|
upm_module_init()
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include <mraa/common.hpp>
|
#include <mraa/common.hpp>
|
||||||
#include <mraa/gpio.hpp>
|
#include <mraa/gpio.hpp>
|
||||||
#include <mraa/spi.hpp>
|
#include <mraa/spi.hpp>
|
||||||
#include "gfx.h"
|
#include "ili9341_gfx.h"
|
||||||
|
|
||||||
// Defines
|
// Defines
|
||||||
#define ILI9341_TFTWIDTH 240
|
#define ILI9341_TFTWIDTH 240
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gfx.h"
|
#include "ili9341_gfx.h"
|
||||||
|
|
||||||
using namespace upm;
|
using namespace upm;
|
||||||
|
|
@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
%apply uint8_t *INPUT { uint8_t *addr }
|
%apply uint8_t *INPUT { uint8_t *addr }
|
||||||
|
|
||||||
%include "gfx.h"
|
%include "ili9341_gfx.h"
|
||||||
%{
|
%{
|
||||||
#include "gfx.h"
|
#include "ili9341_gfx.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
%module jsupm_ili9341
|
%module jsupm_ili9341
|
||||||
%include "../upm.i"
|
%include "../upm.i"
|
||||||
|
|
||||||
%include "gfx.h"
|
%include "ili9341_gfx.h"
|
||||||
%{
|
%{
|
||||||
#include "gfx.h"
|
#include "ili9341_gfx.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "ili9341.h"
|
%include "ili9341.h"
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
%feature("autodoc", "3");
|
%feature("autodoc", "3");
|
||||||
%rename("printString") print(std::string msg);
|
%rename("printString") print(std::string msg);
|
||||||
|
|
||||||
%include "gfx.h"
|
%include "ili9341_gfx.h"
|
||||||
%{
|
%{
|
||||||
#include "gfx.h"
|
#include "ili9341_gfx.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "ili9341.h"
|
%include "ili9341.h"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
%module jsupm_nrf24l01
|
%module jsupm_nrf24l01
|
||||||
%include "../upm.i"
|
%include "../upm.i"
|
||||||
|
%include "../carrays_uint8_t.i"
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include "nrf24l01.h"
|
#include "nrf24l01.h"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
%include "pyupm_doxy2swig.i"
|
%include "pyupm_doxy2swig.i"
|
||||||
%module pyupm_nrf24l01
|
%module pyupm_nrf24l01
|
||||||
%include "../upm.i"
|
%include "../upm.i"
|
||||||
|
%include "../carrays_uint8_t.i"
|
||||||
|
|
||||||
%feature("autodoc", "3");
|
%feature("autodoc", "3");
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
set (libname "ssd1351")
|
set (libname "ssd1351")
|
||||||
set (libdescription "libupm SSD1351 SPI LCD")
|
set (libdescription "libupm SSD1351 SPI LCD")
|
||||||
set (module_src gfx.cxx ssd1351.cxx)
|
set (module_src ssd1351_gfx.cxx ssd1351.cxx)
|
||||||
set (module_h gfx.h ssd1351.h)
|
set (module_h ssd1351_gfx.h ssd1351.h)
|
||||||
upm_module_init()
|
upm_module_init()
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
%ignore m_map;
|
%ignore m_map;
|
||||||
%ignore font;
|
%ignore font;
|
||||||
|
|
||||||
%include "gfx.h"
|
%include "ssd1351_gfx.h"
|
||||||
%{
|
%{
|
||||||
#include "gfx.h"
|
#include "ssd1351_gfx.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "ssd1351.h"
|
%include "ssd1351.h"
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
%module jsupm_ssd1351
|
%module jsupm_ssd1351
|
||||||
%include "../upm.i"
|
%include "../upm.i"
|
||||||
|
|
||||||
%include "gfx.h"
|
%include "ssd1351_gfx.h"
|
||||||
%{
|
%{
|
||||||
#include "gfx.h"
|
#include "ssd1351_gfx.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "ssd1351.h"
|
%include "ssd1351.h"
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
%feature("autodoc", "3");
|
%feature("autodoc", "3");
|
||||||
%rename("printString") print(std::string msg);
|
%rename("printString") print(std::string msg);
|
||||||
|
|
||||||
%include "gfx.h"
|
%include "ssd1351_gfx.h"
|
||||||
%{
|
%{
|
||||||
#include "gfx.h"
|
#include "ssd1351_gfx.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "ssd1351.h"
|
%include "ssd1351.h"
|
||||||
|
@ -44,7 +44,7 @@ SSD1351::SSD1351 (uint8_t oc, uint8_t dc, uint8_t rst) :
|
|||||||
|
|
||||||
// Setup SPI bus
|
// Setup SPI bus
|
||||||
m_spi.frequency(8 * 1000000);
|
m_spi.frequency(8 * 1000000);
|
||||||
m_spi.mode(mraa::SPI_MODE3);
|
m_spi.mode(mraa::SPI_MODE0);
|
||||||
m_spi.writeByte(0x00); // Need to bring clk high before init
|
m_spi.writeByte(0x00); // Need to bring clk high before init
|
||||||
|
|
||||||
// Init pins
|
// Init pins
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include <mraa/common.hpp>
|
#include <mraa/common.hpp>
|
||||||
#include <mraa/gpio.hpp>
|
#include <mraa/gpio.hpp>
|
||||||
#include <mraa/spi.hpp>
|
#include <mraa/spi.hpp>
|
||||||
#include "gfx.h"
|
#include "ssd1351_gfx.h"
|
||||||
|
|
||||||
// Display Size
|
// Display Size
|
||||||
#define SSD1351WIDTH 128
|
#define SSD1351WIDTH 128
|
||||||
@ -92,7 +92,13 @@ namespace upm {
|
|||||||
*
|
*
|
||||||
* @brief API for SSD1351 OLED displays
|
* @brief API for SSD1351 OLED displays
|
||||||
*
|
*
|
||||||
* This module defines the interface for the SSD1351 display library
|
* This module defines the interface for the SSD1351 display library. It was
|
||||||
|
* tested with the Adafruit 1.5" OLED Display, but should work with any SSD1351
|
||||||
|
* display running in SPI mode.
|
||||||
|
*
|
||||||
|
* On the Intel Edison don't forget to disable SPI Power Management (PM) for
|
||||||
|
* this driver to work, you can find more details on this topic here:
|
||||||
|
* http://iotdk.intel.com/docs/master/mraa/edison.html
|
||||||
*
|
*
|
||||||
* @image html ssd1351.jpg
|
* @image html ssd1351.jpg
|
||||||
* @snippet ssd1351.cxx Interesting
|
* @snippet ssd1351.cxx Interesting
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "gfx.h"
|
#include "ssd1351_gfx.h"
|
||||||
|
|
||||||
using namespace upm;
|
using namespace upm;
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
set (libname "st7735")
|
set (libname "st7735")
|
||||||
set (libdescription "libupm SPI LCD")
|
set (libdescription "libupm SPI LCD")
|
||||||
set (module_src gfx.cxx st7735.cxx)
|
set (module_src st7735_gfx.cxx st7735.cxx)
|
||||||
set (module_h gfx.h st7735.h)
|
set (module_h st7735_gfx.h st7735.h)
|
||||||
upm_module_init()
|
upm_module_init()
|
||||||
|
@ -35,9 +35,9 @@
|
|||||||
$1 = (unsigned char *)JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
$1 = (unsigned char *)JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
%include "gfx.h"
|
%include "st7735_gfx.h"
|
||||||
%{
|
%{
|
||||||
#include "gfx.h"
|
#include "st7735_gfx.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "st7735.h"
|
%include "st7735.h"
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
%module jsupm_st7735
|
%module jsupm_st7735
|
||||||
%include "../upm.i"
|
%include "../upm.i"
|
||||||
|
|
||||||
%include "gfx.h"
|
%include "st7735_gfx.h"
|
||||||
%{
|
%{
|
||||||
#include "gfx.h"
|
#include "st7735_gfx.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "st7735.h"
|
%include "st7735.h"
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
%feature("autodoc", "3");
|
%feature("autodoc", "3");
|
||||||
%rename("printString") print(std::string msg);
|
%rename("printString") print(std::string msg);
|
||||||
|
|
||||||
%include "gfx.h"
|
%include "st7735_gfx.h"
|
||||||
%{
|
%{
|
||||||
#include "gfx.h"
|
#include "st7735_gfx.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include "st7735.h"
|
%include "st7735.h"
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include <mraa/gpio.hpp>
|
#include <mraa/gpio.hpp>
|
||||||
|
|
||||||
#include <mraa/spi.hpp>
|
#include <mraa/spi.hpp>
|
||||||
#include "gfx.h"
|
#include "st7735_gfx.h"
|
||||||
|
|
||||||
#define INITR_GREENTAB 0x0
|
#define INITR_GREENTAB 0x0
|
||||||
#define INITR_REDTAB 0x1
|
#define INITR_REDTAB 0x1
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "gfx.h"
|
#include "st7735_gfx.h"
|
||||||
|
|
||||||
using namespace upm;
|
using namespace upm;
|
||||||
|
|
Reference in New Issue
Block a user