Commit graph

362 commits

Author SHA1 Message Date
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Daniel Leung 0340d66847 samples: grove: re-add Quark D2000 to sample.yaml
Since we now have a working ADC driver for Quark D2000,
add the whitelist back.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-09-05 18:38:57 -04:00
Punit Vara 108b5398e4 tests: adc_api: Remove sample width test scenario
Remove unnecessary sample width scenario.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara 094531bf9f samples: grove_temperature: Use device name from Kconfig
Use Kconfig to get device name. Make LIBC conditional to get
output.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara 52339f4b1d samples: grove_light: Provide device name from Kconfig
check return value for sample fetch. Conditional printk
added to print adc value.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Michael Hennerich 84c352d0f3 samples: sensor: adxl372: Add ADXL372 sample application
This sample application produces slightly different outputs based on
the chosen driver configuration mode. In Measuring Mode with trigger
support, the acceleration on all three axis is printed in m/s^2 at
the sampling rate (ODR). In polled Measuring Mode the instantaneous
acceleration is polled every 2 seconds. In most high-g applications,
a single (3-axis) acceleration sample at the peak of an impact event
contains sufficient information about the event, and the full
acceleration history is not required.
In this Max Peak Detect Mode the device returns only the over
threshold peak acceleration between two consecutive sample fetches or
trigger events. Instead of printing the acceleration on all three axis,
the sample application calculates the vector magnitude
(root sum squared) and displays the result in g rather than in m/s^2,
together with an bar graph.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
2018-08-21 20:19:44 -05:00
Diego Sueiro 22b61c7f43 sensors: add WaRP7 board listing for fxos8700 and fxas21002
Update yaml files to include warp7_m4 board in the platform_whitelist
for fxos8700 and fxas21002 sensors.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-08-21 18:54:41 -05:00
Johann Fischer c9c8bbf255 samples: apds9960: whitelist reel board
Whitelist reel board.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-08-17 13:19:20 -07:00
Johann Fischer 1f19078ebf samples: apds9960: whitelist arduino_101_sss
Whitelist arduino_101_sss.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-08-17 13:19:20 -07:00
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
David B. Kinder 6750b8d2e8 doc: fix misspellings in docs
Occasional scan for misspellings missed during normal doc reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-08-08 01:49:14 -05:00
Lars Knudsen 70a35e2346 samples: sensors: mma8451q: Add accelerometer sample
Prints accelerometer data from MMA8451Q every 500ms

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
2018-07-31 09:07:54 -05:00
Michael Hennerich 92c1c2a24b samples: sensor: adt7420: Add ADT7420 sample application
This simple application periodically prints the ambient temperature.
Optional support for threshold triggers is provided.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
2018-07-12 13:03:24 -05:00
Anas Nashif 10d8e711be samples: move grove samples to sensors and display
No need to have a category for grove, instead moved the samples to both
sensors and display based on what the sample does.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-11 17:11:18 -04:00
Paras Jain 61f91f8fec samples: sensor : mcp9808: check return value
Check the return value while setting sensor trigger

Coverity-CID: 186196

Signed-off-by: Paras Jain <parasjain2000@gmail.com>
2018-06-01 14:41:42 -05:00
Ulf Magnusson cbdfdf9e77 samples: bmm150: Remove assignment to missing CONFIG_BMM150_SET_ATTR
This symbol never existed, and has some dead code associated with it:
https://github.com/zephyrproject-rtos/zephyr/issues/7848

Just remove the assignment to the undefined Kconfig symbol for now. The
associated code could be removed separately if it isn't needed anymore.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 14:21:21 -05:00
Ulf Magnusson 9a06d119a8 samples: mcp9808: Fix CONFIG_MCP9808_TRIGGER_GLOBAL_THREAD assignment
CONFIG_MCP9808_TRIGGER_GLOBAL never existed. Looks like a typo.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-24 09:21:32 -04:00
Marti Bolivar bdfbbfee3f samples: sensor: vl53l0x: trivial README.rst fix
Use zephyr-app-commands for portability instead of assuming Make on
Unix, also adding a missing "flash" invocation.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-17 07:41:56 +03:00
Tomasz Bursztyka eb7af5527d drivers/sensors: Switch bmi160 driver to new SPI API
Replacing legacy API calls by news ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Tomasz Bursztyka 244c2af154 drivers/sensors: Switch bme280 driver to new SPI API
Replacing legacy API calls by news ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Armando Visconti 87d6c50e47 sensors: Add separation between ambient and die temperature
Some device include a temperature sensor, usually used as a
companion for helping in drift compensation, that measure the
die temperature. This temperature IS NOT related to the the
ambient temperature, hence a clean separation between the two
is required.

This commit introduces a clean separation between the two
types of temperature leaving the old deprecated definition
still there.

