171 Commits

Author SHA1 Message Date
Serban Waltter
e489f6c180 Added bindings for iLight sensors.
Removed old interfaces C++ examples.

Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
2018-10-11 17:54:09 +03:00
Serban Waltter
555a0f9f82 dded bindings for iHumidity sensors.
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
2018-10-11 17:54:09 +03:00
Serban Waltter
dac8250765 Added bindings for iHeartRate sensors.
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
2018-10-11 17:54:09 +03:00
Serban Waltter
7353449b2b Added bindings for iDistanceInterrupter sensors.
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
2018-10-11 17:54:09 +03:00
Serban Waltter
2ac7778d2d Added new interfaces bindings
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
2018-10-11 17:54:09 +03:00
Mihai Tudor Panu
89e2ec870a bh17xx: minor documentation and formatting updates, added rohm to vendor groups
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-08-10 10:24:50 -07:00
Assam Boudjelthia
4935a16530 BH1749: Add library blocks to headers, JSON format, and change SWIG JAVA vector type
- Add library blocks to header files
- Removed unneccessay new lines in JSON file
- Change SWIG Java floatVector to uint16Vector

Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-08-09 12:03:40 -07:00
Assam Boudjelthia
9ef90ccb81 bh1749: Add examples for all languages
* Examples for C/C++/Python/Java/JavaScript
* Add Java example to CMakeLists

Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-08-09 12:03:35 -07:00
Assam Boudjelthia
09208e90d0 BH1792: Add examples for all languages
- Examples for C/C++/Python/Java/JavaScript
- Add build line for java BH1792_Example

Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-08-09 12:03:24 -07:00
Noel Eck
3e84b74bdf kxtj3: A few last-minute changes to the kxtj3 src
* Removed trailing whitespace
    * Fixed a few spelling errors
    * Switched to upm_delay_us for C source

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-21 10:33:38 -07:00
Assam Boudjelthia
186bbfab76 kxtj3: Add java/python/javascript examples
* Java/Python/Javascript examples
* change usleep to upm_delay_us in C++ example
* Add Java example to CMakeLists

Signed-off-by: Assam Boudjelthia <assam.boudjelthia@fi.rohmeurope.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-06-21 10:04:36 -07:00
Noel Eck
83f541a5db Tsl2561_Example: Removed duplicate Tsl2561_Example
It appears that an additional tsl2561 Java example existed.
Removed the *newer* Tsl2561_Example.java in favor of the original
example.  Updated all corresponding collateral which references the
Tsl2561_Example.java file (CMake and library descriptor file).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-19 10:39:26 -07:00
Noel Eck
c54d6de054 JAVA: Unified Java Example names
Unified all Java examples to *match* <LIBRARY>[_otherstuf]_Example.java.
Note, a handful of the examples have a pseudo-random string for the
first component (see FlexSensor_Example.java, ideally this would be
Flex_Example.java).

This commit allows for quick development on a single sensor library
since a -DMODULE_LIST=mysensorlib now works with Java examples
(previously Java examples would fail generation when using
MODULE_LIST).

    * Renamed examples
    * Updated class names
    * Updated library descriptor .json files
    * Updated sample mapping file

TODO: Make this work like the C/C++ examples - grab the target library
name from the filename and grab all dependencies from that target
library.  Fix the handful of example names which don't conform.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-27 15:28:48 -08:00
Noel Eck
a43bcfe8d2 kx122: Add Java/Javascript/Python examples
Implemented a swig interface file for the kx122 and added corresponding
swig language examples.  Also added an STL vector flavor for getting
acceleration values from the kx122.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-26 14:36:06 -08:00
Noel Eck
3cfea676e2 lcd: Renamed 'i2clcd' library to 'lcd'
All other upm library directories match their corresponding library
name, the i2clcd was an outlier which caused problems for CMake and
testing.

    * Replaced usage of i2clcd with lcd
    * Renamed source files and examples
    * Updated examples to use correct class
    * Updated documentation where necessary (left changelog sections)

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 13:00:53 -08:00
Noel Eck
666452e873 SWIGJAVA: Remove the last JAVA ifdefs from src
Removed all references to #ifdef SWIGJAVA and JAVACALLBACK from the
library source.  All java-specific source code has been moved to the
corresponding library's .i file for java.

    * Update library source
    * Update examples where necessary
    * The function pointer methodology has been remove from libraries
      which provided callbacks as both a class and a function pointer
      implementation.  Examples were updated to use the class version
      of callbacks.
    * Updated documentation for SWIGJAVA

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-01-24 09:31:05 -08:00
Alex Tereschenko
a842898bd5 lis3dh: add sensor support based on lis2ds12 module
Adding STMicro LIS3DH sensor support. This module is based on
the one for lis2ds12 (thanks, jontrulson!), but as sensors are
noticeably different, the contents underwent major rework.

