zephyr
zephyr copied to clipboard
drivers: sensor: lis2dw12: Add Power Domain Handling
The lis2dw12 accelerometer driver now supports power domains via CONFIG_PM_DEVICE. If the config is selected, the driver will be required to provide a power-domain and will initialize itself by enabling pm_device_runtime on this domain.
Tap detection can be enabled by setting the sensor_trigger_set callback to a valid callback function - which in turn gets the power domain and keeps it until sensor_trigger_set is called with a NULL callback. This way, interrupt based events can be caught, while the driver stays on a power domain - assuming that the detection is disabled once it is no longer needed.
Similarly, a sensor attribute for continuous measurement mode has been added to allow for an application to continuously fetch data from the sensor without having to power - and reinitialize - only during a fetch call. When set using sensor_value, the driver keeps the power domain and does not put it back until the attribute is reset again.
Additional flags have been introduced to handle any overlap of domain requesting/putting back. The ability to set the default fifo mode has also been added.
Clang formatting has also been introduced for previously incorrectly formatted source files
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.
Please rebase. Sorry I missed this PR evolution
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.