Commit graph

51 commits

Author SHA1 Message Date
Simon Glass 5afdceee8c sensor: shell: Add a 'battery' command
It is useful to show sensor channels for a battery in cohesive block as
it is easier to read. Add a 'battery' command to handle this. It only
supports a single battery, relying on the device-tree alias to select
it.

uart:~$ battery
Temp:  23.55 C
V:     4.31 V
V-desired: 4.40 V
I:    574 mA (CHG)
I-desired:  2000 mA
Charging: Not Allowed
Charge: 100 %
V-design: 3.86 V
Remaining: 6764 mA
Cap-full: 6764 mA
Design: 6910 mA
Time full: 0h:00
Time empty: 0h:00

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-23 12:12:09 -04:00
Simon Glass ee34aced6a sensor: max17055: Add MAX17055 driver
Add support for the Maxim MAX17055 fueld-gauge sensor.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-23 12:12:09 -04:00
Saravanan Sekar 9ac3c9d42a drivers: sensors: itds: Add support for WSEN-ITDS 3-axis accel sensor
Add support for wsen-itds 3-axis accel sensor, provides acceleration,
temperature data reading and supports configuring of output data rate,
operating mode and scale.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2020-07-20 12:45:56 +02:00
Armando Visconti 485f2d410c drivers/sensors: Add iis2dh accelerometer sensor support
Add support to STM IIS2DH the ultra-low-power highperformance
three-axis linear accelerometer.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-07-10 11:49:40 -05:00
Christoph Reiter d49e7da7da sensor: add sensor driver for Infineon DPS310
Add driver for Infineon DPS310 temperature and pressure sensor.

Signed-off-by: Christoph Reiter <christoph.reiter@infineon.com>
2020-05-14 11:02:29 +02:00
Sven Herrmann bded58cee5 Sensor: mpr: Add Honeywell MPR driver
The Honeywell MPR sensor is a piezoresistive silicon pressure sensor,
which can be accessed via i2c.

https://sensing.honeywell.com/micropressure-mpr-series

Signed-off-by: Sven Herrmann <sven.herrmann@posteo.de>
2020-04-22 17:39:31 +02:00
Parthiban Nallathambi e65b14c2b6 sensor: bq274xx: Add BQ27421 driver
Add support for TI BQ27421 fuel gauge sensor

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-04-13 11:50:41 -05:00
Armando Visconti a302786e9b drivers/sensor: add support to IIS2MDC magnetometer sensor
The IIS2MDC is a 3D digital magnetometer ultra-low power sensor
for industrial applications, which can be interfaced through
either I2C or SPI bus.

https://www.st.com/resource/en/datasheet/iis2mdc.pdf

This driver is based on stmemsc i/f v1.02.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-03-20 14:53:42 -05:00
Armando Visconti c0f7a1ac6f drivers/sensor: add support to ISM330DHCX IMU sensor
The ISM330DHCX is a ultra-low power IMU with a 3D digital accelerometer
and 3D digital gyroscope tailored for Industry 4.0 applications, which
can be interfaced through either I2C or SPI bus.

https://www.st.com/resource/en/datasheet/ism330dhcx.pdf

This driver is based on stmemsc i/f v1.02.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-03-18 16:14:47 -05:00
Armando Visconti e13205b256 drivers/sensor: add support to IIS2DLPC accelerometer sensor
The IIS2DLPC is a 3D digital accelerometer ultra-low power sensor
for industrial applications, which can be interfaced through either
I2C or SPI bus.

https://www.st.com/resource/en/datasheet/iis2dlpc.pdf

This driver is based on stmemsc i/f v1.02

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-03-16 10:42:28 -05:00
Kamil Rakoczy 687d1040ac Sensor: ADXL345: Add ADXL345 driver
Add support for Analog Devices ADXL345 3-axis I2C accelerometer.

Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
2020-03-13 08:53:43 -05:00
Francisco Munoz 7357ae974f drivers: sensors: Add tachometer driver for MEC family
Introduce the tach driver for the microchip XEC SoCs.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2020-03-13 08:49:21 -05:00
Henrik Brix Andersen fdbb76ff55 drivers: sensor: add driver for the nxp kinetis temperature sensor
Add sensor driver for the internal temperature sensor present in the
NXP Kinetis SoC series.