Examples and basic API are left the same.

Tested on Intel Edison with Arduino board using both I2C and SPI.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2018-01-16 20:30:34 -08:00
Stefan Andritoiu
ae77966204 java: added some of the missing samples
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2017-08-10 16:57:11 -07:00
Stefan Andritoiu
74cb3504f3 java: updated examples to use AbstractList<> for data containers
Signed-off-by: Bogdan Ichim <bogdan.ichim@rinftech.com>
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-06-27 12:17:12 -07:00
Abhishek Malik
b90c5a7710 HCSR04: Modifying implementation and adding examples
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2017-06-07 11:46:12 -07:00
Stefan Andritoiu
2b70bea44f java: Fixed HTU21DSample
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-05-31 11:43:54 -07:00
Jon Trulson
274fd9b608 lsm6dsl: Initial implementation; C; C++ wraps C; FTI; examples
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-05-23 16:20:51 -06:00
Jon Trulson
ee0aaa89eb lsm6ds3h: Initial implementation; C; FTI: C++; C++ wraps C; examples
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-05-22 16:43:49 -06:00
Abhishek Malik
b4bc15201b VEML6070: Adding separate i2c contexts for separate addresses
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2017-05-18 14:28:29 -07:00
Jon Trulson
c70f378f72 lis2ds12: Initial implementation C; C++; FTI; examples
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-05-15 14:59:22 -06:00
Jon Trulson
21a1860ec2 rn2903: Initial implementation; C; C++ wraps C; examples
This requires a new MRAA with UART sendbreak support.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-05-09 13:44:12 -06:00
Abhishek Malik
e7ca8cf18b VEML6070: Initial Commit
This commit provides a basic driver for the Vishay VEML6070 UV
Sensor. Some functionality might be missing. Binding examples have
not been tested as of now.

Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2017-05-04 11:18:13 -07:00
Noel Eck
563519ae4f unicode: Remove B7 unicode character from examples
The 00B7 unicode character in 4 of the Java examples can cause warnings
(and possible errors) when compiling.  Removed to minimize this risk.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-28 11:39:57 -07:00
Stefan Andritoiu
fe9254c004 java: Created a general interface that is no longer included in each package and updated examples
Signed-off-by: Bogdan Ichim <bogdan.ichim@rinftech.com>
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
2017-04-25 11:57:54 -07:00
Noel Eck
0bd68e4e2b ANDROID: CMake/src changes to build on android-24
* Updated pom file generation: Generate pom files after all sensor
      library targets have been created - allows for dependencies
    * Changes for compiling on Android
    * Check for mraa build options: Look at symbols in mraa library to
      determine UPM build options (example: mraa_iio_init, mraa_firmata_init)
    * Add per target summary for C/C++/java/nodejs/python
    * Added hierarchy to fti include directory...
        old: #include "upm_voltage.h"
        new: #include "fti/upm_voltage.h"
    * Removed unimplemented methods from mpu9150 library and java example
    * Add utilities-c target for all c examples.  Most of the C examples
      rely on the upm_delay methods.  Add a dependency on the utilities-c
      target for all c examples.
    * Updated the examples/CMakeLists.txt to add dependencies passed via
      TARGETS to the target name parsed from the example name.  Also updated
      the interface example names to start with 'interfaces'.
    * Updated src/examples/CMakeLists.txt to ALWAYS remove examples from the
      example_src_list (moved this from end of function to beginning).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-24 10:27:35 -07:00
Jon Trulson
5cc4e2120a lsm303d: Initial implementation, C, C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-04-19 16:44:40 -06:00
Jon Trulson
1f5f466691 lsm303agr: Initial implementation, C, FTI, C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-04-18 12:07:05 -06:00
Jon Trulson
19c58ebba2 lsm303: rename to lsm303dlh
There are a variety of LSM303 devices out there with various
incompatibilities and differing capabilities.  The current lsm303
driver in UPM only supports the LSM303DLH variant, so it has been
renamed to lsm303dlh to avoid confusion and to make it clear which
variant is actually supported.

