1251 Commits

Author SHA1 Message Date
Abhishek Malik
8c4b5333d5 TSL2561: Adding C source
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2016-09-14 14:07:56 -07:00
Mihai Tudor Panu
b01b52dfb8 apa102: added c version of driver, no example yet
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-09-14 14:07:56 -07:00
Noel Eck
b608232cb9 vdiv: Added vdiv C source.
Multiple changes related to building the vdiv c source w/c example.

    * Renamed GroveVdiv to vdiv (all cases) throughout source, examples,
    directory names, and documentation.

    * Added C source.

    * Tested C sensor code on edison

    * Updated CMakeLists.txt for examples-c to build from
    <sensorname>-c.  This was a small change to get c examples to build
    for sensors in which the C++ does NOT wrap the C.

    * Added C example for vdiv.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-09-14 14:07:55 -07:00
Abhishek Malik
c0bff584d5 Loudness: Adding C components
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2016-09-14 14:07:54 -07:00
Abhishek Malik
d1fccde249 Moisture Sensor: Adding C source
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2016-09-14 14:07:54 -07:00
Abhishek Malik
d6dd6402b9 GP2Y0A: Adding C source
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2016-09-14 14:07:53 -07:00
Jon Trulson
dcb4e83251 dfrorp: Initial implementation
This module implements support for the DFRobot Analog ORP
(Oxidation/Reduction Potential) Meter.

It requires 5.0 volts, but the more accurate the voltage specified (to
the constructor), the more accurate the meter (paraphrased from the
wiki).

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:52 -07:00
Noel Eck
2a7ca8e51d nmea_gps: Fixed differences in function signatures.
Small diff between header and source.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-09-14 14:07:52 -07:00
Noel Eck
70368ecb7e crequires: Add utilites-c target for all c sensors
Switch from upmc-utilities to target name (utilities-c).

Fixes linking problem with C libraries.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-09-14 14:07:51 -07:00
Abhishek Malik
f1bcd7bfb4 A110x: Adding C source
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2016-09-14 14:07:51 -07:00
Jon Trulson
21297e80d4 hka5: Initial implementation
This module implements support for the DFRobot Laser PM2.5 Sensor.  It
connects to a UART at 9600 baud.  This is the only baud rate
supported.  It optionally supports Reset and Set/Sleep gpios as well.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:50 -07:00
Jon Trulson
1b74f5335d src/CMakeLists.txt: fix an indentation 2016-09-14 14:07:50 -07:00
Jon Trulson
4a8ddc10ad nmea_gps: add support for ubloc I2c reading of NMEA data
These changes allow NMEA data to be read via I2C on UBLOX compliant
devices that support this capability, such as the LEA-6H based GPS
shield from DFRobot.

It adds a new init() function to the C code, and a new constructor to
the C++ code. It also adds 5 new examples for C, C++, Javascript,
Python, and Java.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:49 -07:00
Jon Trulson
d456066277 ublox6: remove driver and replace with generic nmea_gps driver
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:48 -07:00
Jon Trulson
a040f51cda nmea_gps: renamed vk2828u7 to nmea_gps
This driver will serve as a generic module for grabbing NMEA data from
various GPS devices via a serial interface.  ublox6 will also be
removed in favor of using this driver going forward.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:48 -07:00
Jon Trulson
46460e20d9 urm37: Add C library for this sensor
Added a C implementation for this sensor.  The C++ library was changed
to just wrap the C library calls.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:47 -07:00
Jon Trulson
196654e7c6 bh1750: Initial implementation
This driver was developed with the DFRobot Light Sensor based on the
BH1750.  It has a sensitivity of .5 to 65535 Lux.  It supports
voltages from 3-5vdc and is connected via I2C.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:47 -07:00
Jon Trulson
d1aa4b62f2 mma7361: Initial implementation
This driver implements support for the DFRobot MMA7361 analog
accelerometer.  It supports 3 axes with a selectable 1.5G and 6G
sensitivity. It is not really meant for navigation, but rather for
uses such as orientation and freefall detection.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:46 -07:00
Jon Trulson
3cb80093e0 src/CMakeLists.txt: add upm utilities as a link dependency for C libs
Make sure that for all C libs, upmc-utilities is linked in.  Also, do
not do this for the utilities library itself.

In addition, do not add the utilities library as a requirement for the
libupmc-utilities pkgconfig file.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:46 -07:00
Jon Trulson
64e81def0f vk2828u7: Initial implementation
This module provides support for the VK2828U7 (ublox based) GPS module
from DFRobot.  It is connected via a UART, and emits NMEA data.

