2132 Commits

Author SHA1 Message Date
Jon Trulson
7d789ec208 bma250e: fix up some comments and error messages
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
3c5a5b87c8 bmg160: use MRAA::Edge for interrupt edge specification
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-30 16:43:35 -06:00
Jon Trulson
22a6c52795 bmg160: fixup some comments, add GPIO to FTI
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-30 16:43:35 -06:00
Jon Trulson
b8fa948f7d src/CMakeLists.txt: always add upm include dirs to includes
Previously, the upm include dir was only added for C targets.  This
breaks when you have a C++ only target that depends on a C++/C driver.
Suddenly, you can't find header files like upm.h, upm_platform.h, etc.

This patch has the UPM include dirs always added for all targets.

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
Jon Trulson
33f3c882b8 bno055: remove duplicate #defines from header
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-30 16:43:35 -06:00
Noel Eck
5943dad78c rf22: Removed new from examples
Removed new from examples.  Client had new w/o delete.  These
don't need to be pointers.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-29 16:42:45 -07:00
Noel Eck
2f051a202c ldt0028: Removed new for example array
Not necessary in C++.  This was getting flagged as a memory
leak in the examples.  Not a big deal, but can be done differently.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-29 16:42:45 -07:00
Noel Eck
a760f2952a memleak: Free alloc'ed memory for device
Added free for device context.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-29 16:42:45 -07:00
Noel Eck
9549529faf p9813.cxx: Handle buffer overrun
Changed for loop iterator from <= to <.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-29 16:42:45 -07:00
Noel Eck
65969462d1 memleak: i2c init was getting called twice
Removed duplicate call to mraa_i2c_init which was allocating
space for the i2c device twice.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-29 16:42:45 -07:00
Noel Eck
13eea53090 memleak: Free alloc'ed memory for device
Added free for device context.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-29 16:42:45 -07:00
Noel Eck
fa8ab6194d memleak: Handle freeing return from spi call
mraa_spi_write_buf returns an allocated buffer.  Added call to free
the allocated memory.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-29 16:42:45 -07:00
Noel Eck
8048e8734f doxygen: Relative paths in generated docs - update
Reverted changes to CMakeLists.txt, change is done solely in
Doxygen.in.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-28 12:29:11 -07:00
Noel Eck
8262a4203b doxygen: Use relative paths in generated docs
Updated cmake to use strip the full path to the base UPM directory
from generated documentation.  This removes the build server full-
path from UPM documentation.

Old html:

upm: /iotdk/jenkins/workspace/upm-doc-stable/src/moisture/moisture.h File Reference

New html:

upm: src/moisture/moisture.h File Reference

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-28 11:35:11 -07:00
Noel Eck
01f9dd2f41 ims/max30100: Fixed small typo
Changed Initilize -> Initialize.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-20 16:23:37 -07: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
Noel Eck
05435eed4f docs: Small updates to descriptions.
Updated descriptions on four headers.  One header needed a description.
Replaced 'driver' with 'library' on the other three.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-20 10:30:20 -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
Stefan Andritoiu
27c6ac1d31 java: solved unclean Java bindings for: htu21d, ozw
Signed-off-by: Bogdan Ichim <bogdan.ichim@rinftech.com>
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com>
2017-03-17 11:44:41 -06:00
Jon Trulson
8779700d82 md: move defines/register defs into separate header for SWIG
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-17 11:41:33 -06:00
Jon Trulson
f9b5d7c52c sht1x: move defines/register defs into separate header for SWIG
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-17 11:41:33 -06:00
Jon Trulson
a10e798682 md: move defines/register defs into separate header for SWIG
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-17 11:41:33 -06:00
Jon Trulson
8cd91624ee mcp2515: remove carrays from java interface file
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-17 11:41:33 -06:00
Jon Trulson
68e42a22d6 ims: move defines/register defs into separate header for SWIG
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-17 11:41:33 -06:00
Jon Trulson
fdef953859 bmi160: move defines/register defs into separate header for SWIG
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-17 11:41:33 -06:00
Jon Trulson
3f334ed1f3 bh1750: move defines/register defs into separate header for SWIG
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-17 11:41:33 -06:00
Mihai Tudor Panu
1a0bdf00cf mmc35240: add mraa dependency to cmakelists
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-17 08:58:48 -07:00
Norbert Wesp
54cd191d43 src/tmp006/tmp006.hpp: fixed encoding error
Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:28:07 -07:00
Norbert Wesp
9fa4dad1ab src/<sensor>/<sensor>.hpp: fixed file_encoding errors
Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:27:35 -07:00
Norbert Wesp
080c121e07 src/<sensor>/CMakeLists.txt: Added mraa dependency in 'upm_module_init'
Like Propanu commented, I changed the dependency of mraa library in each
CMakeLists.txt file of the sensors:
hdc1000 , mag3110 , mma8x5x , tcs37727 , tmp006

