1204 Commits

Author SHA1 Message Date
Jon Trulson
fb88fda5cb upm_utilities: Add a _POSIX_C_SOURCE define if needed
In certain systems, where -std=c11 is used, certain posix extensions
are disabled unless specifically enabled.  On these systems, this
could cause usleep() and/or nanosleep() to fail with an implicit
declaration warning.  This patch ensures that at least POSIX 200809 is
used, if otherwise undefined.

This should fix Issue #513.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-02-02 13:58:41 -07:00
Jon Trulson
90d856d128 utilities: use nanosleep() instead of usleep() for upm_delay*() functions
usleep() has been deprecated, and can cause compile problems on never
glibc versions (debian jesse).  We now use nanosleep() on linux
systems to implement delays.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-02-02 12:32:04 -07:00
Jon Trulson
d2e0327c30 src/CMakLists.txt: re-disable other warnings for SWIG building
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-02-02 12:31:57 -07:00
Jon Trulson
2e97aa9979 speaker: fix some incorrect comments/documentation
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-02-01 17:59:15 -07:00
Noel Eck
cdb75e8c13 swig_java: Fix for #518 - java wrapper implementations
This commit fixes #518 by adding source back into the CXX swig-
generated wrapper.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-02-01 16:15:30 -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
Jon Trulson
0749f130e1 nunchuck: C port; FTI; C++ wraps C
Some API changes were made as well, see docs/apichanges.md.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-01-31 13:08:20 -07:00
Jon Trulson
1bbb9386b7 enc03r: C port; FTI; C++ wraps C
The API for this driver has changed.  See docs/apichanges.md.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-01-30 12:06:32 -07:00
Noel Eck
f914159e21 ims: Small logging change for C init method
Added a bit more description if the library cannot set I2C
standard mode.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-01-27 11:16:24 -08:00
Jon Trulson
849711c47d wfs: C port; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-01-26 15:13:01 -07:00
Jon Trulson
0a91eb0b46 hmc5883l: C port; FTI; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-01-25 17:42:38 -07:00
Jon Trulson
806b00c2b7 uartat: add missing uartat_defs.h to SWIG interface files
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-01-24 17:31:57 -07:00
Jon Trulson
e8151640a1 uartat, le910: initial implementation.
uartat is the underlying UART driver, specifically for use with
AT-style command driven devices like modems.

The le910 support is provided in the form of examples that make use
of the uartat driver to interact with the device.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-01-24 14:02:03 -07:00
Jon Trulson
123e611f45 cjq4435: C port, C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-01-20 12:02:30 -07:00
Jon Trulson
ab96e8f3a3 speaker: C port, C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-01-19 13:54:47 -07:00
Jon Trulson
d3b864362d ds18b20: rewrite C++ to wrap C, add FTI, update examples
Previously, the C++ and C versions of this driver were separate.  Now
the C++ implementation wraps the C implementation.

In addition, the C++ init() function has been deprecated.  It
currently does nothing, and examples have been modified to remove it's
calls.  This function will be removed in a separate release.

The examples have been further modified to update all detected devices
and print their respective temperatures, instead of only reporting the
on the first device detected.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2017-01-18 13:33:44 -07:00
Noel Eck
6769d976a0 max30100: ISR recover attempt
Handle failure in ISR routine - attempt to read status and
FIFO registers and continue sampleing (vs exiting and turning
off continuous sampling).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-01-11 15:52:41 -08:00
Noel Eck
bd47b9ed45 max30100: Initial commit - MAX30100 pulse oximeter
* c/c++ source
    * java/js/python/c/c++ examples
    * Doc image (png)
    * Tested on Intel Edison
    * TODO: Tuning for SpO2 reading

Signed-off-by: Noel Eck <noel.eck@intel.com>
2017-01-10 11:29:30 -08:00
Noel Eck
e25be536a1 ims: Small typo fix
Changed ISM to IMS.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-12-20 23:25:26 -08:00
Jon Trulson
a70629e3b2 mcp2515: fix return from rx_status_filtermatch; Travis CI (clang)
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-12-20 13:01:04 -07:00
Jon Trulson
fed0478dc9 mcp2515: fix conversion error reported by Travis CI (clang)
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-12-20 12:47:43 -07:00
Jon Trulson
fcb4d9d36d mcp2515: Initial implementation; C; C++
The mcp2515 is a CAN bus controller.  It was developed using the Seeed
CAN bus shield.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-12-20 12:17:14 -07:00
Jon Trulson
5eb8af6d70 upm.i: treat upm_result_t like an int in SWIG
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-12-20 12:17:09 -07:00
Mihai Tudor Panu
78953b110f npm: small improvement in logic for handling C sources
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-12-15 16:44:36 -08:00
Mihai Tudor Panu
53124e9704 npm: rename c sources to avoid node-gyp makefile target collision
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-12-13 17:14:21 -08:00
Mihai Tudor Panu
dfc7a710d4 firmata: extended data types on pins to allow subplatform usage
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-12-08 15:10:36 -08:00
Mihai Tudor Panu
130cb822e4 rf22: Initial implementation for RFM22B radios, C++ only & bindings
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-12-07 14:38:56 -08:00
Jon Trulson
c6ad8cb5ee utilities: use a better method for detecting zephyr kernel version
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-12-05 15:04:34 -07:00
Jon Trulson
024b43dfa3 utilities: fix new Zephyr k_timer based implementation
- Fixed the Zephyr kernel version checks to check for 0.1.6 rather
  than 1.6.0.
