Commit graph

368 commits

Author SHA1 Message Date
Johann Fischer dc6a48fa29 samples: fxos8700-hid: convert to new GPIO API
Convert fxos8700-hid sample to new GPIO API

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Peter Bigot 6980a04e8c drivers: sensor: sx9500: convert to new GPIO API
Use the new pin and interrupt configuration API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot acb43b66da sensors: ccs811: update to new API
Update devicetree sources and bindings, switch to new GPIO API.  Use
devicetree property name to identify interrupt signal.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 50d1bb16e3 sensor: adt7420: update for new GPIO API
Update sample overlays.  Add GPIO flags to configuration state.
Refactor to split out setup/handle/process phases.  Switch to new API
replacing callback dis/enable with interrupt dis/enable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot c273b5d885 drivers: sensor: mcp9808: update to new GPIO API
Since this was converted to the setup/handle/process idiom in master
the conversion is straightforward.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 6afbd053e4 drivers: sensor: isl29035: update to new GPIO API
Document alert pin behavior, switch to new API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer 664a1cf0db drivers: amg88xx: convert to new GPIO API
Convert AMG88XX sensor driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Kevin Townsend f800c7266e drivers: hmc5883l: update to new GPIO API
This commit updates the HMC5883L driver to use the new GPIO API.

Also add a note explicitly describing the active state of the DRDY
pin in the binding file.

Tested on frdm_k64f.

Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 4b5393c228 sensor: adxl372: update for new GPIO API
Update sample overlay for missing chip select and to deconflict with
UART TXD.  Add GPIO flags to configuration state.  Replace callback
enable with interrupt enable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot de7e3e7693 sensor: adxl362: update for new GPIO API
Add a sample overlay.  Add GPIO flags to configuration state.  Replace
callback enable with interrupt enable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot c44290f75d drivers: sensor: dht: update to new GPIO API
Document IO signal behavior, switch to new API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 1cf43985e9 drivers: sensor: lsm6dsl: update to new GPIO API
Correct IRQ active level to default active-high, switch to new
interrupt configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot a49b364244 drivers: sensor: sht3xd: convert to new GPIO APIO
Update ALERT active level in all devicetree files.  Capture GPIO flags
in static configuration.  Add internal API to enable and disable
interrupt, to release the handlers when an alert occurs, and to
re-enable the signal when the handler completes.  Check for alerts
received during periods when the interrupt was disabled.

Extend the example to handle both above and below range triggers and
alerts that are present on startup.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Ulf Magnusson ecb20669b3 samples: sht3xd: kconfig: Do not assign promptless SHT3XD_TRIGGER
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

SHT3XD_TRIGGER is already being selected by
SHT3XD_TRIGGER_GLOBAL_THREAD, which is enabled in the same configuration
file.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-16 07:50:05 -06:00
Peter A. Bigot 45f9efe02f samples: sensor: ccs811: update for new capabilities
Use nrf52_pca20020 and nrf51_ble400 to demonstrate the new functionality
of the CCS811 driver.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot ff7269013e samples: sensor: ccs811: add Linaro copyright statements
Add missing information to existing files in anticipation of whinage
from recently modified CI License checks.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot 6c15968322 drivers: sensor: ccs811: uncrustify
Run the code formatter over the source files for the CCS811.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot f05cbb421d drivers: sensor: mcp9808: fix various problems and improve test
Correct handling of device encoded temperature values, which combine a
12-bit 2s complement signed value with a separate sign bit.  Rework
conversion between device and sensor temperature representations to
support negative temperatures in both domains.

Use a much simpler trigger configuration where the alert is driven by
comparator output, rather than as an interrupt that requires a pair of
I2C transactions to read and clear the flag.

Refactor the trigger infrastructure to use the setup/handle/process
idiom, which reduces duplicated code and to correctly detect alerts
present when the triggers are set.

Completely replace the sample with something that demonstrates
updating upper and lower threshold values to track moving
temperatures.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-08 20:33:51 -05:00
Peter Bigot 649500aeca samples: sensor: mpu6050: convert to devicetree
Add a sample for the MPU6050 that demonstrates on-demand and triggered
display of all sensor data.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:40:04 +01:00
Peter Bigot ff5cadc52c samples: sensor: adt7420: rework for trigger testing
When a trigger was enabled the original implementation would do
nothing more than print "Waiting for a threshold event", without
describing what such an event would look like.