All examples and source files have been renamed, including header
files.  In addition, the class name, LSM303, has been renamed to
LSM303DLH.  No other functionality or behavior has been changed.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-04-12 11:52:50 -06:00
Noel Eck
52879b0b04 contributions.md: Updated sensortemplate script
C/C++ CMakeLists.txt lines are no longer needed - removed.
Converted bash script to a function to add some error checking.
Removed redundant author/copyright entry.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-04-05 15:16:20 -07:00
Jon Trulson
c57a0d2c30 bmpx8x: rewrite in C; FTI; C++ wraps C
This driver has been rewritten from scratch.

See docs/apichanges.md for a list of API compatibility changes
compared to the original driver.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-04-05 11:29:08 -06:00
Jon Trulson
c014ffddcd bmx055: remove bmm150, use new bmm150 library
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-30 16:43:35 -06:00
Jon Trulson
aeaf84ccc6 bmm150: split into new library, C port, FTI, C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-30 16:43:35 -06:00
Jon Trulson
3d0461b40a bmx055: remove bma250e, use new bma250e library
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-30 16:43:35 -06:00
Jon Trulson
5aed632782 bma250e: split into new library, C port, FTI, C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-30 16:43:35 -06:00
Jon Trulson
f61b615704 bmx055: remove bmg160, use new bmg160 library
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-30 16:43:35 -06:00
Jon Trulson
8dcd22794b bmg160: C port, FTI, C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-30 16:43:35 -06:00
Noel Eck
ccb9fa2a4f doc: Updated spelling occured -> occurred
Fixed small typo.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-20 14:26:50 -07:00
Jon Trulson
54a84af1c3 light: modify so C++ wraps C code
This also provides some more functionality.  get_raw() has been
deprecated in favor of using getNormalized().

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-17 16:24:15 -06:00
Jon Trulson
ab171573f9 lcd/lcm1602/jhd1313m1: remove lcm1602 and jhd1313m1 from lcd library
The lcm1602 and jhd1313m1 drivers had been rewritten in C with a C++
wrapper some time ago, however the original lcm and jhd drivers were
still present in the lcd library.  In addition, to avoid header file
conflicts, the new, separated lcm and jhd header files were renamed
with a .hxx prefix.

This patch:

- renames the new lcm1602/ and jhd1313m1/ header files to have the
  usual .hpp prefix.

- removes the lcm1602, jhd1313m1, and sainsmartks drivers from the
  lcd/ (i2clcd) library.

- fixes the examples to use the "new" libraries (lcm1602 and
  jhd1313m1)

- changes the argument type for the createChar() (C++) to use a byte
  vector (std::vector<uint8_t>) rather than a typedef'd char array.
  The lcm1602_create_char() function (C) uses a standard char *.  The
  use of std::vector is well supported by SWIG.

- SWIG interface files changed to use upm_vectortypes.i, and removes
  the carrays helpers, which should no longer be needed for these
  drivers.

- removes the inclusion of the driver C .h header files into the SWIG
  interface files - this should not be needed for these drivers.

- the sainsmartks driver will be placed into it's own new lcdks (LCD
  Keypad Shield) library.  This library should support the
  SainsmartKS, DFRobot LCD Keypad Shield, and similar products from
  other manufacturers in a future commit.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-16 12:39:52 -06:00
Noel Eck
58cdfadf4e p9813: Chainable LEDS
Initial commit of the p9813 chainable LED controller.
Added C, C++, python, java, and node examples.

Signed-off-by: Sergey Kiselev <sergey.kiselev@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-08 09:46:43 -08:00
Jon Trulson
d4b536b593 bno055: C port; C++ wraps C
The API has been changed in some cases - see the apichanges.md
document.

In addition, this driver uses a new upm_vectortypes.i SWIG interface
file to provide a mechanism for methods that return a vector of floats
and ints instead of a pointer to an array.

This works much nicer than C array pointers, and results in Python/JS/Java
code that looks much more "natural" to the language in use.

The Python, JS, and Java examples have been changed to use these
methods.  Support for the "old" C-style pointer methods are still
provided for backward compatibility with existing code.

