Commit graph

2428 commits

Author SHA1 Message Date
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
Thomas Stranger
d0816a1a60 drivers: w1: updates to reflect analog maxim acquisition
Links and the manufacturer name are updated from maxim to analog
for the 1-wire subsystem and the related ds18b20 sensor.

After the acquisition of Maxim Integrated the documentation
of these devices has been moved to the analog.com website.
Redirects exist, so they are not broken yet,
but we should not rely on that.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-11-16 13:51:38 -05:00
Thomas Stranger
501f07fe53 drivers: sensor: sensirion: sht4x: update measurement duration
Update the measurement durations for the sht4x sensors
in accordance with the datasheet revision 6.6 (2024-04).

These timings have been updated by sensirion in rev 3 of
the datasheet.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-11-16 13:51:10 -05:00
Jilay Pandya
6a0d7351d5 drivers: sensor: fcx_mldx5 fix string_overflow issue
This commit fixes Copy into fixed size buffer (STRING_OVERFLOW) by checking
the cmd_data_len

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-16 13:38:00 -05:00
Jilay Pandya
cebd1c78e8 drivers: sensor: emul_bmi160: fix cid 215232
This commit fixes the issue of Null pointer dereferencing

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-11-16 13:37:42 -05:00
Tarang Raval
bb7319e7f2 drivers: sensor: ina219: remove redundant error check
The function ina219_set_msr_delay always returns zero, indicating success.
Therefore, the error check on its return value is unnecessary and can be
removed.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
2024-11-16 13:33:34 -05:00
Ryan McClelland
c58c130b48 drivers: sensor: default_rtio_sensor: fix limited range warning
`chan_type` is defined as a `uint16_t`. This makes checking if it is
< 0 always false. A warning is shown with -Wtype-limits. Remove the
check as it is unnecessary.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-08 22:28:08 -06:00
Jun Lin
69e85b25fe board: npcx: remove CONFIG_PINCTRL from defconfig of npcx boards
The CONFIG_PINCTRL is removed from the board's defconfig files.
Drivers which use pin control function should add "select PINCTRL"
in their Kconfig files.

Fixes #78619

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-11-07 08:59:14 -08:00
Gerson Fernando Budke
0cc8f93e8a soc: atmel: Drop PINCTRL from Kconfig.defconfig
This Kconfig has wrongly been added to defconfig files. It is not the
right place for it. It has never been the right place for it. Drivers
that need it should select the symbol in their Kconfig entries. Drop
PINCTL from Kconfig.defconfig and add proper select at Kconfig.sam*.

Fixes #78619

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-11-04 13:43:26 -06:00
Dimitrije Lilic
5ee9d7a869 driver: sensor: adxl345: Bug fix for q31_t conv
This is a bug fix for adxl345_accel_convert_q31 functions.
Functions are used to convert samples received from
sensor to q31_t format when RTIO stream is used.

Signed-off-by: Dimitrije Lilic <dimitrije.lilic@orioninc.com>
2024-10-29 07:09:13 -05:00
Maureen Helm
9ca3826abf drivers: sensor: adi: Set trigger thread name
Sets the trigger thread name for all adi sensor drivers to more clearly
identify the thread when tracing or debugging.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-10-26 03:56:58 +01:00
Vladislav Pejic
832bbd8030 driver: sensor: adxl372: Bug fix for q31_t conv
This is a bug fix for adxl372_accel_convert_q31 function.
Function is used to convert samples received from
sensor to q31_t format when RTIO stream is used.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2024-10-26 03:54:23 +01:00
Vladislav Pejic
527c1f5356 driver: sensor: adxl362: Bug fix for q31_t conv
This is a bug fix for adxl362_temp_convert_q31 and
adxl362_accel_convert_q31 functions.
Functions are used to convert samples received from
sensor to q31_t format when RTIO stream is used.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2024-10-25 12:51:31 -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
Tobias Pisani
66af846010 drivers: ti: bq274xx: Do not wait for device on init when lazy-loading
Before communicating with the device, the driver needs to wait 300ms. This
moves all communication with the device from init to configure, such
that this delay can be avoided on startup by using zephyr,lazy-load.

Signed-off-by: Tobias Pisani <mail@topisani.dev>
2024-10-24 17:52:30 +02:00
Michal Smola
ab3bf82efe drivers: sensor: nxp kinetis temp: Remove depends on kinetis
Remove Kconfig dependency on SOC_FAMILY_KINETIS as the temperature
sensor is available also on MCX family.

Signed-off-by: Michal Smola <michal.smola@nxp.com>
2024-10-24 14:05:00 +02:00
Florian Weber
1a89d4b13e drivers: sensor: akm09918: make submit function more unblocking
The driver now does not wait for the completion of a measurement
in the submit function.
Instead it schedule the fetch and the completion of the
submission queue entry as delayed work to the system work queue.

Signed-off-by: Florian Weber <Florian.Weber@live.de>
2024-10-23 15:35:35 -05:00
Jilay Pandya
d172847da5 drivers: sensor: adi: ltc2990 init trigger measurement
This commit triggers measurement during sensor initialization