The list of current drivers that read the die (and not the ambient)
temperature is the following:

 - adxl362
 - bma280
 - bmg160
 - bmi160
 - fxos8700
 - lis3mdl
 - lsm6ds0
 - lsm6dsl
 - lsm9ds0
 - mpu6050

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-04-03 22:29:11 -04:00
Kumar Gala 2f4e987945 samples: sensor: ccs811: Add dummy dts.fixup so we can always build
Not all boards are going to have the ccs811 on them, and thus not in the
device tree.  We need a dts.fixup stub to dummy out the CONFIG_CCS811_*
defines that the driver expects.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-03-05 14:16:46 -06:00
Manivannan Sadhasivam 2c31ccee0e samples: sensor: Add sample application for CCS811 sensor
Add sample application for AMS CCS811 digital gas sensor driver.
This application fetches Co2, VOC, Voltage and Current readings
from the sensor and prints it on serial console continuously.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-02-06 11:16:26 -05:00
Paul Sokolovsky 63f862b262 samples: sensor: vl53l0x: Update for SENSOR_CHAN_DISTANCE refactor
SENSOR_CHAN_DISTANCE is now in meters. Print value in meters, as
double, this requires printf() and CONFIG_STDOUT_CONSOLE. This is
similar to how other sensor samples have it.

Fixes: #5693

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-05 10:30:34 -06:00
Paul Sokolovsky b7623a85b0 sensors: Redefine SENSOR_CHAN_HUMIDITY in percents, not milli-percents.
Based on the discussion in #5693, the reason why humidity was defined
in milli-percent was likely following Linux which defines it as such
in its sensor subsystem:
http://elixir.free-electrons.com/linux/latest/source/Documentation/ABI/testing/sysfs-bus-iio#L263

However, Linux defines temperature in milli-degrees either, but
Zephyr uses degrees (similarly for most other quantities). Typical
sensor resolution/precision for humidity is also on the order of 1%.

One of the existing drivers, th02.c, already returned values in
percents, and few apps showed it without conversion and/or units,
leading to confusing output to user like "54500".

So, switching units to percents, and update all the drivers and
sample apps.

