This commit adds a driver for the BH1790 Heart Rate Monitor IC.
Based on the approach used by the MAX30101 driver, an existing optical
heart rate sensor with a sample in Zephyr.
Signed-off-by: Magpie Embedded <magpieembedded@gmail.com>
When calculating accel and gyro period for 12.5Hz, the frequency value is
incorrect. Updated to correct value.
Signed-off-by: Yau-ming Leung <ymleung314@gmail.com>
PIN9 of an ICM42688 can be configured as an interrupt output, external
clock input or frame sync output. Pin function can now be set via a sensor
attribute.
Signed-off-by: Yau-ming Leung <ymleung314@gmail.com>
Add threshold attribute handling to set low and high
temperature at runtime and validation for runtime changes
Signed-off-by: Tobias Meyer <tobiuhg@gmail.com>
The original scale value used to convert raw gyro value to q31 format is
incorrect. Updated to the correct value.
Signed-off-by: Yau-ming Leung <ymleung314@gmail.com>
In order to prevent not serving all events that would clear the
interrupt line. This patch also removes FIFO servicing through
fetch/get APIs, as this is only exposed through streaming mode.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Previously, the TMP1075 driver only used the integer part (val1) of the
sensor_value when setting TLOW and THIGH thresholds. This limited the
precision of temperature threshold configuration and could be insufficient
in applications requiring fine-grained control.
This patch adds proper handling for the fractional part (val2) by encoding
it into bits [7:4] of the 12-bit temperature register according to the
TMP1075 datasheet. The decoding logic in get_threshold_attribute() is also
updated to recover the fractional value accurately.
Signed-off-by: Hank Wang <wanghanchi2000@gmail.com>
Make the vbus-limit-microamp property of npm1300-charger required and
change its range to reflect the one actually supported by the device.
Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
Add missing curly braces in if/while/for statements.
This is a style guideline we have that was not enforced in CI. All
issues fixed here were detected by sonarqube SCA.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add wsen_itds_2533020201601 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>
Using pre-defined values displayed on datasheet's table 5-4 for
CMM Update Rates.
Please note that datasheet specifies these Update-Rates may have
up to 7% standard deviation, which may be significant for certain
applications.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch introduces rm3100 magnetometer sensor, with basic
support (only read-decode).
This driver has bus support for I2C.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Since it's directly related (we can't just burst-read the fifo at
once). This patch includes a comment block explaining this rationale.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Allow for users to define the fifo-watermark on a per-instance basis
through device-tree properties. This setting is validated at build
time, so missing it when required, or setting an invalid value should
not end up in a run-time errror (as in: it runs but nothing happens).
Signed-off-by: Luis Ubieda <luisf@croxel.com>
This patch fixes previous overriding of ODR setting through DTS (it
would always be 25-Hz, irrespective of what the DTS property said).
While doing so, create dt-binding enum to improve settings clarity.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
The sensor value was accidentally set a second time.
Refactor `tmp11x_attr_get` to fix the issue and align more with
`tmp11x_attr_set`.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
When SENSOR_TRIG_FIFO_WATERMARK or SENSOR_TRIG_FIFO_FULL is not configured,
an unsupported trigger debug message will be printed. Moved such that
a no trigger configured debug message will be printed only if both triggers
are not configured.
Signed-off-by: Yau-ming Leung <ymleung314@gmail.com>
Refactor DHT20 sensor init and measurement handling.
Added 100ms power-on wait to comply with datasheet.
Simplified measurement frame handling.
Initialize status register only once after power-on.
Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
Fix undeclared variable error by changing 'config' to 'cfg' in the
data_sync condition check, matching the variable name declared at the
beginning of the function.
Signed-off-by: Liang Jiaxiang <moonbite233@gmail.com>
To improve code clarity, use `shell_print` in place of `shell_fprintf`
with `SHELL_NORMAL` where appropriate.
For partial-line outputs, use `shell_fprintf_normal` to preserve output
formatting.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Make `sensor_channel_name` and `sensor_attribute_name arrays` to use
`const char *const`. This ensures full immutability of the tables,
placing them entirely in the `.rodata` section and reducing usage
of the `.data` segment.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Aligned the `struct shell *` argument name from `shell_ptr` to `sh`
for consistency with other drivers' usage of `sh`, and to match
the `shell_cmd_handler` argument name.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Aligned the `struct shell *` argument name from `shell_ptr` to `sh`
for consistency with other drivers' usage of `sh`, and to match
the `shell_cmd_handler` argument name.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
When using 20-bit FIFO packets, invalid data is indicated by the value
-524288. Currently, no check is done against this and invalid data is
decoded. Fixed by adding a simple check. Also, the wrong bit is used to
check if HIRES is enabled. Fixed by using the correct mask.
Signed-off-by: Yau-ming Leung <ymleung314@gmail.com>
The icm42688 driver RTIO stream module does not specify a compile time log
level. Thus, CONFIG_SENSOR_LOG_LEVEL_DBG is ignored. Fixed by specifying
log level on log module declaration.
Signed-off-by: Yau-ming Leung <ymleung314@gmail.com>
Allow reading the offset register.
This allows reading the offset before setting it if offset is set more than
once.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Add driver capability to properly set high performance mode
while setting data rate (thru lis2duxxx_mode_set() API)
based on how power-mode is set into DTS: if it is set to
LIS2DUX12_OPER_MODE_HIGH_PERFORMANCE then configure HP mode,
LP/ULP mode otherwise.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Calling sensor API functions on devices not in `PM_DEVICE_STATE_ACTIVE`
is a violation of the PM API. Adding manual checks inside of drivers
complicates the drivers and increases ROM footprint for no additional
benefit.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Align all sensor drivers that are using stmemsc (STdC) HAL i/f
to new APIs of stmemsc v2.9.1.
Requires https://github.com/zephyrproject-rtos/hal_st/pull/25
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Update the direction of the measured current to match that expected by
the API and existing users, positive = charging and negative =
discharging.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Both the input and output parameters are floats, not doubles, so use
the floating point logarithm variant.
Correct the source of the equations for the latest datasheet versions
at the same time.
Signed-off-by: Jordan Yates <jordan@embeint.com>