Signed-off-by: Jilay Pandya <jilay.pandya@zeiss.com>
2024-10-23 15:33:56 -05: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
Armando Visconti
4c3606a3bf drivers/sensor: lps2xdf: Fix typo in Kconfig
Change I2C into I3C as it is a typo.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-10-23 16:52:57 +02:00
Armando Visconti
71bb3f7ade drivers/sensor: lps2xdf: add API to configure interrupt
Add a generic lps2xdf_config_int() API to configure device interrupt
mode, and implement the specific routines for lps22df and lps28dfw.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-10-23 16:52:57 +02:00
Armando Visconti
8fab391d3f drivers/sensor: lps2xdf: (Fix) move API inside CONFIG_LPS2XDF_TRIGGER
Move api_lps2xdf_handle_interrupt() API inside the CONFIG_LPS2XDF_TRIGGER
ifdef, because it should be defined only in that case.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-10-23 16:52:57 +02:00
Vladislav Pejic
cfe64f7f1c drivers: sensor: adxl372: Updated driver with RTIO stream functionality
Updated ADXL372 driver with RTIO stream functionality.
RTIO stream is using both FIFO threshold and FIFO full triggers.
Together with RTIO stream, RTIO async read is also implemented.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2024-10-22 18:30:13 -04: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
Luis Ubieda
ca822d4e4b sensor: lm77: Add LM77 config as a subset of the main symbol
Following pattern used in other Kconfigs. This also addresses the CI
failure on previous run.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-10-22 20:41:43 +02:00
Luis Ubieda
d557ee36d5 sensor: tree-wide: Enforce dependency of int-gpios with Trigger feature
We need int-gpios defined to use trigger functionality. Enforced with
the Kconfig parameter.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-10-22 20:41:43 +02: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
Vladislav Pejic
6d8ace9198 drivers: sensor: adxl362: Added RTIO stream
Updated ADXL362 driver with RTIO stream functionality.
RTIO stream is using both FIFO threshold and FIFO full triggers.
Together with RTIO stream, RTIO async read is also implemented.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2024-10-22 14:02:21 +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
Jordan Yates
8f4cf7f6af sensor: voltage_divider: delay sampling after power-on
Enforce some minimum delay between enabling the voltage divider with a
GPIO and sampling the analog voltage. Without this delay the ADC can
easily sample the transient power up curve instead of the steady state
output.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-17 15:38:52 -04:00
Florian Weber
0d9cdf0990 drivers: sensors: rtio
Inform the executor of a submissions completion with -ENOMEM
if the size of the workq is not big enough.

Signed-off-by: Florian Weber <Florian.Weber@live.de>
2024-10-17 15:37:49 -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
Jordan Yates
5d3d78e9cb sensor: bmm150: support power domains
Support the BMM150 being on a power domain, which may not be powered at
boot. For example, Nordic Thingy53.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-17 09:46:46 +02:00
Juliane Schulze
38ee9aa17b vcnl36825t: additional delay after wakeup on "force"-mode
There is an (undocumented) additional delay necessary if the device woke
up and a measurement is triggered via the "force"-mode. The additional
sleep time was determined empirically on different devices.

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2024-10-17 09:46:38 +02:00
Jordan Yates
5eb5f3d6a5 sensor: bme280: only configure mode on PM suspend/resume
Update power management to only start/stop periodic measurements in
`CONFIG_BME280_MODE_NORMAL`, instead of re-initialising the chip
completely.

In `CONFIG_BME280_MODE_FORCED`, there is nothing to do when suspending,
as the sensor is already in its lowest power mode.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-17 09:46:24 +02:00
Jordan Yates
ecfb4c7628 sensor: bme280: check status before sleeping
Check the status register immediately, instead of waiting 3ms for the
first check.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-17 09:46:24 +02:00
Jordan Yates
22c2fe52dc sensor: bme280: name for mode choice
Add a name for the mode choice symbol to enable other Kconfig files
to change the default.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-17 09:46:24 +02:00
Emilio Benavente
82a192c8a9 boards: nxp: Removing CONFIG_PINCTRL from the boards defconfig
The Drivers using Pinctrl should be turning Pinctrl on
this should not be the responsibility of the board. This
commit removes CONFIG_PINCTRL from the boards side for nxp boards.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-10-15 19:09:45 -04:00
Jordan Yates
1637443dc0 sensor: current_amp: request calibration
Request calibration on ADC samples to improve the accuracy of the ADC
outputs and therefore the final measured current.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-15 19:07:21 +01:00
Krzysztof Chruściński
b773306a56 drivers: sensor: nordic: qdec: Add runtime PM
Add runtime PM to the driver.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-15 19:06:01 +01:00
Tim Lin
7fa962589f ITE: it8xxx2: Remove CONFIG_PINCTRL from soc defconfig file
The driver Kconfig determines whether pinctrl is enabled
instead of soc defconfig.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-10-15 13:52:55 +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
Jordan Yates
4361c96c48 adc: current_sense_amplifier: resistance in milli-ohms
Change the unit of the sense resistor in the devicetree binding from
micro-ohms to milli-ohms. This is done for three reasons.

Firstly, the maximum value resistor that can currently be represented
is 4.2 kOhms, due to the limitation of devicetree properties to 32 bits.

Secondly, storing the resistance at such a high resolution makes
overflows much more likely when the desired output unit is micro-amps,
not milli-amps.

Finally, micro-ohms, are an unnecessarily precise unit for the purpose
of these calculations, and a resolution that is not realistic to
achieve. The high resistor resolution results in large divisors that
reduce the resolution of outputs. Unlike resistors characterised down to
the micro-ohm, devices wanting to measure micro-amps are actually
realistic.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-14 13:05:07 +02:00
Mahesh Mahadevan
1f0a15fa08 drivers: sensor: Fix NXP LPCMP driver
Fix Build failure due to undefined variable.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-10-14 13:01:13 +02: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