- fixed the k_timer implementation to actually work.  None of these
  were being called correctly.
- due to the fact that the k_timer API only has a 1ms resolution,
  re-implement upm_delay_us() (on 0.1.6 version of zephyr) as a busy
  loop using a upm_clock_t.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-12-05 13:41:19 -07:00
Jon Trulson
6667646d32 mb704x: Initial implementation; C; FTI; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-12-02 16:44:43 -07:00
Jon Trulson
e1e9067744 groups.md: Add MaxBotix manufacturer
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-12-02 16:44:43 -07:00
Jon Trulson
c4656bf8ba utilities: add Zephyr 1.6 k_timer support (pulled from zupm)
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-12-02 16:44:43 -07:00
Noel Eck
232089f400 cmake: Check for JAVA in top-level CMakeLists.txt
Moved require for Java/JNI/mraajava to top-level CMakeLists.txt
which will fail early if these are NOT found (vs failing in
the src-level CMakeLists.txt

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-11-29 15:14:32 -08:00
Noel Eck
929244b27a ims: Fixed IMS java example
* Fixed a compile issue for the JAVA example
    * Added C header to swig java/js interface files

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-11-29 09:56:57 -08:00
Noel Eck
9a4f0cae0c ims: Added FTI and java example
* Added compiling FTI for IMS
    * Updated JAVA example, added to CMakeLists.txt

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-11-29 08:51:45 -08:00
Jon Trulson
402de082d3 ecezo: make sure to mraa_init() in ecezo_uart_init()
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-28 18:23:18 -07:00
Jon Trulson
ad275e1d41 ecezo: initial implementation; C, C++; FTI + examples
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-28 17:45:23 -07:00
Noel Eck
971cb4ab51 ims: Initial turnin of I2C Moisture Sensor
* Added C library
    * Added CXX library
    * Added C/CXX/java/js/python examples

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-11-21 14:57:15 -08:00
Jon Trulson
11e14a891f ms5803: remove utf8 delta-sigma characters from comment block
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-16 10:57:21 -07:00
Jon Trulson
803f9a9838 ms5803: initial implementation; C, C++; FTI + examples
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-14 17:26:42 -07:00
Jon Trulson
7bc9ef0150 cmake: disable some other warnings seen with edison gcc 4.9.1
Also, fix possible uninitialized access in ds1808lc C++ example.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-11 10:44:43 -07:00
Noel Eck
72e8629d72 cmake: Make sure utilities directory gets added to cmake
If directories are specified with -DMODULE_LIST=blah, it's
possible to skip adding the utilities directory which is needed
by *most* sensor library targets in UPM.  Added a check for this
when using -DMODULE_LIST.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-11-08 21:58:05 -08:00
Noel Eck
cdc33ceb9f bitbake: Fix for pthreads C test w/yocto
Fixed a problem where the C/CXX compile flags were getting
overwritten.  Fixed warnings in a few sensor drivers.

This commit fixes #485

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-11-08 16:28:54 -08:00
Jon Trulson
54771e63c1 my9221: C implementation; C example; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-08 17:13:22 -07:00
Abhishek Malik
fde727b601 Button: Adding C sources and C examples
This commit adds C sources and examples for the button sensor.

Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2016-11-08 13:38:52 -08:00
Jon Trulson
1630ebfca4 otp538u: C implementation; FTI; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-07 13:53:43 -07:00
Jon Trulson
3eb3a0b825 guvas12d: C implementation; FTI; C++ wraps C
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-04 12:52:33 -06:00
Noel Eck
9be920dbcd cxx_warnings: Misc changes to enable Werror
* CMake option to enable -Werror as default
    * Change to make sure all cxx examples have correct target name
    * Added PUBLIC CXX compiler flags to ads1x15 and ozw targets to
      work around compiler warnings
    * Renamed cmake variable for compiler warnings

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-11-03 16:45:32 -07:00
Noel Eck
601d25cebc llvm: Fixed remaining warnings for llvm
This commit addresses warnings emitted from the llvm
compilers which were not encountered with gnu.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2016-11-03 14:14:37 -07:00
Jon Trulson
c900743f8d upm.i: turn off swig warnings relating to nested structs
Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-11-03 13:54:46 -06:00