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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
When two tach use simultaneously, I find that the both tach status will
be cleared at once, which causes one of tach not to get rpm speed.
So I change it to clear status only one tach at a time.
This issue is reported by Huaqin:
https://partnerissuetracker.corp.google.com/issues/404067663?pli=1
Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
When converting raw values to integer and fractional (micro) parts, the
fractional part must be a signed integer.
- Fix prototypes where the fractional part was declared as unsigned.
- Fix comments which did not match the declared type.
Signed-off-by: Christophe Tournery <christophe.tournery@freshape.com>
Instead of requiring the edata struct, just receive full-scale
parameter. This simplifies the decoding process for FIFO data
during streaming.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Add calibration via a known gas concentration. This is the recommended way
of calibrating the sensor according to the datasheet.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
- add driver for Vishay VEML6031 High Accuracy Ambient Light Sensor.
- add new compatible "vishay,veml6031".
- read and write consecutive 8 bit registers as bulk operation.
- add driver to build all test of sensors.
- support fetch and get.
- triggered mode and interrupt is not yet supported.
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Working through either Motion detection or through Data-Ready.
Data-ready has a back-up timer to trigger worst case, if no motion
occurs within 10X data-rate.
On every streaming event, the driver checks for the sensor health, and
attempts recoverying its state if it detects issues.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
- Add bus support for SPI (based on RTIO).
- Support read/decode API for one-shot reads on the following channels:
- SENSOR_CHAN_POS_DX.
- SENSOR_CHAN_POS_DY.
- SENSOR_CHAN_POS_DXYZ.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Soft reset HS400x during initialization to make sure that
device is at a known state and writeable registers have the
default values.
Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
According to the datasheet, maximum conversion time for both
humidity and temperature at 14 bits resolution is 1.7 ms.
Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
The sensor does not always finish responding within 200 ms.
This is the sometimes the case when using the sensor calibrate command `X`.
Response delay up to 212 ms has been measured with a logic analyzer.
Increase the max response delay to 300 ms to fix the issue.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
During calibration feature development the following loop was used for
testing:
```shell
CMD="sensor attr_set explorir_m co2 calibration 1234"
while : ; do echo "$CMD" > /dev/ttyACM0; sleep .8; done
```
At some point calibration would fail and all following calibration commands
would fail.
Reset buffer and semaphore just before terminating the command to better
mitigate disturbance from previous failed command.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
- Add support for Fetch/Get API.
- Add support for Read/Decode API.
- Add config settings through device-tree.
- Add bus support for SPI (although easily extensible to others as
based on RTIO).
Fetch/Get API tested with accel_polling sample.
Read/Decode API tested with sensor_shell sample.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
sca finds the code to be logically dead considering the size of long
to be 4 bytes.
- Solution: use uint64_t type for the variable `value`.
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
The tmp1075 driver already registers a log module using
LOG_MODULE_REGISTER(TMP1075, CONFIG_SENSOR_LOG_LEVEL).
This ensures that all log messages are prefixed with "TMP1075".
The existing LOG_ERR message redundantly includes "tmp1075",
which is unnecessary.
Signed-off-by: Hank Wang <wanghanchi2000@gmail.com>
Allow to set attribute of the measurement rate of the apds9253. This
must be done setting the sampling frequency (in Hz).
Signed-off-by: Margherita Milani <margherita.milani@amarulasolutions.com>
Allow to set attribute of the gain of the apds9253. The gain
is applied to all the channels.
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Margherita <margherita.milani@amarulasolutions.com>