Rework to maintain a window of +/- 0.5 Cel around the most recent
in-window temperature, and reset that window whenever a trigger occurs
or a non-trigger reading is outside the window.  Time-out and display
the temperature if no event occurs in a reasonable time.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:38:43 +01:00
Peter Bigot 6ecc0c53c0 samples: sensor: adt7420: add nrf52_pca10040 devicetree overlay
Expand the set of hardware this can be tested with.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:38:43 +01:00
Peter Bigot be904bc289 samples: sensor: adt7420: fix frdm_k64f devicetree overlay
The device address can only be 0x48 through 0x1B.  C6 is connected to
the FXOS870 and is not exposed on a header: switch to Arduino D0.

Move this to a boards subdirectory so we can add other overlays
without cluttering the root.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:38:43 +01:00
Peter Bigot c2723054f6 samples: sensor: lps22hh: add standalone sample
Although this sensor is demonstrated by the X-NUCLEO-IKS01A3 sample,
maintenance of the driver is simplified if it can be tested in
isolation.  Provide a sample modeled on hts221.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-20 20:25:11 -05:00
Anas Nashif 6b01656c4b samples: sensor: fix test identifier
use sample.sensor.shell instead of test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-20 10:35:13 -05:00
Diego Sueiro e924879ef7 samples/subsys/shell: Introduce Sensor Shell module
Adds the Sensor Shell module sample app.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-19 15:54:04 -05:00
Peter Bigot 816d2c47a4 samples: sensor: dht: add sample
Add a sample to test the Aosong temperature/humidity sensor.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 06:43:37 -06:00
Emil Obalski 2128750138 usb: api: Add user device status callback
By this commit user gets possibility to register USB
device satutus callback. This callback represents device state
and is added so user could know what happend to USB device.

Callback is registered by providing it to usb_enable()
USB api is extended by this callback handler.

Samples using using USB are by default provide no callback
and the usb_enable() is called with NULL parameter.

Status callback registered by hid class is deleted as now
USB device has global callback for all classes within device.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Emil Obalski d65027d8c0 usb: samples: Application calling usb_enable by itself
User app is reponsible for issuing usb_enable and
making USB hardware operative.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Peter Bigot 50a54f4a4a samples: sensors: isl29035: add sample
Add a sample to demonstrate and test the Renesas/Intersil ISL29035
light sensor driver.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-18 15:07:02 -06:00
Ulf Magnusson 984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Anas Nashif 70758c4374 tests: fix test identifiers
The seasonal overhaul of test identifiers aligning the terms being used
and creating a structure. This is hopefully the last time we do this,
plan is to document the identifiers and enforce syntax.

The end-goal is to be able to generate a testsuite description from the
existing tests and sync it frequently with the testsuite in Testrail.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-09 15:53:44 -05:00
Erwan Gouriou e0353db10b samples: lsm6dsl: Add a harness_config
In order to enable sample to be run and evaluated in sanitycheck,
add a harness_config to validate sample output:
- Add "regex" to match on sample output
- Add "timeout" to save some time when debugging
- Add "ordered" instruction. Since sample is running a while loop
test verdict can potentially be computed on previous run output,
issuing a wrong status.

Last, since sanitycheck regex does not play well them, rework
sample to output without parenthesis.

Tested on disco_l475_iot1

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-12-09 12:52:35 -05:00
David B. Kinder ddf0b574b0 doc: fix LPS22HB doc indentation
Lines with leading spaces aren't rendered well in the generated HTML.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-11-20 17:47:20 -05:00
Peter Bigot eb2c3307cc samples: sensor: lps22hb: remove trigger-related code
The driver for this sensor does not support asynchronous sampling.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-18 13:53:20 +01:00
Peter Bigot 86461ac559 samples: sensor: mcp9808: fix frdm_k64f devicetree overlay
The device address can only be 0x18 through 0x1F.  C6 is connected to
the FXOS870 and is not exposed on a header: switch to Arduino D0.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-13 15:16:54 -06:00
Peter Bigot 83b2bb614b drivers: sensor: mcp9808: clean up I2C API usage
The i2c_msg API details do not work correctly with Nordic TWI.  Switch
to the higher-level and simpler API for register read and write.  Also
add a tree configuration on a Nordic-based board.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-13 15:16:54 -06:00
Kevin Townsend 740f6868a5 sensor: hmc5883l: convert to device tree
This commit converts the existing hcm5883l 3-axis magnetometer
driver to use device tree for the I2C and GPIO selection.