The driver allows reading the die temperature and the voltage of the
external voltage reference used for calculating the temperature.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-16 17:30:42 -06:00
Diego Sueiro 93e1560faa subsys/shell: Introduce the Sensor Shell Module
Adds a Shell Module for retrieving Sensor data. The following commands
were added:

sensor - Device commands
Options:
  -h, --help  :Show command help.
Subcommands:
  get            :<device_name> [chanel_idx]
  list           :List configured sensors
  list_channels  :<device_name>

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2019-12-19 15:54:04 -05:00
Thomas Schmid 9a06428244 sensor: add ms5607 sensor
Implement a driver for the te connectivity ms5607 pressure and
temperature sensor.

Signed-off-by: Thomas Schmid <tom@lfence.de>
2019-12-09 12:22:25 -06: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
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
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
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 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
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
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
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
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
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
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
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 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
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 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
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
Philémon Jaermann 43bc39e140 drivers: sensor: lsm303dlhc magnetometer driver
Enable magnetometer measurement

Signed-off-by: Philémon Jaermann <p.jaermann@gmail.com>
2018-10-15 12:47:13 -05:00
Philémon Jaermann 0453b2e0dd drivers: sensor: lsm303dlhc accel driver
Enable acceleration measurement.

Signed-off-by: Philémon Jaermann <p.jaermann@gmail.com>
2018-10-15 12:47:13 -05:00
Jan Van Winkel db9403def5 drivers: sensors: Added MS5837 driver
Added MS5837 pressure sensor driver

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-10-12 14:28:32 -05:00
Mario Tesi 5d8834bee4 driver: sensor: Add support for LIS2MDL Mag sensor
Added support to LIS2MDL Magnetometer sensor provided
with following features:
	- I2C interface
	- Mag data
	- Temperature data
	- ODR configurable by config or at runtime
	- Trigger mode selectable by menuconfig
	- IRQ pin configurable (by dts or Kconfig)
	- Hard Iron offset setting at runtime
	- Include yaml file

Tested on ST MEMS IKS01A2 + NUCLEO STM32F411RE board.
LIS2MDL connected to I2C master interface (SPI 3 wire not
supported yet).
Test run with all ODR {10, 20, 50, 100} Hz in poll and
trigger mode.

GPIO IRQ dts configuration has been tested by adding
to boards/arm/nucleo_f411re/nucleo_f411re.dts file
this patch:

&i2c1 {
        status = "ok";
        clock-frequency = <I2C_BITRATE_FAST>;
+
+       /* ST Microelectronics LIS2MDL mag sensor */
+       lis2mdl-magn@1e {
+               compatible = "st,lis2mdl-magn";
+               reg = <0x1e>;
+               irq-gpios = <&gpioa 4 0>;
+               label = "LIS2MDL";
+               status = "ok";
+       };
};

and adding boards/arm/nucleo_f411re/dts.fixup with following
content:

	ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_LABEL
	ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_BASE_ADDRESS
	ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_BUS_NAME
	ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_IRQ_GPIOS_CONTROLLER
	ST_STM32_I2C_V1_40005400_ST_LIS2MDL_MAGN_1E_IRQ_GPIOS_PIN

For more info on this LIS2MDL please follow this link:
http://www.st.com/en/mems-and-sensors/lis2mdl.html

Signed-off-by: Mario Tesi <mario.tesi@st.com>
2018-10-12 14:13:50 -05:00
Maureen Helm 553a31efb9 drivers: sensor: Add missing cmake files for bmm150
The bmm150 sensor driver was missed in the conversion from kbuild to
cmake. This problem was found when updating the build_all tests to
include missing sensor drivers.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-20 12:43:59 -04:00
Michael Hennerich a3e7cea1df drivers: sensors: adxl372: Add driver for ADXL372 high-g accelerometer
This patch adds support for the Analog Devices ADXL372 ultra-low power,
3-axis, +/-200 g MEMS accelerometer. The ADXL372 can be either connected
via a SPI or I2C interface.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
2018-08-21 20:19:44 -05:00
Lars Knudsen 9c0d7813e5 drivers: sensor: Add support for MMA8451Q (3-axis accelerometer)
Only basic features supported initially but more could be added from:
https://www.nxp.com/docs/en/data-sheet/MMA8451Q.pdf

fixes #9006

A sample app will be provided in a separate PR.

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
2018-07-31 09:07:54 -05:00
Michael Hennerich 21fd91e11e drivers: sensors: adt7420: Add driver for ADT7420 Temperature Sensor
This patch adds support for the Analog Devices ADT7420 High-Accuracy
16-bit Digital I2C Temperature Sensors. Optionally sensor threshold
events are supported.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
2018-07-12 13:03:24 -05:00
Adithya Baglody 62004146e4 drivers: sensors: Remove usage of zephyr_library_ifdef
Phasing out the usage of this cmake macro from the sensor folder.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-05-28 13:23:13 -04:00
Adithya Baglody b0db28b512 drivers: Cmake: Add __ZEPHYR_SUPERVISOR__ macro for driver files.
Normally a syscall would check the current privilege level and then
decide to go to _impl_<syscall> directly or go through a
_handler_<syscall>.
__ZEPHYR_SUPERVISOR__ is a compiler optimization flag which will
make all the system calls from the driver files directly link
to the _impl_<syscall>. Thereby reducing the overhead of checking the
privileges.

In the previous implementation all the source files would be compiled
by zephyr_source() rule. This means that zephyr_* is a catchall CMake
library for source files that can be built purely with the include
paths, defines, and other compiler flags that all zephyr source
files uses. This states that adding one extra compiler flag for only
one complete directory would fail.
This limitation can be overcome by using zephyr_libray* APIs. This
creates a library for the required directories and it also supports
directory level properties.
Hence we use zephyr_library* to create a new library with
macro _ZEPHYR_SUPERVISOR_ for the optimization.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-05-15 17:48:18 +03:00
Manivannan Sadhasivam 9e88120fdf drivers: sensor: Add support for CCS811 Digital Gas Sensor
Add support for AMS CCS811 Digital Gas Sensor for monitoring
indoor air quality. This sensor reports the following parameters:

1. Co2 concentration
2. VOC concentration
3. Sensor voltage
4. Sensor current

This driver only supports polling mode as of now.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-02-06 11:16:26 -05:00
Vincent Veron 347560459b driver: sensor: Add vl53l0x
Add driver for ST vl53l0x time of flight sensor.
This driver can be used in 2 modes :
  * proximity sensor :
      configure VL53L0X_PROXIMITY_THRESHOLD
      will return 1 if target is between sensor and threshold,
      else, 0
  * distance sensor :
      will return the distance in millimeters from sensor to target

This driver use the official STMicroelectronics library for vl53l0x.
(in ext/hal/st/lib/sensor/vl53l0x)

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2018-01-23 10:14:49 -06:00
Johann Fischer 476f05d2f8 drivers: sensors: add driver for amg88xx sensor
This patch adds the driver for Panasonic AMG88xx
infrared array sensor.

The driver was developed within the framework of a student
internship in the development department. The task of the
student was to implement the trigger part of the driver,
transfer and visualization of the measured data.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-01-07 16:04:45 -05:00
Yongfa Zhou ce6f6f4985 drivers: sensor: Fix some code style issues
Signed-off-by: Yongfa Zhou <yongfa.zhou@intel.com>
2017-11-27 22:17:38 -05:00
Yongfa Zhou 85c6b060b0 drivers: sensor: Add plantower PMS7003 Driver
Tested on STM32F103 board

Origin: Original

Signed-off-by: Yongfa Zhou <yongfa.zhou@intel.com>
2017-11-27 22:17:38 -05:00
Sebastian Bøe 29bb2a8fbf cmake: Fixed drivers/sensor/CMakeLists.txt
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-10 11:21:41 -05:00