Add support for Omron D6F mass flow rate sensor series. The sensor series
outputs an analogue voltage which is read using an ADC.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Add flow rate to `enum sensor_channel` in litres per minute.
The SI unit for flow rate is cubic metres per second. Due to a sensor value
resolution of 1/100000 this unit is not granular enough for low flow rate
sensors.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Use k_timepoint_t instead of k_timeout_t for absolute time to avoid
ambiguity and ensure the code works even when CONFIG_TIMEOUT_64BIT=n.
Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
Adds a skip-calibration property to the voltage divider sensor,
which can be enabled, in case the underlying ADC driver
does not support calibration.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
This macro doesn't accept a delay parameter anymore (well, it does, but
it's deprecated and will trigger build warnings). Just remove it from the
places that were still passing it.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
- Since ti-hdc20xx is a sensor, it should use SENSOR_DEVICE_* macro for
definition.
- Allows it to work with sensor_shell properly.
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Otherwise we'd always return false in spite of the flag being set in
the encoded data, which may lead to the user not reading the underlying
data in an event-paced readout scheme.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Commit bc8d66d538931e650dd2855fabe768720dcb4b02 introduced a
result argument to some RTIO callback handlers. Update for the IIS3DWB
sensor.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Process all in one callback, in order to reduce latency.
The following changes have been done:
- Process FIFO read-out and/or Data-ready in GPIO callback.
- FIFO Full is handled on completion if needed.
- Omit fifo-count fetching, to optimize cycles. The watermark
count is the number of samples we're going for.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
By introducing three states: Off -> On -> Busy -> (Offf)
This allows us to more clearly guard on-going events and detect
overlapping triggers.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Since the driver knows how many samples it wants (because of the
watermark threshold), stick to that per event in order to facilitate
batches of N number of samples.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
In order to allow the error-handling scheme to take action, instead
of crashing when asserts are enabled. Now possible since we have RTIO
error handling for streaming mode.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Similar pattern applied to other in-tree sensor drivers, where
preparing a set of SQEs for writing/reading on registers is a recurrent
syntax.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
The IIS3DWB is a system-in-package featuring a 3-axis digital vibration
sensor with low noise over an ultrawide and flat frequency range.
The wide bandwidth, low noise, very stable and repeatable sensitivity,
together with the capability of operating over an extended temperature
range (up to +105 C), make the device particularly suitable for vibration
monitoring in industrial applications.
Datasheet: https://www.st.com/en/mems-and-sensors/iis3dwb.html
This driver is currently only supporting the polling-mode read_and_decode
APIs (both blocking and non-blocking).
This driver is based on stmemsc HAL i/f v2.9.1.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Requesting/releasing QDEC device may be ISR safe, but
it cannot be reliably known whether managing its power
domain is. Is is then assumed that if power domains are used,
device is no longer ISR safe. This macro let's us check if
we will be requesting/releasing power domains and determines
PM device ISR safety value.
Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
Add support for runtime and devicetree configuration of themocouple
type, ADC resolution, filter coefficient and cold junction temperature
resolution. Extend device specific sensor channels to include cold
junction temperature, delta tempereature, hot junction temperature and
raw ADC values while still maintaining backwards compability with the
existing SENSOR_CHAN_AMBIENT_TEMP channel.
Signed-off-by: Thomas Schmid <tom@lfence.de>
Explicitly cast data->atime to uint32_t to
prevent signed promotion and sign extension
when multiplying with data->again.
Signed-off-by: Manoj Purushothama <hpmanoj@umich.edu>
Remove the calls to LL_TIM_ENCODER_StructInit and LL_TIM_ENCODER_Init
in the QDEC driver. This avoids calling functions from stm32xxxx_ll_tim.c.
They are replaced by a set of simpler functions from the header file.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Add missing one-shot conversion logic in sample_fetch when driver is
configured for shutdown mode. Previously, the driver would attempt to
read temperature without triggering conversion, resulting in stale data.
Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
Add support for enabling and configuring the self-test mode of the
LIS2DH accelerometer through a dedicated sensor attribute.
Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
Add test for Texas Instruments INA228 current sensor via I2C.
Signed-off-by: Jonas Berg <jonas.s.t.berg@gmail.com>
Signed-off-by: Wilkins White <ww@novadynamics.com>
Add the Texas Instruments INA228 Power/Energy/Charge
monitor. This chip is similar to the INA237, but has
a more precise ADC and added energy/charge channels.
Signed-off-by: Wilkins White <ww@novadynamics.com>
This commit renames the ina23x folder and common files to ina2xx.
The more generic name will support, e.g., the INA237 and INA228
series chips.
Signed-off-by: Wilkins White <ww@novadynamics.com>
Callbacks now take a result parameter which may, if the callback was
linkd to by a previous submissions, have the result code from the last
submission.
Additionally the userdata is now const by default making it easier to
use the device pointer as the userdata which is very common.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Add the option to specify an alternate ADC gain value to use if the
initial measurement saturates the range. This enables higher data
resolutions when the values are small compared to the maximum signal
values, while still supporting the maximum.
As a concrete example, measuring charge currents from a small solar
panel (0 - 50mA), while also supporting high USB charge currents
(up to 1A).
Signed-off-by: Jordan Yates <jordan@embeint.com>
Fix missing shift values in `sensor_three_axis_data` when performing
one-shot reads on SENSOR_CHAN_ACCEL_XYZ and SENSOR_CHAN_GYRO_XYZ
Signed-off-by: Anthony Williams <anthony289478@gmail.com>
According to the LIS2DU12 datasheet (p.30), the device must be
inpower-down mode before executing a software reset.
Entering power-down requires setting the ODR field to 0x000.
This commit adds the missing call to set ODR=0x000 before issuing the
reset. Without this step, the sensor does not recover after a controller
reset and only resumes operation after a full power cycle.
Signed-off-by: Jan Kablitz <jan.kablitz@8tronix.de>
Relocate private reboot function to allow ODR configuration before
execution. This will ensure proper power-down sequence prior to software
reset.
Signed-off-by: Jan Kablitz <jan.kablitz@8tronix.de>