Skip to content

BMP581: Stream: Add FIFO Watermark Support #93166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ubieda
Copy link
Member

@ubieda ubieda commented Jul 15, 2025

Description

This PR is a follow-on effort to #93130 in which FIFO Watermark support is added on top of Streaming, and is configurable through fifo-watermark DTS property.

Note

Marking this PR as DNM until its predecessor is merged.

Testing

  • Build Command
west build -b frdm_mcxn947/mcxn947/cpu0 samples/subsys/shell/shell_module -- -DCONFIG_SENSOR=y -DCONFIG_SENSOR_SHELL=y -DCONFIG_I2C_SHELL=y -DCONFIG_SENSOR_SHELL_STREAM=y
  • Overlay
#include <zephyr/dt-bindings/sensor/bmp581.h>

&flexcomm2_lpi2c2 {
	status = "okay";

	bmp581:bmp581@46 {
		compatible = "bosch,bmp581";
		reg = <0x46>;
		status = "okay";
		odr = <BMP581_DT_ODR_10_HZ>;
		press-osr = <BMP581_DT_OVERSAMPLING_1X>;
		temp-osr = <BMP581_DT_OVERSAMPLING_1X>;
		int-gpios = <&gpio0 29 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
		fifo-watermark = <10>;
	};
};
  • Output
uart:~$ sensor stream bmp581@46 on fifo_wm incl
Disabling existing stream
Enabling stream...
Trigger (10 / fifo_wm) detected
channel type=13(ambient_temp) index=0 shift=15 num_samples=10 value=60481891090ns (23.896118)
channel type=14(press) index=0 shift=15 num_samples=10 value=60481891090ns (101.374755)
Trigger (10 / fifo_wm) detected
channel type=13(ambient_temp) index=0 shift=15 num_samples=10 value=61478180456ns (23.891021)
channel type=14(press) index=0 shift=15 num_samples=10 value=61478180456ns (101.375274)
Trigger (10 / fifo_wm) detected
channel type=13(ambient_temp) index=0 shift=15 num_samples=10 value=62474455063ns (23.902160)
channel type=14(press) index=0 shift=15 num_samples=10 value=62474455063ns (101.376113)
uart:~$ sensor stream bmp581@46 off
Disabling existing stream
[00:15:21.449,000] <wrn> BMP581_STREAM: Callback triggered with no streaming submission - Disabling interrupts

ubieda added 5 commits July 15, 2025 09:13
The existing driver requires setting multiple attributes in order to
work basic fetch/get reads. Simplify this by allowing the user to set
dts node properties based on the use-case.

As a result, basic settings results in the driver being up and running
from the start, one can just get sensor readings out of the box.

These still can be overriden at run-time if need be.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
In order to abstract details of the transport itself, improving
portability.

No functional changes at this point. Driver works the same as far
as my local testing goes.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
Decoding one-shot reads through submit API.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
Working only with DRDY Interrupts. FIFO watermark not added yet.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
Otherwise it leads to potential incorrect expansions.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
@ubieda ubieda added the DNM This PR should not be merged (Do Not Merge) label Jul 15, 2025
@ubieda ubieda changed the title bmp581: stream: Add FIFO Watermark Support BMP581: Stream: Add FIFO Watermark Support Jul 15, 2025
@ubieda ubieda force-pushed the bmp581/fifo-wm-support branch from 7be7877 to faa9f02 Compare July 15, 2025 22:02
Configurable through dts property: fifo-watermark.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
@ubieda ubieda force-pushed the bmp581/fifo-wm-support branch from faa9f02 to bba0620 Compare July 15, 2025 22:07
Copy link

@ubieda ubieda requested a review from bperseghetti July 15, 2025 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DNM This PR should not be merged (Do Not Merge)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant