Commit Graph

507 Commits

Author SHA1 Message Date
Jan Faeh 22945254ef drivers: sensor: STS4x Add driver
This adds support for Sensirion's STS4x temperature sensor.

Signed-off-by: Jan Faeh <jan.faeh@sensirion.com>
2024-11-16 14:02:15 -05:00
Adrien Leravat 9df661ea1a drivers: sensor: hc-sr04: add driver
Add a simple driver for the HC-SR04 ultrasonic distance sensor.

Signed-off-by: Adrien Leravat <adrien.leravat@gmail.com>
2024-11-16 14:00:34 -05:00
Mahesh Mahadevan 38f06aa4bf drivers: sensor: p3t1755: Driver for NXP digital temperature sensor
Added driver for the NXP P3T1755 digital temperature sensor.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-10-25 08:53:56 +02:00
Armando Visconti 5be36eef47 drivers/sensor: lps2xdf: add ilps22qs support
The ILPS22QS is an ultra-compact piezoresistive absolute pressure sensor
which functions as a digital output barometer, supporting dual full-scale
up to user- selectable 4060 hPa. The device delivers ultra-low pressure
noise with very low power consumption and operates over an extended
temperature range from -40 °C to +105 °C.

(https://www.st.com/en/mems-and-sensors/ilps22qs.html)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-10-23 16:52:57 +02:00
Dimitrije Lilic 86ed9811c4 drivers: sensor: adxl345: Updated ADXL345 drv RTIO stream & Trigger func
Updated ADXL345 driver with RTIO stream functionality.
Added Trigger intterupt functionality. RTIO stream is using
FIFO threshold.Together with RTIO stream, RTIO async read
is also implemented.

Signed-off-by: Dimitrije Lilic <dimitrije.lilic@orioninc.com>
2024-10-22 18:29:22 -04:00
Wajdi ELMuhtadi fb45c6d93a drivers: sensor: wsen_hids_2525020210002: add sensor driver
Add wsen_hids_2525020210002 driver with
the corrected name and compatibility with
the hal update as well as added new features.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-22 14:03:08 +02:00
Chris Ruehl a3f863e3f1 Drivers: Sensors: Bosch bmp390 merge into bmp388
Add support for Bosch bmp390 sensor, the drop in replacement for the
bmp388 with same register but different chip-id. This patch make use
of "bosch_bmp390" or "bosch_bmp388" and set the specific chip-id in a
data->chip-id variable, which then used to check against the register
value.

Additional, manual shift operation had been replaced with ENDIAN safe
macros and calibration values with target variable of int16_t add a
cast for it.

bmp388_spi: read register implementation wrong, fixed it.
tx-buffer must be <addr><dummy><dummy> in order to receive the
register value. Read registers in burst mode and have rx and tx
buffer same spi_buf to avoid clock stop and delay with nrf5.

Signed-off-by: Chris Ruehl <chris@gtsys.com.hk>
2024-10-22 13:58:33 +02:00
Stefan Schwendeler 8786436909 drivers: sensor: ntc_thermistor: adds support for VDD based ADC reference
The NTC thermistor implementation assumes a constant pull-up voltage
and that the ADC channel is measured against a reference voltage so that
the absolute voltage across the NTC can be calculated. Based on the
relationship of `pullup-uv` and this absolute NTC voltage, the resistance
of the NTC is calculated.

There are applications where the "pullup-uv" is not constant, but VDD.
Most ADCs support relative measurements against VDD. If `pullup-uv` is not
defined, the implementation assumes now that the ADC channel is configured
to use VDD as a reference and therefore no millivolt conversion is
required.

Signed-off-by: Stefan Schwendeler <Stefan.Schwendeler@husqvarnagroup.com>
2024-10-22 13:56:54 +02:00
Juliane Schulze 7adcebc675 vcnl36825t: add trigger capability
Adds trigger capability to the Vishay VCNL36825T sensor.

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-10-21 12:41:12 +02:00
Javier Santos a70eaa5c4a drivers: sensor: npm1300: Added charging support without NTC
Current nPM1300 charger driver does not work with batteries
without NTC thermistor. Added supported for this feature.

Signed-off-by: Javier Santos <jasr93@outlook.es>
2024-10-17 15:39:28 -04:00
Tomáš Juřena 3602342611 drivers: sensor: ti: ina230: Add support for INA236
This commit adds support for INA236 into the existing INA230 driver.
These two chips are similar enough to share most of the code.
The device can be defined the same way as INA230 and we only have
the extra option to select the high-precision mode.

```
ina236: ina236@40 {
		status = "okay";
		compatible = "ti,ina236", "ti,ina230";
		reg = <0x40>;
		adc-mode = "Bus and shunt voltage continuous";
		vbus-conversion-time-us = <1100>;
		vshunt-conversion-time-us = <1100>;
		avg-count = <1>;
		current-lsb-microamps = <1000>;
		rshunt-micro-ohms = <15000>;
		alert-gpios = <&gpiod 0 GPIO_ACTIVE_LOW>;
		high-precision;
	};
```

Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
2024-10-17 15:39:18 -04:00
Daniel Kampert 9d0486e3ee drivers: sensor: Add support for Broadcom APDS-9306
- Add Broadcom / Avago APDS-9306 ambient light sensor driver

Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>
2024-10-17 09:46:53 +02:00
Paweł Czaplewski 9fe959857a drivers: sensor: tmp1075: Add tmp1075 sensor driver and sample
TI tmp1075 driver implemented based on tmp108 driver.
The driver initializes the sensor based on the DTS.

Added tmp1075 example overlay file to thermometer sample.
All you need to do to use the sensor is to connect the I2C and
optionally interrupt line.
To see default DTS configuration option inspect `ti,tmp1075.yaml`
bindings file and sensor spec.

Signed-off-by: Paweł Czaplewski <pawel.czaplewski@arrow.com>
2024-10-15 04:10:40 -04:00
Wajdi ELMuhtadi 9af50a7b19 drivers: sensor: wsen_tids: remove wsen_tids driver
Remove wsen_tids since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi 8f684cfe9b drivers: sensor: wsen_pdus: remove wsen_pdus driver
Remove wsen_pdus since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi 8c0b09ddc3 drivers: sensor: wsen_pads: remove wsen_pads driver
Remove wsen_pads since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi 449bf8019c drivers: sensor: wsen_hids: remove wsen_hids driver
Remove wsen_hids since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Wajdi ELMuhtadi 5f584052d8 drivers: sensor: wsen_itds: remove wsen_itds driver
Remove wsen_itds driver since the hal update
is no longer compatible with this version.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2024-10-11 13:15:10 -04:00
Bjarki Arge Andreasen 4e55597527 drivers: sensor: mcux_acmp: update dts binding and adapt driver
Update the devicetree binding for the nxp,kinetis-acmp comparator and
move the binding to dts/bindings/comparator.

The update to the binding includes:
- Remove unused io-channel-cells property
- Remove unused sensor-device include
- Adding missing properties dac config, discrete mode config, and
  input configs.
- Rename properties to exclude redundant vendor prefix since props in
  this binding are not inhereted, and as such, don't need to be
  namespaced.
- Deprecate the old names of the renamed properties

The sensor based device driver has been updated to support both the
deprecated and new property names. This allows it to use both
nxp,enable-sample and filter-enable-sample for example.

Additionally, remove the unused io-channel-cells properties from
in-tree nodes of compatible = "nxp,kinetis-acmp"

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 04e70ab96c drivers: comparator: add nRF LPCOMP device driver
Add nRF LPCOMP device driver.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Bjarki Arge Andreasen 4adc92475d drivers: comparator: Add nRF COMP device driver
Add nRF COMP device driver and remove deprecated bindings from
dts/bindings/sensor.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-10-10 20:24:52 -04:00
Andrew Sonzogni 70de35d9c9 drivers: sensor: lis2dw12: add inactivity detection
Add inactivity mode or stationary detection

Signed-off-by: Andrew Sonzogni <andrew@safehear.fr>
2024-10-03 11:41:51 +01:00
Mathieu Choplain 5a0775b1ab dts: bindings: stm32-temp*: align 'avgslope' to datasheet format
Change the STM32 Temperature Sensor bindings to accept the average slope
value in string form instead of integer. With this change, it is possible
to use the raw decimal value found in each MCU's datasheet instead of
needing to scale it (differently depending on series!). This also allows
regrouping the property in a single file to reduce duplication.

Also update all DTSI files affected by this change and the dietemp driver
to accept the property's new format.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain e61b010b4c dts: bindings: stm32-temp*: reword bindings documentation
Improve the STM32 dietemp sensor bindings by rewording the descriptions
of bindings and properties.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain 4641d3dab9 dts: bindings: stm32-temp*: regroup 'ntc' in common file
Reduce duplication in STM32 dietemp bindings by regrouping the 'ntc'
property declared in both "st,stm32-temp" and "st,stm32c0-temp-cal"
to the shared "st,stm32-temp-common" binding.

"st,stm32-temp-cal" is also modified to block 'ntc' property on include as
no dual-calibration sensors to date require it (this could be changed later
when need arises).

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain 8785e9f605 dts: bindings: stm32c0-temp-cal: force new series to define 'avgslope'
Set the 'avgslope' property of 'st,stm32c0-temp-cal' to required, and
remove its default value, to ensure new series cannot be introduced without
setting the property to the correct value explicitly.

This change does not require any DTSI modification, because there are only
two files using this compatible (stm32f030.dtsi / stm32c0.dtsi), and both
of these already set 'avgslope' explicitly.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain 8caf1f6d3e dts: bindings: stm32-temp: force new series to define 'avgslope'
Set the 'avgslope' property of 'st,stm32-temp' to required, and remove its
default value, to ensure new series cannot be introduced without setting
the property to the correct value explicitly.

This change does not require any DTSI modification, because there are only
two files using this compatible (stm32f1.dtsi / stm32f2.dtsi), and both of
these already set 'avgslope' explicitly.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Mathieu Choplain 665f33ec51 dts: bindings: stm32-temp: force new series to define 'v25'
Set the 'v25' property of 'st,stm32-temp' to required, and remove its
default value, to ensure new series cannot be introduced without setting
the property to the correct value explicitly.

This change does not require any DTSI modification, because there are only
two files using this compatible (stm32f1.dtsi / stm32f2.dtsi), and both of
these already set 'v25' explicitly.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-10-02 10:03:03 +02:00
Lauren Murphy e0bd9aef66 drivers: sensor: add mmc56x3 sensor driver
Adds Memsic MMC56X3 magnetometer and temperature
sensor driver.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2024-09-24 10:09:25 +02:00
Margherita Milani 5032f099c6 drivers: sensor: add apds9253 driver
Add all the necessary files to add apds9253 Avago sensor driver.

Sensor available at https://docs.broadcom.com/doc/APDS-9253-001-DS

Signed-off-by: Margherita Milani <margherita.milani@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-09-09 13:56:17 -04:00
Chris Ruehl 03c942132d Drivers: Bosch bmp180 dts bindings
Add the yaml files needed for the dts binding of the Bosch bmp180 sensor.

V2 Fixup
--------
yaml fixup for complient checks
merge bmp180-i2c.yaml and bmp180.yaml

Signed-off-by: Chris Ruehl <chris@gtsys.com.hk>
2024-08-30 11:46:25 -04:00
Fin Maaß 2293e6668a drivers: sensors: add jedec jc 42.4 compliant temperature sensor
This transforms the existing driver for the Microchip MCP9808
to be used as a generic driver to be used with  all
JEDEC JC 42.4 compliant temperature sensor chips.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-08-28 14:02:16 -04:00
Anuj Pathak 1f05d03489 Drivers: Sensor: mc3419: Moved Decimation Rate config to DT
- Similar to LPF settings decimation rate could be applied to
per instance basis, thus moved to DT prop

Signed-off-by: Anuj Pathak <anuj@croxel.com>
2024-08-26 18:51:28 +02:00
Anuj Pathak 932e207741 Drivers: Sensor: mc3419: Added LPF CutOff select using dt
For applications that rely on low noise/variance in accelerometer
sample reading. Application can take advantage of integrated LPF
Thus this PR adds LPF configuration capability to the mc3419 driver

Signed-off-by: Anuj Pathak <anuj@croxel.com>
2024-08-26 18:51:28 +02:00
Krystof Sadlik 913d6a3e55 dts: bindings: Added bindings for the fxls8974 accelerometer
Added bindings to enable fxls8974 accelerometer

Signed-off-by: Krystof Sadlik <krystof.sadlik@nxp.com>
2024-08-19 10:00:34 -04:00
Lucas Tamborrino ca31dbc0bc drivers: sensor: icm42670: Add I2C bus support
Add bus interface so the driver can support both
SPI and I2C bus.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-08-16 14:08:44 -04:00
Parthiban Nallathambi 17f11332a9 dts: bindings: fix typo in icm42688
accelerometer range is not suffixed with 'G' in the header
and also in the usages, but bindings use with suffix 'G'.
remove the suffix 'G' to have same reference.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2024-08-14 19:07:20 -07:00
Fabian Pflug ac8e578456 drivers: sensor: tmag5273: Add support for tmag3001
The TMAG3001 is quite similar to the tmag5273 and can be used with just
some small modifications.

Signed-off-by: Fabian Pflug <fabian.pflug@grandcentrix.net>
2024-08-05 16:27:25 +02:00
Andrzej Głąbek 791ba98e7a dts: bindings: nordic: Require pinctrl-names together with pinctrl-0
... so that a clear devicetree error is reported when the pinctrl-names
property is missing, not a quite cryptic compilation error about an
undeclared PINCTRL_STATE_*_UPPER_TOKEN symbol in pinctrl.h.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-08-02 03:29:30 -04:00
Miguel Gazquez f712f9554b dts: bindings: add DT binding for lsm9ds1
This commit adds a description for the lsm9ds1 sensor,
with a .h file containing all configuration options.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2024-07-29 14:21:24 +02:00
Tom Burdick 058253b4b6 icm42688: Follow st's devicetree bindings
Fix the devicetree bindings to actually be used as the default
configuration, following the example set by various ST sensor devices.

This requires sadly dropping enums and using #defines for various
options as well as repeating many numbers, but presumably is the way to
do it given the precedent set by ST with sensors like the lsm6dso.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-06-26 14:13:21 -04:00
Simon Frank 2ca7e41b26 drivers/sensor: lis2mdl: use common SPI duplex option
Driver used a custom SPI duplex option. Replaced with the common one
found in spi-device.yaml.

Signed-off-by: Simon Frank <simon.frank@lohmega.com>
2024-06-26 09:01:13 -04:00
Luis Ubieda 51ad3d34bd sensor: vcnl36825t: fix: Address CID 347083
Coverity found this legitimate issue: the datasheet specifies PS_IT
being 2-bits long (1, 2, 4, 8) and this driver assumes more steps are
available. Remove extraneous fields so the Proximity integration
setting fits in the expected 16-bit value.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-06-20 12:05:07 -04:00
Gerson Fernando Budke 0561d74d31 drivers: counter: sam: Add qdec as tc special mode
The current atmel,sam-tc-qdec sensor implementation shared the timer
counter node. This create issues when users wants define both modes.
The current proposal changes the qdec dedinition to be a child of
tc and refactor all the chain of definitions.

Fixes #71312

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-06-17 17:47:42 -04:00
Trent Piepho d7e03dd148 drivers/sensor: si7006: Support SHT21 and HTU21D
These three sensor types are all largely compatible.  The SHT21 and
HTU21D can be supported by this driver by sending command 0xE3 instead
of 0xE0 to read the temperature.

Mention the sensor names in bindings and Kconfig to help those looking
for support to find it.  There have been at least five PRs attempting to
add SHT21 and/or HTU21D support that did not realize the Si7006 is the
same.

As mentioned in PR #22862, the Sensirion SH21 is the original.  The dts
bindings are adjusted (in a backward compatible way!) to make the sht21
the base binding and si7006 is derived from that.

Examples of dts compatibles:

TE Connectivity née Measurement Sepcialties HTU21D:
compatible = "meas,htu21d", "sensirion,sht21";

Sensirion SHT21:
compatible = "sensirion,sht21";

Silicon Labs Si7006
compatible = "silabs,si7006";

Silicon Labs Si7021
compatible = "silabs,si7021", "silabs,si7006";

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2024-06-15 04:42:31 -04:00
Benjamin Lemouzy 5c8937fbac drivers: sensor: lm75: add alert threshold support
Add SENSOR_ATTR_ALERT and SENSOR_ATTR_HYSTERESIS attributes support.
The code is heavily inspired by the one for lm77 sensor.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
2024-06-14 18:48:32 -04:00
Robert Hancock 2d171efcec drivers: sensors: Add driver for LM95234 temperature sensor
Add a driver for the National/TI LM95234 Quad Remote Diode and Local
Temperature Sensor with SMBus Interface and TruTherm Technology.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2024-06-14 19:34:01 +02:00
Thomas Stranger 34cac05775 drivers: sensor: sensirion: shtcx: remove chip property
Removes the dts "chip" property, the compatible should be used instead.

Any existing dts should be converted from something like:

test_i2c_shtc3: shtc3@70 {
	compatible = "sensirion,shtcx";
	reg = <0x70>;
	chip = "shtc3";
	measure-mode = "normal";
	clock-stretching;
};

to something like:

test_i2c_shtc3: shtc3@70 {
	compatible = "sensirion,shtc3", "sensirion,shtcx";
	reg = <0x70>;
	measure-mode = "normal";
	clock-stretching;
};

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-06-11 20:12:15 +03:00
Aurelien Jarno 371f22b937 drivers: sensor: st: add driver for the STM32 Digital Temperature Sensor
This add basic support for the STM32 Digital Temperature Sensor found
notably on the STM32H7 series. It work in interrupt mode and support
basic power device management.

It does not support the more advanced features like using the
temperature threshold, triggers from LPTIM or using the LSE clock in
during sleep or stop.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-06-04 16:37:19 +02:00
Zhaoxiang Jin 79e134bc4b dts: bindings/sensor: Support NXP LPCMP bindings
Support NXP LPCMP bindings

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-05-31 09:51:29 -05:00