Commit graph

2428 commits

Author SHA1 Message Date
Maxmillion McLaughlin
6f59533675 drivers: bmp581: change sensor_channel units to match spec
The bmp581 driver currently returns pressure in pascals, when
the sensor_channel enum specifies kilopascals.

Signed-off-by: Maxmillion McLaughlin <max@sorcerer.earth>
2025-04-26 10:55:27 +02:00
Petr Vilím
a7bddddb1e drivers: sensor: max31855: fixed sign bit positions
MAX31855 driver had a wrong position of sign bits causing
invalid reading of negative temperature values. Fixed by
shifting position of sign bit by one bit.

Signed-off-by: Petr Vilím <petr.vilim@proton.me>
2025-04-25 14:05:18 +02:00
Luis Ubieda
72854df0a1 sensor: icm45686: Add stream support over I3C IBI
Streaming mode now supported through In-band Interrupts (I3C).
By default, a dedicated INT GPIO is prioritized, even if the sensor
is on an I3C bus.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-04-25 14:05:10 +02:00
Luis Ubieda
ba36d8a6b6 sensor: icm45686: Add I3C bus support
I3C is now a bus supported, by relying on RTIO IODEV which is supported
for all buses (I2C, I3C and SPI). Tested backwards compatibility: I2C
and I3C.

No IBI support yet.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-04-25 14:05:10 +02:00
Henrik Lindblom
1a3fb4adfc drivers: stm32: use cache peripheral driver
Use cache API for disabling and enabling ICACHE. The driver handles waiting
for ongoing cache invalidation.

Signed-off-by: Henrik Lindblom <henrik.lindblom@vaisala.com>
2025-04-25 11:04:37 +02:00
Ruibin Chang
eb99158a80 drivers/sensor/ite/tach/it51xxx: implement tachometer driver
Implement tachometer driver for ITE it51xxx series chip.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2025-04-24 11:56:44 +02:00
Luis Ubieda
0a4d86c557 sensor: icm45686: Add I2C bus support
Validated for read/decode APIs, as well as Streaming mode (FIFO).

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-04-23 02:15:34 +02:00
Luis Ubieda
b22299d262 sensor: icm45686: Rename REG_SPI_READ_BIT to REG_READ_BIT
So it's generic irrespective to the bus. Tested for I2C and SPI.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-04-23 02:15:34 +02:00
Armando Visconti
242f3e2364 sensor: lsm6dsv16x: fix rtio/iodev prefix names
Use prefix for rtio_ctx and iodev instance names in
I2C case.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-04-22 04:33:28 +02:00
Paul Timke Contreras
503f6388e4 drivers: sensor: paj7620: added driver
Added driver for the PAJ7620 gesture sensor. For now,
just added basic gesture mode, although sensor also
has other modes (proximity and cursor modes).

Signed-off-by: Paul Timke Contreras <ptimkec@live.com>
2025-04-22 04:32:54 +02:00
Jhan BoChao
482d17f235 driver: sensor: add tachometer driver for rts5912
Add tachometer driver for Realtek rts5912.

Signed-off-by: Jhan BoChao <jhan_bo_chao@realtek.com>
2025-04-15 09:28:01 +02:00
Jeppe Odgaard
231b2a0c19 drivers: sensor: rename tmp116 to tmp11x
The tmp116 sensor driver also supports tmp117 and tmp119. Therefore rename
to indicate that is supports a range of tmp devices.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-04-11 16:17:35 +02:00
Jeppe Odgaard
4ce331c1d9 drivers: sensor: add tmp119 support
Add support for TMP119. Its registers are compatible with TMP117 except for
device id register.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-04-11 16:17:35 +02:00
Derek Valleroy
ead1cfb1aa drivers: sensors: lsm6dsv16x: Fix bug in decoder
The lsm6dsv16x driver is using an incorrect value for the index
into the acceleration range. This results in using the wrong
range. The issue was found to be a bug in a MACRO in
lsm6dsv16x_decoder.h that was used to find the index in the
acceleration range. The MACRO was improperly counting zeros from the
leading edge, instead of the trailing edge.