It also adds a basic sample application for this sensor, using the
frdm-k64f development board to demonstrate how the interrupt
GPIO pin and I2C bus can be selected.

Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
2019-11-08 12:12:38 -06:00
Kumar Gala 36c94ddd36 sensor: bmc150_magn: Convert to DTS
Convert bmc150_magn sensor driver to utilize device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala 62f5ac1ad4 sensor: bmg160: Convert to DTS
Convert bmg160 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala 7b8b5524be sensor: bmm150: Convert to DTS
Convert bmm150 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala ddddbf9f84 sensor: max44009: Convert to DTS
Convert max44009 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala 30ea840eb1 sensor: mcp9808: Convert to DTS
Convert mcp9808 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala 03c7cb4f46 sensor: sx9500: Convert to DTS
Convert sx9500 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala b388b178a0 sensor: tmp112: Convert to DTS
Convert tmp112 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
Kumar Gala 0e9e67297e sensor: th02: Convert to DTS
Convert th02 sensor driver and sample app to utilize device tree.

Introduce a dts board overlay on the frdm_k64f board to ensure we at
least have a single platform in which the sample gets built.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-08 07:44:54 -06:00
David B. Kinder 9b66efc858 doc: fix misspellings in rst docs
Fix some misspellings missed during regular reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-29 06:01:13 +01:00
Daniel Leung b7eb04b300 x86: consolidate x86_64 architecture, SoC and boards
There are two set of code supporting x86_64: x86_64 using x32 ABI,
and x86 long mode, and this consolidates both into one x86_64
architecture and SoC supporting truly 64-bit mode.

() Removes the x86_64:x32 architecture and SoC, and replaces
   them with the existing x86 long mode arch and SoC.
() Replace qemu_x86_64 with qemu_x86_long as qemu_x86_64.
() Updates samples and tests to remove reference to
   qemu_x86_long.
() Renames CONFIG_X86_LONGMODE to CONFIG_X86_64.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-10-25 17:57:55 -04:00
Peter Bigot be7a4bf727 samples: sensor: add lis2dh sample
Basic polled and triggered sampling of accelerometer data from
LIS2DH-compatible sensors.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-25 11:02:58 -05:00
Peter Bigot 040b1d676e samples: sensor: lps22hb: add sample
Copy and rename from hts221.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-22 17:56:56 -05:00
Peter Bigot ad4b365af8 samples: sensor: lsm6dsl: configure with trigger
This sensor defaults to no trigger, in which case no observations will
be read from the device.  Set to use the work queue (global) trigger.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-17 13:17:02 -05:00
Peter Bigot 6e5db350b2 coccinelle: standardize k_sleep calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
David B. Kinder 82d6347355 doc: fix broken file and zephyr-app refs
found some references to files (via :zephyr_file: and :zephyr-app:) that
were moved, so the links were broken

Fixes: #19660

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-08 15:42:32 -05:00
Ioannis Konstantelias 656792d58f samples: sensor: tmp116: Add sample for TMP116
Added sample demonstrating the TMP116 temperature sensor.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-10-04 15:31:56 -05:00
Anas Nashif 2d4837061a tests: fix identifiers
Fix identifier and rename plain 'test' to something more appropriate.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 17:20:22 -04:00
Charles E. Youse ce46e0df4d cmake: samples/tests: update cmake_minimum_required() to 3.13.1
Some samples/tests are still referring to 3.8.x versions.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-27 23:09:24 -04:00
Johann Fischer fd8a27a51b samples: amg88xx: update README.rst
Update README.rst

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-17 06:27:21 -05:00
Johann Fischer feef83d864 drivers: amg88xx: rework sensor driver to use DT
Rework sensor driver to use DT.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-09-17 06:27:21 -05:00
Anas Nashif 578ae40761 boards: remove quarl_se_c1000
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Anas Nashif ffaba63b10 boards: remove arduino 101 and related boards
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Anas Nashif 7d309ee733 samples: grove_temperature: cleanup whitelisting
Do not whitelist on boards, rely on features instead. Turns out we do
not need I2C enabled as well.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07:00
Kumar Gala db167c606d dts: Rename LED._GPIO_* -> DT_ALIAS_LED._GPIOS_*
We use the following commands to rename any
LED._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_LED._GPIOS_{CONTROLLER,PIN,FLAGS}