For few drivers, there was also optimized conversion arithmetics
to avoid u64_t operations. (There're probably more places to
optimize it, and temperature conversion could use such optimization
too, but that's left for another patch.)

Fixes: #5693

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-05 14:10:39 +01:00
Maureen Helm e92df9c01d samples: Build hts221 sensor sample only on supported boards
The hts221 sensor driver was implicitly made dependent upon the
disco_l475_iot1 board when it was converted to dts, so build the
associated sample only for this board. This issue was encountered when
adding sensor dts support to nxp boards, which don't have hts221.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
David B. Kinder 701bb2afba doc: fix misspellings in boards and samples docs
Fix misspellings found in board and sample docs missed during regular
reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-01-30 20:27:43 -05:00
Vincent Veron 8310c53200 sample: sensor: Add vl53l0x sample application
This sample application allows to test vl53l0x distance sensor.
By default it is built with disco_l475_iot1 board as it is
built-in.

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2018-01-23 10:14:49 -06:00
Erwan Gouriou 0a3d9933c2 sample: fix configuration for sensor HTS221 sample application
Since no GPIO trigger is configured in hts221 sample application,
update prj.conf to enable TIGGER_NONE flag


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-01-13 09:06:58 -08:00
Yannis Damigos 4b7f3e75dd samples: bmi160: Add testcase filter for SPI_LEGACY_API
Don't run testcase if CONFIG_SPI_LEGACY_API is false.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-11 14:35:45 -06:00
Yannis Damigos d907ed309e samples: bme280: Add testcase filter for SPI_LEGACY_API
Don't run testcase if CONFIG_SPI_LEGACY_API is false.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-11 14:35:45 -06:00
Anas Nashif 2735c15120 samples: fix amg88xx sample.yaml syntax
Was still using old synatx.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 14:45:38 -05:00
Johann Fischer 7817622b4b samples: sensor: add amg88xx sample
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-01-07 16:04:45 -05:00
Anas Nashif eba1bbd705 samples: remove more build_only tags
Remove build_only and add harness type needed for the sample/test to
allow running with sanitycheck and on devices once we have harness
support.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 6e7de15680 samples: TMP112: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 9f0e1b82f0 samples: TH02: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif c98513e6a5 samples: sx9500: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 31a23dca68 samples: mcp9808: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif a6119ee105 samples: max30101: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 482feb45e4 samples: bmi160: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 159e0a2167 samples: magn_polling: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 0448642b33 samples: hts221: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 42ac8abdc3 samples: fxos8700: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 1ac3cc9347 samples: fxas21002: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 21787c8d1a samples: bmi150: fix dependencies and test cleanup
Remove ARC unrelated configs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 200b2459cf samples: bmg160: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif da9a59e233 samples: bme280: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif e7c009eec9 samples: apds9960: fix dependencies
depend on i2c and gpio drivers being available.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 468e3f7a11 samples: apds9960: remove arc related configs
Also remove unused STDOUT_CONSOLE

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Carles Cufi 8146d8efbb samples: sensor: Convert doc to CMake
Convert doc of samples/sensor to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
David B. Kinder ee71332b99 doc: fix doc misspellings
Found some spelling issues missed during regular PR review

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 14:31:52 -04:00
Anas Nashif 0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Punit Vara 3dd100a750 samples: bmm150: Add sample application for BMM150 sensor
To test BMM150 geomagnetic sensor driver in polling mode,
sample application added by this patch can be used.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-05 07:56:41 -04:00
Punit Vara da163e3bfc samples: Add sample for APDS9960 sensor
Sample can be used to test ambient light, RGB and proximity
functionality of APDS9960 sensor in polling mode.

Remove old sample which is not using sensor API.

ZEP-1552

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-08-03 15:29:35 -05:00
Anas Nashif 3c50f7aa12 tests: samples: remove duplicate filtering
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Anas Nashif 470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
David B. Kinder cbec29ab95 doc: change UTF-8 chars to sphinx inline replaces
Avoiding use of UTF-8 characters (trip up some tools)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-16 07:35:11 -05:00
David B. Kinder d1bdb3e092 doc: fix board/sample broken links
Some files have moved from their original location, or are no longer
available.  For the mbedtls samples, tweak the link to point to a page
where links for current and previous downloads can be found.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-13 20:49:13 -04:00
David B. Kinder 342bdda760 doc: spelling fixes in samples/ and boards/
regular spelling check on .rst files

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-12 18:28:08 -04:00
Erwan Gouriou 7991784297 samples: sensor: hts221
This commit provides sample application for sensor hts221.
By default, it is enabled on board disco_l475_iot1

Change-Id: I535fac8a670fa89cc1cae15ea1abe9cfe4b6c56b
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-05-03 13:51:37 -04:00
Kumar Gala e547533435 samples: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08c682bfc0b80dfa88de859e90a011bcd2db2762
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:53:53 -05:00
Anas Nashif c6f4476bf6 sensors: bmg160: fixed wrong Kconfig variable
Change-Id: I3e24420519535310728b3395c3c71a5fb3560f35
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-11 03:14:23 +00:00
Maureen Helm 0ab8874fde samples: Add max30101 sample application
Adds a max30101 sample application that polls sensor data and prints it
to the console.

Jira: ZEP-720
Change-Id: I50f28eaf9ea2ff5bfbb9fb6922c4006d5c02e739
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-04-06 11:47:18 +00:00
David B. Kinder 6a7527b5b4 doc: add labels to sensor sample docs for linking
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I37c654fb0bb7ebdf288af01e41ce5497969f8968
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 20:47:35 +00:00
Maureen Helm e09dc931bf samples: fxos8700: Update doc references and sample output
Updates the fxos8700 sample documentation to include board
cross-references and sample output with temperature data.

Change-Id: I8d4e4d8d287806f5480316da09d4072fcf9c05ac
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-30 21:21:22 +00:00
Maureen Helm 07241cafce samples: Add fxas21002 sample application
Adds a fxas21002 sample application that uses the sensor data ready
trigger to periodically print gyroscope data.

Jira: ZEP-1392
Change-Id: Ic9d3803a41f2873aef470a2a73b3f1db44d39b50
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-30 21:19:54 +00:00
Maureen Helm 153017834a samples: fxos8700: Add support for temperature
Enables the temperature sensor in the fxos8700 sample.

Change-Id: I2b4c306d3c5528dc32d940476c00180b5df08187
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:41:49 -05:00
Maureen Helm 9b715d9128 samples: fxos8700: Switch to generic SYS_LOG_SENSOR_LEVEL
The fxos8700 driver was previously converted to use the generic
SYS_LOG_SENSOR_LEVEL. Update the fxos8700 sample to use it too.

Change-Id: I2ef02342ce3a25e8d3a3d1b13181872ca0abdc16
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:41:49 -05:00
Anas Nashif 3dc9af66ca sensors: BME280: added support for SPI communication
Support connection via SPI and keep I2C as the default.

Jira: ZEP-1698
Change-Id: I42a76131577a37429375364deb07e451107f5d81
Signed-off-by: Dario Pennisi <dario@iptronix.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-21 10:39:27 +01:00
Kuo-Lang Tseng 61452f0e38 samples: bmi160: use correct device name
Binding of the device failed due to incorrect device name. Update
to use the correct device name.

Jira: ZEP-1704

Change-Id: I6ca23a439357592c9c974ca746bccc35e77d996d
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-11 01:28:09 +00:00
Anas Nashif df16cb92d4 arduino_101: bmi160: use new device name
Use new device name for SPI device

Jira: ZEP-1704
Change-Id: Iec39468bbef54423af2b3a681dd4ae1eee866d1e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-10 16:02:22 +00:00
Baohong Liu fd74c0c5a6 samples: bmi160: reduce polling mode sampling frequency
Reduce the accelerometer sampling frequency for polling mode.
So, cpu has more time to fetch the sample.

Also add some waiting time for the new frequency setting to
take effect.

Jira: ZEP-1532

Change-Id: If5c1d8a2b5f30b232a212f2775306ca397b9f80c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-04 20:08:16 +00:00
Bogdan Davidoaia a45dd12f0c sensor: use SENSOR_CHAN_*_XYZ instead of SENSOR_CHAN_*_ANY
SENSOR_CHAN_*_ANY will be deprecated, so use the new SENSOR_CHAN_*_XYZ
enum values.

Change-Id: I91cf25864613a934feab65588969d10c52fd4fe6
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-27 19:07:17 +00:00
Maureen Helm 5d5b17b037 samples: fxos8700: Convert documentation to RST
Converts the fxos8700 sample documentation to RST format.

Change-Id: I26084fea4b0eb11d09cd75526c6c52e3fdd76dda
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-26 11:57:23 +00:00
Maureen Helm 1938f5dadb samples: fxos8700: Decimate sensor data before printing to the console
At the default sample rate of 400 Hz, there is not enough bandwidth on
the UART at 115200 baud to print every sample. Fix by decimating the
sensor data by 4 before printing to the console.

This issue was discovered after fixing ZEP-1507.

Change-Id: I451ec9873ca93fe417d5d5a2d6d13b5e921c7611
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-26 11:57:23 +00:00
David B. Kinder 2cb045420c doc: fix .rst files canonical heading order
The headings on some .rst files were not following the expected
heading order of using # for h1, * for h2, = for h3, and - for h4
This patch fixes that, and the doc/templates/*.tmpl files created
for folks to use as templates for creating board and sample docs.

Change-Id: I0263b005648558d5ea41a681ceaa4798c9594dd9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-20 16:06:36 -08:00
Bogdan Davidoaia 6460e7655d samples: sensor: fxos8700: use floating point for printing sensor values
Printing values as <integer_part>.<fractional_part> gives undesired
results for negative numbers, so print the values converted to floating
point to avoid this.

Change-Id: I871b8461f2d643a2adce67df064e9f5e6d506319
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-20 14:40:39 +00:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Bogdan Davidoaia d4efb9a21f samples: thermometer: use convert to double function from sensor.h
Remove the convert_to_double function and use sensor_value_to_double
from sensor.h.

Change-Id: I92ef4219057f431917f4c8e9d46d4ee2074b423b
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-16 13:15:14 +00:00
Bogdan Davidoaia 30162aedf1 sensor: remove sensor value type
Remove the type field from the sensor value structure. All values will
have the type previously defined by SENSOR_VALUE_TYPE_INT_PLUS_MICRO.

This simplifies the interface, as apps will know what value type to
expect. Apps that prefer to use double values can optain them using the
sensor_value_to_double function.

Change-Id: I3588d74258030eb16c3f89d8eead13cca4606b18
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-15 01:09:33 +00:00
Anas Nashif eeb6a30f29 samples: apds9960: move under sensors and update docs
Change-Id: I8e5735f15dbba5b9fead8f677104843a947b28ca
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-11 12:24:58 +00:00
Marcus Shawcroft f0da59b062 sensor: Fix samples that assume incorrect sensor_value type.
Various sensor samples are hardwired to expect returned sensor values
are represented as doubles.  In each case this assumption is incorrect.

Introduce a generic sensor_value to double helper function and adjust
the samples to use it.

Change-Id: I89c788686576562b84e07a36064640231340c33b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-08 16:16:15 +00:00
Anas Nashif fc6137001b doc: move documetnation context to root directory
This will allow inclusion of documentation files that exist outside of
doc/ and will make it possible to add rst files across the tree,
especially for boards, samples and tests.

Change-Id: I7afcf92d99f504b2bc0b2b7e3452acb2f8e08294
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 22:51:31 +00:00
Anas Nashif a6997bbc17 samples: sensors: fix documentation layout of MCP9808 sample
Change-Id: Iab5426a0689fd7ac22933e3c61e22d217af7f067
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 16:32:31 -05:00
Anas Nashif 813df21713 samples: sensors: fix documentation layout of TH02 sample
Change-Id: I140fdd96eea74aaeb0216829024a46f2430fc9c6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 16:32:31 -05:00
Baohong Liu 0632bcac25 samples: bmi160: use correct spi dev name
The dev name for spi in the sensor sub-system was changed to
SPI_SS_x from SPI_x recently. Let's use the new name in the
sample app.

Change-Id: I78cdf21fce16290503c303e0de1432b4587486aa
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-24 13:35:43 +00:00
Anas Nashif 4b20b634be samples: fix RST syntax and add headers
Change-Id: Ic94213f97698bd861516de0bd159fb37f9124883
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-22 08:01:49 -05:00
Flavio Santes d47abac73d samples: Add the ARG_UNUSED macro
Avoid compiler warnings by incorporating the ARG_UNUSED macro.

Change-Id: Iea567bf5f42d9f609bf68d171e0bc0e03b62b821
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:53 +00:00
Baohong Liu db20723da2 samples: bmi160: code clean up
Remove CONFIG_BMI160_TRIGGER_SOURCE_GPIO from prj config
file. It is not being used any more.

Also change CONFIG_STDOUT_CONSOLE to CONFIG_PRINTK. The
whole sample is using printk instead of printf.

Change-Id: I4ac7db37da1e45aed2457ace9e82385e37143c36
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 23:07:55 +00:00
Baohong Liu 8b146d48d7 samples: bmi160: replace printf with printk
Change-Id: If1d05242d271ea4f8e4b60de8530984341f43d43
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 15:56:34 +00:00
Baohong Liu 9e4c2e92ca samples: bmi160: use direct GPIO trigger instead of ipm
Directly use AON GPIO trigger instead of IPM.

In the past, SW did not allow arc to receive AON GPIO interrupt.
So, interrupt from BMI160 was routed to x86 cpu. Then, x86 cpu
passed the event to arc through IPM. But, SW was updated and arc
is able to directly receive interrupt from AON GPIO now. So, IPM
is not needed any more. Both IPM and GPIO triggering code is there.
We just need to change the configuration by modifying the prj
config file.

The x86 code will be removed since it will not be used any more.

Change-Id: Ibc4250a34218cc52bf4c726cf70617cfdea3b2e8
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 15:56:33 +00:00
Bogdan Davidoaia 4946e3e6e6 sensor: remove SENSOR_VALUE_TYPE_INT
Remove SENSOR_VALUE_TYPE_INT as it is the same as
SENSOR_VALUE_TYPE_INT_PLUS_MICRO with val2 set to 0.

Change-Id: If5a9c579b7267701c27f40fd887acae47d64edc5
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-12-13 21:51:10 +00:00
Bogdan Davidoaia b584acb0a4 sensor: remove unused Q16_16 value type
Remove SENSOR_VALUE_TYPE_Q16_16 as it is not used by any driver. Future
drivers can use any of the remaining value types.

Change-Id: I984143cc65d6a6fd0477f310ac17c62498cc05b8
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-12-13 21:51:09 +00:00
Marcus Shawcroft 0bc4b494d7 samples: Add thermometer
Change-Id: Ia561255be4f47dcb2e17bf734af77786fda80d0b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-11 11:14:06 +00:00
Sergio Rodriguez a213fb4e27 samples: sensor: fxos8700: Check sample fetch return value
The sample was reading the sample values regardless of return
value of the fetch sample function, now it exits the function and
prints an error message

Coverity-CID: 157576

Change-Id: If9a909ed9b617357a032c5632ac04984846d6744
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-11 04:30:02 +00:00
Maureen Helm 23b06ebd8c samples: Add fxos8700 sample application
Adds a fxos8700 sample application that uses the sensor data ready
trigger to periodically print accelerometer and magnetometer data.

Change-Id: I43fef6cd6090b58d8d0168a25558a3a05781ea5d
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-12-04 12:37:49 +00:00
Flavio Santes 328ecb8dfd samples/sensors: Update README files
Remove nano kernel references found at the README files.

Change-Id: Id42f4797561f3d7674110bb84531b5f6e487decd
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-26 10:46:10 +00:00
Flavio Santes 5f818bfcd3 sensors/mcp9808: Evaluate sensor_channel_get return code
The sensor_channel_get return code is now evaluated.

Change-Id: Ib931d6caba65af7195bad53c62e6e5a3033b49e8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-17 01:30:00 -06:00
Flavio Santes 0e20d45272 sensors/mcp9808: Evaluate sensor_sample_fetch return code
sensor_sample_fetch return code is now evaluated.

Coverity-CID: 151957

Change-Id: I79b9f44c79ac13e8d7da55c9e3866ad504a4a450
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-17 01:25:12 -06:00
Anas Nashif 3fe2575f0d drivers: sensors: use unified kernel threads
convert all sensor drivers to use threads and the unified kernel API and
remove all legacy APIs.

Change-Id: Ica43ea74ecbbf85273f718f182c413a9dcd8abc6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-11 21:00:19 +00:00
Anas Nashif d622b09bc0 samples: tests: remove obsolete KERNEL_TYPE and kernel variables
Remove those from Makefiles and testcase.ini, we now support unified kernel
only and sanitycheck script now knows how to deal with this.

Change-Id: I853ebcadfa7b56a4de5737d95f2ba096babb2e13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 15:47:25 -04:00
Anas Nashif 629393192f sensors: tmp112: convert to and build with unified kernel
Change-Id: I8ba57652db533fc19ebecf213dccf1564ba85f61
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:51 +00:00
Anas Nashif 79232914c9 sensors: th02: convert to and build with unified kernel
Change-Id: Idcdce36314dce4bfe9f6cf627c38b9f350b19355
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:50 +00:00
Anas Nashif bf169afd46 sensors: sx9500: convert to and build with unified kernel
Change-Id: Ic3e8d0c59eda97759f1d56127f42120b0c0a6def
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:50 +00:00
Anas Nashif 5d3634d0b1 sensors: mcp9808: convert to and build with unified kernel
Change-Id: I8bd15fd5c353c2040ffb99e759b7739d435f2829
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:49 +00:00
Anas Nashif ee23f1464b sensors: max44009: convert to and build with unified kernel
Change-Id: I024d00dfd264b9ca8afb682f4146176678440ed8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:49 +00:00
Anas Nashif 1dc946bda1 sensors: magn_polling: convert to and build with unified kernel
Change-Id: Ib0c364c1e9faa95adf8e7a5dde8d6aa1214d9771
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:48 +00:00
Anas Nashif 159b27f3c5 sensors: bmg160: convert to and build with unified kernel
Change-Id: I4571cc371dcbbfaaf1a6b3a9abacac1f4b6e2821
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:48 +00:00
Anas Nashif 9a82a81d58 sensors: bmi160: convert to and build with unified kernel
Change-Id: I63bf181b6ec84e21a2e83bb5bce4ffb57b3affe8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:47 +00:00
Anas Nashif 221bb6979b sensors: bme280: convert to and build with unified kernel
Change-Id: I721ae3a9b982ff4571e7e9bc966df8c79c4dc6c3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:46 +00:00
Anas Nashif 5925eaf5f1 optimize testcase runs for sensors
Change-Id: If701d1824572bed068712750fbd14758806ba70f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 23:47:39 +00:00
Anas Nashif 511339f54c samples: cleanup sensor samples
- remove useless Kconfigs
- remove SPI DW kconfigs, we now use QMSI driver
- Cleanup readme and turn into ReST

Change-Id: Ie1f39e0afabf499fa81627ded59adf267e01993a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 23:47:21 +00:00
Anas Nashif 95bf69197d samples: sensors: cleanup mcp9808 sample and refine documentation
Enhance documentation and build for Quark D2000 Devboard by default.

Change-Id: I3417c31a8898a076465d25f45d7821820b480290
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 23:46:38 +00:00
Anas Nashif c224491aec samples: sensors: remove reference to non-existing MDEF_FILE
Change-Id: Ideaa795e8afc8d3226adc340db7299eaa9bf6bcc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-25 23:16:32 +00:00
Anas Nashif 71d6ad2619 sensors: bmi160: remove unused init priority config
Change-Id: I367d7b084fb93609000066b610e01a802fdd152e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-20 09:39:51 +00:00
Anas Nashif a61a7faf53 samples: TH02 temperature and humidity sensor sample
This sample uses the grove temperature and humidity sensor and displays the
read values on the grove LCD.

Change-Id: Id6fb6171c26c97f1b01008fa06a4dc85287d7545
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 00:24:34 +00:00
Anas Nashif 84c9db39e7 gpio: reduce Kconfigs and use consistent name for GPIOs
Using AON for GPIO kconfigs is very specifc to quark se, there
is no need to make this special for this platform. Use the
existing scheme instead.

Change-Id: I946431490380dc0f537d6056277a94c9c9c80fed
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 16:15:07 +00:00
Anas Nashif f482200f9c samples: remove useless filters in testcase.ini
Change-Id: Iaf7f77a738a48918752347c97019660355de370a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 14:07:24 +00:00
Anas Nashif 5363d14a9e boards: rename Quark SE Devboard to Quark SE C1000
This board now has an official name and will be available soon:

http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/se-soc/overview.html

Jira: ZEP-758
Change-Id: Ia16d33722308cf81471321c3063bdc75055a4d50
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:31 +00:00
Anas Nashif 5e4b62c35c boards: rename Quark SE Devboard to Quark SE C1000 (Sensor Subsystem)
Jira: ZEP-758
Change-Id: I8ee5a2f9e4a6ecbd15214e59321bf27a502ef6ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:30 +00:00
Anas Nashif 4589f2c468 samples: use printf/printk directly instead of macros
In many cases there is no need to define a macro for printing to
the console, just use the correct variant directly.

Jira: ZEP-240
Change-Id: I9952deda4bfc60424f01fca2443d037562d13d0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-14 16:56:02 +00:00
Anas Nashif e38abba451 tests: change tags for sensors
Change tags to reflect the type of samples, in this case it is all
about sensors.

Change-Id: I9f87e8683dd52fd757cd07ba5aa9fad99d17ab38
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-11 19:10:40 +00:00
Anas Nashif 62289e6de7 quark_se: disable IPM and enable UART0 on the sensor subsystem
Treat the sensor subsystem as an independent board that can send
messages to UART and disable IPM and the messaging interface. IPM
can be enabled by applications that require such interface.

Fix all samples that are affected by this change to make sanitycheck
pass.

Jira: ZEP-451
Change-Id: I3df6af16adefaefec02b97778d6c68ffc920ac35
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-08-31 16:31:04 +00:00
Andrew Boie 701f0598a8 Revert "misc: Remove generic PRINT macros from sensor samples"
This reverts commit 107f38acf6.

Change-Id: I6c5aa1323da485fc7a04452537d67c797a18bba5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:19:44 -07:00
Andrew Boie a0a5e82205 samples: mcp9808: build for sanitycheck runs
Change-Id: I593478da5f9f168be8415ada83b97876fe0b3b99
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:54 -07:00
Andrew Boie 58823e92fc samples: bme280: build for sanitycheck runs
Change-Id: I410c602a323e8aba00bc57111f1bb536a4dc0bf6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:54 -07:00
Andrew Boie 342392fbd9 samples: tmp112: build for sanitycheck
Change-Id: I6b1da26495f1fa1063b1ca9d2990ee428fbaad1e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:54 -07:00
Andrew Boie 48567055cf samples: sx9500: build for sanitycheck
Change-Id: Ic0a3614b6bd98d0e65117704b5da10ecdee39996
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:53 -07:00
Andrew Boie e61041dade samples: magn_polling: build for sanitycheck
Change-Id: I10ca471302050a107e720dfd4ca6c9961b588721
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:53 -07:00
Juan Manuel Cruz Alcaraz 107f38acf6 misc: Remove generic PRINT macros from sensor samples
Remove generic PRINT macros from sensor samples and replace
with SYS_LOG  module.

Jira: ZEP-240

Change-Id: I474efcd1daf8e621acd50d88b3a9662b8cd2b516
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-05 20:36:53 +00:00
Baohong Liu 538d8d184d sensor: fix BMI160 sensor hang issue
Fix several issues which are causing the BMI160 app hang.

For SPI duplex transfer, QMSI only supports equal length.
For SPI freq, divider is used. Actual freq is no longer used.

Jira: ZEP-461

Change-Id: I1a1bcc12c6514c3797686dfdad1ce1b852f7dc78
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-08-05 17:35:42 +00:00
Bogdan Davidoaia a30a3ac949 samples: bmi160: add sensor_value_sprintf helper function
Add helper function for printing sensor_value to char buffer.

Change-Id: I46329675d9a69376ea74c4f7dfcb270ca2078c72
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-08-02 05:22:44 +00:00
Kumar Gala fd9c66e3f2 samples: sensor: bmi160: Fix Kconfig dev name typo
The sample prj.conf file was using CONFIG_BMI160_DRV_NAME which doesn't
exist.  Use CONFIG_BMI160_NAME instead.

Change-Id: I6eb29bf7772055a7b1fd62461fabe8e358dd10ec
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-28 07:22:35 -05:00
Baohong Liu d215841808 samples: Add an app for MAX44009 light sensor
Add a sample app to read MAX44009 light sensor via i2c
of quark se sensor system.

Origin: Original

Change-Id: I7078b3383021cdc81ff7b59fd1958e6bf86fe988
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-07-27 18:03:34 -07:00
Mariusz Ryndzionek d4983df3b1 samples: add simple tmp112 sensor application
Periodically reads temperature and prints it on console

Change-Id: I293a7aad88bce245d6c1149fd19fcb7c7e770e54
Signed-off-by: Mariusz Ryndzionek <mariusz.ryndzionek@firmwave.com>
2016-06-30 14:50:56 +00:00
Kumar Gala 7dcbbc39e7 build: move from srctree to ZEPHYR_BASE for app include paths
$srctree for the application might not be set to be $ZEPHYR_BASE, use
$ZEPHYR_BASE instead to be more explicit in the build.

Change-Id: Iefa5ff59f246b584949329044f7a6531adc6ed62
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-30 14:36:39 +00:00
Bogdan Davidoaia 72786486c6 sensor: remove CONFIG_SENSOR_DEBUG
Remove the CONFIG_SENSOR_DEBUG as it is no longer needed since switching
to SYS_LOG_* in the sensor susbsystem.

Also, use __ASSERT where CONFIG_SENSOR_DEBUG was used to validate
function parameters.

Change-Id: I80ed7209abfb92220fa229d246c5b3a43b887e32
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-05-21 21:20:13 +00:00
Murtaza Alexandru 310ed1e2e9 sensor: add support for BME280
* Rename BMP280 to BME280 which is a superset for the former.
* Autodetect device based on chip ID.
* Implement humidity fetching and reading for BME280
* Rename sample BMP280 to BME280

Change-Id: I565c769a7011e7496c9f1cad861d5ee311839b4f
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-05-17 20:07:34 +00:00
Anas Nashif f62d86c42b samples: get rid of obsolete usage of ARCH variable
Using ARCH variable to select different configurations for the different
architectures is misleading and conflicts with the variable ARCH being used by
the build system.  The variable is not needed, it is application specific and
an application can be built without the need to specify ARCH on the command
line.

This is yet another item specific to samples and test cases that
wrongfully being used and documented for every application.  We need to use
another variable and just make it clear it is specific to samples and how they
are written.  One possible solution is to have a script that gets the
architecture based on the board being used.  Attachments

Jira: ZEP-238
Change-Id: Ieccbc087a41858fb96fb361c0aaa04705e968a4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:28 +00:00
Anas Nashif fbe7d90ead spi: consalidate and simplify
Use the same Kconfig infrastructure and options for all SPI drivers.

Jira: ZEP-294
Change-Id: I7097bf3d2e1040fcec166761a9342bff707de4dd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:26 +00:00
Anas Nashif 0140da310b i2c: unify kconfig options and share them across drivers
Reduces Kconfig variables by ~20

Change-Id: If39f7d49482d62417c621f98bc8c0c78df0d4139
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:22 +00:00
Laurentiu Palcu 5841aeae14 sensor: bmg160: add sample application
The application tests polling mode and trigger mode (both data ready and
anymotion triggers).

Origin: Original
Change-Id: Ic0f9400758aaf56ef95f0f3c68c872d1bfd51176
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-05-04 13:14:00 +00:00
Anas Nashif fe1fb2a9b9 samples: magn_polling: include stdio.h and remove redundant configs
Change-Id: I8b2c729761c36c777c675c2b26f9ec7d3a22567c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-28 12:29:14 +00:00
Anas Nashif 9eaf052778 sensors: sample: this testcase is for arduino_101
Change-Id: Id0299a05aab171621a317e4ea446acd65150d6ac
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-27 15:04:18 +00:00
Murtaza Alexandru f1b95df34e sensor: rename SENSOR_TYPE_* to SENSOR_VALUE_TYPE_*
Rename sensor_value_type enums from SENSOR_TYPE_* to more concludent
name SENSOR_VALUE_TYPE_*. This change is required if we want to
introduce SENSOR_TYPE_* (SENSOR_TYPE_ACCEL - if the sensor/driver
supports accelerometer, SENSOR_TYPE_MAGN - etc.) in the future.
Also it is more clear with this notation what these enums are referring
to.

Change-Id: Ic58e29288669e10c0695e0f86f59b0e57f7ac38c
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-26 18:09:41 +00:00
Laurentiu Palcu 47de28535a sensor: bmi160: switch x86 app to QMSI GPIO driver
Change-Id: I1265507aec8214fbdad4ea3d88cd4358081dfced
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-26 10:57:56 +00:00
Anas Nashif 4b854b00c3 sx9500: remove explicit definitions for GPIO/I2C
Change-Id: I6c0e13707a91db993737297c59ed77603c561377
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:05 +00:00
Tomasz Bursztyka cc53ac7918 samples: sensor: Use new GPIO callback API for bmi160 sample
gpio_set_callback is meant to be deprecated and thus modifying the
sample to use the new GPIO callback API.

Change-Id: I822cd1c81575834d40926c56cd61b87884230594
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-25 14:58:16 +00:00
Laurentiu Palcu 01d133a201 sensor: bmi160: add trigger tests to the application
Also, lower the clock for the SPI bus in order not to hit the DW
controller CS issue.

Change-Id: I69c4211bfa6efb85117185e2ae813dd7c4915a7a
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:15 +00:00
Laurentiu Palcu b70278f113 sensor: bmi160: add x86 app for Arduino101
This app is needed for Arduino101 only, or boards using the Curie
module.

BMI160 interrupt pin is connected to AON GPIO controller. The driver
handling the AON GPIO controller runs on x86 core. Even though, the AON
GPIO controller is accesible to ARC core too, the current implementation
for Designware controller driver does not allow it. Hence, this app will
register a gpio callback and signal the ARC core through IPM.

Other boards that use a gpio pin on the regular GPIO controllers don't
need this app.

Origin: Original
Change-Id: I225ca60735e39c7a47693dc53237f48cd9ac2680
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Laurentiu Palcu 559112a6a0 sensor: bmi160: move sample app to arc subdirectory
The movement is needed because on some boards, like Arduino101, the
current GPIO driver implementation does not allow for receiving
interrupts from AON GPIO controller directly on ARC core. Hence, IPM is
needed to relay the interrupts from x86 to arc.

However, other boards that can use a regular GPIO intterupt or users
that connect a BMI160 chip separately, can still use the ARC application
as is.

Change-Id: I58dd77edd45ea2b071db5b99073eb15722847bfe
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-21 14:16:12 +00:00
Vlad Dogaru fd094f8cfc samples: revert to default CFLAGS
SDK version 0.7.5 has fixed ZEP-62.  It is no longer necessary to use
-O0 in order to get correct readings from sensors.

Change-Id: Ia8ac2f55453b7dfdda71fe2f41863cbd0b366739
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-08 17:24:38 +00:00
Laurentiu Palcu dbe2c5faff bmi160: Add sample application
Origin: Original
Change-Id: I8bd3fa30f3794de0fa22ffff8e3eaeb213612741
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-02 23:08:48 +00:00
Vlad Dogaru 0e702a6ce3 sensor: add driver for BMP280
This is a temperature and atmospheric pressure chip.  The datasheet is
available at:
	https://www.adafruit.com/datasheets/BST-BMP280-DS001-11.pdf

Change-Id: I3406eb6c2c4da564757b8315323d0681d648b541
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-27 00:34:38 +00:00
Murtaza Alexandru 9d4c6507e4 sensor: add magnetometer generic polling sample
Add generic sample that continuosly read magnetometer data from
the first device that finds available within a predefined list.

Change-Id: Ia9b5fd434f462fb4704896852415f90eb633e1eb
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-03-19 10:40:14 +00:00
Vlad Dogaru e479839fa1 samples: Add sample app for sx9500 sensor driver
This illustrates the usage of the sensor API, using either triggers or
periodic reads from the driver.

Origin: Original
Change-Id: Ief7451fc4771b9459a2b3b7ed0a33341a7710cc3
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-15 18:04:19 -04:00
Vlad Dogaru 49d96d95ab sensor: Add threshold trigger support for MCP9808
The MCP9808 supports threshold triggering.  Add support for this feature
in the driver and the sample application.

If triggering is activated, the driver can create its own fiber or use
the system-wide sensor fiber.

Origin: Original
Change-Id: Ie825a22245cb48cbdffba3049011e4d305975d53
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-15 18:04:19 -04:00
Vlad Dogaru d30b3ca516 samples: Add sample app for MCP9808 sensor
The app simply reads the temperature from the connected MCP9808 sensor.
It forces -O0 compile flags, as the default (-Os) triggers a compiler
bug when converting temperature readings.

Origin: Original
Change-Id: I0654543e3d361a862bdf78b44fdc1430cb6aad51
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-03-15 18:04:19 -04:00