Signed-off-by: Derek Valleroy <derekvalleroy@fb.com>
2025-04-11 06:34:24 +02:00
Armando Visconti
4f8572c35a sensor: lsm6dsv16x: fix building in rtio config
Fix build error which happens when LSM6DSV16X_STREAM=y and there
are no lsm6dsv16x driver instances on i3c bus.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-04-10 14:43:53 +02:00
Jordan Yates
c7bc268656 sensor: current_amp: add a noise threshold
ADC output values can have noise, even if the input is 0V. Add a noise
threshold so that raw ADC readings below the threshold can be zeroed
out. By default the threshold is disabled.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-09 19:32:02 +02:00
Benjamin Cabé
39a65c0be2 drivers: sensor: icp201xx: fix channel check logic
Update the channel validation logic to properly check channel against
SENSOR_CHAN_ALTITUDE.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-04-08 10:48:49 +02:00
Benjamin Cabé
93c52cf0b5 drivers: sensor: icp201xx: fix channel check logic
Update the channel validation logic to avoid using enum constants as
boolean values.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-04-08 10:48:49 +02:00
Emil Dahl Juhl
1a3dd63dde drivers: sensor: ti: opt3001: add trigger support
The ti,opt3001 ambient light sensor is capable of asserting its interrupt
gpio upon conversion completion. The interrupt gpio can then be used to
trigger a reading of the conversion result automatically.
Due to this, it makes sense for the driver to implement the sensor trigger
functionality.

Add a devicetree property, int-gpios, to the ti,opt3001 bindings to allow
describing the gpio used for getting interrupts from the ti,opt3001.

Implement the sensor trigger functionality with options for using the
global worker thread or letting the ti,opt3001 create its own thread for
servicing the interrupts.
In both cases, when an interrupt is received the driver will read a new
measurement from the chip and clear the interrupt. The sample is then ready
to be read by the user of the sensor.

When manually triggering a sample_fetch, the trigger handler is not
invoked.

Signed-off-by: Emil Dahl Juhl <emdj@bang-olufsen.dk>
2025-04-07 15:18:21 +02:00
Remi Buisson
7f0b538d4a drivers: sensor: icp201xx: Add icp201xx support
Use official TDK Invensense driver for icp201xx sensor in tdk_hal module.

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
2025-04-07 15:17:44 +02:00
Ivan Wagner
b5adb4457c drivers: sensor: meas: ms5837 supporting 02 and 30 variants via dt
This patch adds support via dt compatible property.

Signed-off-by: Ivan Wagner <ivan.wagner@tecinvent.ch>
2025-04-04 21:16:20 +02:00
Valerio Setti
d75c2113a9 drivers: sensors: bma4xx: add I2C_RTIO Kconfig for I2C
Since #83575 bma4xx driver relies on RTIO to work. This means that
CONFIG_I2C_RTIO should be defined together with CONFIG_I2C in the
Kconfig, otherwise I2C_DT_IODEV_DEFINE() won't be available at
build time.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-04-04 18:17:41 +02:00
Jordan Yates
e661a55044 sensor: bme280: clamp humidity to non-negative
Clamp the returned humidity to a non-negative value. This ensure that
the return value is always within the expected range, even if the
calibration parameters are read out incorrectly or corrupted.

This check is applied in the example Bosch driver for the float
conversion case, so there are situations that warrant it.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-04 14:57:43 +02:00
David Cerrone
bbaaac999f drivers: sensor: current_amp: add calibration option
Allow the option to enable or disable calibration of the ADC.

Signed-off-by: David Cerrone <davidcerrone@gmail.com>
2025-04-03 15:26:36 -07:00
Luis Ubieda
c1e75b6c3b sensor: pat9136: Add cooldown timer
This sensor may trigger data at a very fast pace (20,000 fps) and this
may not be useful for the application. Instead, it may affect its
proper functioning. Therefore, this patch includes a cool-down timer
before which time the INT line won't be enabled.

