The IMS library will now change its I2C address after resetting the HW to a new
address. It will attempt to close the mraa context and re-init each
time.
Signed-off-by: Noel Eck <noel.eck@intel.com>
and example
LIDAR-Lite v3, a compact, high-performance optical distance measurement
sensor from Garmin™. It is the ideal solution for drone, robot or unmanned
vehicle applications.
The library provided is libupm-lidarlitev3.so
The example provided is lidarlitev3.cxx where it will print the distance
of object/obstacle from the sensor.
The image of the sensor is at docs/images/lidarlitev3.jpg
Signed-off-by: Saloni Jain <saloni.jain@tcs.com>
Signed-off-by: Niti Rohilla <niti.rohilla@tcs.com>
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
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>
Since src/utilities now builds a C/C++ library, other targets which were
using symbols from utilities now need to include the correct target
dependency. This is mainly for upm_delay* functions. Added utilities-c
target to all sensor library CMakeLists.txt which require it.
Moved macro for __FILENAME__ from upm_utilities.h to upm_fti.h since
ONLY the FTI headers used this.
Signed-off-by: Noel Eck <noel.eck@intel.com>
* 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>
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>
Dependencies added via 'TARGETS' in add_example are 'in addition to' the
dependency provided by the example filename.
* Small change to examples/CMakeLists.txt to handle additional
dependencies
* Prefix 'interfaces-' onto the interfaces examples
Signed-off-by: Noel Eck <noel.eck@intel.com>
* Added //! [Interesting] tag to all examples which were missing this
* Removed windows CR/LF
* Removed pointers from examples since these are not needed. Removed
try/catch which seems to be there only to handle failing pointers and
return value from main.
* Reformatted examples when the formatting was wonky/inconstant.
Signed-off-by: Noel Eck <noel.eck@intel.com>
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>
Updated the examples to comprehend transitive dependencies. This means
that each example target will no longer have a giant list of -I includes
(the examples at the end of the list had includes for all previous
examples, upwards of 200 -I's on the command line).
* Created a CMakeLists.txt in the upm/examples directory, moved
common functionality to this level.
* C/C++ examples now look to the filename for their dependency
target name, ie; gas-mq2.cxx adds a dependency to the 'gas' target
* Updated a handful of C/C++ example names to reflect this
* Example CMake flow - glob the list of files, add targets for any
special case examples, then att targets for all the rest
Signed-off-by: Noel Eck <noel.eck@intel.com>
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>
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>
This also provides some more functionality. get_raw() has been
deprecated in favor of using getNormalized().
Signed-off-by: Jon Trulson <jtrulson@ics.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This commit attempts to use a more cmake-friendly approach when
handling inter-target dependencies. A combination of macros and
include_directories usage provided overzealous compile -I/blah
entries which equates to large catch-all build commands. For
example, the last CXX target contains include directories for nearly
all preceeding targets (~190). Library dependencies were also often
wrong or missing.
* Removed nearly all used of include_directories (swig cmake
commands still appear to need these for generating the swig
command line)
* Updated usage of target_link_libraries in upm_module_init,
also changed to using target_include_directories per target.
This greatly simplifies upm/mixed_module_init usage for libraries
which depend on other libraries (in this project).
example (src/tb7300/CMakeLists.txt)
old:
# upm-libbacnetmstp will bring in libbacnet, I hope
set (reqlibname "upm-bacnetmstp")
include_directories(${BACNET_INCLUDE_DIRS})
include_directories("../bacnetmstp")
upm_module_init()
upm_target_link_libraries(${libname} bacnetmstp)
new:
upm_module_init(bacnetmstp)
The reason here, is that tb7300 depends on bacnetmstp, which
depends on BACNET includes/libs, so tb7300 gets the headers and
libraries transitively via its dependency on bacnetmstp.
* Updated pkg-config .pc file generation flow to reflect changes
with dependencies.
* Create a real target for the interfaces (CXX abstract sensor
classes). Renamed the directory from 'upm/src/upm' to
'upm/src/interfaces' Also changed the install location of the
interface headers to include/upm/interfaces. Updated interface
header usage to reflect this.
* Updated a few sensor libs to use fwd declarations for mraa.
Ideally the UPM libs would do more of this which eases the
burden on anyone building on top of the sensor libraries since
they would not need to know about mraa headers.
* Fixed examples which use symbols not defined in local includes
Signed-off-by: Noel Eck <noel.eck@intel.com>
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>