Ideally this data could be fed to an external library like TinyGPS to
parse the NMEA data and provide an easier method of extracting GPS
information.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-09-14 14:07:45 -07:00
Noel Eck
c1f9d15f67 upmc: Updates for building C modules w/base UPM
Test commit for building C UPM modules.

    * Added C include directory
    * Added C utilities directory
    * Rename C++ upm.h -> upm.hpp to make room for C upm.h
    * Added upm_mixed_module_init function to src/CMakeLists.txt.  This
      function takes filesnames similar to upm_module_init and does a
      bit of processing before calling upm_module_init.
    * Added c example directory.  Changed c++ example names.
    * Added dfrph implemention for testing (C++ wraps C).  Added mraa
      to .pc requires for dfrph.  Tested against stand-alone project.
      Added dfrph c example.
    * Update implemention of pkg-config file generation.
    * Added two cmake cache variables: BUILDCPP and BUILDFTI
    * Removed src from swig_add_module calls, added libname to
      swig_link_libraries calls.  Shrinks swig'ed binaries by ~13%.
    * Added install target in upm/CMakeLists.txt to install C header,
      directory.  Is this where we want this?
    * C FTI header directory is include/fti

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-09-14 14:07:44 -07:00
Mihai Tudor Panu
2de319c254 docs: removed superfluous UPM API reference from sensor names
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-30 16:51:10 -07:00
Bill Penner
77fbf49f93 htu21d: fixed 16-bit i2c reads and added extra functionality
Fixed 16-bit read code to use the correct mraa function to align with
the datasheet.  Added code for dew point calculation and single function
to retreive temp, humidity, and dewpoint.  Other clean up as well.

Signed-off-by: Bill Penner <william.penner@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-30 16:15:28 -07:00
Mihai Tudor Panu
dd014c718f si7005: fixed sensor description and added example link
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-30 15:54:28 -07:00
Mihai Tudor Panu
5304192813 jhd1313m1: added backlight control functions
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-30 15:16:07 -07:00
Mihai Tudor Panu
2d2ee8d1f0 apa102: added extra functionality
Exposed call to MRAA SPI frequency for those super long strips where the clock signal will degrade and introduce glitches. Slowing down will fix it without the need for extra filtering or redrivers. Batch mode also helps since only one write per frame will be required.

Added functions that control brightness only for fade effects without the need to keep an extra copy of the pixel color map.

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-25 17:33:41 -07:00
Mihai Tudor Panu
9a83bb7530 ads1x15: changed error types to runtime errors on failed i2c ops
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-23 10:41:14 -07:00
Mihai Tudor Panu
2b642ab7a4 ssd1306: failed i2c frequency change should be non-fatal for this device
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-23 10:40:59 -07:00
Mihai Tudor Panu
bde7259ee8 mcp9808: failed i2c frequency change should be non-fatal for this device
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-23 10:40:45 -07:00
Jon Trulson
dc93fb11ff otp538u: some fixes to get working on the Arduino 101 with Firmata
There are some issues using this device on the 101 with Firmata:

1. You cannot use any other ADC resolution than 1024.  By default the
driver would try to set 12b resolution for improved accuracy.  Doing
this on the 101 yielded nonsensical readings causing the driver to
fail.  Using 10b resolution will yield less accuracy, but at least the
driver will function.

2. After the first ADC read, and for some time period after, the MRAA
aio_read() calls will always return 0.  This would cause an exception
to be thrown by the driver since this is an invalid reading.  Now, we
do an analog read on each channel and sleep for .5 seconds in the ctor
to get around this problem.  It is a hack and should be properly fixed
somewhere else (firmata?  MRAA?).

Some code was reworked/renamed to make it more clear what is actually
going on.  In addition a setDebug() method was added to enable some
debugging output.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-08-16 11:22:43 -06:00
Mihai Tudor Panu
19d1af6a48 ads1x15: failed i2c frequency change should be non-fatal for this device
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-12 11:59:47 -07:00
Jon Trulson
e689dc175c l3gd20: add l3gd20h chipid to ctor check as well
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-08-10 13:01:33 -06:00
Jon Trulson
06ecae7212 l3gd20: Add support for I2C connections
The existing driver only supported IIO.  This change adds support for
controlling the device via an I2C connection. In addition, there is a
new C++ example for it (l3gd20-i2c.cxx).

Note: Only basic functionality is supported, though a full register
map and access functions are available to fill in any desired
functionality.