Signed-off-by: Norbert Wesp nwesp@phytec.de
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:27:00 -07:00
Norbert Wesp
545e288967 examples/c++/<sensor>.cxx: changed cout / endl to std::cout / std::endl
Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:26:27 -07:00
Norbert Wesp
aecdac255d hdc1000: Added upm support for sensor HDC1000
The HDC1000 is a digital humidity sensor with integrated temperature sensor.

Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:25:56 -07:00
Norbert Wesp
5c837f22cb mag3110: Added upm support for sensor MAG3110
MAG3110 is a three-axis digital magnetometer.

Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:25:20 -07:00
Norbert Wesp
12c81adeba mma8x5x: Added upm support for some MMA8X5X sensors
This commit adds support for following sensors:
MMA8652 , MMA8653, MMA8451 , MMA8452 , MMA8453
These sensors are three-axis accelerometer.

Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:24:41 -07:00
Norbert Wesp
8342b4c079 tmp006: Added upm support for sensor TMP006
TMP006 is a infrared-thermopile sensor.

Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:24:01 -07:00
Norbert Wesp
e83b8ef114 tcs37727: Added upm support for color sensor TCS37727
TCS37727 is a Color Light-To-Digital Converter.
I also added the manufacturer 'ams' of TCS37727.

Signed-off-by: Norbert Wesp <nwesp@phytec.de>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:23:16 -07:00
Lay, Kuan Loon
fabf4287d6 upm: enable MMC35240 3-axis magnetic sensor library and example
MMC35240 is 3-axis magnetic sensor from MEMSIC.

This sensor can measure magnetic fields within the full scale range of
+-24 Gauss (G).

The library provided is libupm-mmc35240.so
The example provided is mmc35240-example-cxx where it will print x,y,z axis
when trigger buffer data is ready. It's also print azimuth value.

This sensor requires calibration. Please shake the sensor in figure 8 pattern,
mmc35240-example will print the calibrated level.

As the sensor data is noisy, we have implemented denoise algorithm within the
sensor library.

The azimuth formula is provided by Han, He <he.han@intel.com>.

Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2017-03-16 17:22:40 -07:00
Jon Trulson
4ea01180a1 lcdks: renamed from sainsmartks, added backlight support
The sainsmartks driver has been reimplemented in it's own, new C/C++
library: lcdks (LCD Keypad Shield).

In addition, support for an optional backlight GPIO was added.

This was tested with the SainsmartKS and DFRobot LCD Keypad Shields.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-16 12:40:10 -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
Abhishek Malik
d965b92af1 ABPDRRT005PG2A5: Initial Commit
This commit enables the ABP Honeywell sensor. Java examples is
yet to be tested and has not been provided with the current commit
and will be provided in a future commit.

Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2017-03-13 11:13:10 -07:00
Jon Trulson
cc0174910b ds18b20: fix delay timing error in ds18b20_update()
Due to the change of using upm_delay_ms() instead of usleep(), but
failing to adjust the delay time accordingly, ds18b20_update() was
waiting for 750000ms (12 minutes) before reading the result of a
measurement, instead of the more appropriate 750ms.

This should fix Issue #530.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-13 12:05:22 -06:00
Jon Trulson
c4a506f5a3 bmp280/bme280: C port, C++ wraps C
Some private methods (relating to calibration/compensation) are no
longer exposed.  In addition, the driver auto-detects the chip (BMP280
or BME280) and acts accordingly, rather than requiring the
specification of a chip id in the ctor.

The getHumidity() method no longer accepts an arguement representing
pressure at sea level.  A new method is provided to specify this.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-10 17:00:50 -07: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
Noel Eck
b3a5275183 t6713: Static analysis fixes
Updated t6713 to use class instances vs class pointers.  Creating these
on the stack clears up some memory leaks where items created in the
heap are not deleted for a handful of the throw conditions.  Removed
all news/deletes.

Also reformatted to remove tabs and some spaces.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-03-07 22:10:16 -08:00
Jon Trulson
b314f56c00 l298: fix a potential divied-by-zero
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-03-07 14:24:04 -07: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