The three sensor channels listed below were recently added by the commit
9471df95a5:
- SENSOR_CHAN_GAME_ROTATION_VECTOR
- SENSOR_CHAN_GRAVITY_VECTOR
- SENSOR_CHAN_GBIAS_XYZ
Theses channel names are missing and causes a system crash if the
SENSOR_LOG_LEVEL is set to DEBUG.
Also, the two sensor attributes SENSOR_ATTR_GAIN and SENSOR_ATTR_RESOLUTION
were added by the commit f849140de7.
This adds these missing channel and attribute to the list of names in the
sensor shell.
Signed-off-by: Gaël PORTAY <gael.portay@rtone.fr>
Update the driver to take the "vrefint-cal-resolution" property into
account when performing the calculations.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
This is a squash of all the groundwork needed to
get a functioning driver for the DS3231 with the RTC API.
Signed-off-by: Gergo Vari <work@gergovari.com>
Add the Sensor Fusion Low Power (SFLP) FIFO streaming capability,
using RTIO. The decode function is now aware of parsing following FIFO
tags:
- LSM6DSV16X_SFLP_GAME_ROTATION_VECTOR_TAG
- LSM6DSV16X_SFLP_GYROSCOPE_BIAS_TAG
- LSM6DSV16X_SFLP_GRAVITY_VECTOR_TAG
To activate SFLP the user should put in DT the proper configuration.
For example, to activate a 60Hz SFLP FIFO batching rate of game rotation
vector, gravity vector and gbias components, the user should add in DT
the following:
sflp-odr = <LSM6DSV16X_DT_SFLP_ODR_AT_60Hz>;
sflp-fifo-enable = <LSM6DSV16X_DT_SFLP_FIFO_GAME_ROTATION_GRAVITY_GBIAS>;
Signed-off-by: Armando Visconti <armando.visconti@st.com>
In case I3C IBI interrupt is not used do not skip reading the status
register, otherwise the interrupt event will not get cleared.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Align all sensor drivers that are using stmemsc (STdC) HAL i/f
to new APIs of stmemsc v2.8
Requires https://github.com/zephyrproject-rtos/hal_st/pull/24
Signed-off-by: Armando Visconti <armando.visconti@st.com>
The get_frame_count() API must return the number of frames in FIFO
for a given channel type, and not the total number of generic FIFO
frames. This API may be also re-used in the decoder routine when
the timestamp baseline is adjusted.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
The LIS2DUXS12 is a smart, digital, 3-axis linear accelerometer whose
MEMS and ASIC have been expressly designed to combine the lowest current
consumption possible with features such as always-on antialiasing
filtering, a finite state machine (FSM) and machine learning core (MLC)
with adaptive self-configuration (ASC), and an analog hub / Qvar sensing
channel.
(https://www.st.com/en/mems-and-sensors/lis2duxs12.html)
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Prepare the driver to be able to handle other DUX software compatible
devices. Currently the driver handles the st_lis2dux12 compatible only.
Do following major changes:
1. Introduce the lis2dux12_chip_api structure filled with device specific
APIs. At the moment define following callback:
- api_lis2dux12_set_odr_raw()
- api_lis2dux12_set_range()
- api_lis2dux12_sample_fetch_accel()
- api_lis2dux12_sample_fetch_temp()
- api_lis2dux12_handle_interrupt()
- api_lis2dux12_init_interrupt()
2. Prepare specific APIs for st_lis2dux12 device.
3. Make DT instantiation on inst + name basis, and not only by inst. This
commit only use "name = DT_DRV_COMPAT = st_lis2dux12".
Signed-off-by: Armando Visconti <armando.visconti@st.com>
The DHT[11/22] sensor driver fails to read data due to an extra
"gpio_pin_set_dt" that is occurs prior to waiting for the sensor active
response. This leads to consistent failed reads on esp32 (devkitc,
wrover). After removing this line reads are consistently successful.
Signed-off-by: Omar Naffaa <omarnaffaa.on@gmail.com>
coverity complains of a missing break statement in SENSOR_CHAN_ALL case
this is fixed by adding __attribute__((fallthrough))
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Use shell_device_get_binding() instead of device_get_binding() so that
we get the device based on its name and in addition by its label.
Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
Prepare to use official TDK Invensense Inc. driver for icm42670-P/-S
sensor in tdk_hal module. Simplify I2C and SPI transport files.
Driver code moves in hal_tdk module.
Adds APEX features, such as Pedometer, Tilt detection, Wake on Motion
and Significant Motion Detector.
Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
find a sensor driver bug don't judge the data whether read back
correctly, deal with buffer data directly.
Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
This commit fixes a shared context between multiple instances of the
INA230 and INA236 driver. The issue is the naming of the instance data in
`INA230_DRIVER_INIT` macro when we have one instance of INA230 and one
of INA236 the name of the data variable will be `drv_data_0`. This
variable will then be passed to both instances.
Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
Compilation will fail if multiple models are used at the same time.
Changing to define different unique names for the symbols
to avoid conflicts.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The lsm6dso driver does not correctly reflect the status of
the node in dt. So the driver didn't compile even if
`st,lsm6dso32` node exists.
I fixed it to correctly go through ithe compile.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
There were code paths that could have lead to divide by zero given an
invalid scale setting for accel or gyro. In practice this should be an
invalid setup even before getting to these conversion functions. The
conversion functions now better show all valid values are accounted for
by using CODE_UNREACHABLE in the default case.
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Fixes type mix-match for rtd temperature calculation. Also changes
coefficient array name for clarity.
Signed-off-by: Maxmillion McLaughlin <max@sorcerer.earth>
Update discharge current limit property to be aligned
with the most recent npm1300 datasheet.
This affects the discharge current measurement calculation,
which needs to be scaled accordingly.
Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
Select TRIGGER_GLOBAL_THREAD by default if rtio streaming is enabled,
and TRIGGER_NONE otherwise. This change prevents bad trigger configurations
like
CONFIG_LSM6DSV16X_TRIGGER=y
CONFIG_LSM6DSV16X_TRIGGER_NONE=y
which does not have any sense.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Add sensor driver for npm2100 pmic.
This pmic performs measurements of battery voltage, regulator voltage
and die temperature.
Configurable pmic attributes are also organized under this driver.
Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
Add support for setting the sample frequency via `attr_set` and the
output data rate from device tree source.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
This commit explicitly type-casts data_bits to uint64_t
in order to fix implicit sign extension warning
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Add RTIO async and RTIO stream functionalities that enables,
among all the other things, the sensor data streaming from FIFO.
RTIO stream is using both SENSOR_TRIG_FIFO_WATERMARK and
SENSOR_TRIG_FIFO_FULL triggers. The decoder currently only supports
following FIFO tags:
- LSM6DSV16X_XL_NC_TAG
- LSM6DSV16X_GY_NC_TAG
- LSM6DSV16X_TEMP_NC_TAG
Following FIFO parameters has to be defined in device tree to
correctly stream sensor data:
- fifo-watermark (defaults to 32)
- accel-fifo-batch-rate (defaults to LSM6DSV16X_DT_XL_NOT_BATCHED)
- gyro-fifo-batch-rate (defaults to LSM6DSV16X_DT_GY_NOT_BATCHED)
- temp-fifo-batch-rate (defaults to LSM6DSV16X_DT_TEMP_NOT_BATCHED)
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Updates the Kconfig condition to support trigger functionality for INA236.
This will get rid of `warning: INA230_TRIGGER (defined at
drivers/sensor/ti/ina23x/Kconfig:43) was assigned the value 'y' but got
the value 'n'.` if INA230_TRIGGER is enabled.
Signed-off-by: Tomáš Juřena <jurenatomas@gmail.com>
Fix for conversion of temperature values in adxl367_temp_convert
and missing break statement.
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
Fix for SPI communication when RTIO is used in SPI driver. When in
adxl367_bus_access, const struct spi_buf buf[3] is used,
spi_rtio_copy function won't set correct buffers and length
for buf[2] and that will cause exception when that buffer is
processed.
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
Add a timeout to the `bme280_wait_until_ready` loop to ensure that we
never get stuck in this loop even if the bus enters an error condition.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Updated ADXL367 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.
Supported FIFO_CHANNEL configurations:
- XYZ
- X
- Y
- Z
- XYZT
- XT
- YT
- ZT
Configurations with external ADC are currently not supported.
Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
Add possibility to retrieve VBUS status of the nPM1300 charger through
its sensor APIs. Updated shields/npm1300_ek sample to use the new API.
Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>