Note, that some methods are only usable with specific connection
types.  See the documentation.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-08-09 16:03:42 -06:00
Mihai Tudor Panu
5265bada9c ms5611: description and some doxygen tags updated
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-04 17:12:45 -07:00
Henry Bruce
84067826eb upm.h: Added manufacturwer entry for Measurement Specialties
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-04 17:12:28 -07:00
Henry Bruce
98e3621c93 ms5611: Initial implementation
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-04 17:12:10 -07:00
Mihai Tudor Panu
d79799bab9 docs: updated doxygen tags for some sensors
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-04 17:11:52 -07:00
Jon Trulson
49e04593d8 build: remove unnecessary BUILDSWIG option
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-08-03 11:54:36 -06:00
Mihai Tudor Panu
bda66a3d06 grovetemp: updated conversion formula for v1.2 compatibility
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-02 10:16:46 -07:00
Mihai Tudor Panu
b08fc8d48d grove: split code base for grove sensors into individual files
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-08-01 18:25:36 -07:00
Lay, Kuan Loon
e64f192fb7 apds9930: enable sensor before read out sensor data
Changes in library:
- enableProximity() function is to enable or disable proximity sensor
- enableIlluminance() function is to enable or disable illuminance sensor
- run clang-format

Changes in example:
- proximity and illuminance kernel IIO-based driver init state is power off,
  require enable before read out sensor data. Sleep time is needed after
  enable, the sleep time may vary on different platform.
- run clang-format

Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-07-22 16:30:25 -07:00
deadprogram
40fe6654eb ublox6: Add most popular baud rates to GPS enums
Signed-off-by: deadprogram <ron@hybridgroup.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-07-22 15:33:05 -07:00
Mihai Tudor Panu
b257d91702 mpr121: fixed default value for filter configuration register
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-07-19 10:08:52 -07:00
Mihai Tudor Panu
e7394217b1 mlx90614: set i2c bus speed to 100 kHz on init to match sensor specs
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-07-14 14:41:03 -07:00
Jon Trulson
baec9966f0 spelling: correct many misspellings of celsius
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-07-12 17:42:01 -06:00
Jon Trulson
0fb56356fb bmx055: fix up some issues reported by static analysis
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-07-12 16:05:22 -06:00
Jon Trulson
e0ef6eea64 ozw: fix up some issues reported by static analysis
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-07-12 16:05:13 -06:00
Jon Trulson
9ab9e2c403 ozw: Rework and add some device specific drivers and examples.
This commit reworks ozw somewhat and adds some device specific drivers
with examples.  All of these drivers are kept in the UPM ozw library.

The OZW class has been reworked to make it a proper singleton, since
the OpenZWave::Manager() it depends on is already a singleton.  This
avoids issues such as opening and initializing OpenZWave multiple
times.

A new, relatively thin base class, ozwInterface is also now present.
This class wraps some basic functionality, and handles initialization
of the OZW base class.  It is intended to be inherited by device
driver classes.  It operates on a node id for a device.  Each OZW
device is referenced by a node id, which does not change unless the
device is removed (and possibly re-added) to a Z-Wave network.

Finally, a series of device specific drivers have been implemented.
These provide basic functionality to monitor and in some cases control
the operation of a Z-Wave device.  They are the following:

ozwdump - This is a fake 'device' driver that initializes an OZW
network and dumps information on all of the nodes (devices) present.
Along with each node, available information on each valueid associated
with that node is also printed.  This fake device and it's examples
replace the original ozw example.

aeotecss6 - Aeotec Smart Switch 6.  This device allows control of the
switch, as well as reporting of information the switch makes
available, such as current consumption, volts, watts, and accumulated
energy use (kWh).

aeotecsdg2 - Aeotec Smart Dimmer Gen 2.  This device is similar to the
Smart Switch 6, but also provides dimming functionality.  It also
provides information on energy use.

aeotecdw2e - Aeotec Door/Window Sensor 2nd Edition.  This device is a
magnetic switch with an embedded tamper switch used to detect the
opening/closing of windows and doors.  This is a battery powered
device.

aeotecdsb09104 - Aeotec Home Energy Monitor.  This device is intended
to be installed at the MAINS or Breaker box.  It reports current and
cumulative energy consumption.

tzemt400 - Trane TZEMT400 Thermostat.  This device is a thermostat
with Z-Wave functionality.  The variant tested was the
TZEMT400BB32MAA.  The driver reports various information on the status
of the thermostat, as well as the current measured temperature.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-07-06 15:13:00 -06:00
Noel Eck
e1df8b5bf6 iio_core: Patches for IIO core kernel standard
Applying patches from Kuan Loon Lay.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-06-30 14:57:19 -07:00
Noel Eck
05ca452831 python: Removed exact from find_package
Failing on exact match for minor version.  Reverting back to
non-exact match.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-06-24 23:01:25 -07:00