Please note that this sensor accumulates the delta compared to the
last reading, so on its own, not reading data-changes does not imply
losing data, as long as it does not saturate.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-04-02 05:29:23 +02:00
Luis Ubieda
382fa5d085 sensor: pat9136: Add Streaming mode
Working with DRDY and Motion triggers.
DRDY contains a backup software timer to guarantee checking in with
the sensor.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-04-02 05:29:23 +02:00
Luis Ubieda
9df68a4c48 sensor: pat9136: Add basic functionality
- Basic support with Read/Decode API for one-shot reads.
- Supported channels:
    - SENSOR_CHAN_POS_DX.
    - SENSOR_CHAN_POS_DY.
    - SENSOR_CHAN_POS_DXYZ.
    - SENSOR_CHAN_POS_DX_MM (private channel).
    - SENSOR_CHAN_POS_DY_MM (private channel).
    - SENSOR_CHAN_POS_DXYZ_MM (private channel).

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-04-02 05:29:23 +02:00
Peggy Chen
9faa7b07ff drivers: sensor: bma4xx: Implement streaming APIs
Add a streaming implementation for the BMA4XX using both
FIFO watermark and FIFO full interrupts. A batch duration of
3,000 have been used for verification.

Signed-off-by: Peggy Chen <peggy.chen@cienet.com>
2025-04-02 05:29:11 +02:00
Peggy Chen
2dff22b0c7 drivers: sensor: bma4xx: Enable and resolve issues with emulator
Enable the sensor emulator and address related issues
to ensure proper functionality.

Signed-off-by: Peggy Chen <peggy.chen@cienet.com>
2025-04-02 05:29:11 +02:00
Peggy Chen
26af8a4b7a drivers: sensor: bma4xx: Refactor submit logic into separate files
Refactor the sensor submit logic into individual files
to enhance maintainability and readability.

Signed-off-by: Peggy Chen <peggy.chen@cienet.com>
2025-04-02 05:29:11 +02:00
Peggy Chen
feb65f6ce1 drivers: sensor: bma4xx: Refactor decoder into separate files
Refactor the sensor decoder code into individual files for
improved maintainability and readability.

Signed-off-by: Peggy Chen <peggy.chen@cienet.com>
2025-04-02 05:29:11 +02:00
Peggy Chen
67e688ee3e drivers: sensor: bma4xx: Update config to use bma4xx_safely_configure
Updated the sensor configuration to use the bma4xx_safely_configure
function for safer and more reliable initialization.

Signed-off-by: Peggy Chen <peggy.chen@cienet.com>
2025-04-02 05:29:11 +02:00
Peggy Chen
551027c5aa drivers: sensor: bma4xx: Split off bma4xx_defs.h
Added register definitions, bit masks, and related constants
for the BMA4XX sensor in a separate header file.