git grep -l LED._GPIO_CONTROLLER | xargs sed -i 's/LED\(.\)_GPIO_CONTROLLER/DT_ALIAS_LED\1_GPIOS_CONTROLLER/g'
git grep -l LED._GPIO_PIN | xargs sed -i 's/LED\(.\)_GPIO_PIN/DT_ALIAS_LED\1_GPIOS_PIN/g'
git grep -l LED._GPIO_FLAGS | xargs sed -i 's/LED\(.\)_GPIO_FLAGS/DT_ALIAS_LED\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-02 08:26:37 -04:00
Henrik Brix Andersen 917890a544 samples: sensors: fxos8700: add support for twr-ke18f board
Add support for the FXOS8700CQ present on the NXP TWR-KE18F
development board. The FXOS8700CQ IRQ lines are not connected by
default on the TWR-KE18F, so only polling (no trigger) is supported.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-07-01 11:41:25 -05:00
Henrik Brix Andersen 506256c7cc samples: sensors: fxos8700: add polling support
Add support for polling the sensor values of the FXOS8700 device when
no trigger (interrupt) is enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-07-01 11:41:25 -05:00
Kumar Gala 284bc9d964 dts: Rename SW._GPIO_* -> DT_ALIAS_SW._GPIOS_*
We use the following commands to rename any
SW._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_SW._GPIOS_{CONTROLLER,PIN,FLAGS}

git grep -l SW._GPIO_CONTROLLER | xargs sed -i 's/SW\(.\)_GPIO_CONTROLLER/DT_ALIAS_SW\1_GPIOS_CONTROLLER/g'
git grep -l SW._GPIO_PIN | xargs sed -i 's/SW\(.\)_GPIO_PIN/DT_ALIAS_SW\1_GPIOS_PIN/g'
git grep -l SW._GPIO_FLAGS | xargs sed -i 's/SW\(.\)_GPIO_FLAGS/DT_ALIAS_SW\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-01 07:14:36 -05:00
Anas Nashif a2fd7d70ec cleanup: include/: move misc/util.h to sys/util.h
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 5eb90ec169 cleanup: include/: move misc/__assert.h to sys/__assert.h
move misc/__assert.h to sys/__assert.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 8c1f89fa99 cleanup: include/: move sensor.h to drivers/sensor.h
move sensor.h to drivers/sensor.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 8f692c7d38 cleanup: include/: move i2c.h to drivers/i2c.h
move i2c.h to drivers/i2c.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Charles E. Youse ca4910827b boards/x86/quark_d2000_crb: drop support for Quark D2000 dev board
Remove the board directory as well as references in tests and samples.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Ulf Magnusson eba81c6e54 yaml: Remove redundant document separators
YAML document separators are needed e.g. when doing

  $ cat doc1.yaml doc2.yaml | <parser>

For the bindings, we never parse concatenated documents. Assume we don't
for any other .yaml files either.

Having document separators in e.g. base.yaml makes !include a bit
confusing, since the !included files are merged and not separate
documents (the merging is done in Python code though, so it makes no
difference for behavior).

The replacement was done with

    $ git ls-files '*.yaml' | \
        xargs sed -i -e '${/\s*\.\.\.\s*/d;}' -e 's/^\s*---\s*$//'

First pattern removes ... at the end of files, second pattern clears a
line with a lone --- on it.

Some redundant blank lines at the end of files were cleared with

    $ git ls-files '*.yaml' | xargs sed -i '${/^\s*$/d}'

This is more about making sure people can understand why every part of a
binding is there than about removing some text.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-19 10:40:10 +02:00
David B. Kinder 6b2cd29223 doc: fix misspellings in documentation
Fix misspellings and doc issues missed during regular reviews (including
some files without a trailing newline)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-06-18 15:08:19 -04:00
Ulf Magnusson a84ded74ea dts: Replace status = "ok" with status = "okay"
The DT spec. only has "okay" and not "ok". The Linux kernel has around
12k "okay"s and 300 "ok"s.

The scripts/dts scripts only check for "disabled", so should be safe re.
those at least.

The replacement was done with

    git ls-files | xargs sed -i 's/status\s*=\s*"ok"/status = "okay"/'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-14 19:51:13 -05:00
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Anas Nashif 51cc6a4ffa samples: grove_light: remove whitelisting
Remove unnecessary whitelisting and fix boards to enable ADC instance
when ADC is configured in.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Anas Nashif efb47ace39 doc: samples: cleanup board reference and layout
Cleanup references to boards in some of the example and use the same
boards through the examples. Other minot cleanups and make the text more
generic and not specific to certain boards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Johann Fischer 808075f53f sample: ti_hdc: whitelist reel_board and nucleo_l496zg
Whitelist reel_board and nucleo_l496zg boards.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-11 10:17:11 -05:00
Nikos Oikonomou 3ae5b65503 samples: added sample for ti_hdc
Added a new sample for TI_HDC driver, tested with nucleo and hdc1080.

