Commit graph

741 commits

Author SHA1 Message Date
Kumar Gala cd35a4a753 sensor: vl53l0x: Convert GPIO XSHUT to device tree
Update vl53l0x dts binding to include GPIO XSHUT pin and change
driver code to get the GPIO pin and controller info from DT instead of
Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-05 15:07:18 -06:00
Kumar Gala b09b773bb5 sensor: nrf5: Convert name to come from device tree
Update the binding for nordic,nrf-temp to require the label property and
use the generated define (DT_INST_0_NORDIC_NRF_TEMP_LABEL) instead of
Kconfig symbol (CONFIG_TEMP_NRF5_NAME).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-05 19:56:28 +01:00
Marcin Niestroj afa5183ee3 sensors: lis2dh: support disabling SDO/SA0 pull-up during init
Some chips supported by lis2dh driver (such as LIS2DH12 and LIS3DH)
contain CTRL_REG0 (1Eh) register to control internal pull-up on SDO/SA0
line (enabled by default). Add disconnect-sdo-sa0-pull-up boolean
device-tree property to allow disconnecting pull-up during driver
initialization. This allows to save around 180uA at 3.6V in
accelerometer power-down mode.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-05 19:40:12 +01:00
Marcin Niestroj d3f2878460 sensors: lis2dh: compile lis2dh_reg_field_update() unconditionally
There is little reason to compile lis2dh_reg_field_update() function
conditionally, based on enabled features. If it is not used, then linker
will drop it anyway.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-05 19:40:12 +01:00
Ulf Magnusson 1f38ea77ba kconfig: Clean up 'config FOO' (two spaces) definitions
Must've been copy-pasted around.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Ulf Magnusson bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Ulf Magnusson 975de21858 kconfig: Global whitespace/consistency cleanup
Clean up space errors and use a consistent style throughout the Kconfig
files. This makes reading the Kconfig files more distraction-free, helps
with grepping, and encourages the same style getting copied around
everywhere (meaning another pass hopefully won't be needed).

Go for the most common style:

 - Indent properties with a single tab, including for choices.

   Properties on choices work exactly the same syntactically as
   properties on symbols, so not sure how the no-indentation thing
   happened.

 - Indent help texts with a tab followed by two spaces

 - Put a space between 'config' and the symbol name, not a tab. This
   also helps when grepping for definitions.

 - Do '# A comment' instead of '#A comment'

I tweaked Kconfiglib a bit to find most of the stuff.

Some help texts were reflowed to 79 columns with 'gq' in Vim as well,
though not all, because I was afraid I'd accidentally mess up
formatting.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-01 15:53:23 +01:00
Jan Van Winkel 0e59f6846f libc: Changed dependencies of NEWLIB_C into !MINIMAL_LIBC
Changed Kconfig dependencies of NEWLIB_C into !MINIMAL_LIBC

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-11-01 14:18:36 +01:00
Peter Bigot f875c3fc48 sensor: lis2dh: support I2C use on Nordic platforms
The default I2C driver on Nordic platforms does not support the I2C
burst operations, so replace those calls with ones that work on the
platform.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-25 11:02:58 -05:00
Ulf Magnusson d5ff890547 sensor: bmg160: Use BMG160_THREAD_PRIORITY instead of ignoring it
The value of BMG160_THREAD_PRIORITY has never been used after the symbol
was added. Use it.

The value defaults to 10 in Kconfig too, so this is a no-op in itself.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-22 14:32:55 -05:00
Ulf Magnusson 677f1e6db9 kconfig: Turn pointless/confusing 'menuconfig's into 'config's
Defining a symbol with 'menuconfig' just tells the menuconfig to display
any dependent symbols that immediately follow it in a separate menu.
'menuconfig' has no effect on symbol values.

Making a symbol that doesn't have any dependent symbols after it a
'menuconfig' should be avoided, because then you end up with an empty
menu, which is shown as e.g.

    [*] Enable foo ---

This is how it would be shown if there were children but they all
happened to be invisible as well.

With a regular 'config', it turns into

    [*] Enable foo

Change all pointless 'menuconfig's to 'config's.

See the section on 'menuconfig' on the Kconfig - Tips and Best Practices
page as well.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-22 13:53:06 -05:00
Alexander Wachter 91818d2c07 drivers: sensors: ens210: fix fractional part calculation
This commit fixes the calculation of the fractional part
for both values.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-22 13:48:12 -05:00
Ulf Magnusson 53c688292a drivers: sensor: ens210: Fix broken CONFIG_ENS210_CRC_CHECK checks
The CONFIG_* prefix was missing, making the #ifdefs always false.

Found with a script (CONFIG_ENS210_CRC_CHECK was unused).

Also make ens210_crc7() static. Guessing it's unused outside this file.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-22 09:44:46 -05:00
Ulf Magnusson a9759d2cab drivers: lsm6dsl: kconfig: Remove unused internal pull-up symbol
Added in commit 180b139786 ("drivers: sensor: lsm6dsl: Adding sensorhub
support"), then never used.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 08:20:59 -05:00
Ulf Magnusson 4310babed8 drivers: sensor: lis2mdl: kconfig: Remove unused fixed ODR symbols
After commit 44f373e806 ("driver/sensor: lis2mdl: make use of STdC
definitions"), the code only looks at LIS2MDL_MAG_ODR_RUNTIME, and not
at the LIS2MDL_MAG_ODR_<frequency> symbols.

LIS2MDL_MAG_ODR_RUNTIME is now a yes/no thing in practice, so remove the
choice and turn it into a regular bool symbol.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-10-21 08:20:23 -05:00
Peter Bigot 9e473f9fea drivers: sensor: lsm6dsl: correct initialization order
The function that initializes interrupts configures the sensor
register to enable interrupts.  It is called before the function that
resets the sensor.  Swap the order.

Also correct the mask argument to the configuration command, and use
the BIT() macro to construct the set argument.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-17 13:17:02 -05:00
Armando Visconti dc9e297e09 modules/hal_st: Align sensor drivers to stmemsc HAL i/f v1.02
Align all sensor drivers that are using stmemsc (STdC) HAL i/f
to new APIs of stmemsc v1.02.

Requires https://github.com/zephyrproject-rtos/hal_st/pull/3

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-10-17 13:07:50 -05:00
Iosif Macesanu 24508a777d drivers: sensor: Add OPT3001 light sensor driver
Add OPT3001 light sensor driver

Signed-off-by: Iosif Macesanu <iosif@actinius.com>
2019-10-16 14:51:07 -05:00
Iosif Macesanu 884485667d drivers: sensor: Add SI7060 temperature sensor driver
Add SI7060 temperature sensor driver

Signed-off-by: Iosif Macesanu <iosif@actinius.com>
2019-10-16 14:48:12 -05:00
Marcin Niestroj 74fc8fe071 sensor: lis2dh: fix SPI burst transfers
After switching to new SPI API there is no need to reserve first dummy
byte in buffer and ignore that in application later on. Instead two
buffers can be specified, which is how it is done already in lis2dh
driver. The problem is that dummy byte is still part of the buffer, but
it clearly should no longer be. As an example we write 0x7 (bits to
enable XYZ axes) into CTRL2 instead of CTRL1 register. When reading
measurements on the other hand we have filled buffer starting from 0,
instead of 1 as the driver code has expected.

Fix driver in all places that use burst transfers by removing first
dummy byte from input/output buffer.

Fixes: 2f7e6b6d42 ("drivers/sensors: Switch lis2dh driver to new SPI
  API")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-10-14 17:16:03 -05:00
Krzysztof Chruscinski ac417abdf0 drivers: sensors: Fix log module registration
All sensors were using legacy log module registeration method
where LOG_LEVEL was defined before registeration. This method
was error prone as it requires preserving includes order.

Replaced with LOG_MODULE_REGISTER(foo, level).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-11 07:33:08 -05:00
Peter Bigot e28f330a8e coccinelle: standardize k_thread create/define calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments
to k_thread_create and K_THREAD_DEFINE to use the standard timeout
macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04: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
Ioannis Konstantelias 556cf41021 drivers: sensor: Add TMP116
Added driver for TI's TMP116. This driver does not use the Alert
functionality.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-10-04 15:31:56 -05:00
Krzysztof Chruscinski 6700f2f194 drivers: clock_control: nrf: reimplementation including API updates
Reimplementation of clock control driver for nrf platform. It includes
latest API changes: asynchronous starting and getting clock status.

Additionally, it implements calibration algorithm which optionally
skips calibration based on no temperature change. Internal temperature
sensor is used for that.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-10-04 17:15:39 +02:00
Peter Bigot ab91eef23b coccinelle: standardize kernel API timeout arguments
Use the int_literal_to_timeout Coccinelle script to convert literal
integer arguments for kernel API timeout parameters to the standard
timeout value representations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-03 11:55:44 -07:00
Armando Visconti 82b9172718 driver/sensor: lis2mdl: remove sensitivity
LIS2MDL sensor has a fixed sensitivity equal to 1500 uGauss/LSB.
So, use a constant value directly.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-26 13:42:59 -07:00
Armando Visconti 44f373e806 driver/sensor: lis2mdl: make use of STdC definitions
Port the lis2mdl sensor driver on top of the lis2mdl_StdC
HAL interface (in modules/hal/st/sensor/stmemsc/).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-26 13:42:59 -07:00
Armando Visconti a34a5885b8 driver/sensor: lis2mdl: change order of operations in trigger init
Creation of callback thread is moved before the enabling of
the callback itself.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-26 13:42:59 -07:00
Armando Visconti 89199dcbaf driver/sensor: lis2mdl: Fix the temperature fractional value
The temperature fractional value has to be assigned multiplied
by 10^6.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-26 13:42:59 -07:00
Andrzej Głąbek c24c463328 soc: nordic: Include <nrfx.h> instead of <nrf.h> from <soc.h>
This change is done so that there is no need to additionaly include
<nrfx.h> before <soc/nrfx_coredep.h> (what might be a bit surprising)
and so that <nrfx_config.h> doesn't need to be include separately for
nRF SoCs requiring a special mapping of peripheral accessing symbols.

This commit removes also no longer needed inclusions and updates
the hal_nordic module with required minor correction of nrfx_glue.h.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Andrzej Głąbek 57c6cfc9cd nordic: Use hal/ in all inclusions of nrfx HAL header files
Header files of nrfx HALs are not supposed to be included directly
but only with their names prepended with the hal/ directory (so that
an inclusion of an nrfx HAL header clearly differs from an inclusion
of an nrfx driver header).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Peter Bigot d566254e3f drivers: fix k_thread_create timeout argument
Use the named representation for no-wait to future-proof against a
change to the representation of timeout values.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-09-19 17:35:53 +02:00
Armando Visconti c79925bd0f driver/sensor: IIS3DHHC: Fix DT_ macro typo for CS GPIO
The correct suffix name for selecting the GPIO for SPI Chip Select
is _CS_GPIOS_CONTROLLER and not _CS_GPIO_CONTROLLER.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-19 09:47:45 -05:00
Michał Oleszczyk 2663f71c6a drivers/sensor: lis2dw12: fix for wrong gpio_callback handling
It seems that gpio_pin_disable_callback() has never been working
for that sensor as it was expected. We used there argument 'dev'
as its own (lis2dw12) device pointer. While this argument is a
gpio_port device pointer not lis2dw12 sensor device pointer. So
cfg->int_gpio_pin always tries to disable callback for some random
pin read from accidental data sector.

Signed-off-by: Michał Oleszczyk <oleszczyk.m@gmail.com>
2019-09-19 08:04:05 -05:00
Michał Oleszczyk da4d00ee0a drivers/sensor: sht3xd: implement single shot mode
For now there is only periodic data acquisition mode implemented.
This mode is quite power consuming. Based on datasheet in idle
state in periodic data acquisition mode SHT3X consumes 45uA but
in single shot mode 0.2uA. For many applications where power
consumption has to be kept as low as possible single shot mode
is the only choice. Tester on custom board NRF52832 + SHT31-DIS.

Signed-off-by: Michał Oleszczyk <oleszczyk.m@gmail.com>
2019-09-18 18:03:32 -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
Armando Visconti 871d132577 driver/sensor: add IIS3DHHC accelerometer sensor
Add support to STM IIS3DHHC the ultra-low noise, high-stability
three-axis linear accelerometer.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-16 14:07:56 -05:00
Kumar Gala c17297c18a drivers: ens210: Fix error in header guard
Looks like some copy/paste bug snuck in.  Fix the include header guard
to define the proper name.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-12 22:04:55 -05:00
Erwan Gouriou 21d39eff6c dts/Kconfig: Remove symbol HAS_DTS_QDEC.
Symbol not used, so clean it up.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-12 08:16:42 -05:00
Erwan Gouriou 555936f771 dts/Kconfig: Remove unused HAS_DTS_SPI
Symbol is always "and'ed" with the symbol that
selects it, so no effect. Clean it up.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-12 08:16:42 -05:00
Armando Visconti b7944510a4 dts/bindings: sensors: remove '-magn' extension from lis2mdl name
The LIS2MDL is not a combo device, but pure magnotemeter.
Hence, '-magn' extension is not adding information and can
be removed from dts compatible name as well as binding filename.

Instead specify '-i2c' or '-spi' to distinguish between the names.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-12 07:58:34 -05:00
Andy Ross 075c94f6e2 kernel: Port remaining syscalls to new API
These calls are not accessible in CI test, nor do they get built on
common platforms (in at least one case I found a typo which proved the
code was truly unused).  These changes are blind, so live in a
separate commit.  But the nature of the port is mechanical, all other
syscalls in the system work fine, and any errors should be easily
corrected.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-09-12 11:31:50 +08:00
Michał Oleszczyk e4ed17472f driver/sensor: lis2dw12: single/double tap trigger implementation
Implementation for two new interrupt triggers: single tap and
double tap. Add new Kconfig options to configure those triggers:
trigger mode (single/single and double), latency/quiet/shock time,
threshold levels, active axes.

Signed-off-by: Michał Oleszczyk <oleszczyk.m@gmail.com>
2019-09-09 10:52:57 -05:00
Vaishali Pathak 0923ae4172 drivers: sensors: Add Si7006 temperature/humidity sensor driver
Adds driver for Silicon Labs Si7006 chip.

Signed-off-by: Vaishali Pathak <vaishali@electronut.in>
2019-08-06 15:05:25 -05:00
Armando Visconti 6dceb4987e driver/sensor/lsm6dso: Fix deprecated macros CS_GPIO_* to CS_GPIOS_*
The lsm6dso driver was in pre-merging state when a614a026
was committed. So, let's make the modification manually.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-08-06 11:09:34 -04:00
Armando Visconti 9e5c97edae driver/sensor: add STTS751 temperature sensor
Add support to STM STTS751 temperature sensor.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-07-31 10:32:10 -04:00
Marcin Niestroj 710f9e7b3e sensors: lis2dh: support high resolution mode
So far we supported normal (10 bit) and low-power (8 bit) modes. Add
support for high-resolution mode as a third option.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-07-23 10:52:08 +02:00
Kumar Gala c016cd2c4e sensor: lis2dh: Fix stray use of old DT define
Convert old DT_ST_LIS2DH_0_BUS_SPI to DT_ST_LIS2DH_BUS_SPI.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-10 10:25:21 -05:00
Armando Visconti 72ae24d8d5 driver/sensor: lsm6dso: Add support
Add support to STM LSM6DSO 6-axis IMU sensor driver.
This driver supports communication with device though both
I2C and SPI bus and both polling and drdy trigger mode.

This driver supports also the sensorhub mode with the possibility
to connect a maximum of two external devices, typically a
magnetometer and an environmental sensor, currently selected among
following devices: lis2mdl magnetometer, lps22hh or lps22hb
pressure and temperature sensors, HTS221 humidity sensor.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-07-03 12:17:43 -05:00
Armando Visconti 9dbdd81abe driver/sensor: add LPS22HH sensor support
Add support to STM LPS22HH pressure and temperature sensor.
The driver support I2C and SPI bus communication and both
polling and drdy trigger mode.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-07-03 11:59:17 -05:00
Andy Ross 17051e42d6 drivers/sensor/hp206c: Clarify tick rate warning
The default tick rate is now 10 kHz, but that driver was demanding
that it be exactly 1 kHz instead of at least that rate.  I checked the
source, and the driver isn't actually extracting "ticks" from the
kernel illegally, it just needs fine-grained timers that work with the
existing millisecond API.  Let it build, this is fine.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04:00
Krzysztof Chruscinski f1b349aa72 drivers: sensor: temp_nrf5: Code cleanup
Reworked nrf5 internal temperature sensor driver to use hal

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-07-02 15:54:25 -04: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 5d001f3e41 cleanup: include/: move misc/byteorder.h to sys/byteorder.h
move misc/byteorder.h to sys/byteorder.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 d1b2718687 cleanup: include/: move uart.h to drivers/uart.h
move uart.h to drivers/uart.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 bd70f6f1ed cleanup: include/: move spi.h to drivers/spi.h
move spi.h to drivers/spi.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
Anas Nashif 17ddd1714c cleanup: include/: move clock_control.h to drivers/clock_control.h
move clock_control.h to drivers/clock_control.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 f4709f2c2f cleanup: include/: move adc.h to drivers/adc.h
move adc.h to drivers/adc.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
Kumar Gala a614a026b7 dts: Rename DT_.*_GPIO_* to DT_.*_GPIOS_*
Convert DT_.*_GPIO_{CONTROLLER,PIN,FLAGS} ->
	DT_.*_GPIOS_{CONTROLLER,PIN,FLAGS)

Used the following commands to make these conversions:

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

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-27 13:02:34 -05:00
Robert Lubos 7bf0124adf drivers: sensor: Update DT symbols in qdec_nrfx driver
Currently used IRQ DT symbols became deprecated.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-06-27 07:16:33 -04:00
Armando Visconti ab4f280661 driver/sensor: lis2dw12: make use of STdC definitions
Port the lis2dw12 sensor driver on top of the lis2dw12_StdC
HAL interface (in modules/hal/st/sensor/stmemsc/).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-06-26 15:41:40 -04:00
Kumar Gala 0a99f53c80 sensor: lis2dh: Use general DT_<COMPAT>_BUS_<BUS> define.
Match what other drivers are doing and use the general BUS define.
Change DT_ST_LIS2DH_0_BUS_SPI to DT_ST_LIS2DH_BUS_SPI

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-24 07:28:19 -05:00
Anas Nashif f2cb20c772 docs: fix misspelling across the tree
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-19 15:34: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
Nikos Oikonomou 8617df1e64 sensors: ti_hdc simplified ti_hdc_channel_get
Removed unneeded second temporary variable, used for humidity conversion

Signed-off-by: Nikos Oikonomou <nikoikonomou92@gmail.com>
2019-06-11 10:17:11 -05:00
Nikos Oikonomou e7dbc1d770 sensors: ti_hdc now supports 1050 versions
TI_HDC Driver now also supports the 1050 (e.g. hdc1050, hdc1080) temp/rh
sensor versions.

Signed-off-by: Nikos Oikonomou <nikoikonomou92@gmail.com>
2019-06-11 10:17:11 -05:00
Nikos Oikonomou 080e71c908 sensors: ti_hdc driver wait conversion support
TI_HDC Driver now also supports waiting for conversion to finish instead
of waiting for GPIO interrupt.

Signed-off-by: Nikos Oikonomou <nikoikonomou92@gmail.com>
2019-06-11 10:17:11 -05:00
Nikos Oikonomou 4a38cae2af sensors: renamed hdc1008 driver into ti_hdc
Hdc1008 driver is renamed into ti_hdc to prepare it to support all
available Texas Instruments HDC sensors (e.g. hdc1080, hdc2080).

Signed-off-by: Nikos Oikonomou <nikoikonomou92@gmail.com>
2019-06-11 10:17:11 -05:00
Anas Nashif 4c32258606 style: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
Johann Fischer 2204193bdb drivers: apds9960: allow additional LED current configuration
Allow additional proximity LED current configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-05 07:48:58 -05:00
Johann Fischer df3796a724 drivers: apds9960: make proximity pulse length configurable
Make proximity pulse length and pulse count configurable.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-05 07:48:58 -05:00
Johann Fischer 67ae508459 drivers: apds9960: make ALS and proximity gain configurable
Make ALS and proximity gain configurable.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-05 07:48:58 -05:00
Johann Fischer 3bbd102844 drivers: apds9960: allow to disable Ambient Light Sense
Allow to disable Ambient Light Sense (ALS) if measurement is
not necessary.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-05 07:48:58 -05:00
Bosch Sensortec b05d5ffc46 driver: sensor: bme680 added support
Added support for the BME680 environmental sensor

Signed-off-by: Bosch Sensortec <github@bosch-sensortec.com>
2019-05-31 10:27:13 -05:00
Brett Witherspoon 626349f16f drivers: adxl362: use burst transfer
It is recommended that multibyte (burst) transfers are used to read
acceleration and temperature data. This ensures the data is concurrent
and complete.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-23 06:55:38 -05:00
Brett Witherspoon 1becd75604 drivers: adxl362: rework temperature conversion
This commit consolidates the temperature conversion into a single
location and subtracts the bias from the measurement using values from
the datasheet. Also magic numbers have been replaced with more
descriptive macros.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-21 14:26:31 -05:00
Brett Witherspoon 935efeb0ce drivers: adxl362: fix acceleration sample conversion
This driver uses magic numbers which are incorrect. A correct conversion
is done using the LSB/g scale factors given by Table 1 in the
specifications section of the ADXL362 (Rev. F) datasheet. The entire
conversion has also been consolidated into a signal function.

The sensitivity and offset of the accelerometer values actually vary
with the supply voltage and temperature. Using datasheet provided values
for 25 C and 2.0 V is the best we can do. Users will need to apply
sensitivity and offset corrections for their application.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-21 14:26:31 -05:00
Brett Witherspoon 4cc486ec4f drivers: adxl362: fix control flow issue
The return code check and error return on the interrupt register
configuration function call should be included in the #if defined
region.

Fixes #16159

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-21 14:20:42 -05:00
Brett Witherspoon a5327b0003 drivers: adxl362: clear status independently and before mapping
Clear status bits before mapping them to the interrupt pin, so the
interrupt will occur on the next event instead of a pending event. Also
the status bits are cleared independently, because the threshold and
data ready functions can be enabled simultaneously.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-13 09:53:04 -05:00
Brett Witherspoon ed474e88bd drivers: adxl362: check interrupt status
Check the status and only execute the callback if the event has
occurred.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-13 09:53:04 -05:00
Brett Witherspoon 0e9257018c drivers: adxl362: don't disable callbacks
Enabling and disabling the GPIO callbacks is error prone and unnecessary
since the trigger data is protected with a mutex, so it has been
removed. This resolves the following issues:

- The GPIO callbacks are not being re-enabled properly in the error path
  of the trigger setting function.

- The device pointer used in the GPIO callback to retrieve the ADXL362
  driver configuration data is the GPIO device not the ADXL362 device,
  so this cast is invalid and the int_gpio field is garbage.

- There are potential timing issues between enabling interrupts and
  re-enabling the callbacks.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-13 09:53:04 -05:00
Brett Witherspoon cddb3a1e34 drivers: adxl362: use Kconfig for interrupt mode
Commit 11295c1 added Kconfig options for interrupt mode, but then hard
coded the interrupt mode. This commit uses the Kconfig option to set
the interrupt mode.

Applications expecting the interrupt mode to be something other than
the default will need to be updated.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-08 12:00:17 -05:00
Brett Witherspoon ae9905232c drivers: adxl362: don't skip mutex unlocking in error path
The default case of the switch statement jumps over the unlocking of the
trigger mutex. This has been fixed with more granular locking which has
the added benefit of being more explicit about what is being protected.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-08 11:58:07 -05:00
Brett Witherspoon bfea453693 drivers: adxl362: use logger API
Use logger API instead of printk.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-04 09:54:26 -04:00
Henrik Malvik Halvorsen 11295c190b drivers: sensor: Add ADXL362 interrupt handling
The ADXL362 driver is expanded to support interrupt handling.

Signed-off-by: Henrik Malvik Halvorsen <henrik.halvorsen@nordicsemi.no>
2019-05-03 09:11:51 -05:00
Alexander Wachter f29ec12f21 drivers: sensor: ens210: Implement AMS ens210 Sensor
Implementation of 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 3c70a3832d drivers: sensor: ams_iAQcore: Implemented ASM Indoor Air Quality Sensor
Implementation of AMS (Austria Micro Systems) Indoor Air Quality Sensor

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-04-19 08:37:17 -05:00
Henrik Brix Andersen 917cb432ee sensor: fxos8700: add support for hardware reset pin
Add support for pulsing the hardware reset pin of the FXOS8700 high
during initialization.

According to the datasheet, this is required for the I2C/SPI bus
auto-detection logic to work properly if the VDD/VDDIO power
sequencing order cannot be guaranteed.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-04-18 09:22:56 -04:00
William Fish 1e5e8829c7 drivers: sensor: APDS9660 WhoAmI check logic
APDS9660 sensor driver missing WhoAmI check

signed-off-by: William Fish <william.fish@manulytica.com>
2019-04-18 09:15:56 -04: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
Patrik Flykt 21358baa72 all: Update unsigend 'U' suffix due to multiplication
As the multiplication rule is updated, new unsigned suffixes
are added in the code.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05: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
Maureen Helm 0cff42fe9d drivers: sensor: Refactor apds9960 to use const config struct
Refactors the apds9960 sensor driver to get the i2c device name, i2c
device address, gpio device name, and gpio pin from a constant device
configuration structure, rather than using hardcoded macros. This will
make it easier to change the names of the macros and to instantiate
multiple instances of the driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-15 10:30:53 -05:00
Henrik Malvik Halvorsen 627fdd67f3 drivers: sensor: ADXL362 data conversion fix
The ADXL362 sensor data is converted to the expected
output, m/s^2.

Signed-off-by: Henrik Malvik Halvorsen <henrik.halvorsen@nordicsemi.no>
2019-03-15 09:25:58 -05:00
Henrik Malvik Halvorsen 64fd822652 drivers: sensor: adxl362: Driver update and CS support
Updated to add support for CS. DT config names updated
to adhere to the DTS naming convention. Init and SPI
configuration now follows the device datasheet.

Signed-off-by: Henrik Malvik Halvorsen <henrik.halvorsen@nordicsemi.no>
2019-03-15 07:39:05 -05: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
Ulf Magnusson 53376394b7 kconfig: Remove blank lines at the beginning/end of files
Maybe this is some "just in case" thing that got copied around. There's
no need to have a blank line at the beginning or end of Kconfig files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-13 07:29:42 -05:00
Gaute Gamnes 6af7856a66 drivers: nrf5: temp: Cleanup temp_nrf5.c source
1. Remove nrf_common.h include
2. Remove unnecessary NRF_*Type defines, using
   CMSIS NRF_TEMP define directly instead.
3. Align driver code by including DEVICE_DECLARE,
   and moving DEVICE_AND_API_INIT() to the bottom.

Signed-off-by: Gaute Gamnes <gaute.gamnes@nordicsemi.no>
2019-03-12 13:33:36 +01:00
Gaute Gamnes f4f98981d7 drivers: nrf5: temp: Migrate Kconfig priority option to DT
1. Kconfig options priority setting removed.
2. Modified temp_nrf5.c driver to use DT
   defines instead of Kconfig.

Signed-off-by: Gaute Gamnes <gaute.gamnes@nordicsemi.no>
2019-03-12 13:33:36 +01:00
Armando Visconti 599bda3745 driver/sensor: lis2mdl: (FIX) change 'uint32_t' type into 'u32_t'
In zephyr drivers should always use u32_t.
Using uint32_t here generates issues in the CI when NEWLIB_LIBC
is defined.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-03-11 22:06:37 -07:00
Patrik Flykt 4344e27c26 all: Update reserved function names
Update reserved function names starting with one underscore, replacing
them as follows:
   '_k_' with 'z_'
   '_K_' with 'Z_'
   '_handler_' with 'z_handl_'
   '_Cstart' with 'z_cstart'
   '_Swap' with 'z_swap'

This renaming is done on both global and those static function names
in kernel/include and include/. Other static function names in kernel/
are renamed by removing the leading underscore. Other function names
not starting with any prefix listed above are renamed starting with
a 'z_' or 'Z_' prefix.

Function names starting with two or three leading underscores are not
automatcally renamed since these names will collide with the variants
with two or three leading underscores.

Various generator scripts have also been updated as well as perf,
linker and usb files. These are
   drivers/serial/uart_handlers.c
   include/linker/kobject-text.ld
   kernel/include/syscall_handler.h
   scripts/gen_kobject_list.py
   scripts/gen_syscall_header.py

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-11 13:48:42 -04:00
Ulf Magnusson e3ce7a62a4 kconfig: drivers: sensor: Remove redundant dependencies
Most of these are from 'source'ing drivers/sensor/grove/Kconfig within
an 'if SENSOR' (in drivers/sensor/Kconfig), and then adding another 'if
SENSOR' within it.

'if FOO' is just shorthand for adding 'depends on FOO' to each item
within the 'if'. Dependencies on menus work similarly. There are no
"conditional includes" in Kconfig, so 'if FOO' has no special meaning
around a source. Conditional includes wouldn't be possible, because an
if condition could include (directly or indirectly) forward references
to symbols not defined yet.

Tip: When adding a symbol, check its dependencies in the menuconfig
('ninja menuconfig', then / to jump to the symbol). The menuconfig also
shows how the file with the symbol got included, so if you see
duplicated dependencies, it's easy to hunt down where they come from.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-09 09:57:44 -05:00
Piotr Zięcik d30c9aeafd drivers: nrf_power_clock: Migrate to DTS.
This commit migrates the nrf_power_clock driver to DTS.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-25 17:51:24 +01:00
Erwan Gouriou c55c188e68 drivers/sensor/vl53l0x: Remove unnecessary lib include check
vl53l0x driver is using an external library to build, located under:
ext/hal/st/lib/sensor/vl53l0x.
This library is expecting stdint.h lib to be available and to
secure this for driver library inclusion work, a stdint.h file
header check was done. This check was based on assumptions on possible
header names for stdint.h.
Due to recent renaming of the zephyr header files, this check was
returning a false positive, generating warning at compilation.

Rather than updated with new header names, remove this check, since
driver porting is completed and stdint.h inclusion is actually
done.

Fixes #10134

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-19 07:48:10 -06:00
Johann Fischer 70776028f5 drivers: apds9960: fix ALS in non-trigger mode
Generate interrupt on every ALS cycle in non-trigger mode
and enable ALS saturation interrupt.

resolves: #11989

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-02-13 22:10:21 -06:00
Armando Visconti 208f565bce driver/sensor: add LIS2DW12 sensor support
Add support to STM LIS2DW12 3-axis accelerometer driver.
The driver support I2C and SPI bus communication and both
polling and drdy trigger mode.

Co-authored-by: Mario Tesi <mario.tesi@st.com>
Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-02-08 15:22:42 -06: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
Kumar Gala 4520237ef5 sensors: adxl372: Fixup SPI CS handling
Replace undefined Kconfig SPI CS defines with DTS based defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-06 14:01:51 -06:00
Kumar Gala 2d90772244 sensor: lis2ds12: Fixup SPI CS handling
Replace undefined Kconfig SPI CS defines with DTS based defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-04 08:17:08 -06:00
Armando Visconti 37e77f942a driver/sensor: lps25hb: align driver to auto-generated dts macros
Use auto-generated device tree macros in LPS25HB driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-02-01 04:19:42 -06:00
Armando Visconti 396ffbd86d driver/sensor: lsm6ds0: align driver to auto-generated dts macros
Use auto-generated device tree macros in LSM6DS0 driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-02-01 04:19:42 -06:00
Kumar Gala e0349fb421 sensor: lsm6dsl: Fixup SPI CS handling
Replace undefined Kconfig SPI CS defines with DTS based defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-01 04:11:23 -06:00
Kumar Gala 13fd996178 sensor: lsm9ds0: Remove unused define/Kconfig symbol
We use DT to get the I2C address, so the define that got it from a
Kconfig sybmol isn't used and the Kconfig symbol isnt defined.  Remove
this dead code.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 09:10:29 -06:00
Kumar Gala 1d210dc2d8 sensor: adxl372: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert adxl372 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 17:51:25 -06:00
Kumar Gala 8de6778e90 sensor: lis2dh: Fix gcc8 compiler warning
We get the following warning with sdk-ng:

	drivers/sensor/lis2dh/lis2dh.c:210:38: error: bitwise comparison
	always evaluates to false [-Werror=tautological-compare]

	if ((value & LIS2DH_LP_EN_BIT_MASK) == 1 && ...
                                      ^~
The test needs to be:
	(value & LIS2DH_LP_EN_BIT_MASK) == LIS2DH_LP_EN_BIT_MASK

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 17:19:41 -06:00
Kumar Gala 4f334970ad sensor: adt7420: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert adt7420 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 08:08:03 -06:00
Kumar Gala cdc1b1f103 sensor: ccs811: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ccs811 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 02:53:35 -06:00
Kumar Gala d7b7dbd910 sensor: apds9960: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert apds9960 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 16:03:21 -06:00
Kumar Gala 1300f5bd9e sensor: ms5837: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ms5837 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 15:26:28 -06:00
Peter A. Bigot 5147ab74da drivers: sensors: hts221: move static definition out of header
This belongs in the implementation file that references the array, since
the header is included in multiple files.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-29 17:50:02 +01:00
Peter A. Bigot 4cd19eaeee drivers: sensor: hts221: correct bit for CTRL_REG1.BDU
Setting bit 3 instead of bit 2 modifies a reserved section of the
register, with the impact that the ODR is not as configured.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-29 17:50:02 +01:00
Peter A. Bigot 9f15116fd7 drivers: sensor: hts221: correct default log configuration
Incorrect symbol used for default.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-29 17:50:02 +01:00
Armando Visconti 42c7e8873c driver/sensor: lis3mdl: align driver to auto-generated dts macros
Use auto-generated device tree macros in LIS3MDL driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-28 10:01:19 -06:00
Armando Visconti a3ae11f897 driver/sensor: lis2mdl: align driver to auto-generated dts macros
Use auto-generated device tree macros in LIS2MDL driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-28 10:01:19 -06:00
Armando Visconti 5ad0d27bd1 driver/sensor: lsm6dsl: Fix attribute setting for gyroscope fs
The API for setting the gyroscope full scale attruibute requires
the argument in radians/s.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-28 10:01:19 -06:00
Armando Visconti c81efe25d5 driver/sensor: lsm6dsl: align driver to auto-generated dts macros
Use auto-generated device tree macros in LSM6DSL driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-28 10:01:19 -06:00
Johann Fischer 65087aa99e drivers: hdc1008: add macros for manufacturer and device IDs
Add macros for HDC1008 manufacturer and device IDs.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-01-26 12:08:52 -05:00
Johann Fischer f36fe23e65 sensor: hdc1008: convert to DT_<COMPAT>_<INSTANCE> defines
Convert hdc1008 sensor driver to use new defines.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-01-26 12:08:52 -05:00
Armando Visconti 797ecde958 sensor/lis2mdl: use kconfig named choice for TRIGGER_MODE
Use Kconfig named choice for TRIGGER_MODE in order to easy
up the trigger mode selection in default configurations
for boards using this sensor driver.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 09:38:08 -06:00
Armando Visconti 3ab122d293 driver: sensor: lps22hb: fix the temp sensor fractional value
Fix the temperature sensor fractional value.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 09:38:08 -06:00
Armando Visconti aca8ae3fd4 driver/sensor: use lis2dh as common driver among multiple sensors
Share lis2dh driver among few accelerometer sensors that has
same register interface: LIS2DH, LIS3DH, LSM303DLHC, LIS2DH12,
LSM303AGR.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 07:26:16 -06:00
Armando Visconti e35f36966b driver/sensor: lis2dh: align driver to auto-generated dts macros
Use auto-generated device tree macros in LIS2DH driver to avoid
usage of dts.fixup files. The triggered interrupt part has been
slightly hacked to automatically understand whether only int1 is
configured or both int1 and int2.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 07:26:16 -06:00
Armando Visconti fdce786c07 driver/sensor: add LIS2DS12 sensor support
Add support to STM LIS2DS12 3-axis accelerometer driver.
The driver support I2C and SPI bus communication and both
polling and drdy trigger mode.
Currently it uses high resolution only as power mode.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-22 08:48:40 -06:00
Kumar Gala affc1ed253 sensor: bmi160: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert bmi160 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 12:53:53 -06:00
Kumar Gala 31dad5b411 sensor: vl53l0x: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert vl53l0x sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 12:52:14 -06:00
Kumar Gala 957c3009a6 sensor: max30101: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert max30101 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 12:50:12 -06:00
Peter A. Bigot 12836d9280 drivers: sensors: sht3xd: support multiple devices and DT bindings
Add a configuration structure to sht3xd that holds instance-specific
parameters, implemented in a immutable statically allocated object
initialized with material from device tree binding aliases.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-18 09:43:14 -06:00
Peter A. Bigot ec6509504d drivers: sensors: sht3xd: uncrustify
Run this through the code formatter.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-18 09:43:14 -06:00
Peter A. Bigot 98cc93952d drivers: sensors: sht3xd: move object definitions out of header
These belong in the driver implementation file.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-18 09:43:14 -06:00
Kumar Gala 7b9bf08dce sensor: lps22hb: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert lps22hb sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 09:38:31 -06:00
Kumar Gala 8f04f81e97 sensor: fxas21002: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert fxas21002 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 08:54:31 -06:00
Kumar Gala 5431762769 sensor: fxos8700: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert fxos8700 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 13:29:46 -06:00
Kumar Gala 689ad43b62 sensor: hts221: Move GPIO to device tree
Move how we configure the DRDY gpio line to device tree from Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 11:06:38 -06:00
Kumar Gala c77a322c6e sensors: hts221: Get I2C address from device tree
Change driver to get I2C address of sensor from the device tree like
most other sensor drivers that utilize device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 11:06:38 -06:00
Kumar Gala a5e8921de9 sensors: hts221: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert hts221 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 11:06:38 -06:00
Kumar Gala efd31af624 sensors: lsm303dlhc: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert lsm303dlhc_accel & lsm303dlhc_magn sensor driver to use new
defines so we can remove the dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-16 21:33:16 -05:00
Kumar Gala be2b6f870d sensor: bme280: Converting to using device tree
Convert the BME280 driver to use device tree and new DT_<COMPAT>
defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-16 12:39:37 -06:00
Armando Visconti 16891af7a7 drivers/sensor: lis2dh: Fix LP Enable bit mask
Fix the value for Low Power Enable (LP_EN) bit mask.
(Issue described by Coverity CID #188734)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-16 12:27:05 -06:00
Varun Sharma 77c643a5a3 drivers: Modify drivers to use DEVICE_AND_API_INIT()
Modified drivers to use DEVICE_AND_API_INIT() instead of DEVICE_INIT()

This will make sure driver_api,is populated at build time and is exposed
to user space

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2019-01-15 10:39:34 -08:00
Ioannis Glaropoulos 302a746bd6 drivers: clock control: nrf: rename CLOCK_CONTROL_NRF5 Kconfig symbol
This commit renames the CLOCK_CONTROL_NRF5 Kconfig symbol to
CLOCK_CONTROL_NRF. The change is required to aleviates confusion
when selecting the symbol in nRF9160 SOC definition.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-01-15 18:03:24 +01:00
Armando Visconti f300dedcc1 drivers/sensor/lsm6dsl: Use DT defines to select I2C/SPI bus
Remove configuration parameter CONFIG_BUS_TYPE. Now we may
make use of DT_ST_LSM6DSL_BUS_I2C and DT_ST_LSM6DSL_BUS_SPI
definition to select the bus.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-08 09:15:51 -06:00
Armando Visconti b75a05cae6 driver: sensors: convert lsm9ds0_gyro to use information coming from dts
Convert lsm9ds0_gyro driver to get the device name as well as
i2c slave information and gpio info for triggers from device tree.
Updates the build_all test accordingly.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-20 12:35:46 +01:00
Dhananjay Gundapu Jayakrishnan bfe0c2e748 drivers: sensor: temp_nrf5: update assert condition in nRF temp sensor
nRF 16MHz clock is used by both BLE radio and temperature sensor.
During BLE connection if the temperature sensor is also used then
at some point assert condition is hit in temp_nrf5_sample_fetch().
The error code -EBUSY seen during clock_control_off() is that clock
is no longer needed for the temperature sensor, but it cannot be
just turned off because it is still needed for BLE connection.

Signed-off-by: Dhananjay Gundapu Jayakrishnan <dhananjay.jayakrishnan@proglove.de>
2018-12-19 09:03:47 -06:00
Armando Visconti 4446b16e24 driver: sensors: convert lsm9ds0_mfd to use information coming from dts
Convert lsm9ds0_mfd accel/magn driver to get the device name as well
as i2c slave information from device tree. Updates the build_all
test accordingly.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-19 07:31:18 -06:00
Armando Visconti 6e2a1b62c4 drivers: lsm9ds0_mfd: Fix typo in get accel/magn channels
Fixed channel type in get accel/magn channel routines,
where, by mistake, GYRO definitions were used instead of
ACCEL/MAGN ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-19 07:31:18 -06:00
Armando Visconti ec47b7cd7d sensors: convert lis2mdl to use information coming from dts
Convert lis2mdl magnetometer driver to get the device name as well
as i2c slave information from device tree. Updates the build_all
test accordingly.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-11 08:11:11 -06:00
Armando Visconti e721b498ce drivers/lis3dh: Add symbol to TRIGGER_MODE config choice
Add symbolic names to trigger mode (LIS3DH_TRIGGER_MODE) in order to
be defined in board defconfig files.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-07 10:43:13 -05:00
Armando Visconti 7dbbb07f07 sensors: convert lis3dh to use information coming from dts
Convert lis3dh accelerometer driver to get the device name as well
as i2c slave information from device tree. Updates the build_all
test accordingly.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-07 10:43:13 -05:00
Armando Visconti 802ad61aba drivers: sensors: lis2dh: Fix out-of-bound access
FIX issue #10571 and #10593
atomic_xxx() functions expect the bit argument to be the
position index inside the target integer and not its
numerical representation (e. g. 5 means the 5th bit and not 32).
The original code could potentially override an adiacent variable.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-05 10:38:38 -08:00
Patrik Flykt 8ff96b5a57 drivers: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Jan Van Winkel 55f091f43f i2c: sensor: Replace static_assert by BUILD_ASSERT_MSG
Replace static_assert in NRFX TWI, TWIM and QDEC drivers by
BUILD_ASSERT_MSG

fixes: #11754

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-01 18:37:16 +01:00
Peter A. Bigot be624d8e51 drivers: sensor: sht3xd: change from level to double edge trigger
The sensor signal cannot be cleared by the application, so enabling
level triggers causes the system to hang as the callback is invoked
repeatedly.  We want notification when the alarm state is entered, and
when it's exited, so use a double edge.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2018-11-30 08:30:13 -08:00
Peter A. Bigot 5313d4fb51 drivers: sensor: sht3xd: migrate GPIO from Kconfig to device tree
Replace Kconfig ALERT signal GPIO device and pin information with device
tree bindings.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2018-11-30 08:30:13 -08:00
Peter A. Bigot b7dc23984d drivers: sensor: sht3xd: migrate I2C from Kconfig to device tree
Replace Kconfig I2C bus and address information with device tree
bindings.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2018-11-30 08:30:13 -08:00
Peter A. Bigot 2bb33a1bdc drivers: sensor: sht3xd: correct humidity threshold conversion
Original scale factor assumed a maximum humidity of 10^5 percent.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2018-11-30 08:30:13 -08:00
Armando Visconti a1c0a1fbe5 drivers/lis2dh: Add symbol to BUS_TYPE and TRIGGER_MODE config choices
Add symbolic names to bus type (LIS2DH_BUS_TYPE) and trigger mode
(LIS2DH_TRIGGER_MODE) in order to be defined in board defconfig
files.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-11-30 08:36:29 -06:00
Armando Visconti 73a6f58dd4 sensors: convert lis2dh to use information coming from dts
Convert lis2dh accelerometer driver to get the device name as well
as i2c/spi slave information from device tree. Updates the build_all
test accordingly. (issue #11605)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-11-30 08:36:29 -06:00
Himanshu Jha f411073c85 drivers: sensor: vl53l0x: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Mieszko Mierunski c9906dd3cf dts: nrf: Remove qdec dts.fixup defines and use aliases instead.
Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-11-20 22:18:09 +01:00
Maureen Helm f2d8d93269 drivers: sensor: Convert adxl362 to device tree
Converts the adxl362 sensor driver to get the device name and spi slave
properties from the device tree rather than Kconfig. Updates the
build_all test accordingly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-11-14 23:54:57 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Kumar Gala a134438840 sensors: bmi160: Add DTS support
Convert the BMI160 to use Device Tree to get SPI and GPIO params instead
of Kconfig.  Updated samples, tests, and arduino_101_sss board support
for this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-13 10:23:22 +01:00
Krzysztof Chruscinski 97345dbb1b logging: Fix errors in log usage
Couple of findings which were revealed after changing
LOG_MODULE_REGISTER macro:
- missing semicolons after LOG_MODULE_REGISTER()
- missing LOG_LEVEL defines
- other

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Himanshu Jha cb350e9399 sensors: lis2dh: Handle return value of lis2dh_reg_read_byte function
Provide necessary error handling for `lis2dh_reg_read_byte` function
which might fail.

Also, use a common `status` variable to be used for storing the
error code.

Fixes #10590
Coverity-CID: 188733

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-09 16:11:26 -06:00
Maureen Helm f379abfe47 drivers: sensor: Fix missing case break in fxos8700 driver
Fixes a missing case break in the fxos8700 sensor driver, caught by
Coverity.

Coverity-CID: 189517

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-11-07 19:23:46 -05:00
Himanshu Jha d0a98b7cf9 drivers: Remove redundant semicolon
Remove the redundant semicolon used as a terminator in
`if`, `switch`, `while` statements.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:34:06 -05:00
Himanshu Jha 4a5042dd77 sensor: lis2mdl: Handle return value of i2c_burst_read
i2c_burst_read can fail during read/write procedure. Therefore,
add a sanity check for its return value.

Fixes #11101
Coverity-CID: 189505

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-06 14:10:51 -06:00
Dennis Wildmark e60a6e9256 drivers: lsm303dlhc_accel: support for sensor_attr_set
Driver for LSM303DLHC accelerometer now supports API function
sensor_attr_set for attribute SENSOR_ATTR_SAMPLING_FREQUENCY.

Signed-off-by: Dennis Wildmark <d.wildmark@gmail.com>
2018-11-05 10:41:51 -06:00
Flavio Ceolin 20e5c257f8 drivers: sensor: Fix syscall name
syscall sensor_sample_fetch was erroneously being defined as
sensor_sample_sample_fetch.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-11-01 14:40:30 -07:00
Himanshu Jha b8c19d8c75 util: Add GENMASK helper macro definition
Macro is used to create contiguous bitmask between the
arguments passed to the macro.

BITS_PER_LONG is computed as the multiplication of predefined
macros `__CHAR_BIT__` and `__SIZEOF_LONG__`.

Both gcc and clang support these predefined macros.

With this change, replace the redundant defintions of
GENMASK with the new generic macro available.

Fixes #10843

Suggested-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-01 13:40:01 +01:00
Anas Nashif 04c85e64c1 sensors: qdex_nrfx: move to new logger
Move to new logger and use sensor log level instead of our own.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-31 08:34:36 -04:00
Kumar Gala d505d9a8ca driver: sensor: bmm150: Use SENSOR_CHAN_MAGN_XYZ
Driver should be using SENSOR_CHAN_MAGN_XYZ as SENSOR_CHAN_MAGN_ANY has
been deprecated for a while.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-30 15:28:41 -05:00
Satya Bhattacharya 7d886e8b6e sensor: isl29035: Unchecked return value
Check the return value of i2c_reg_read_byte() and return
if unable to read the register
Coverity-CID: 188740

Fixes #10585

Signed-off-by: Satya Bhattacharya <satyacube@gmail.com>
2018-10-30 05:56:18 -05:00
Anas Nashif 203948e156 sensors: move grove sensors under drivers/sensor
Grove devices are sensors, so no need to have them under their own
category.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-28 11:46:36 -04:00
Johann Fischer 38765d2c40 drivers: fxos8700: mention compatible devices in the help section
Mention compatible devices in the Kconfig help section.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer ba4239f5f8 Revert "drivers: sensor: Add support for MMA8451Q (3-axis accelerometer)"
Driver fxos8700 can also be used for the MMA8451
accelerometer and offers more functionality.
Revert the commit to avoid duplicate code.

This reverts commit 9c0d7813e5.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer 47bb0e1e5f drivers: fxos8700: add verification of the supported devices
Add basic verification of the supported devices.
Add IDs for MMA8451, MMA8652, MMA8653 and FXOS8700 and
remove Kconfig FXOS8700_WHOAMI option.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer b401f5ee38 drivers: fxos8700: add motion detection
Add basic support for motion detection.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer 8e0ec542a5 drivers: fxos8700: add power mode configuration
Add power mode configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer 6bd80cdc97 drivers: fxos8700: allow to change output data rate
Add attr_set for SENSOR_ATTR_SAMPLING_FREQUENCY and
allow to change output data rate.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Pawel Dunaj 004b8b26c0 drivers: sensors: qdec_nrfx: Add support for Nordic QDEC
Add a QDEC driver that utilizes Nordic's QDEC.

This closes issue #9364

Jira:DESK-259

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2018-10-17 13:45:51 -05:00
Anas Nashif 86ad1bd03d drivers: lsm303dlhc_magn: move to new logger
Move to new logger replacing macros and defining module.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 17:30:09 -04:00
Anas Nashif b49e26680d drivers: lsm303dlhc_accel: move to new logger
Move to new logger replacing macros and defining module.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 17:30:09 -04:00
Andy Ross 220d4f8347 sys_clock.h: Make "global variable" APIs into proper functions
The existing API defined sys_clock_{hw_cycles,ticks}_per_sec as simple
"variables" to be shared, except that they were only real storage in
certain modes (the HPET driver, basically) and everywhere else they
were a build constant.

Properly, these should be an API defined by the timer driver (who
controls those rates) and consumed by the clock subsystem.  So give
them function syntax as a stepping stone to get there.

Note that this also removes the deprecated variable
_sys_clock_us_per_tick rather than give it the same treatment.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-10-16 15:03:10 -04:00