Signed-off-by: Peggy Chen <peggy.chen@cienet.com>
2025-04-02 05:29:11 +02:00
Dipak Shetty
eb0050f7c9 drivers: sensor: add everlight light sensor
Adds driver for Everlight ALS-PT19 Ambient Light Sensor.

Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
2025-04-01 22:12:13 +02:00
Konrad Sikora
c099a01760 drivers: sensor: liteon: Move to vendor subdirectory
Organizes liteon sensor drivers by vendor to make consistent
with other drivers.

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2025-04-01 22:12:01 +02:00
Konrad Sikora
8ad2cac1b5 drivers: sensor: Add support for LTR329 sensor
Add support for Liteon LTR329 Digital Ambient Light Sensor

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2025-04-01 22:12:01 +02:00
Konrad Sikora
85e9cef24e drivers: sensor: Change vendor prefix from 'ltr' to 'liteon'
The vendor prefix has been changed from 'ltr' to 'liteon'.
This change is made to better reflect the actual name of
the vendor, which is LiteOn. The previous prefix 'ltr'
was referring to the LiteOn Optical Sensor family, which
could lead to misunderstandings.

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2025-04-01 22:12:01 +02:00
Armando Visconti
cc9b93d50c sensor: lsm6dsv16x: sensor GBIAS initialization
Use SENSOR_ATTR_OFFSET attribute to initialize the Sensor Fusion GBIAS.
This is useful when the device is not sill (e.g. hold in hand) and so
the gyroscope calibration does not run.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-04-01 11:59:31 +02:00
Armando Visconti
9a8ecf0c0c sensor: lsm6dsv16x: fix place where gyro_freq get set
Move gyro_freq setting inside lsm6dsv16x_gyro_set_odr_raw() routine,
so that it is properly saved in all cases (i.e. from DT configuration
and from runtime ATTR set case).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-04-01 11:59:31 +02:00
Corey Wharton
3aebc9d258 drivers: sensor: tmp112: add support for setting ALERT thresholds
Allows setting tLow/tHigh threasholds via the SENSOR_ATTR_LOWER_THRESH/
SENSOR_ATTR_UPPER_THRESH attributes.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2025-03-31 08:07:12 +02:00
Corey Wharton
7425070ecc drivers: sensor: tmp112: format file
Format before other changes.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2025-03-31 08:07:12 +02:00
Zhaoxiang Jin
7ed7cd191a modules: hal_nxp: Move hal_nxp glue layer to zephyr repo
Move hal_nxp glue layer to zephyr repo.
Fix build warnings and failures caused by hal_nxp upgrade.
Update manifest to contain hal_nxp changes.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-03-26 16:26:34 +01:00
Corey Wharton
a7f6cee9de drivers: sensors: lsm6dsv16x: add support for lsm6dsv32x variant
The LSM6DSV32X part is nearly identical to the LSM6DSV16X but has different
sensitivity scales for the accelerometer (4-32G versus 2-16G). This commit
adds support for this part via the "st,lsm6dsv32x" compatible string.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2025-03-26 16:19:54 +01:00
Jamie McCrae
5c027f270e drivers: sensors: kconfig: Add sort
Adds sort to individual sensor Kconfigs and sorts them

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-03-26 11:33:11 +01:00
Tilmann Unte
224b5b744d drivers: sensor: mpu6050: scale settings to DT, adds sample rate setting
Moves the MPU6050 accel/gyro scale settings from KConfig to Devicetree.
Adds a new setting for the MPU6050 sample rate divider register and
transmits it to the sensor upon initialization.
This helps to reduce the interrupt firing rate when combined with the
data ready trigger.
A default division factor is provided which ensures compatibility with
existing applications.
The MPU6050 sample application is extended and used for hardware tests.

Signed-off-by: Tilmann Unte <unte@es-augsburg.de>
2025-03-25 22:12:49 +01:00
Fredrik Gihl
e6ed809a07 drivers: sensor: tmp114: device tree support for setting oversample
Add support for setting oversample from `attr_set` and device tree

Signed-off-by: Fredrik Gihl <fgihl@hotmail.com>
2025-03-25 22:12:11 +01:00
Fredrik Gihl
83b1422f9c drivers: sensor: tmp114: Support setting odr
Add support for setting the sample frequency via `attr_set` and the
output data rate from device tree source.

Signed-off-by: Fredrik Gihl <fgihl@hotmail.com>
2025-03-25 22:12:11 +01:00
Fredrik Gihl
af0367f295 drivers: sensor: tmp114: Correct clang warning
Corrected clang warning introduced on commit 9eaf488

Signed-off-by: Fredrik Gihl <fgihl@hotmail.com>
2025-03-25 22:12:11 +01:00
Benjamin Cabé
1e75b82244 sensors: lsm6dsv16x: fix double-promotion warning
use roundf instead of round in Q31_SHIFT_VAL macro to avoid
double-promotion warning

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-03-21 17:03:53 +01:00
Ruibin Chang
dcbd0d1397 drivers/sensor/ite/tach_ite_it8xxx2: run clang format
Run clang format.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2025-03-21 09:53:22 +01:00