This commit moves common SWIG syntax to a ${libname}.i for sensor
libraries. Much of the swig content was originally duplicated for
each wrapper language which has lead to inconsistencies between wrappers
over time. This commit moves all swig syntax to a common file. Language
specific swig syntax can be added with #ifdef SWIG<LANGUAGE>.
The src/CMakeLists.txt will look first for a language-specific .i file,
then fall back to ${libname}.i. In this way, it's possible to override
the common ${libname}.i file. If a fallback .i file does NOT exist,
UPM CMake will generate a simple interface file for all languages.
Example:
If no src/abp/pyupm_abp.i and no src/abp/abp.i then
generate ${CMAKE_CURRENT_BINARY_DIR}/abp.i
When src/CMakeLists.txt uses a common ${libname}.i, it adds a -module
<language>upm_${libname} to the swig command line.
In the example below, a -module argument is provided for both Java and
Javascript, while the python module takes all syntax from pyupm_abp.i.
SWIG FILE Language CMake added SWIG args
--------------- ---------- ---------------------
src/abp/abp.i java -module javaupm_abp
src/abp/abp.i javascript -module jsupm_abp
src/abp/pyupm_abp.i python
This commit removes ~4500 redundant lines for the UPM repository and
helps promote uniformity for the SWIG'ed languages.
Signed-off-by: Noel Eck <noel.eck@intel.com>
Touched on all library brief descriptions for better integration with ISS and fixed a few typos and connection tags in the process.
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Since UPM uses doxy2swig, there is no need for the swig interface
file autodoc for python.
Also, turned on the doxy2swig --quiet switch which cleans up the build
log a tiny bit.
This removes a redundant chunk of documentation from python modules
(per each function).
Old:
def pH(self, samples=15):
+-> """
| pH(DFRPH self, unsigned int samples=15) -> float
|
| Parameters
| ----------
swig| samples: unsigned int
|
| pH(DFRPH self) -> float
|
| Parameters
| ----------
+-> self: upm::DFRPH *
+-> float pH(unsigned int
| samples=15)
|
| Take a number of samples and return the detected pH value. The default
| number of samples is 15.
|
doxy2swig| Parameters:
| -----------
|
| samples: The number of samples to average over, default 15
|
| The pH value detected
| """
+-> return _pyupm_dfrph.DFRPH_pH(self, samples)
New:
def pH(self, samples=15):
+-> """
| float pH(unsigned int
| samples=15)
|
| Take a number of samples and return the detected pH value. The default
| number of samples is 15.
|
doxy2swig| Parameters:
| -----------
|
| samples: The number of samples to average over, default 15
|
| The pH value detected
+-> """
Signed-off-by: Noel Eck <noel.eck@intel.com>
~20 UPM modules have multiple I2C calls in them. As per MRAA API
the I2C address is set in the MRAA I2C context and used from there
for all I2C transactions. Setting the I2C address alone does not
actually result in an I2C transaction. This makes multiple set
address calls pointless. This commit removes these superflous set
address calls from the UPM modules. Setting the address once per
context per device should be enough, unless there are multiple
addresses or multiple devices with different addresses.
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
In an effort to clean-up and standardize UPM library
documentation, this commit updates (and in most cases,
unifies) the CMake description string AND CXX header
@comname string.
Strings were taken from datasheets when possible, spelling
mistakes were addressed, copy/paste errors where fixed,
Title Case was used, etc.
* Tested/updated/added @web tags
* Added/updated invalid sensor images
* Added/updated @man tags, added missing manufacturers
Signed-off-by: Noel Eck <noel.eck@intel.com>
A handful of modules do not require mraa. Captured this in
src/CMakeLists.txt - only add mraa dependency for targets which
use:
upm_module_init(mraa ... )
or
upm_mixed_module_init(... REQUIRES mraa)
All sensors which use UPM interfaces (src/interfaces) now
explicitly add the interfaces target:
upm_module_init(interfaces ... )
or
upm_mixed_module_init(... REQUIRES interfaces)
Signed-off-by: Noel Eck <noel.eck@intel.com>
To make room for UPM C and C++ sensor code to coexist, all UPM
C++ headers have been renamed from h -> hpp. This commit contains
updates to documentation, includes, cmake collateral, examples, and
swig interface files.
* Renamed all cxx/cpp header files which contain the string
'copyright intel' from .h -> .hpp (if not already hpp).
* Replaced all references to .h with .hpp in documentation,
source files, cmake collateral, example code, and swig interface
files.
* Replaced cmake variable module_h with module_hpp.
* Intentionally left upm.h since this file currently does not
contain code (documentation only).
Signed-off-by: Noel Eck <noel.eck@intel.com>
This change is due to commit 35760929dbb912fc3dfc738fee67c4f0dd63d55f
from MRAA.
Signed-off-by: Andrei Vasiliu <andrei.vasiliu@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Overload is unnecessary and SWIG can't handle overloads with the same number of arguments
thus it would break the js and py bindings
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Tweak the fudge factor so it is more accurate for 50Hz and 60Hz periods. (Tested on Logic 4 and it is spot on now)
Get rid of compiler warnings when -Wall is set
Allow for float angle to be passed into the servo() method for more accurate positioning
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>