As an example - to retrieve the x, y, and z data for Euler Angles from
the bno055, the original python code would look something like:

       ...
       x = sensorObj.new_floatp()
       y = sensorObj.new_floatp()
       z = sensorObj.new_floatp()
       ...
       sensor.getEulerAngles(x, y, z)
       ...
       print("Euler: Heading:", sensorObj.floatp_value(x), end=' ')
       print(" Roll:", sensorObj.floatp_value(y), end=' ')
       ...

Now the equivalent code is simply:

       floatData = sensor.getEulerAngles()
       print("Euler: Heading:", floatData[0], ...
       print(" Roll:", floatData[1], end=' ')
       ...

Additionally, interrupt handling for Java is now implemented
completely in the C++ header file now rather than the .cxx file, so no
special SWIG processing is required anymore. See Issue #518 .

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-07 13:16:24 -07:00
Noel Eck
b7faba556f sensortemplate: Added a template sensor
The purpose of the templatesensor is to get contributors up and running
faster when adding a new sensor.

    * Created library named 'sensortemplate'
    * Added C++ source
    * Added swig interface files for java, javascript, and python
    * Added sensortemplate image file
    * Added examples for c++, java, javascript, and python
    * Updated contributions.md with steps to create a new sensor from
      the sensortemplate library.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-02 23:05:51 -08:00
sisinty sasmita patra
1f18369fbe SWIG_JAVA: C++ Interfaces to Java interfaces, Modified one Java Example
This commit translates C++ interfaces to Java interfaces, previously C++ Interfaces implemented java classes.

    * Added java swig interface files for all C++ interfaces to simplify swig
    javaupm_iADC.i
    javaupm_iCO2Sensor.i
    javaupm_iHumiditySensor.i
    javaupm_iLightController.i
    javaupm_iLightSensor.i
    javaupm_iModuleStatus.i
    javaupm_interfaces.i
    javaupm_iPressureSensor.i
    javaupm_iTemperatureSensor.i

    <example Usage>
        %include"../interfaces/javaupm_iADC.i"

    * Modified swig interface files for few sensors that implements interfaces
    ads1x15
    bmp280
    bmpx8x
    ds1808lc
    hlg150h
    lp8860
    max44009
    ms5611
    si1132
    si7005
    t6713

    * Removed few methods that were mentioned Protected and made them public, so that menthods can be overridden

    * Made IModuleStatus virtual to avoid ambiguity in multiple inheritance
    For example
    class A {};
    class B : public A {};
    class C : public A {};
    class D : public B, public C {};

    This can be solved as
    class A {};
    class B : virtual public A {};
    class C : virtual public A {};
    class D : public B, public C {};

    * Modified java interface files to support multiple swig versions

    * Modified javaupm interface file to support standard auto load library code

    * Fixed autoloadlibrary tests for interfaces

    * Created one interface example separately <BME280_InterfaceExample.java>,
    <example Usage>
        BME280_InterfaceExample.java
    since we cann't define swig versions inside java example file.
    So, instaed added swig versions in Cmake.
    <example Usage>
         if (SWIG_VERSION VERSION_GREATER 3.0.8)
           add_example_with_path(BME280_InterfaceExample bmp280 bmp280)
         endif()

Signed-off-by: sisinty sasmita patra <sisinty.s.patra@intel.com>
2017-03-02 20:14:03 -08:00
Mihai Tudor Panu
dbac88d225 ads1x15: extend examples for both ads1015 and ads1115 and clarify which one is used where
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-02-09 15:11:59 -08:00
Jon Trulson
dac31a0347 speaker: Add pwm functionality and 5 new examples to demonstrate
These changes add the ability to intialize a speaker instance to use a
PWM pin instead of a standard GPIO pin in order to emit sounds.

The current GPIO functionality is fairly constrained by the
implementation -- it only permits playing cerain hardcoded "notes".

The PWM support allows one to emit specific frequencies (currently
between 50-32Khz) using a PWM pin.  Of course, you may still be
constrained by the limits of your PWM hardware in the end.

There are a few new functions provided to support this PWM mode.  To
use the PWM mode of speaker, use the speaker_init_pwm() initialization
routine instead of speaker_init() (for C). For C++ and the SWIG
languages, pass "true" as the second argument to the constructor to
enable PWM mode.  The default is "false", to match current default
behavior (GPIO).

Functions that are not related to a given mode (GPIO vs. PWM) will do
nothing if not usable in that mode.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-02-01 17:08:05 -07:00