Signed-off-by: Nikos Oikonomou <nikoikonomou92@gmail.com>
2019-06-11 10:17:11 -05:00
Bosch Sensortec 992819bc84 samples: sensor: bme680 added sample code
Sample code for the BME680 environmental sensor

Signed-off-by: Bosch Sensortec <github@bosch-sensortec.com>
2019-05-31 10:27:13 -05:00
Brett Witherspoon 07d21bef0d samples: add ADXL362 sensor sample application
Add a sample application that demonstrates how to use the ADXL362 with
data ready and threshold triggers.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-15 13:38:27 -05:00
Aaron Tsui b8285a580e samples: sensor: bme280: add arduino_101_sss.overlay
Add an overlay file, build out of the box for arduino_101 board.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-05-13 08:40:18 -05:00
Aaron Tsui 0b46eb26b4 samples: sensor: bme280: add README.rst
Added BME280 (humidity and pressure sensor) sample documentation for
guiding beginners.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-05-13 08:40:18 -05:00
Maksim Masalski 888f4dd096 samples: LSM6DSL accel fix unchecked return value sensor_trigger_set()
Inside void main(void) result of function sensor_trigger_set() is not
checked which might result that function can't set sensor type
and that error can't be handled.

Coverity-CID: 186196
Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>
2019-05-03 09:22:40 -05:00
Andrei Emeltchenko 1b3227fd99 samples: usb: Correct USB HID device name
Use "HID_0" as a device name since we have only device count now.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Henrik Brix Andersen ae218d2950 samples: sensors: fxos8700: whitelist rv32m1_vega board
Add the RISCV RV32M1 Vega board to the whitelist in the FXOS8700
sample.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-04-22 08:40:03 -05:00
Alexander Wachter f0090825be samples: sensor: ens210: Implement sample for ens210
Sample code for AMS (Austria Micro Systems) ENS210 temperature and
relative humidity sensor.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-04-19 08:37:17 -05:00
Alexander Wachter f989f2d0f9 samples: sensor: ams_iAQcore: Implement sample for AMS iAQ-core
Sample code for AMS (Austria Micro Systems) Indoor Air Quality Sensor
reading VOC and equivalent CO2 values.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-04-19 08:37:17 -05:00
Kumar Gala 6b4007e5ed samples: sensor: bme280: Convert code to use printk
There isn't any specific need to use printf here, convert to use printk
instead.

Fixes #14997

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-04-17 19:49:01 -05:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Anas Nashif 6e6f13c18a samples: fix identifiers for samples
Fix identifiers for tests in samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-01 12:23:09 -04:00
Anas Nashif da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Aaron Tsui 3c45eb45d6 samples: sensor: fix hardware fault when no sensor connected
There are two sensor samples be modified for a more explicit log when
no sensor connected or not connected correctly. Rather than a horrible
hardware fault, which may misleading beginner.

1. bme280
2. sx9500

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-03-28 14:32:17 -05:00
Andrew Boie 435c1a3fe2 samples: bmg169: don't enable CONFIG_LOG
It's not necessary for this sample to output to the user
(it uses printf) and saves over 5K of ROM size, eliminating
some build failures on Quark D2000.

Fixes: #14476

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-18 09:22:50 -07:00
Ramakrishna Pallala e1639b5345 device: Extend device_set_power_state API to support async requests
The existing device_set_power_state() API works only in synchronous
mode and this is not desirable for devices(ex: Gyro) which take
longer time (few 100 mSec) to suspend/resume.

To support async mode, a new callback argument is added to the API.
The device drivers can asynchronously suspend/resume and call the
callback function upon completion of the async request.

This commit adds the missing callback parameter to all the drivers
to make it compliant with the new API.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Andrei Emeltchenko 1b5227ebc9 samples: fxos8700-hid: Use HID Device interface
Refactor sample using new HID Device interface.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Peter A. Bigot aa684363f0 drivers: sht3xd: update to new I2C API
Use the new i2c_write_read() wrapper to simplify the code.

Also add several overlays used to test the sensor on a variety of
boards, and conf file support for trigger testing.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-02-07 22:04:28 -05:00
Andrei Emeltchenko ea98034aab samples: fxos8700-hid: Use HID_MOUSE_REPORT_DESC macro
Use API macro for mouse description.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-05 11:08:24 -05:00
Kumar Gala 2d9afbf423 samples: fxos8700-hid: Don't use CONFIG_ namespace for non Kconfig
The sample was defining a #define with a CONFIG_ prefix but this wasn't
coming from Kconfig.  Change the define name not to conflict with the
Kconfig CONFIG_ namespace.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-01 19:01:16 -05:00